Changeset 14644 for NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/step.F90
- Timestamp:
- 2021-03-26T15:33:49+01:00 (3 years ago)
- Location:
- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final
- Property svn:externals
-
old new 9 9 10 10 # SETTE 11 ^/utils/CI/sette _wave@13990sette11 ^/utils/CI/sette@14244 sette
-
- Property svn:externals
-
NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/step.F90
r14219 r14644 33 33 !! 4.1 ! 2019-08 (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 34 34 !!---------------------------------------------------------------------- 35 35 36 #if defined key_qco || defined key_linssh 36 37 !!---------------------------------------------------------------------- … … 41 42 #else 42 43 !!---------------------------------------------------------------------- 43 !! stp : O PAsystem time-stepping44 !! stp : OCE system time-stepping 44 45 !!---------------------------------------------------------------------- 45 46 USE step_oce ! time stepping definition modules … … 50 51 PUBLIC stp ! called by nemogcm.F90 51 52 52 !!---------------------------------------------------------------------- 53 !! time level indices 54 !!---------------------------------------------------------------------- 55 INTEGER, PUBLIC :: Nbb, Nnn, Naa, Nrhs !! used by nemo_init 53 ! !** time level indices **! 54 INTEGER, PUBLIC :: Nbb, Nnn, Naa, Nrhs !: used by nemo_init 56 55 57 56 !! * Substitutions 58 57 # include "do_loop_substitute.h90" 59 58 # include "single_precision_substitute.h90" 60 61 59 !!---------------------------------------------------------------------- 62 60 !! NEMO/OCE 4.0 , NEMO Consortium (2018) … … 76 74 !! *** ROUTINE stp *** 77 75 !! 78 !! ** Purpose : - Time stepping of O PA(momentum and active tracer eqs.)76 !! ** Purpose : - Time stepping of OCE (momentum and active tracer eqs.) 79 77 !! - Time stepping of SI3 (dynamic and thermodynamic eqs.) 80 78 !! - Time stepping of TRC (passive tracer eqs.) … … 90 88 !!---------------------------------------------------------------------- 91 89 INTEGER :: ji, jj, jk, jtile ! dummy loop indice 92 !!gm kcall can be removed, I guess93 INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt)94 90 !! --------------------------------------------------------------------- 95 91 #if defined key_agrif … … 102 98 ENDIF 103 99 IF( kstp == nit000 + 1 ) lk_agrif_fstep = .FALSE. 104 # if defined key_ iomput100 # if defined key_xios 105 101 IF( Agrif_Nbstepint() == 0 ) CALL iom_swap( cxios_context ) 106 102 # endif … … 113 109 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 114 110 ! 115 IF( l_1st_euler ) THEN 116 ! start or restart with Euler 1st time-step 117 rDt = rn_Dt 111 IF( l_1st_euler ) THEN ! start or restart with Euler 1st time-step 112 rDt = rn_Dt 118 113 r1_Dt = 1._wp / rDt 119 114 ENDIF … … 122 117 ! update I/O and calendar 123 118 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 119 ! 124 120 IF( kstp == nit000 ) THEN ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 125 121 CALL iom_init( cxios_context, ld_closedef=.FALSE. ) ! for model grid (including possible AGRIF zoom) … … 128 124 IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! for coarse grid 129 125 ENDIF 130 IF( (kstp == nitrst) .AND. lwxios) THEN131 CALL iom_swap( cw_ocerst_cxt)132 CALL iom_init_closedef(cw_ocerst_cxt)133 CALL iom_setkt( kstp - nit000 + 1, cw_ocerst_cxt)126 IF( kstp == nitrst .AND. lwxios ) THEN 127 CALL iom_swap( cw_ocerst_cxt ) 128 CALL iom_init_closedef( cw_ocerst_cxt ) 129 CALL iom_setkt( kstp - nit000 + 1, cw_ocerst_cxt ) 134 130 #if defined key_top 135 CALL iom_swap( cw_toprst_cxt ) 136 CALL iom_init_closedef(cw_toprst_cxt) 137 CALL iom_setkt( kstp - nit000 + 1, cw_toprst_cxt ) 138 #endif 139 ENDIF 131 CALL iom_swap( cw_toprst_cxt ) 132 CALL iom_init_closedef( cw_toprst_cxt ) 133 CALL iom_setkt( kstp - nit000 + 1, cw_toprst_cxt ) 134 #endif 135 ENDIF 136 IF( kstp + nn_fsbc - 1 == nitrst .AND. lwxios ) THEN 140 137 #if defined key_si3 141 IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN 142 CALL iom_swap( cw_icerst_cxt ) 143 CALL iom_init_closedef(cw_icerst_cxt) 144 CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 145 ENDIF 146 #endif 138 CALL iom_swap( cw_icerst_cxt ) 139 CALL iom_init_closedef( cw_icerst_cxt ) 140 CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 141 #endif 142 IF( ln_abl ) THEN 143 CALL iom_swap( cw_ablrst_cxt ) 144 CALL iom_init_closedef( cw_ablrst_cxt ) 145 CALL iom_setkt( kstp - nit000 + 1, cw_ablrst_cxt ) 146 ENDIF 147 ENDIF 147 148 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 148 149 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp … … 161 162 ! Update stochastic parameters and random T/S fluctuations 162 163 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 163 IF( ln_sto_eos ) CALL sto_par( kstp )! Stochastic parameters164 IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn) )! Random T/S fluctuations164 IF( ln_sto_eos ) CALL sto_par( kstp ) ! Stochastic parameters 165 IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn) ) ! Random T/S fluctuations 165 166 166 167 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 202 203 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 203 204 204 CALL ssh_nxt ( kstp, Nbb, Nnn, ssh, Naa ) ! after ssh (includes call to div_hor) 205 IF( .NOT.ln_linssh ) CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn, Naa ) ! after vertical scale factors 206 CALL wzv ( kstp, Nbb, Nnn, Naa, ww ) ! now cross-level velocity 207 IF( ln_zad_Aimp ) CALL wAimp ( kstp, Nnn ) ! Adaptive-implicit vertical advection partitioning 208 CALL eos ( CASTWP(ts(:,:,:,:,Nnn)), rhd, rhop, CASTWP(gdept(:,:,:,Nnn)) ) ! now in situ density for hpg computation 205 CALL ssh_nxt ( kstp, Nbb, Nnn, ssh, Naa ) ! after ssh (includes call to div_hor) 206 IF( .NOT.ln_linssh ) & 207 & CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn, Naa ) ! after vertical scale factors 208 CALL wzv ( kstp, Nbb, Nnn, Naa, ww ) ! now cross-level velocity 209 IF( ln_zad_Aimp ) CALL wAimp ( kstp, Nnn ) ! Adaptive-implicit vertical advection partitioning 210 CALL eos ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) ) ! now in situ density for hpg computation 209 211 210 212 … … 233 235 CALL dyn_zdf ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa ) ! vertical diffusion 234 236 IF( ln_dynspg_ts ) THEN ! vertical scale factors and vertical velocity need to be updated 235 CALL wzv ( kstp, Nbb, Nnn, Naa, ww ) ! nowcross-level velocity237 CALL wzv ( kstp, Nbb, Nnn, Naa, ww ) ! Nnn cross-level velocity 236 238 IF( ln_zad_Aimp ) CALL wAimp ( kstp, Nnn ) ! Adaptive-implicit vertical advection partitioning 237 239 ENDIF … … 261 263 ! Passive Tracer Model 262 264 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 263 CALL trc_stp ( kstp, Nbb, Nnn, Nrhs, Naa )! time-stepping265 CALL trc_stp ( kstp, Nbb, Nnn, Nrhs, Naa ) ! time-stepping 264 266 #endif 265 267 … … 269 271 ! Loop over tile domains 270 272 DO jtile = 1, nijtile 271 IF( ln_tile )CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile )273 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile ) 272 274 273 275 DO_3D( 0, 0, 0, 0, 1, jpk ) 274 ts(ji,jj,jk,:,Nrhs) = 0._wp 276 ts(ji,jj,jk,:,Nrhs) = 0._wp ! set tracer trends to zero 275 277 END_3D 276 278 … … 287 289 288 290 #if defined key_agrif 289 IF(.NOT. Agrif_Root())THEN290 IF( ln_tile )CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )291 CALL Agrif_Sponge_tra ! tracers sponge292 291 IF(.NOT. Agrif_Root() ) THEN 292 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) 293 CALL Agrif_Sponge_tra ! tracers sponge 294 ENDIF 293 295 #endif 294 296 295 297 ! TEMP: [tiling] Separate loop over tile domains (due to tra_adv workarounds for tiling) 296 298 DO jtile = 1, nijtile 297 IF( ln_tile )CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile )299 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile ) 298 300 299 301 CALL tra_adv ( kstp, Nbb, Nnn, ts, Nrhs ) ! hor. + vert. advection ==> RHS 300 302 IF( ln_zdfmfc ) CALL tra_mfc ( kstp, Nbb, ts, Nrhs ) ! Mass Flux Convection 301 IF( ln_zdfosm ) CALL tra_osm ( kstp, Nnn, ts, Nrhs ) ! OSMOSIS non-local tracer fluxes ==> RHS 302 IF( lrst_oce .AND. ln_zdfosm ) & 303 & CALL osm_rst ( kstp, Nnn, 'WRITE' ) ! write OSMOSIS outputs + ww (so must do here) to restarts 303 IF( ln_zdfosm ) THEN 304 CALL tra_osm ( kstp, Nnn, ts, Nrhs ) ! OSMOSIS non-local tracer fluxes ==> RHS 305 IF( lrst_oce ) CALL osm_rst ( kstp, Nnn, 'WRITE' ) ! write OSMOSIS outputs + ww (so must do here) to restarts 306 ENDIF 304 307 CALL tra_ldf ( kstp, Nbb, Nnn, ts, Nrhs ) ! lateral mixing 305 308 … … 365 368 ! AGRIF update 366 369 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 367 IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) THEN368 369 ENDIF 370 371 #endif 372 IF( ln_diaobs .AND. nstop == 0 )CALL dia_obs( kstp, Nnn ) ! obs-minus-model (assimilation) diags (after dynamics update)370 IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) & 371 & CALL Agrif_update_all( ) ! Update all components 372 373 #endif 374 IF( ln_diaobs .AND. nstop == 0 ) & 375 & CALL dia_obs( kstp, Nnn ) ! obs-minus-model (assimilation) diags (after dynamics update) 373 376 374 377 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 377 380 IF( kstp == nit000 ) THEN ! 1st time step only 378 381 CALL iom_close( numror ) ! close input ocean restart file 379 IF( lrxios ) CALL iom_context_finalize( cr_ocerst_cxt)382 IF( lrxios ) CALL iom_context_finalize( cr_ocerst_cxt ) 380 383 IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce 381 384 IF(lwm .AND. numoni /= -1 ) CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) … … 387 390 IF( lk_oasis .AND. nstop == 0 ) CALL sbc_cpl_snd( kstp, Nbb, Nnn ) ! coupled mode : field exchanges 388 391 ! 389 #if defined key_ iomput392 #if defined key_xios 390 393 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 391 394 ! Finalize contextes if end of simulation or error detected … … 398 401 ! 399 402 IF( l_1st_euler ) THEN ! recover Leap-frog timestep 400 rDt = 2._wp * rn_Dt403 rDt = 2._wp * rn_Dt 401 404 r1_Dt = 1._wp / rDt 402 405 l_1st_euler = .FALSE.
Note: See TracChangeset
for help on using the changeset viewer.