Changeset 5989 for branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
- Timestamp:
- 2015-12-03T09:10:32+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
r5260 r5989 27 27 USE dom_oce ! ocean space and time domain variables 28 28 USE sbc_oce ! surface boundary condition: ocean 29 USE sbcrnf ! river runoffs 30 USE sbcisf ! ice shelf melting/freezing 29 31 USE zdf_oce ! ocean vertical mixing 30 32 USE domvvl ! variable volume 31 USE dynspg_oce ! surface pressure gradient variables32 USE dynhpg ! hydrostatic pressure gradient33 33 USE trd_oce ! trends: ocean variables 34 34 USE trdtra ! trends manager: tracers 35 35 USE traqsr ! penetrative solar radiation (needed for nksr) 36 36 USE phycst ! physical constant 37 USE ldftra_oce ! lateral physics on tracers 37 USE ldftra ! lateral physics on tracers 38 USE ldfslp 38 39 USE bdy_oce ! BDY open boundary condition variables 39 40 USE bdytra ! open boundary condition (bdy_tra routine) … … 45 46 USE timing ! Timing 46 47 #if defined key_agrif 47 USE agrif_opa_update48 48 USE agrif_opa_interp 49 49 #endif … … 56 56 PUBLIC tra_nxt_vvl ! to be used in trcnxt 57 57 58 REAL(wp) :: rbcp ! Brown & Campana parameters for semi-implicit hpg59 58 60 59 !! * Substitutions … … 88 87 !! 89 88 !! ** Action : - (tb,sb) and (tn,sn) ready for the next time step 90 !! - (ta,sa) time averaged (t,s) (ln_dynhpg_imp = T)89 !! 91 90 !!---------------------------------------------------------------------- 92 91 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 103 102 IF(lwp) WRITE(numout,*) 'tra_nxt : achieve the time stepping by Asselin filter and array swap' 104 103 IF(lwp) WRITE(numout,*) '~~~~~~~' 105 !106 rbcp = 0.25_wp * (1._wp + atfp) * (1._wp + atfp) * ( 1._wp - atfp) ! Brown & Campana parameter for semi-implicit hpg107 104 ENDIF 108 105 109 106 ! Update after tracer on domain lateral boundaries 110 107 ! 108 ! 109 #if defined key_agrif 110 CALL Agrif_tra ! AGRIF zoom boundaries 111 #endif 112 ! 111 113 CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1._wp ) ! local domain boundaries (T-point, unchanged sign) 112 114 CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1._wp ) … … 114 116 #if defined key_bdy 115 117 IF( lk_bdy ) CALL bdy_tra( kt ) ! BDY open boundaries 116 #endif117 #if defined key_agrif118 CALL Agrif_tra ! AGRIF zoom boundaries119 118 #endif 120 119 … … 143 142 ELSE ! Leap-Frog + Asselin filter time stepping 144 143 ! 145 IF( lk_vvl ) THEN ; CALL tra_nxt_vvl( kt, nit000, 'TRA', tsb, tsn, tsa, jpts ) ! variable volume level (vvl) 146 ELSE ; CALL tra_nxt_fix( kt, nit000, 'TRA', tsb, tsn, tsa, jpts ) ! fixed volume level 144 IF( lk_vvl ) THEN ; CALL tra_nxt_vvl( kt, nit000, rdttra, 'TRA', tsb, tsn, tsa, & 145 & sbc_tsc, sbc_tsc_b, jpts ) ! variable volume level (vvl) 146 ELSE ; CALL tra_nxt_fix( kt, nit000, 'TRA', tsb, tsn, tsa, jpts ) ! fixed volume level 147 147 ENDIF 148 ENDIF 149 ! 150 #if defined key_agrif 151 ! Update tracer at AGRIF zoom boundaries 152 IF( .NOT.Agrif_Root() ) CALL Agrif_Update_Tra( kt ) ! children only 153 #endif 148 ENDIF 154 149 ! 155 150 ! trends computation … … 182 177 !! 183 178 !! ** Method : - Apply a Asselin time filter on now fields. 184 !! - save in (ta,sa) an average over the three time levels185 !! which will be used to compute rdn and thus the semi-implicit186 !! hydrostatic pressure gradient (ln_dynhpg_imp = T)187 179 !! - swap tracer fields to prepare the next time_step. 188 !! This can be summurized for tempearture as:189 !! ztm = tn + rbcp * [ta -2 tn + tb ] ln_dynhpg_imp = T190 !! ztm = 0 otherwise191 !! with rbcp=1/4 * (1-atfp^4) / (1-atfp)192 !! tb = tn + atfp*[ tb - 2 tn + ta ]193 !! tn = ta194 !! ta = ztm (NB: reset to 0 after eos_bn2 call)195 180 !! 196 181 !! ** Action : - (tb,sb) and (tn,sn) ready for the next time step 197 !! - (ta,sa) time averaged (t,s) (ln_dynhpg_imp = T)182 !! 198 183 !!---------------------------------------------------------------------- 199 184 INTEGER , INTENT(in ) :: kt ! ocean time-step index … … 206 191 ! 207 192 INTEGER :: ji, jj, jk, jn ! dummy loop indices 208 LOGICAL :: ll_tra_hpg ! local logical209 193 REAL(wp) :: ztn, ztd ! local scalars 210 194 !!---------------------------------------------------------------------- … … 216 200 ENDIF 217 201 ! 218 IF( cdtype == 'TRA' ) THEN ; ll_tra_hpg = ln_dynhpg_imp ! active tracers case and semi-implicit hpg219 ELSE ; ll_tra_hpg = .FALSE. ! passive tracers case or NO semi-implicit hpg220 ENDIF221 202 ! 222 203 DO jn = 1, kjpt … … 231 212 ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn) ! ptn <-- pta 232 213 ! 233 IF( ll_tra_hpg ) pta(ji,jj,jk,jn) = ztn + rbcp * ztd ! pta <-- Brown & Campana average234 214 END DO 235 215 END DO … … 241 221 242 222 243 SUBROUTINE tra_nxt_vvl( kt, kit000, cdtype, ptb, ptn, pta, kjpt )223 SUBROUTINE tra_nxt_vvl( kt, kit000, p2dt, cdtype, ptb, ptn, pta, psbc_tc, psbc_tc_b, kjpt ) 244 224 !!---------------------------------------------------------------------- 245 225 !! *** ROUTINE tra_nxt_vvl *** … … 249 229 !! 250 230 !! ** Method : - Apply a thickness weighted Asselin time filter on now fields. 251 !! - save in (ta,sa) a thickness weighted average over the three252 !! time levels which will be used to compute rdn and thus the semi-253 !! implicit hydrostatic pressure gradient (ln_dynhpg_imp = T)254 231 !! - swap tracer fields to prepare the next time_step. 255 232 !! This can be summurized for tempearture as: 256 !! ztm = ( e3t_n*tn + rbcp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] ) ln_dynhpg_imp = T257 !! /( e3t_n + rbcp*[ e3t_b - 2 e3t_n + e3t_a ] )258 !! ztm = 0 otherwise259 !! tb = ( e3t_n*tn + atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] )260 !! /( e3t_n + atfp*[ e3t_b - 2 e3t_n + e3t_a ] )261 !! tn = ta262 !! ta = zt (NB: reset to 0 after eos_bn2 call)263 233 !! 264 234 !! ** Action : - (tb,sb) and (tn,sn) ready for the next time step 265 !! - (ta,sa) time averaged (t,s) (ln_dynhpg_imp = T) 266 !!---------------------------------------------------------------------- 267 INTEGER , INTENT(in ) :: kt ! ocean time-step index 268 INTEGER , INTENT(in ) :: kit000 ! first time step index 269 CHARACTER(len=3), INTENT(in ) :: cdtype ! =TRA or TRC (tracer indicator) 270 INTEGER , INTENT(in ) :: kjpt ! number of tracers 271 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: ptb ! before tracer fields 272 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: ptn ! now tracer fields 273 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: pta ! tracer trend 235 !! 236 !!---------------------------------------------------------------------- 237 INTEGER , INTENT(in ) :: kt ! ocean time-step index 238 INTEGER , INTENT(in ) :: kit000 ! first time step index 239 REAL(wp) , INTENT(in ), DIMENSION(jpk) :: p2dt ! time-step 240 CHARACTER(len=3), INTENT(in ) :: cdtype ! =TRA or TRC (tracer indicator) 241 INTEGER , INTENT(in ) :: kjpt ! number of tracers 242 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: ptb ! before tracer fields 243 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: ptn ! now tracer fields 244 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: pta ! tracer trend 245 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,kjpt) :: psbc_tc ! surface tracer content 246 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,kjpt) :: psbc_tc_b ! before surface tracer content 247 274 248 !! 275 LOGICAL :: ll_tra , ll_tra_hpg, ll_traqsr! local logical249 LOGICAL :: ll_traqsr, ll_rnf, ll_isf ! local logical 276 250 INTEGER :: ji, jj, jk, jn ! dummy loop indices 277 251 REAL(wp) :: zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d ! local scalar … … 286 260 ! 287 261 IF( cdtype == 'TRA' ) THEN 288 ll_tra = .TRUE. ! active tracers case289 ll_tra_hpg = ln_dynhpg_imp ! active tracers case and semi-implicit hpg290 262 ll_traqsr = ln_traqsr ! active tracers case and solar penetration 263 ll_rnf = ln_rnf ! active tracers case and river runoffs 264 IF (nn_isf .GE. 1) THEN 265 ll_isf = .TRUE. ! active tracers case and ice shelf melting/freezing 266 ELSE 267 ll_isf = .FALSE. 268 END IF 291 269 ELSE 292 ll_tra = .FALSE. ! passive tracers case293 ll_tra_hpg = .FALSE. ! passive tracers case or NO semi-implicit hpg294 270 ll_traqsr = .FALSE. ! active tracers case and NO solar penetration 271 ll_rnf = .FALSE. ! passive tracers or NO river runoffs 272 ll_isf = .FALSE. ! passive tracers or NO ice shelf melting/freezing 295 273 ENDIF 296 274 ! 297 275 DO jn = 1, kjpt 298 276 DO jk = 1, jpkm1 299 zfact1 = atfp * rdttra(jk)277 zfact1 = atfp * p2dt(jk) 300 278 zfact2 = zfact1 / rau0 301 279 DO jj = 1, jpj … … 315 293 ztc_f = ztc_n + atfp * ztc_d 316 294 ! 317 IF( ll_tra .AND. jk == 1 ) THEN ! first level only for T & S 318 ze3t_f = ze3t_f - zfact2 * ( emp_b(ji,jj) - emp(ji,jj) ) 319 ztc_f = ztc_f - zfact1 * ( sbc_tsc(ji,jj,jn) - sbc_tsc_b(ji,jj,jn) ) 295 IF( jk == mikt(ji,jj) ) THEN ! first level 296 ze3t_f = ze3t_f - zfact2 * ( (emp_b(ji,jj) - emp(ji,jj) ) & 297 & - (rnf_b(ji,jj) - rnf(ji,jj) ) & 298 & + (fwfisf_b(ji,jj) - fwfisf(ji,jj)) ) 299 ztc_f = ztc_f - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) ) 320 300 ENDIF 321 IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr ) & ! solar penetration (temperature only) 301 302 ! solar penetration (temperature only) 303 IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr ) & 322 304 & ztc_f = ztc_f - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) ) 323 305 324 ze3t_f = 1.e0 / ze3t_f 325 ptb(ji,jj,jk,jn) = ztc_f * ze3t_f ! ptb <-- ptn filtered 326 ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn) ! ptn <-- pta 327 ! 328 IF( ll_tra_hpg ) THEN ! semi-implicit hpg (T & S only) 329 ze3t_d = 1.e0 / ( ze3t_n + rbcp * ze3t_d ) 330 pta(ji,jj,jk,jn) = ze3t_d * ( ztc_n + rbcp * ztc_d ) ! ta <-- Brown & Campana average 331 ENDIF 306 ! river runoff 307 IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) ) & 308 & ztc_f = ztc_f - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) & 309 & * fse3t_n(ji,jj,jk) / h_rnf(ji,jj) 310 311 ! ice shelf 312 IF( ll_isf ) THEN 313 ! level fully include in the Losch_2008 ice shelf boundary layer 314 IF ( jk >= misfkt(ji,jj) .AND. jk < misfkb(ji,jj) ) & 315 ztc_f = ztc_f - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) ) & 316 & * fse3t_n(ji,jj,jk) * r1_hisf_tbl (ji,jj) 317 ! level partially include in Losch_2008 ice shelf boundary layer 318 IF ( jk == misfkb(ji,jj) ) & 319 ztc_f = ztc_f - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) ) & 320 & * fse3t_n(ji,jj,jk) * r1_hisf_tbl (ji,jj) * ralpha(ji,jj) 321 END IF 322 323 ze3t_f = 1.e0 / ze3t_f 324 ptb(ji,jj,jk,jn) = ztc_f * ze3t_f ! ptb <-- ptn filtered 325 ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn) ! ptn <-- pta 326 ! 332 327 END DO 333 328 END DO
Note: See TracChangeset
for help on using the changeset viewer.