- Timestamp:
- 2020-03-20T23:26:56+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/traatf.F90
r12377 r12581 26 26 !!---------------------------------------------------------------------- 27 27 USE oce ! ocean dynamics and tracers variables 28 USE dom_oce ! ocean space and time domain variables 28 USE dom_oce ! ocean space and time domain variables 29 29 USE sbc_oce ! surface boundary condition: ocean 30 30 USE sbcrnf ! river runoffs … … 33 33 USE domvvl ! variable volume 34 34 USE trd_oce ! trends: ocean variables 35 USE trdtra ! trends manager: tracers 35 USE trdtra ! trends manager: tracers 36 36 USE traqsr ! penetrative solar radiation (needed for nksr) 37 37 USE phycst ! physical constant … … 69 69 !! *** ROUTINE traatf *** 70 70 !! 71 !! ** Purpose : Apply the boundary condition on the after temperature 71 !! ** Purpose : Apply the boundary condition on the after temperature 72 72 !! and salinity fields and add the Asselin time filter on now fields. 73 !! 74 !! ** Method : At this stage of the computation, ta and sa are the 73 !! 74 !! ** Method : At this stage of the computation, ta and sa are the 75 75 !! after temperature and salinity as the time stepping has 76 76 !! been performed in trazdf_imp or trazdf_exp module. 77 77 !! 78 !! - Apply lateral boundary conditions on (ta,sa) 79 !! at the local domain boundaries through lbc_lnk call, 80 !! at the one-way open boundaries (ln_bdy=T), 78 !! - Apply lateral boundary conditions on (ta,sa) 79 !! at the local domain boundaries through lbc_lnk call, 80 !! at the one-way open boundaries (ln_bdy=T), 81 81 !! at the AGRIF zoom boundaries (lk_agrif=T) 82 82 !! … … 88 88 INTEGER , INTENT(in ) :: kt ! ocean time-step index 89 89 INTEGER , INTENT(in ) :: Kbb, Kmm, Kaa ! time level indices 90 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers 90 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers 91 91 !! 92 92 INTEGER :: ji, jj, jk, jn ! dummy loop indices … … 104 104 105 105 ! Update after tracer on domain lateral boundaries 106 ! 106 ! 107 107 #if defined key_agrif 108 108 CALL Agrif_tra ! AGRIF zoom boundaries … … 112 112 ! 113 113 IF( ln_bdy ) CALL bdy_tra( kt, Kbb, pts, Kaa ) ! BDY open boundaries 114 114 115 115 ! set time step size (Euler/Leapfrog) 116 116 IF( neuler == 0 .AND. kt == nit000 ) THEN ; r2dt = rdt ! at nit000 (Euler) … … 119 119 120 120 ! trends computation initialisation 121 IF( l_trdtra ) THEN 121 IF( l_trdtra ) THEN 122 122 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 123 123 ztrdt(:,:,jpk) = 0._wp 124 124 ztrds(:,:,jpk) = 0._wp 125 IF( ln_traldf_iso ) THEN ! diagnose the "pure" Kz diffusive trend 125 IF( ln_traldf_iso ) THEN ! diagnose the "pure" Kz diffusive trend 126 126 CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_zdfp, ztrdt ) 127 127 CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_zdfp, ztrds ) 128 128 ENDIF 129 ! total trend for the non-time-filtered variables. 129 ! total trend for the non-time-filtered variables. 130 130 zfact = 1.0 / rdt 131 131 ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms … … 137 137 CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_tot, ztrds ) 138 138 IF( ln_linssh ) THEN ! linear sea surface height only 139 ! Store now fields before applying the Asselin filter 139 ! Store now fields before applying the Asselin filter 140 140 ! in order to calculate Asselin filter trend later. 141 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm) 141 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm) 142 142 ztrds(:,:,:) = pts(:,:,:,jp_sal,Kmm) 143 143 ENDIF 144 144 ENDIF 145 145 146 IF( neuler == 0 .AND. kt == nit000 ) THEN ! Euler time-stepping 146 IF( neuler == 0 .AND. kt == nit000 ) THEN ! Euler time-stepping 147 147 ! 148 148 IF (l_trdtra .AND. .NOT. ln_linssh ) THEN ! Zero Asselin filter contribution must be explicitly written out since for vvl … … 156 156 ELSE ! Leap-Frog + Asselin filter time stepping 157 157 ! 158 IF( ln_linssh ) THEN ; CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000, 'TRA', pts, jpts ) ! linear free surface 158 IF( ln_linssh ) THEN ; CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000, 'TRA', pts, jpts ) ! linear free surface 159 159 ELSE ; CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rdt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts ) ! non-linear free surface 160 160 ENDIF … … 164 164 & pts(:,:,:,jp_tem,Kaa), 'T', 1., pts(:,:,:,jp_sal,Kaa), 'T', 1. ) 165 165 ! 166 ENDIF 167 ! 168 IF( l_trdtra .AND. ln_linssh ) THEN ! trend of the Asselin filter (tb filtered - tb)/dt 169 zfact = 1._wp / r2dt 166 ENDIF 167 ! 168 IF( l_trdtra .AND. ln_linssh ) THEN ! trend of the Asselin filter (tb filtered - tb)/dt 169 zfact = 1._wp / r2dt 170 170 DO jk = 1, jpkm1 171 171 ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * zfact … … 191 191 !! 192 192 !! ** Purpose : fixed volume: apply the Asselin time filter to the "now" field 193 !! 193 !! 194 194 !! ** Method : - Apply a Asselin time filter on now fields. 195 195 !! … … 216 216 ! 217 217 DO_3D_00_00( 1, jpkm1 ) 218 ztn = pt(ji,jj,jk,jn,Kmm) 218 ztn = pt(ji,jj,jk,jn,Kmm) 219 219 ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb) ! time laplacian on tracers 220 220 ! … … 231 231 !! *** ROUTINE tra_atf_vvl *** 232 232 !! 233 !! ** Purpose : Time varying volume: apply the Asselin time filter 234 !! 233 !! ** Purpose : Time varying volume: apply the Asselin time filter 234 !! 235 235 !! ** Method : - Apply a thickness weighted Asselin time filter on now fields. 236 236 !! pt(Kmm) = ( e3t(Kmm)*pt(Kmm) + atfp*[ e3t(Kbb)*pt(Kbb) - 2 e3t(Kmm)*pt(Kmm) + e3t_a*pt(Kaa) ] ) … … 262 262 ENDIF 263 263 ! 264 IF( cdtype == 'TRA' ) THEN 264 IF( cdtype == 'TRA' ) THEN 265 265 ll_traqsr = ln_traqsr ! active tracers case and solar penetration 266 266 ll_rnf = ln_rnf ! active tracers case and river runoffs … … 268 268 ELSE ! passive tracers case 269 269 ll_traqsr = .FALSE. ! NO solar penetration 270 ll_rnf = .FALSE. ! NO river runoffs ???? !!gm BUG ? 271 ll_isf = .FALSE. ! NO ice shelf melting/freezing !!gm BUG ?? 270 ll_rnf = .FALSE. ! NO river runoffs ???? !!gm BUG ? 271 ll_isf = .FALSE. ! NO ice shelf melting/freezing !!gm BUG ?? 272 272 ENDIF 273 273 ! … … 279 279 zfact1 = atfp * p2dt 280 280 zfact2 = zfact1 * r1_rau0 281 DO jn = 1, kjpt 281 DO jn = 1, kjpt 282 282 DO_3D_00_00( 1, jpkm1 ) 283 283 ze3t_b = e3t(ji,jj,jk,Kbb) … … 296 296 ! 297 297 ! Add asselin correction on scale factors: 298 zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) ) 299 ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) ) 300 IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * ( rnf_b(ji,jj) - rnf(ji,jj) ) 298 zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) ) 299 ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) ) 300 IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * ( rnf_b(ji,jj) - rnf(ji,jj) ) 301 301 IF ( ll_isf ) THEN 302 302 IF ( ln_isfcav_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) ) … … 304 304 ENDIF 305 305 ! 306 IF( jk == mikt(ji,jj) ) THEN ! first level 306 IF( jk == mikt(ji,jj) ) THEN ! first level 307 307 ztc_f = ztc_f - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) ) 308 308 ENDIF 309 309 ! 310 310 ! solar penetration (temperature only) 311 IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr ) & 312 & ztc_f = ztc_f - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) ) 311 IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr ) & 312 & ztc_f = ztc_f - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) ) 313 313 ! 314 314 ! 315 315 IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) ) & 316 & ztc_f = ztc_f - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) & 316 & ztc_f = ztc_f - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) & 317 317 & * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj) 318 318 … … 328 328 & * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) 329 329 END IF 330 ! level partially include in Losch_2008 ice shelf boundary layer 330 ! level partially include in Losch_2008 ice shelf boundary layer 331 331 IF ( jk == misfkb_cav(ji,jj) ) THEN 332 332 ztc_f = ztc_f - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) ) & … … 342 342 & * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) 343 343 END IF 344 ! level partially include in Losch_2008 ice shelf boundary layer 344 ! level partially include in Losch_2008 ice shelf boundary layer 345 345 IF ( jk == misfkb_par(ji,jj) ) THEN 346 346 ztc_f = ztc_f - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) ) & … … 371 371 ! 372 372 END_3D 373 ! 373 ! 374 374 END DO 375 375 ! 376 376 IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) ) THEN 377 IF( l_trdtra .AND. cdtype == 'TRA' ) THEN 377 IF( l_trdtra .AND. cdtype == 'TRA' ) THEN 378 378 CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) ) 379 379 CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) )
Note: See TracChangeset
for help on using the changeset viewer.