Changeset 14201 for NEMO/trunk/src/OCE/step.F90
- Timestamp:
- 2020-12-17T17:14:55+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/OCE/step.F90
r14143 r14201 50 50 PUBLIC stp ! called by nemogcm.F90 51 51 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 56 54 57 55 !! * Substitutions … … 88 86 !!---------------------------------------------------------------------- 89 87 INTEGER :: ji, jj, jk, jtile ! dummy loop indice 90 !!gm kcall can be removed, I guess91 INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt)92 88 !! --------------------------------------------------------------------- 93 89 #if defined key_agrif … … 111 107 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 112 108 ! 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 116 111 r1_Dt = 1._wp / rDt 117 112 ENDIF … … 120 115 ! update I/O and calendar 121 116 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 117 ! 122 118 IF( kstp == nit000 ) THEN ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 123 119 CALL iom_init( cxios_context, ld_closedef=.FALSE. ) ! for model grid (including possible AGRIF zoom) … … 126 122 IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! for coarse grid 127 123 ENDIF 128 IF( (kstp == nitrst) .AND. lwxios) THEN129 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 ) 132 128 #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 ) 136 132 #endif 137 133 ENDIF 138 134 #if defined key_si3 139 IF( ((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN140 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 ) 143 139 ENDIF 144 140 #endif … … 159 155 ! Update stochastic parameters and random T/S fluctuations 160 156 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 161 IF( ln_sto_eos ) CALL sto_par( kstp )! Stochastic parameters162 IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn) )! Random T/S fluctuations157 IF( ln_sto_eos ) CALL sto_par( kstp ) ! Stochastic parameters 158 IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn) ) ! Random T/S fluctuations 163 159 164 160 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 200 196 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 201 197 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 207 204 208 205 … … 231 228 CALL dyn_zdf ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa ) ! vertical diffusion 232 229 IF( ln_dynspg_ts ) THEN ! vertical scale factors and vertical velocity need to be updated 233 CALL wzv ( kstp, Nbb, Nnn, Naa, ww ) ! nowcross-level velocity230 CALL wzv ( kstp, Nbb, Nnn, Naa, ww ) ! Nnn cross-level velocity 234 231 IF( ln_zad_Aimp ) CALL wAimp ( kstp, Nnn ) ! Adaptive-implicit vertical advection partitioning 235 232 ENDIF … … 259 256 ! Passive Tracer Model 260 257 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 261 CALL trc_stp ( kstp, Nbb, Nnn, Nrhs, Naa )! time-stepping258 CALL trc_stp ( kstp, Nbb, Nnn, Nrhs, Naa ) ! time-stepping 262 259 #endif 263 260 … … 267 264 ! Loop over tile domains 268 265 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 ) 270 267 271 268 DO_3D( 0, 0, 0, 0, 1, jpk ) 272 ts(ji,jj,jk,:,Nrhs) = 0._wp 269 ts(ji,jj,jk,:,Nrhs) = 0._wp ! set tracer trends to zero 273 270 END_3D 274 271 … … 285 282 286 283 #if defined key_agrif 287 288 IF( ln_tile )CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )289 CALL Agrif_Sponge_tra ! tracers sponge290 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 291 288 #endif 292 289 293 290 ! TEMP: [tiling] Separate loop over tile domains (due to tra_adv workarounds for tiling) 294 291 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 ) 296 293 297 294 CALL tra_adv ( kstp, Nbb, Nnn, ts, Nrhs ) ! hor. + vert. advection ==> RHS 298 295 IF( ln_zdfmfc ) CALL tra_mfc ( kstp, Nbb, ts, Nrhs ) ! Mass Flux Convection 299 296 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 restarts297 IF( lrst_oce .AND. ln_zdfosm ) & 298 & CALL osm_rst ( kstp, Nnn, 'WRITE' ) ! write OSMOSIS outputs + ww (so must do here) to restarts 302 299 CALL tra_ldf ( kstp, Nbb, Nnn, ts, Nrhs ) ! lateral mixing 303 300 … … 363 360 ! AGRIF update 364 361 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 365 IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) THEN366 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) 371 368 372 369 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 375 372 IF( kstp == nit000 ) THEN ! 1st time step only 376 373 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 ) 378 375 IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce 379 376 IF(lwm .AND. numoni /= -1 ) CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) … … 396 393 ! 397 394 IF( l_1st_euler ) THEN ! recover Leap-frog timestep 398 rDt = 2._wp * rn_Dt395 rDt = 2._wp * rn_Dt 399 396 r1_Dt = 1._wp / rDt 400 397 l_1st_euler = .FALSE.
Note: See TracChangeset
for help on using the changeset viewer.