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 14201 for NEMO/trunk/src/OCE/step.F90 – NEMO

Ignore:
Timestamp:
2020-12-17T17:14:55+01:00 (4 years ago)
Author:
smasson
Message:

trunk: phase step.F90 and stpmlf.F90...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/step.F90

    r14143 r14201  
    5050   PUBLIC   stp   ! called by nemogcm.F90 
    5151 
    52    !!---------------------------------------------------------------------- 
    53    !! time level indices 
    54    !!---------------------------------------------------------------------- 
    55    INTEGER, PUBLIC :: Nbb, Nnn, Naa, Nrhs          !! used by nemo_init 
     52   !                                          !**  time level indices  **! 
     53   INTEGER, PUBLIC ::   Nbb, Nnn, Naa, Nrhs   !: used by nemo_init 
    5654 
    5755   !! * Substitutions 
     
    8886      !!---------------------------------------------------------------------- 
    8987      INTEGER ::   ji, jj, jk, jtile   ! dummy loop indice 
    90 !!gm kcall can be removed, I guess 
    91       INTEGER ::   kcall        ! optional integer argument (dom_vvl_sf_nxt) 
    9288      !! --------------------------------------------------------------------- 
    9389#if defined key_agrif 
     
    111107      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    112108      ! 
    113       IF( l_1st_euler ) THEN 
    114          ! start or restart with Euler 1st time-step 
    115          rDt =  rn_Dt 
     109      IF( l_1st_euler ) THEN     ! start or restart with Euler 1st time-step 
     110         rDt   = rn_Dt    
    116111         r1_Dt = 1._wp / rDt 
    117112      ENDIF 
     
    120115      ! update I/O and calendar 
    121116      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     117      ! 
    122118      IF( kstp == nit000 ) THEN                       ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    123119                             CALL iom_init( cxios_context, ld_closedef=.FALSE. )   ! for model grid (including possible AGRIF zoom) 
     
    126122         IF( ln_crs      )   CALL iom_init( TRIM(cxios_context)//"_crs" )  ! for coarse grid 
    127123      ENDIF 
    128       IF((kstp == nitrst) .AND. lwxios) THEN 
    129          CALL iom_swap(      cw_ocerst_cxt          ) 
    130          CALL iom_init_closedef(cw_ocerst_cxt) 
    131          CALL iom_setkt( kstp - nit000 + 1,      cw_ocerst_cxt          ) 
     124      IF( kstp == nitrst .AND. lwxios ) THEN 
     125                             CALL iom_swap(                     cw_ocerst_cxt ) 
     126                             CALL iom_init_closedef(            cw_ocerst_cxt ) 
     127                             CALL iom_setkt( kstp - nit000 + 1, cw_ocerst_cxt ) 
    132128#if defined key_top 
    133          CALL iom_swap(      cw_toprst_cxt          ) 
    134          CALL iom_init_closedef(cw_toprst_cxt) 
    135          CALL iom_setkt( kstp - nit000 + 1,      cw_toprst_cxt          ) 
     129                             CALL iom_swap(                     cw_toprst_cxt ) 
     130                             CALL iom_init_closedef(            cw_toprst_cxt ) 
     131                             CALL iom_setkt( kstp - nit000 + 1, cw_toprst_cxt ) 
    136132#endif 
    137133      ENDIF 
    138134#if defined key_si3 
    139       IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN 
    140          CALL iom_swap(      cw_icerst_cxt          ) 
    141          CALL iom_init_closedef(cw_icerst_cxt) 
    142          CALL iom_setkt( kstp - nit000 + 1,      cw_icerst_cxt          ) 
     135      IF( kstp + nn_fsbc - 1 == nitrst .AND. lwxios ) THEN 
     136                             CALL iom_swap(                     cw_icerst_cxt ) 
     137                             CALL iom_init_closedef(            cw_icerst_cxt ) 
     138                             CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 
    143139      ENDIF 
    144140#endif 
     
    159155      ! Update stochastic parameters and random T/S fluctuations 
    160156      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    161       IF( ln_sto_eos ) CALL sto_par( kstp )          ! Stochastic parameters 
    162       IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn)  )          ! Random T/S fluctuations 
     157      IF( ln_sto_eos )   CALL sto_par( kstp )                         ! Stochastic parameters 
     158      IF( ln_sto_eos )   CALL sto_pts( ts(:,:,:,:,Nnn)  )             ! Random T/S fluctuations 
    163159 
    164160      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    200196      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    201197 
    202                             CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )    ! after ssh (includes call to div_hor) 
    203       IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors 
    204                             CALL wzv           ( kstp, Nbb, Nnn, Naa, ww  )    ! now cross-level velocity 
    205       IF( ln_zad_Aimp )     CALL wAimp         ( kstp,      Nnn           )  ! Adaptive-implicit vertical advection partitioning 
    206                             CALL eos    ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) )  ! now in situ density for hpg computation 
     198                         CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )   ! after ssh (includes call to div_hor) 
     199      IF( .NOT.ln_linssh )   & 
     200                       & CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )   ! after vertical scale factors 
     201                         CALL wzv           ( kstp, Nbb, Nnn, Naa, ww  )   ! now cross-level velocity 
     202      IF( ln_zad_Aimp )  CALL wAimp         ( kstp,      Nnn           )   ! Adaptive-implicit vertical advection partitioning 
     203                         CALL eos    ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) )  ! now in situ density for hpg computation 
    207204 
    208205 
     
    231228                            CALL dyn_zdf    ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa  )  ! vertical diffusion 
    232229      IF( ln_dynspg_ts ) THEN                                                       ! vertical scale factors and vertical velocity need to be updated 
    233                             CALL wzv        ( kstp, Nbb, Nnn, Naa, ww )             ! now cross-level velocity 
     230                            CALL wzv        ( kstp, Nbb, Nnn, Naa, ww )             ! Nnn cross-level velocity 
    234231         IF( ln_zad_Aimp )  CALL wAimp      ( kstp,      Nnn )                      ! Adaptive-implicit vertical advection partitioning 
    235232      ENDIF 
     
    259256      ! Passive Tracer Model 
    260257      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    261                          CALL trc_stp       ( kstp, Nbb, Nnn, Nrhs, Naa )  ! time-stepping 
     258                         CALL trc_stp    ( kstp, Nbb, Nnn, Nrhs, Naa )           ! time-stepping 
    262259#endif 
    263260 
     
    267264      ! Loop over tile domains 
    268265      DO jtile = 1, nijtile 
    269          IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile ) 
     266         IF( ln_tile    )  CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile ) 
    270267 
    271268         DO_3D( 0, 0, 0, 0, 1, jpk ) 
    272             ts(ji,jj,jk,:,Nrhs) = 0._wp                                         ! set tracer trends to zero 
     269            ts(ji,jj,jk,:,Nrhs) = 0._wp                                   ! set tracer trends to zero 
    273270         END_3D 
    274271 
     
    285282 
    286283#if defined key_agrif 
    287          IF(.NOT. Agrif_Root()) THEN 
    288             IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) 
    289             CALL Agrif_Sponge_tra        ! tracers sponge 
    290          ENDIF 
     284      IF(.NOT. Agrif_Root()) THEN 
     285         IF( ln_tile    )  CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) 
     286                            CALL Agrif_Sponge_tra        ! tracers sponge 
     287      ENDIF 
    291288#endif 
    292289 
    293290      ! TEMP: [tiling] Separate loop over tile domains (due to tra_adv workarounds for tiling) 
    294291      DO jtile = 1, nijtile 
    295          IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile ) 
     292         IF( ln_tile    )  CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile ) 
    296293 
    297294                            CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection ==> RHS 
    298295         IF( ln_zdfmfc  )   CALL tra_mfc    ( kstp, Nbb,      ts, Nrhs )  ! Mass Flux Convection 
    299296         IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS 
    300          IF( lrst_oce .AND. ln_zdfosm ) & 
    301               &             CALL osm_rst    ( kstp,      Nnn, 'WRITE'  )  ! write OSMOSIS outputs + ww (so must do here) to restarts 
     297         IF( lrst_oce .AND. ln_zdfosm )   & 
     298                         CALL osm_rst    ( kstp,      Nnn, 'WRITE'  )  ! write OSMOSIS outputs + ww (so must do here) to restarts 
    302299                            CALL tra_ldf    ( kstp, Nbb, Nnn, ts, Nrhs )  ! lateral mixing 
    303300 
     
    363360      ! AGRIF update 
    364361      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    365       IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) THEN 
    366                          CALL Agrif_update_all( )                  ! Update all components 
    367       ENDIF 
    368  
    369 #endif 
    370       IF( ln_diaobs .AND. nstop == 0 )  CALL dia_obs( kstp, Nnn )  ! obs-minus-model (assimilation) diags (after dynamics update) 
     362      IF( Agrif_NbStepint() == 0 .AND. nstop == 0 )   & 
     363         &               CALL Agrif_update_all( )                  ! Update all components 
     364 
     365#endif 
     366      IF( ln_diaobs .AND. nstop == 0 )   & 
     367         &               CALL dia_obs( kstp, Nnn )  ! obs-minus-model (assimilation) diags (after dynamics update) 
    371368 
    372369      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    375372      IF( kstp == nit000 ) THEN                          ! 1st time step only 
    376373                                        CALL iom_close( numror )   ! close input  ocean restart file 
    377          IF( lrxios )                   CALL iom_context_finalize(      cr_ocerst_cxt        ) 
     374         IF( lrxios )                   CALL iom_context_finalize( cr_ocerst_cxt ) 
    378375         IF(lwm)                        CALL FLUSH    ( numond )   ! flush output namelist oce 
    379376         IF(lwm .AND. numoni /= -1 )    CALL FLUSH    ( numoni )   ! flush output namelist ice (if exist) 
     
    396393      ! 
    397394      IF( l_1st_euler ) THEN         ! recover Leap-frog timestep 
    398          rDt = 2._wp * rn_Dt 
     395         rDt   = 2._wp * rn_Dt 
    399396         r1_Dt = 1._wp / rDt 
    400397         l_1st_euler = .FALSE. 
Note: See TracChangeset for help on using the changeset viewer.