Changeset 15321
- Timestamp:
- 2021-10-04T12:24:15+02:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r14318_RK3_stage1/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14318_RK3_stage1/src/OCE/stprk3_stg.F90
r15281 r15321 24 24 # if defined key_top 25 25 USE trc ! ocean passive tracers variables 26 USE trcadv ! advection(trc_adv routine)27 USE trcsms ! source and sink28 USE trctrp ! transport29 USE trcbdy 26 USE trcadv ! passive tracers advection (trc_adv routine) 27 USE trcsms ! passive tracers source and sink 28 USE trctrp ! passive tracers transport 29 USE trcbdy ! passive tracers transport open boundary 30 30 USE trcstp_rk3 31 31 # endif … … 204 204 205 205 # if defined key_top 206 ! 206 207 ! !== Passive Tracer ==! 207 208 ! … … 237 238 CASE ( 3 ) !== Stage 3 ==! add all RHS terms but advection (=> Kbb only) 238 239 ! !---------------! 239 CALL trc_sms( kstp, Kbb, Kbb, Krhs ) ! tracers: sinks and sources 240 CALL trc_trp( kstp, Kbb, Kmm, Krhs, Kaa ) ! transport of passive tracers (without advection) 241 ! 242 !!st a mettre dans trp 243 !!st# if defined key_agrif 244 !!st CALL Agrif_trc( kstp ) ! AGRIF zoom boundaries 245 !!st# endif 246 !!st ! Update after tracer on domain lateral boundaries 247 !!st CALL lbc_lnk( 'stprk3_stg', tr(:,:,:,:,Kaa), 'T', 1._wp ) 248 !!st ! 249 !!st IF( ln_bdy ) CALL trc_bdy( kstp, Kbb, Kmm, Kaa ) 250 ! 251 CALL trc_stp_end( kstp, Kbb, Kmm, Kaa ) 240 CALL trc_sms ( kstp, Kbb, Kbb, Krhs ) ! tracers: sinks and sources 241 CALL trc_trp ( kstp, Kbb, Kmm, Krhs, Kaa ) ! transport of passive tracers (without advection) 242 ! 243 ! 244 CALL trc_stp_end( kstp, Kbb, Kmm, Kaa ) 252 245 ! 253 246 END SELECT … … 271 264 CALL tra_sbc_RK3( kstp, Kmm, ts, Krhs, kstg ) ! surface boundary condition 272 265 273 IF( ln_isf ) CALL tra_isf ( kstp, Kmm, ts, Krhs ) ! ice shelf heat flux274 IF( ln_traqsr ) CALL tra_qsr ( kstp, Kmm, ts, Krhs ) ! penetrative solar radiation qsr266 IF( ln_isf ) CALL tra_isf ( kstp, Kmm, ts, Krhs ) ! ice shelf heat flux 267 IF( ln_traqsr ) CALL tra_qsr ( kstp, Kmm, ts, Krhs ) ! penetrative solar radiation qsr 275 268 !!gm 276 269 … … 330 323 ! !== complete the momentum RHS ==! except ZDF (implicit) 331 324 ! ! lateral mixing ==> RHS 332 CALL dyn_ldf( kstp, Kbb, Kmm 325 CALL dyn_ldf( kstp, Kbb, Kmm, uu, vv, Krhs ) 333 326 ! ! OSMOSIS non-local velocity fluxes ==> RHS 334 IF( ln_zdfosm ) CALL dyn_osm( kstp, Kmm 327 IF( ln_zdfosm ) CALL dyn_osm( kstp, Kmm, uu, vv, Krhs ) 335 328 ! 336 329 IF( ln_bdy ) THEN ! bdy damping trends ==> RHS … … 340 333 341 334 # if defined key_agrif 342 IF(.NOT. Agrif_Root() ) THEN ! AGRIF: sponge ==> momentum and tracer RHS335 IF(.NOT. Agrif_Root() ) THEN ! AGRIF: sponge ==> momentum and tracer RHS 343 336 CALL Agrif_Sponge_dyn 344 337 CALL Agrif_Sponge_tra … … 349 342 ! 350 343 CALL tra_ldf( kstp, Kbb, Kmm, ts, Krhs ) ! lateral mixing 351 !!gm ====>>>> already called in stage 1, 2 and 3 case352 !!st CALL tra_sbc( kstp, Kmm, ts, Krhs ) ! surface boundary condition353 !!st IF( ln_isf ) CALL tra_isf( kstp, Kmm, ts, Krhs ) ! ice shelf heat flux354 !!gm355 !356 !!st IF( ln_traqsr ) CALL tra_qsr( kstp, Kmm, ts, Krhs ) ! penetrative solar radiation qsr357 344 IF( ln_trabbc ) CALL tra_bbc( kstp, Kmm, ts, Krhs ) ! bottom heat flux 358 345 IF( ln_trabbl ) CALL tra_bbl( kstp, Kbb, Kmm, ts, Krhs ) ! advective (and/or diffusive) bottom boundary layer scheme … … 364 351 IF( lrst_oce ) CALL osm_rst( kstp, Kmm, 'WRITE' ) ! write OSMOSIS outputs + ww (so must do here) to restarts 365 352 ENDIF 366 367 353 ! 368 354 ! !== DYN & TRA time integration + ZDF ==! ∆t = rDt … … 370 356 CALL dyn_zdf( kstp, Kbb, Kmm, Krhs, uu, vv, Kaa ) ! vertical diffusion and time integration 371 357 CALL tra_zdf( kstp, Kbb, Kmm, Krhs, ts , Kaa ) ! vertical mixing and after tracer fields 372 !373 358 IF( ln_zdfnpc ) CALL tra_npc( kstp, Kmm, Krhs, ts , Kaa ) ! update after fields by non-penetrative convection 374 359 ! … … 378 363 zub(A2D(0)) = uu_b(A2D(0),Kaa) - SUM( e3u_0(A2D(0),:)*uu(A2D(0),:,Kaa), 3 ) * r1_hu_0(A2D(0)) 379 364 zvb(A2D(0)) = vv_b(A2D(0),Kaa) - SUM( e3v_0(A2D(0),:)*vv(A2D(0),:,Kaa), 3 ) * r1_hv_0(A2D(0)) 380 381 !!st zub(:,:) = uu_b(:,:,Kaa) - SUM( e3u_0(:,:,:)*uu(:,:,:,Kaa), 3 ) * r1_hu_0(:,:) 382 !!st zvb(:,:) = vv_b(:,:,Kaa) - SUM( e3v_0(:,:,:)*vv(:,:,:,Kaa), 3 ) * r1_hv_0(:,:) 383 365 ! 384 366 DO jk = 1, jpkm1 ! corrected horizontal velocity 385 367 uu(:,:,jk,Kaa) = uu(:,:,jk,Kaa) + zub(:,:)*umask(:,:,jk) 386 368 vv(:,:,jk,Kaa) = vv(:,:,jk,Kaa) + zvb(:,:)*vmask(:,:,jk) 387 369 END DO 388 389 !!st DO_3D( 0, 0, 0, 0, 1, jpkm1 )390 !!st uu(ji,jj,jk,Kaa) = uu(ji,jj,jk,Kaa) + zub(ji,jj)*umask(ji,jj,jk)391 !!st vv(ji,jj,jk,Kaa) = vv(ji,jj,jk,Kaa) + zvb(ji,jj)*vmask(ji,jj,jk)392 !!st END_3D393 370 394 371 … … 401 378 CALL Agrif_dyn( kstp, kstg ) 402 379 # endif 403 ! !local domain boundaries (T-point, unchanged sign)380 ! !* local domain boundaries (T-point, unchanged sign) 404 381 CALL lbc_lnk_multi( 'stp_RK3_stg', uu(:,:,:, Kaa), 'U', -1., vv(:,:,: ,Kaa), 'V', -1. & 405 382 & , ts(:,:,:,jp_tem,Kaa), 'T', 1., ts(:,:,:,jp_sal,Kaa), 'T', 1. ) 406 383 ! 407 ! !* BDY open boundaries384 ! !* BDY open boundaries 408 385 IF( ln_bdy ) THEN 409 386 CALL bdy_tra( kstp, Kbb, ts, Kaa ) -
NEMO/branches/2021/dev_r14318_RK3_stage1/src/TOP/TRP/trctrp.F90
r15189 r15321 6 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original code 7 7 !! 3.3 ! 2010-07 (C. Ethe) Merge TRA-TRC 8 !! 4.x ! 2021-08 (S. Techene, G. Madec) Adapt for RK3 time-stepping 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_top … … 38 39 PRIVATE 39 40 40 PUBLIC trc_trp ! called by trc_stp 41 PUBLIC trc_trp ! called by trc_stp and stprk3_stg 41 42 42 43 !!---------------------------------------------------------------------- -
NEMO/branches/2021/dev_r14318_RK3_stage1/src/TOP/trcrst.F90
r15191 r15321 8 8 !! - ! 2005-10 (C. Ethe) print control 9 9 !! 2.0 ! 2005-10 (C. Ethe, G. Madec) revised architecture 10 !! 4.x ! 2021-08 (S. Techene, G. Madec) RK3 time-stepping only deals with before read/write 10 11 !!---------------------------------------------------------------------- 11 12 #if defined key_top -
NEMO/branches/2021/dev_r14318_RK3_stage1/src/TOP/trcstp_rk3.F90
r15281 r15321 6 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original 7 7 !! 4.1 ! 2019-08 (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 8 !! 4.x ! 2021-08 (S. Techene, G. Madec) preparation and finalisation for RK3 time-stepping only 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_top 10 11 !!---------------------------------------------------------------------- 11 !! trc_stp : passive tracer system time-stepping 12 !! trc_stp_start : prepare passive tracer system time-stepping 13 !! trc_stp_end : finalise passive tracer system time-stepping 12 14 !!---------------------------------------------------------------------- 13 15 USE par_trc ! need jptra, number of passive tracers … … 52 54 !! *** ROUTINE trc_stp_start *** 53 55 !! 54 !! ** Purpose : Time loop of opa for passive tracer56 !! ** Purpose : Prepare time loop of opa for passive tracer 55 57 !! 56 58 !! ** Method : Compute the passive tracers trends 57 59 !! Update the passive tracers 60 !! Manage restart file 58 61 !!------------------------------------------------------------------- 59 62 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 68 71 l_trcstat = ( sn_cfctl%l_trcstat ) .AND. & 69 72 & ( ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) ) 70 !!st should be in init of top 73 ! 71 74 IF( kt == nittrc000 ) CALL trc_stp_ctl ! control 72 75 IF( kt == nittrc000 .AND. lk_trdmxl_trc ) CALL trd_mxl_trc_init ! trends: Mixed-layer 73 !!st-gm 74 !!st-gm a faire uniquement au stage 3 75 !!st ! 76 ! 76 77 IF( .NOT.ln_linssh ) THEN ! update ocean volume due to ssh temporal evolution 77 78 DO jk = 1, jpk … … 84 85 IF( l_trcdm2dc ) CALL trc_mean_qsr( kt ) 85 86 ! 86 !87 87 IF(sn_cfctl%l_prttrc) THEN 88 88 WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear … … 90 90 ENDIF 91 91 ! 92 !!st tr(:,:,:,:,Krhs) = 0._wp93 !94 92 CALL trc_rst_opn ( kt ) ! Open tracer restart file 95 93 IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar 96 !!st cf. stage 3 CALL trc_wri ( kt, Kmm ) ! output of passive tracers with iom I/O manager97 94 ! 98 95 IF( ln_timing ) CALL timing_stop('trc_stp_start') … … 101 98 102 99 103 SUBROUTINE trc_stp ( kt, Kbb, Kmm, Krhs, Kaa )104 !!------------------------------------------------------------------- 105 !! *** ROUTINE trc_stp ***100 SUBROUTINE trc_stp_end( kt, Kbb, Kmm, Kaa ) 101 !!------------------------------------------------------------------- 102 !! *** ROUTINE trc_stp_end *** 106 103 !! 107 !! ** Purpose : Time loop of opa for passive tracer104 !! ** Purpose : Finalise time loop of opa for passive tracer 108 105 !! 109 !! ** Method : Compute the passive tracers trends 110 !! Update the passive tracers 106 !! ** Method : Write restart and outputs 111 107 !!------------------------------------------------------------------- 112 108 INTEGER, INTENT( in ) :: kt ! ocean time-step index 113 INTEGER, INTENT( in ) :: Kbb, Kmm, K rhs, Kaa ! time level indices109 INTEGER, INTENT( in ) :: Kbb, Kmm, Kaa ! time level indices 114 110 ! 115 111 INTEGER :: jk, jn ! dummy loop indices … … 118 114 !!------------------------------------------------------------------- 119 115 ! 120 IF( ln_timing ) CALL timing_start('trc_stp') 121 ! 122 IF( l_1st_euler .OR. ln_top_euler ) THEN ! at nittrc000 123 rDt_trc = rn_Dt ! = rn_Dt (use or restarting with Euler time stepping) 124 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 125 rDt_trc = 2. * rn_Dt ! = 2 rn_Dt (leapfrog) 126 ENDIF 127 ! 128 IF( .NOT.ln_linssh ) THEN ! update ocean volume due to ssh temporal evolution 129 DO jk = 1, jpk 130 cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 131 END DO 132 IF ( l_trcstat .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend ) & 133 & .OR. iom_use( "pno3tot" ) .OR. iom_use( "ppo4tot" ) .OR. iom_use( "psiltot" ) & 134 & .OR. iom_use( "palktot" ) .OR. iom_use( "pfertot" ) ) & 135 & areatot = glob_sum( 'trcstp', cvol(:,:,:) ) 136 ENDIF 137 ! 138 tr(:,:,:,:,Krhs) = 0._wp 139 ! 140 CALL trc_wri ( kt, Kmm ) ! output of passive tracers with iom I/O manager 141 CALL trc_sms ( kt, Kbb, Kmm, Krhs ) ! tracers: sinks and sources 142 CALL trc_trp ( kt, Kbb, Kmm, Krhs, Kaa ) ! transport of passive tracers 143 ! 116 IF( ln_timing ) CALL timing_start('trc_stp_end') 117 ! 118 ! 144 119 ! Note passive tracers have been time-filtered in trc_trp but the time level 145 120 ! indices will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp. Subsequent calls here … … 152 127 IF(lwm) CALL FLUSH( numont ) ! flush namelist output 153 128 ENDIF 154 IF( lrst_trc ) CALL trc_rst_wri ( kt, Kbb, Kmm, Kaa ) ! write tracer restart file155 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt, Kaa ) ! trends: Mixed-layer156 !157 IF( ln_top_euler ) THEN158 ! For Euler timestepping for TOP we need to copy the "after" to the "now" fields159 ! here then after the (leapfrog) swapping of the time-level indices in OCE/step.F90 we have160 ! "before" fields = "now" fields.161 tr(:,:,:,:,Kmm) = tr(:,:,:,:,Kaa)162 ENDIF163 !164 IF (l_trcstat) THEN165 ztrai = 0._wp ! content of all tracers166 DO jn = 1, jptra167 ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn,Kaa) * cvol(:,:,:) )168 END DO169 IF( lwm ) WRITE(numstr,9300) kt, ztrai / areatot170 ENDIF171 9300 FORMAT(i10,D23.16)172 !173 IF( ln_timing ) CALL timing_stop('trc_stp')174 !175 END SUBROUTINE trc_stp176 177 178 SUBROUTINE trc_stp_end( kt, Kbb, Kmm, Kaa )179 !!-------------------------------------------------------------------180 !! *** ROUTINE trc_stp_end ***181 !!182 !! ** Purpose : Time loop of opa for passive tracer183 !!184 !! ** Method : Compute the passive tracers trends185 !! Update the passive tracers186 !!-------------------------------------------------------------------187 INTEGER, INTENT( in ) :: kt ! ocean time-step index188 INTEGER, INTENT( in ) :: Kbb, Kmm, Kaa ! time level indices189 !190 INTEGER :: jk, jn ! dummy loop indices191 REAL(wp):: ztrai ! local scalar192 CHARACTER (len=25) :: charout !193 !!-------------------------------------------------------------------194 !195 IF( ln_timing ) CALL timing_start('trc_stp_end')196 !197 !198 ! Note passive tracers have been time-filtered in trc_trp but the time level199 ! indices will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp. Subsequent calls here200 ! anticipate this update which will be: Nrhs= Nbb ; Nbb = Nnn ; Nnn = Naa ; Naa = Nrhs201 ! and use the filtered levels explicitly.202 !203 IF( kt == nittrc000 ) THEN204 CALL iom_close( numrtr ) ! close input tracer restart file205 IF(lrxios) CALL iom_context_finalize( cr_toprst_cxt )206 IF(lwm) CALL FLUSH( numont ) ! flush namelist output207 ENDIF208 129 IF( lrst_trc ) CALL trc_rst_wri ( kt, Kbb, Kmm, Kaa ) ! write tracer restart file 209 130 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt, Kaa ) ! trends: Mixed-layer 210 131 ! 211 132 IF (l_trcstat) THEN 212 ztrai = 0._wp 133 ztrai = 0._wp ! content of all tracers 213 134 DO jn = 1, jptra 214 135 ztrai = ztrai + glob_sum( 'trcstp_rk3', tr(:,:,:,jn,Kaa) * cvol(:,:,:) ) !!st cvol@Kmm weird !! … … 219 140 9300 FORMAT(i10,D23.16) 220 141 ! 221 CALL trc_wri ( kt, Kaa ) ! output of passive tracers with iom I/O manager (!!st Kbb car après le swap des indices !!st-correction FAUX on est avant : le swap a lieu après le CALL à stp_RK3_stg(3) )142 CALL trc_wri ( kt, Kaa ) ! output of passive tracers with iom I/O manager before time level swap 222 143 ! 223 144 IF( ln_timing ) CALL timing_stop('trc_stp_end')
Note: See TracChangeset
for help on using the changeset viewer.