New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 12928 for NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/SAS – NEMO

Ignore:
Timestamp:
2020-05-14T21:46:00+02:00 (4 years ago)
Author:
smueller
Message:

Synchronizing with /NEMO/trunk@12925 (ticket #2170)

Location:
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser

    • Property svn:externals
      •  

        old new  
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@HEAD         sette 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/SAS/diawri.F90

    r12178 r12928  
    2424   !!---------------------------------------------------------------------- 
    2525   USE oce             ! ocean dynamics and tracers  
     26   USE abl            ! abl variables in case ln_abl = .true. 
    2627   USE dom_oce         ! ocean space and time domain 
    2728   USE zdf_oce         ! ocean vertical physics 
     
    5152   PUBLIC   dia_wri_state 
    5253   PUBLIC   dia_wri_alloc           ! Called by nemogcm module 
    53  
     54#if ! defined key_iomput    
     55   PUBLIC   dia_wri_alloc_abl       ! Called by sbcabl  module (if ln_abl = .true.) 
     56#endif 
    5457   INTEGER ::   nid_T, nz_T, nh_T, ndim_T, ndim_hT   ! grid_T file 
    5558   INTEGER ::   nid_U, nz_U, nh_U, ndim_U, ndim_hU   ! grid_U file 
    5659   INTEGER ::   nid_V, nz_V, nh_V, ndim_V, ndim_hV   ! grid_V file 
     60   INTEGER ::   ndim_A, ndim_hA                      ! ABL file    
     61   INTEGER ::   nid_A, nz_A, nh_A                    ! grid_ABL file    
    5762   INTEGER ::   ndex(1)                              ! ??? 
    5863   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV 
    59  
    60    !! * Substitutions 
    61 #  include "vectopt_loop_substitute.h90" 
     64   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hA, ndex_A ! ABL 
     65 
    6266   !!---------------------------------------------------------------------- 
    6367   !! NEMO/SAS 4.0 , NEMO Consortium (2018) 
     
    7882 
    7983    
    80    SUBROUTINE dia_wri( kt ) 
     84   SUBROUTINE dia_wri( kt, Kmm ) 
    8185      !!--------------------------------------------------------------------- 
    8286      !!                  ***  ROUTINE dia_wri  *** 
     
    9094      !! 
    9195      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     96      INTEGER, INTENT( in ) ::   Kmm     ! ocean time levelindex 
    9297      !!---------------------------------------------------------------------- 
    9398      !  
    9499      ! Output the initial state and forcings 
    95100      IF( ninist == 1 ) THEN 
    96          CALL dia_wri_state( 'output.init' ) 
     101         CALL dia_wri_state( Kmm, 'output.init' ) 
    97102         ninist = 0 
    98103      ENDIF 
     
    114119   END FUNCTION dia_wri_alloc 
    115120    
     121   INTEGER FUNCTION dia_wri_alloc_abl() 
     122      !!---------------------------------------------------------------------- 
     123     ALLOCATE(   ndex_hA(jpi*jpj), ndex_A (jpi*jpj*jpkam1), STAT=dia_wri_alloc_abl) 
     124      CALL mpp_sum( 'diawri', dia_wri_alloc_abl ) 
     125      ! 
     126   END FUNCTION dia_wri_alloc_abl 
    116127   
    117    SUBROUTINE dia_wri( kt ) 
     128   SUBROUTINE dia_wri( kt, Kmm ) 
    118129      !!--------------------------------------------------------------------- 
    119130      !!                  ***  ROUTINE dia_wri  *** 
     
    129140      !! 
    130141      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     142      INTEGER, INTENT( in ) ::   Kmm  ! ocean time level index 
    131143      !! 
    132144      LOGICAL ::   ll_print = .FALSE.                        ! =T print and flush numout 
     
    136148      INTEGER  ::   ierr                                     ! error code return from allocation 
    137149      INTEGER  ::   iimi, iima, ipk, it, itmod, ijmi, ijma   ! local integers 
     150      INTEGER  ::   ipka                                     ! ABL 
    138151      REAL(wp) ::   zsto, zout, zmax, zjulian                ! local scalars 
     152      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d_abl   ! ABL 3D workspace 
    139153      !!---------------------------------------------------------------------- 
    140154      ! 
    141155      ! Output the initial state and forcings 
    142156      IF( ninist == 1 ) THEN                        
    143          CALL dia_wri_state( 'output.init' ) 
     157         CALL dia_wri_state( Kmm, 'output.init' ) 
    144158         ninist = 0 
    145159      ENDIF 
     
    161175      ENDIF 
    162176#if defined key_diainstant 
    163       zsto = nn_write * rdt 
     177      zsto = nn_write * rn_Dt 
    164178      clop = "inst("//TRIM(clop)//")" 
    165179#else 
    166       zsto=rdt 
     180      zsto=rn_Dt 
    167181      clop = "ave("//TRIM(clop)//")" 
    168182#endif 
    169       zout = nn_write * rdt 
    170       zmax = ( nitend - nit000 + 1 ) * rdt 
     183      zout = nn_write * rn_Dt 
     184      zmax = ( nitend - nit000 + 1 ) * rn_Dt 
    171185 
    172186      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    174188      ijmi = 1      ;      ijma = jpj 
    175189      ipk = jpk 
     190     IF(ln_abl) ipka = jpkam1 
    176191 
    177192      ! define time axis 
     
    188203 
    189204         ! Compute julian date from starting date of the run 
    190          CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian ) 
     205         CALL ymds2ju( nyear, nmonth, nday, rn_Dt, zjulian ) 
    191206         zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    192207         IF(lwp)WRITE(numout,*) 
     
    210225         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    211226            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    212             &          nit000-1, zjulian, rdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
     227            &          nit000-1, zjulian, rn_Dt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
    213228         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept 
    214229            &           "m", ipk, gdept_1d, nz_T, "down" ) 
     
    222237         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
    223238            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    224             &          nit000-1, zjulian, rdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
     239            &          nit000-1, zjulian, rn_Dt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
    225240         CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept 
    226241            &           "m", ipk, gdept_1d, nz_U, "down" ) 
     
    234249         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
    235250            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    236             &          nit000-1, zjulian, rdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
     251            &          nit000-1, zjulian, rn_Dt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
    237252         CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept 
    238253            &          "m", ipk, gdept_1d, nz_V, "down" ) 
     
    241256 
    242257         ! No W grid FILE 
     258         IF( ln_abl ) THEN  
     259         ! Define the ABL grid FILE ( nid_A ) 
     260            CALL dia_nam( clhstnam, nn_write, 'grid_ABL' ) 
     261            IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
     262            CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
     263               &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
     264               &          nit000-1, zjulian, rn_Dt, nh_A, nid_A, domain_id=nidom, snc4chunks=snc4set ) 
     265            CALL histvert( nid_A, "ght_abl", "Vertical T levels",      &  ! Vertical grid: gdept 
     266               &           "m", ipka, ght_abl(2:jpka), nz_A, "up" ) 
     267            !                                                            ! Index of ocean points 
     268         ALLOCATE( zw3d_abl(jpi,jpj,ipka) )  
     269         zw3d_abl(:,:,:) = 1._wp  
     270         CALL wheneq( jpi*jpj*ipka, zw3d_abl, 1, 1., ndex_A , ndim_A  )      ! volume 
     271            CALL wheneq( jpi*jpj     , zw3d_abl, 1, 1., ndex_hA, ndim_hA )      ! surface 
     272         DEALLOCATE(zw3d_abl) 
     273         ENDIF 
    243274 
    244275         ! Declare all the output fields as NETCDF variables 
     
    261292         CALL histdef( nid_T, "sowindsp", "wind speed at 10m"                  , "m/s"    ,   &  ! wndm 
    262293            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     294! 
     295         IF( ln_abl ) THEN 
     296         !                                                                                      !!! nid_A : 3D 
     297         CALL histdef( nid_A, "t_abl", "Potential Temperature"     , "K"        ,       &  ! t_abl 
     298               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 
     299            CALL histdef( nid_A, "q_abl", "Humidity"                  , "kg/kg"    ,       &  ! q_abl 
     300               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     301            CALL histdef( nid_A, "u_abl", "Atmospheric U-wind   "     , "m/s"        ,     &  ! u_abl 
     302               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 
     303            CALL histdef( nid_A, "v_abl", "Atmospheric V-wind   "     , "m/s"    ,         &  ! v_abl 
     304               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     305            CALL histdef( nid_A, "tke_abl", "Atmospheric TKE   "     , "m2/s2"    ,        &  ! tke_abl 
     306               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     307            CALL histdef( nid_A, "avm_abl", "Atmospheric turbulent viscosity", "m2/s"   ,  &  ! avm_abl 
     308               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     309            CALL histdef( nid_A, "avt_abl", "Atmospheric turbulent diffusivity", "m2/s2",  &  ! avt_abl 
     310               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     311            CALL histdef( nid_A, "pblh", "Atmospheric boundary layer height "  , "m",      &  ! pblh 
     312               &          jpi, jpj, nh_A,  1  , 1, 1   , -99 , 32, clop, zsto, zout )                  
     313#if defined key_si3 
     314            CALL histdef( nid_A, "oce_frac", "Fraction of open ocean"  , " ",      &  ! ato_i 
     315               &          jpi, jpj, nh_A,  1  , 1, 1   , -99 , 32, clop, zsto, zout ) 
     316#endif 
     317          CALL histend( nid_A, snc4chunks=snc4set ) 
     318       ! 
     319       ENDIF 
     320! 
    263321 
    264322         CALL histend( nid_T, snc4chunks=snc4set ) 
     
    310368      CALL histwrite( nid_T, "soicecov", it, fr_i          , ndim_hT, ndex_hT )   ! ice fraction    
    311369      CALL histwrite( nid_T, "sowindsp", it, wndm          , ndim_hT, ndex_hT )   ! wind speed    
     370! 
     371      IF( ln_abl ) THEN  
     372        ALLOCATE( zw3d_abl(jpi,jpj,jpka) ) 
     373        IF( ln_mskland )   THEN  
     374          DO jk=1,jpka 
     375             zw3d_abl(:,:,jk) = tmask(:,:,1) 
     376            END DO 
     377       ELSE 
     378            zw3d_abl(:,:,:) = 1._wp      
     379         ENDIF        
     380       CALL histwrite( nid_A,  "pblh"   , it, pblh(:,:)                  *zw3d_abl(:,:,1     ), ndim_hA, ndex_hA )   ! pblh  
     381        CALL histwrite( nid_A,  "u_abl"  , it, u_abl   (:,:,2:jpka,nt_n  )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! u_abl 
     382        CALL histwrite( nid_A,  "v_abl"  , it, v_abl   (:,:,2:jpka,nt_n  )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! v_abl 
     383        CALL histwrite( nid_A,  "t_abl"  , it, tq_abl  (:,:,2:jpka,nt_n,1)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! t_abl 
     384        CALL histwrite( nid_A,  "q_abl"  , it, tq_abl  (:,:,2:jpka,nt_n,2)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! q_abl      
     385        CALL histwrite( nid_A,  "tke_abl", it, tke_abl (:,:,2:jpka,nt_n  )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! tke_abl 
     386        CALL histwrite( nid_A,  "avm_abl", it, avm_abl (:,:,2:jpka       )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! avm_abl 
     387        CALL histwrite( nid_A,  "avt_abl", it, avt_abl (:,:,2:jpka       )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! avt_abl   
     388#if defined key_si3 
     389         CALL histwrite( nid_A,  "oce_frac"   , it, ato_i(:,:)                                  , ndim_hA, ndex_hA )   ! ato_i 
     390#endif 
     391       DEALLOCATE(zw3d_abl) 
     392     ENDIF 
     393! 
    312394 
    313395         ! Write fields on U grid 
     
    325407         CALL histclo( nid_U ) 
    326408         CALL histclo( nid_V ) 
     409         IF(ln_abl) CALL histclo( nid_A ) 
    327410      ENDIF 
    328411      ! 
     
    332415#endif 
    333416 
    334    SUBROUTINE dia_wri_state( cdfile_name ) 
     417   SUBROUTINE dia_wri_state( Kmm, cdfile_name ) 
    335418      !!--------------------------------------------------------------------- 
    336419      !!                 ***  ROUTINE dia_wri_state  *** 
     
    345428      !!      File 'output.abort.nc' is created in case of abnormal job end 
    346429      !!---------------------------------------------------------------------- 
     430      INTEGER           , INTENT( in ) ::   Kmm              ! ocean time levelindex 
    347431      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created 
    348432      !! 
     
    354438      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   and forcing fields file created ' 
    355439      IF(lwp) WRITE(numout,*) '                and named :', cdfile_name, '...nc' 
    356  
    357 #if defined key_si3 
    358      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl ) 
    359 #else 
    360      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 
    361 #endif 
    362  
    363       CALL iom_rstput( 0, 0, inum, 'votemper', tsn(:,:,:,jp_tem) )    ! now temperature 
    364       CALL iom_rstput( 0, 0, inum, 'vosaline', tsn(:,:,:,jp_sal) )    ! now salinity 
    365       CALL iom_rstput( 0, 0, inum, 'sossheig', sshn              )    ! sea surface height 
    366       CALL iom_rstput( 0, 0, inum, 'vozocrtx', un                )    ! now i-velocity 
    367       CALL iom_rstput( 0, 0, inum, 'vomecrty', vn                )    ! now j-velocity 
    368       CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn                )    ! now k-velocity 
    369       CALL iom_rstput( 0, 0, inum, 'sowaflup', emp - rnf         )    ! freshwater budget 
    370       CALL iom_rstput( 0, 0, inum, 'sohefldo', qsr + qns         )    ! total heat flux 
    371       CALL iom_rstput( 0, 0, inum, 'soshfldo', qsr               )    ! solar heat flux 
    372       CALL iom_rstput( 0, 0, inum, 'soicecov', fr_i              )    ! ice fraction 
    373       CALL iom_rstput( 0, 0, inum, 'sozotaux', utau              )    ! i-wind stress 
    374       CALL iom_rstput( 0, 0, inum, 'sometauy', vtau              )    ! j-wind stress 
    375   
     440      ! 
     441      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 
     442      ! 
     443      CALL iom_rstput( 0, 0, inum, 'votemper', ts (:,:,:,jp_tem,Kmm) )    ! now temperature 
     444      CALL iom_rstput( 0, 0, inum, 'vosaline', ts (:,:,:,jp_sal,Kmm) )    ! now salinity 
     445      CALL iom_rstput( 0, 0, inum, 'sossheig', ssh(:,:,         Kmm) )    ! sea surface height 
     446      CALL iom_rstput( 0, 0, inum, 'vozocrtx', uu (:,:,:,       Kmm) )    ! now i-velocity 
     447      CALL iom_rstput( 0, 0, inum, 'vomecrty', vv (:,:,:,       Kmm) )    ! now j-velocity 
     448      CALL iom_rstput( 0, 0, inum, 'vovecrtz', ww                    )    ! now k-velocity 
     449      CALL iom_rstput( 0, 0, inum, 'sowaflup', emp - rnf             )    ! freshwater budget 
     450      CALL iom_rstput( 0, 0, inum, 'sohefldo', qsr + qns             )    ! total heat flux 
     451      CALL iom_rstput( 0, 0, inum, 'soshfldo', qsr                   )    ! solar heat flux 
     452      CALL iom_rstput( 0, 0, inum, 'soicecov', fr_i                  )    ! ice fraction 
     453      CALL iom_rstput( 0, 0, inum, 'sozotaux', utau                  )    ! i-wind stress 
     454      CALL iom_rstput( 0, 0, inum, 'sometauy', vtau                  )    ! j-wind stress 
     455      ! 
     456      CALL iom_close( inum ) 
     457      ! 
    376458#if defined key_si3 
    377459      IF( nn_ice == 2 ) THEN   ! condition needed in case agrif + ice-model but no-ice in child grid 
     460         CALL iom_open( TRIM(cdfile_name)//'_ice', inum, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
    378461         CALL ice_wri_state( inum ) 
    379       ENDIF 
    380 #endif 
    381       ! 
    382       CALL iom_close( inum ) 
    383       ! 
     462         CALL iom_close( inum ) 
     463      ENDIF 
     464#endif 
     465 
    384466   END SUBROUTINE dia_wri_state 
    385467 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/SAS/nemogcm.F90

    r12178 r12928  
    3232   USE bdyini         ! open boundary cond. setting       (bdy_init routine). mandatory for sea-ice 
    3333   USE bdydta         ! open boundary cond. setting   (bdy_dta_init routine). mandatory for sea-ice 
     34   USE diu_layers     ! diurnal bulk SST and coolskin 
     35   USE step_diu       ! diurnal bulk SST timestepping (called from here if run offline) 
    3436   ! 
     37   USE in_out_manager ! I/O manager 
    3538   USE lib_mpp        ! distributed memory computing 
    3639   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
     
    5255   CHARACTER(lc) ::   cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
    5356 
     57#if defined key_mpp_mpi 
     58   INCLUDE 'mpif.h' 
     59#endif 
     60 
    5461   !!---------------------------------------------------------------------- 
    5562   !! NEMO/SAS 4.0 , NEMO Consortium (2018) 
     
    8390      !                            !-----------------------! 
    8491#if defined key_agrif 
     92      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices 
    8593      CALL Agrif_Declare_Var_dom   ! AGRIF: set the meshes for DOM 
    8694      CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA  
     
    109117#if defined key_si3 
    110118      ! Recursive update from highest nested level to lowest: 
     119      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices 
    111120      CALL Agrif_step_child_adj(Agrif_update_ice) 
    112121#endif 
     
    128137         ! 
    129138         DO WHILE( istp <= nitend .AND. nstop == 0 ) 
     139#if defined key_mpp_mpi 
     140            ncom_stp = istp 
     141            IF ( istp == ( nit000 + 1 ) ) elapsed_time = MPI_Wtime() 
     142            IF ( istp ==         nitend ) elapsed_time = MPI_Wtime() - elapsed_time 
     143#endif 
    130144            CALL stp        ( istp )  
    131145            istp = istp + 1 
     
    185199      INTEGER ::   ios, ilocal_comm   ! local integers 
    186200      !! 
    187       NAMELIST/namctl/ ln_ctl   , sn_cfctl, nn_print, nn_ictls, nn_ictle,   & 
     201      NAMELIST/namctl/ sn_cfctl, nn_print, nn_ictls, nn_ictle,              & 
    188202         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             & 
    189203         &             ln_timing, ln_diacfl 
     
    230244      ! open ocean.output as soon as possible to get all output prints (including errors messages) 
    231245      IF( lk_oasis ) THEN 
    232          IF( lwm )   CALL ctl_opn(     numout,              'sas.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     246         IF( lwm )   CALL ctl_opn(     numout,               'sas.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    233247         ! open reference and configuration namelist files 
    234                      CALL ctl_opn( numnam_ref,        'namelist_sas_ref',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    235                      CALL ctl_opn( numnam_cfg,        'namelist_sas_cfg',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    236          IF( lwm )   CALL ctl_opn(     numond, 'output.namelist_sas.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     248                     CALL load_nml( numnam_ref,        'namelist_sas_ref',                                           -1, lwm ) 
     249                     CALL load_nml( numnam_cfg,        'namelist_sas_cfg',                                           -1, lwm ) 
     250         IF( lwm )   CALL ctl_opn(      numond, 'output.namelist_sas.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    237251      ELSE 
    238          IF( lwm )   CALL ctl_opn(     numout,            'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     252         IF( lwm )   CALL ctl_opn(      numout,            'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    239253         ! open reference and configuration namelist files 
    240                      CALL ctl_opn( numnam_ref,            'namelist_ref',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    241                      CALL ctl_opn( numnam_cfg,            'namelist_cfg',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    242          IF( lwm )   CALL ctl_opn(     numond,     'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     254                     CALL load_nml( numnam_ref,            'namelist_ref',                                           -1, lwm ) 
     255                     CALL load_nml( numnam_cfg,            'namelist_cfg',                                           -1, lwm ) 
     256         IF( lwm )   CALL ctl_opn(      numond,     'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    243257      ENDIF 
    244258      ! open /dev/null file to be able to supress output write easily 
     259      IF( Agrif_Root() ) THEN 
    245260                     CALL ctl_opn(     numnul,               '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     261#ifdef key_agrif 
     262      ELSE 
     263                  numnul = Agrif_Parent(numnul)    
     264#endif 
     265      ENDIF 
    246266      ! 
    247267      !                             !--------------------! 
    248       !                             ! Open listing units !  -> need ln_ctl from namctl to define lwp 
     268      !                             ! Open listing units !  -> need sn_cfctl from namctl to define lwp 
    249269      !                             !--------------------! 
    250270      ! 
    251       REWIND( numnam_ref )              ! Namelist namctl in reference namelist 
    252271      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    253272901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist' ) 
    254       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    255273      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    256274902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist' ) 
    257275      ! 
    258       lwp = (narea == 1) .OR. ln_ctl    ! control of all listing output print 
     276      ! finalize the definition of namctl variables 
     277      IF( sn_cfctl%l_allon ) THEN 
     278         ! Turn on all options. 
     279         CALL nemo_set_cfctl( sn_cfctl, .TRUE., .TRUE. ) 
     280         ! Ensure all processors are active 
     281         sn_cfctl%procmin = 0 ; sn_cfctl%procmax = 1000000 ; sn_cfctl%procincr = 1 
     282      ELSEIF( sn_cfctl%l_config ) THEN 
     283         ! Activate finer control of report outputs 
     284         ! optionally switch off output from selected areas (note this only 
     285         ! applies to output which does not involve global communications) 
     286         IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. & 
     287           & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    & 
     288           &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 
     289      ELSE 
     290         ! turn off all options. 
     291         CALL nemo_set_cfctl( sn_cfctl, .FALSE., .TRUE. ) 
     292      ENDIF 
     293      ! 
     294      lwp = (narea == 1) .OR. sn_cfctl%l_oceout    ! control of all listing output print 
    259295      ! 
    260296      IF(lwp) THEN                      ! open listing units 
     
    291327         ! 
    292328      ENDIF 
    293      ! 
    294       ! finalize the definition of namctl variables 
    295       IF( sn_cfctl%l_config ) THEN 
    296          ! Activate finer control of report outputs 
    297          ! optionally switch off output from selected areas (note this only 
    298          ! applies to output which does not involve global communications) 
    299          IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. & 
    300            & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    & 
    301            &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 
    302       ELSE 
    303          ! Use ln_ctl to turn on or off all options. 
    304          CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) 
    305       ENDIF 
    306329      ! 
    307330      IF(lwm) WRITE( numond, namctl ) 
     
    311334      !                             !------------------------------------! 
    312335      ! 
    313       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
    314336      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    315337903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 
    316       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
    317338      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    318339904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )    
     
    334355      CALL nemo_alloc() 
    335356 
     357      ! Initialise time level indices 
     358      Nbb = 1; Nnn = 2; Naa = 3; Nrhs = Naa 
     359 
    336360      !                             !-------------------------------! 
    337361      !                             !  NEMO general initialization  ! 
     
    346370                           CALL phy_cst         ! Physical constants 
    347371                           CALL eos_init        ! Equation of seawater 
    348                            CALL dom_init('SAS') ! Domain 
    349       IF( ln_ctl      )    CALL prt_ctl_init    ! Print control 
     372                           CALL dom_init( Nbb, Nnn, Naa, 'SAS') ! Domain 
     373      IF( sn_cfctl%l_prtctl )   & 
     374         &                 CALL prt_ctl_init        ! Print control 
    350375       
    351376                           CALL day_init        ! model calendar (using both namelist and restart infos) 
     
    353378 
    354379      !                                      ! external forcing  
    355                            CALL sbc_init        ! Forcings : surface module  
     380                           CALL sbc_init( Nbb, Nnn, Naa )  ! Forcings : surface module  
    356381 
    357382      ! ==> clem: open boundaries init. is mandatory for sea-ice because ice BDY is not decoupled from   
     
    360385                           CALL bdy_init 
    361386      ! ==> 
    362                            CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
     387                           CALL icb_init( rn_Dt, nit000)   ! initialise icebergs instance 
    363388      ! 
    364389      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA 
     
    375400      !! ** Purpose :   control print setting 
    376401      !! 
    377       !! ** Method  : - print namctl information and check some consistencies 
     402      !! ** Method  : - print namctl and namcfg information and check some consistencies 
    378403      !!---------------------------------------------------------------------- 
    379404      ! 
     
    383408         WRITE(numout,*) '~~~~~~~~' 
    384409         WRITE(numout,*) '   Namelist namctl' 
    385          WRITE(numout,*) '      run control (for debugging)     ln_ctl     = ', ln_ctl 
     410         WRITE(numout,*) '                              sn_cfctl%l_glochk  = ', sn_cfctl%l_glochk 
     411         WRITE(numout,*) '                              sn_cfctl%l_allon   = ', sn_cfctl%l_allon 
    386412         WRITE(numout,*) '       finer control over o/p sn_cfctl%l_config  = ', sn_cfctl%l_config 
    387413         WRITE(numout,*) '                              sn_cfctl%l_runstat = ', sn_cfctl%l_runstat 
     
    389415         WRITE(numout,*) '                              sn_cfctl%l_oceout  = ', sn_cfctl%l_oceout 
    390416         WRITE(numout,*) '                              sn_cfctl%l_layout  = ', sn_cfctl%l_layout 
    391          WRITE(numout,*) '                              sn_cfctl%l_mppout  = ', sn_cfctl%l_mppout 
    392          WRITE(numout,*) '                              sn_cfctl%l_mpptop  = ', sn_cfctl%l_mpptop 
     417         WRITE(numout,*) '                              sn_cfctl%l_prtctl  = ', sn_cfctl%l_prtctl 
     418         WRITE(numout,*) '                              sn_cfctl%l_prttrc  = ', sn_cfctl%l_prttrc 
     419         WRITE(numout,*) '                              sn_cfctl%l_oasout  = ', sn_cfctl%l_oasout 
    393420         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin   
    394421         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax   
     
    428455      !                             ! Parameter control 
    429456      ! 
    430       IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints 
     457      IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN              ! sub-domain area indices for the control prints 
    431458         IF( lk_mpp .AND. jpnij > 1 ) THEN 
    432459            isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
     
    489516      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file       
    490517      IF( numrun          /= -1 )   CLOSE( numrun          )   ! run statistics file 
    491       IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist 
    492       IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist 
    493518      IF( lwm.AND.numond  /= -1 )   CLOSE( numond          )   ! oce output namelist 
    494       IF( numnam_ice_ref  /= -1 )   CLOSE( numnam_ice_ref  )   ! ice reference namelist 
    495       IF( numnam_ice_cfg  /= -1 )   CLOSE( numnam_ice_cfg  )   ! ice configuration namelist 
    496519      IF( lwm.AND.numoni  /= -1 )   CLOSE( numoni          )   ! ice output namelist 
    497520      IF( numevo_ice      /= -1 )   CLOSE( numevo_ice      )   ! ice variables (temp. evolution) 
     
    552575      sn_cfctl%l_oceout  = setto 
    553576      sn_cfctl%l_layout  = setto 
    554       sn_cfctl%l_mppout  = setto 
    555       sn_cfctl%l_mpptop  = setto 
     577      sn_cfctl%l_prtctl  = setto 
     578      sn_cfctl%l_prttrc  = setto 
     579      sn_cfctl%l_oasout  = setto 
    556580   END SUBROUTINE nemo_set_cfctl 
    557581 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/SAS/sbcssm.F90

    r12178 r12928  
    2626   USE lib_mpp        ! distributed memory computing library 
    2727   USE prtctl         ! print control 
    28    USE fldread        ! read input fields  
     28   USE fldread        ! read input fields 
    2929   USE timing         ! Timing 
    3030 
     
    3838   LOGICAL            ::   ln_3d_uve     ! specify whether input velocity data is 3D 
    3939   LOGICAL            ::   ln_read_frq   ! specify whether we must read frq or not 
    40     
     40 
    4141   LOGICAL            ::   l_sasread     ! Ice intilisation: =T read a file ; =F anaytical initilaistion 
    4242   LOGICAL            ::   l_initdone = .false. 
     
    6262CONTAINS 
    6363 
    64    SUBROUTINE sbc_ssm( kt ) 
     64   SUBROUTINE sbc_ssm( kt, Kbb, Kmm ) 
    6565      !!---------------------------------------------------------------------- 
    6666      !!                  ***  ROUTINE sbc_ssm  *** 
     
    6969      !!               for an off-line simulation using surface processes only 
    7070      !! 
    71       !! ** Method : calculates the position of data  
     71      !! ** Method : calculates the position of data 
    7272      !!             - interpolates data if needed 
    7373      !!---------------------------------------------------------------------- 
    7474      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     75      INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
     76      ! (not needed for SAS but needed to keep a consistent interface in sbcmod.F90) 
    7577      ! 
    7678      INTEGER  ::   ji, jj     ! dummy loop indices 
     
    8082      ! 
    8183      IF( ln_timing )   CALL timing_start( 'sbc_ssm') 
    82       
     84 
    8385      IF ( l_sasread ) THEN 
    8486         IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d )      !==   read data at kt time step   ==! 
    8587         IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d )      !==   read data at kt time step   ==! 
    86          !  
     88         ! 
    8789         IF( ln_3d_uve ) THEN 
    8890            IF( .NOT. ln_linssh ) THEN 
    89                e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor  
     91               e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor 
    9092            ELSE 
    9193               e3t_m(:,:) = e3t_0(:,:,1)                                 ! vertical scale factor 
    9294            ENDIF 
    9395            ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
    94             ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
     96            ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity 
    9597         ELSE 
    9698            IF( .NOT. ln_linssh ) THEN 
    97                e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor  
     99               e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor 
    98100            ELSE 
    99101               e3t_m(:,:) = e3t_0(:,:,1)                                 ! vertical scale factor 
    100102            ENDIF 
    101103            ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
    102             ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
     104            ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity 
    103105         ENDIF 
    104106         ! 
     
    119121         IF( .NOT. ln_linssh ) e3t_m(:,:) = e3t_0(:,:,1) !clem: necessary at least for sas2D 
    120122         frq_m(:,:) = 1._wp                              !              - - 
    121          sshn (:,:) = 0._wp                              !              - - 
    122       ENDIF 
    123        
     123         ssh  (:,:,Kmm) = 0._wp                              !              - - 
     124      ENDIF 
     125 
    124126      IF ( nn_ice == 1 ) THEN 
    125          tsn(:,:,1,jp_tem) = sst_m(:,:) 
    126          tsn(:,:,1,jp_sal) = sss_m(:,:) 
    127          tsb(:,:,1,jp_tem) = sst_m(:,:) 
    128          tsb(:,:,1,jp_sal) = sss_m(:,:) 
    129       ENDIF 
    130       ub (:,:,1) = ssu_m(:,:) 
    131       vb (:,:,1) = ssv_m(:,:) 
    132   
    133       IF(ln_ctl) THEN                  ! print control 
     127         ts(:,:,1,jp_tem,Kmm) = sst_m(:,:) 
     128         ts(:,:,1,jp_sal,Kmm) = sss_m(:,:) 
     129         ts(:,:,1,jp_tem,Kbb) = sst_m(:,:) 
     130         ts(:,:,1,jp_sal,Kbb) = sss_m(:,:) 
     131      ENDIF 
     132      uu (:,:,1,Kbb) = ssu_m(:,:) 
     133      vv (:,:,1,Kbb) = ssv_m(:,:) 
     134 
     135      IF(sn_cfctl%l_prtctl) THEN            ! print control 
    134136         CALL prt_ctl(tab2d_1=sst_m, clinfo1=' sst_m   - : ', mask1=tmask   ) 
    135137         CALL prt_ctl(tab2d_1=sss_m, clinfo1=' sss_m   - : ', mask1=tmask   ) 
     
    156158 
    157159 
    158    SUBROUTINE sbc_ssm_init 
     160   SUBROUTINE sbc_ssm_init( Kbb, Kmm ) 
    159161      !!---------------------------------------------------------------------- 
    160162      !!                  ***  ROUTINE sbc_ssm_init  *** 
    161163      !! 
    162       !! ** Purpose :   Initialisation of sea surface mean data      
    163       !!---------------------------------------------------------------------- 
     164      !! ** Purpose :   Initialisation of sea surface mean data 
     165      !!---------------------------------------------------------------------- 
     166      INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
     167      ! (not needed for SAS but needed to keep a consistent interface in sbcmod.F90) 
    164168      INTEGER  :: ierr, ierr0, ierr1, ierr2, ierr3   ! return error code 
    165169      INTEGER  :: ifpr                               ! dummy loop indice 
     
    186190      ENDIF 
    187191      ! 
    188       REWIND( numnam_ref )              ! Namelist namsbc_sas in reference namelist : Input fields 
    189192      READ  ( numnam_ref, namsbc_sas, IOSTAT = ios, ERR = 901) 
    190193901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc_sas in reference namelist' ) 
    191       REWIND( numnam_cfg )              ! Namelist namsbc_sas in configuration namelist : Input fields 
    192194      READ  ( numnam_cfg, namsbc_sas, IOSTAT = ios, ERR = 902 ) 
    193195902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc_sas in configuration namelist' ) 
    194196      IF(lwm) WRITE ( numond, namsbc_sas ) 
    195       !            
     197      ! 
    196198      IF(lwp) THEN                              ! Control print 
    197199         WRITE(numout,*) '   Namelist namsbc_sas' 
    198          WRITE(numout,*) '      Initialisation using an input file                                 l_sasread   = ', l_sasread  
     200         WRITE(numout,*) '      Initialisation using an input file                                 l_sasread   = ', l_sasread 
    199201         WRITE(numout,*) '      Are we supplying a 3D u,v and e3 field                             ln_3d_uve   = ', ln_3d_uve 
    200202         WRITE(numout,*) '      Are we reading frq (fraction of qsr absorbed in the 1st T level)   ln_read_frq = ', ln_read_frq 
     
    224226         ln_closea = .false. 
    225227      ENDIF 
    226        
    227       !                   
     228 
     229      ! 
    228230      IF( l_sasread ) THEN                       ! store namelist information in an array 
    229          !  
     231         ! 
    230232         !! following code is a bit messy, but distinguishes between when u,v are 3d arrays and 
    231233         !! when we have other 3d arrays that we need to read in 
     
    273275         ENDIF 
    274276         ! 
    275          ierr1 = 0    ! default definition if slf_?d(ifpr)%ln_tint = .false.  
     277         ierr1 = 0    ! default definition if slf_?d(ifpr)%ln_tint = .false. 
    276278         IF( nfld_3d > 0 ) THEN 
    277279            ALLOCATE( sf_ssm_3d(nfld_3d), STAT=ierr )         ! set sf structure 
     
    280282            ENDIF 
    281283            DO ifpr = 1, nfld_3d 
    282                                             ALLOCATE( sf_ssm_3d(ifpr)%fnow(jpi,jpj,jpk)    , STAT=ierr0 ) 
     284               ALLOCATE( sf_ssm_3d(ifpr)%fnow(jpi,jpj,jpk)    , STAT=ierr0 ) 
    283285               IF( slf_3d(ifpr)%ln_tint )   ALLOCATE( sf_ssm_3d(ifpr)%fdta(jpi,jpj,jpk,2)  , STAT=ierr1 ) 
    284286               IF( ierr0 + ierr1 > 0 ) THEN 
     
    296298            ENDIF 
    297299            DO ifpr = 1, nfld_2d 
    298                                             ALLOCATE( sf_ssm_2d(ifpr)%fnow(jpi,jpj,1)    , STAT=ierr0 ) 
     300               ALLOCATE( sf_ssm_2d(ifpr)%fnow(jpi,jpj,1)    , STAT=ierr0 ) 
    299301               IF( slf_2d(ifpr)%ln_tint )   ALLOCATE( sf_ssm_2d(ifpr)%fdta(jpi,jpj,1,2)  , STAT=ierr1 ) 
    300302               IF( ierr0 + ierr1 > 0 ) THEN 
     
    311313      ENDIF 
    312314      ! 
    313       CALL sbc_ssm( nit000 )   ! need to define ss?_m arrays used in iceistate 
     315      CALL sbc_ssm( nit000, Kbb, Kmm )   ! need to define ss?_m arrays used in iceistate 
    314316      l_initdone = .TRUE. 
    315317      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/SAS/step.F90

    r12178 r12928  
    4949 
    5050   !!---------------------------------------------------------------------- 
     51   !! time level indices 
     52   !!---------------------------------------------------------------------- 
     53   INTEGER, PUBLIC :: Nbb, Nnn, Naa, Nrhs          !! used by nemo_init 
     54   !!---------------------------------------------------------------------- 
    5155   !! NEMO/SAS 4.0 , NEMO Consortium (2018) 
    5256   !! $Id$ 
     
    7478 
    7579#if defined key_agrif 
     80      IF( nstop > 0 ) return   ! avoid to go further if an error was detected during previous time step  
    7681      kstp = nit000 + Agrif_Nb_Step() 
     82      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices 
    7783      IF ( lk_agrif_debug ) THEN 
    7884         IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
     
    96102      !           From SAS: ocean bdy data are wrong  (but we do not care) and ice bdy data are OK.   
    97103      !           This is not clean and should be changed in the future.  
    98       IF( ln_bdy     )       CALL bdy_dta ( kstp, kt_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    99104      ! ==> 
    100                              CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
     105      IF( ln_bdy     )       CALL bdy_dta( kstp,      Nnn )                   ! update dynamic & tracer data at open boundaries 
     106                             CALL sbc    ( kstp, Nbb, Nnn )                   ! Sea Boundary Condition (including sea-ice) 
    101107 
    102                              CALL dia_wri( kstp )         ! ocean model: outputs 
     108                             CALL dia_wri( kstp,      Nnn )                   ! ocean model: outputs 
    103109 
    104110#if defined key_agrif 
    105111      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    106       ! AGRIF 
     112      ! AGRIF recursive integration 
    107113      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
    108114                             CALL Agrif_Integrate_ChildGrids( stp )   
    109  
    110       IF( Agrif_NbStepint() == 0 ) THEN               ! AGRIF Update from zoom N to zoom 1 then to Parent  
    111 #if defined key_si3 
    112                              CALL Agrif_Update_ice( )   ! update sea-ice 
    113 #endif 
    114       ENDIF 
    115115#endif 
    116116                              
     
    121121      IF( indic < 0  )  THEN 
    122122                             CALL ctl_stop( 'step: indic < 0' ) 
    123                              CALL dia_wri_state( 'output.abort' ) 
     123                             CALL dia_wri_state( Nnn, 'output.abort' ) 
    124124      ENDIF 
    125       IF( kstp == nit000   ) CALL iom_close( numror )     ! close input  ocean restart file 
     125#if defined key_agrif 
     126      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     127      ! AGRIF update 
     128      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     129      IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) THEN                       ! AGRIF Update from zoom N to zoom 1 then to Parent  
     130#if defined key_si3 
     131                             CALL Agrif_Update_ice( )   ! update sea-ice 
     132#endif 
     133      ENDIF 
     134#endif 
     135      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     136      ! File manipulation at the end of the first time step 
     137      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                          
     138      IF( kstp == nit000   ) CALL iom_close( numror )                          ! close input  ocean restart file 
    126139       
    127140      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    128141      ! Coupled mode 
    129142      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    130       IF( lk_oasis    )  CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges if OASIS-coupled ice 
     143      IF( lk_oasis    )  CALL sbc_cpl_snd( kstp, Nbb, Nnn )     ! coupled mode : field exchanges if OASIS-coupled ice 
    131144 
    132145#if defined key_iomput 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/SAS/stpctl.F90

    r10603 r12928  
    6363      ! 
    6464      ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
    65       ll_colruns = ll_wrtstp .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) 
     65      ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 
    6666      ll_wrtruns = ll_colruns .AND. lwm 
    6767      IF( kt == nit000 .AND. lwp ) THEN 
     
    7373         !                                ! open run.stat file(s) at start whatever 
    7474         !                                ! the value of sn_cfctl%ptimincr 
    75          IF( lwm .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) ) THEN 
     75         IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 
    7676            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    7777            clname = 'run.stat.nc' 
Note: See TracChangeset for help on using the changeset viewer.