Changeset 10336
- Timestamp:
- 2018-11-19T15:34:28+01:00 (6 years ago)
- Location:
- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/ZDF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/ZDF/zdfiwm.F90
r10314 r10336 122 122 ! 123 123 INTEGER :: ji, jj, jk ! dummy loop indices 124 REAL(wp) :: zztmp ! scalar workspace124 REAL(wp) :: zztmp, ztmp1, ztmp2 ! scalar workspace 125 125 REAL(wp), DIMENSION(jpi,jpj) :: zfact ! Used for vertical structure 126 126 REAL(wp), DIMENSION(jpi,jpj) :: zhdep ! Ocean depth … … 157 157 !!gm gde3w ==>>> check for ssh taken into account.... seem OK gde3w_n=gdept_n - sshn 158 158 DO jk = 2, jpkm1 ! complete with the level-dependent part 159 zemx_iwm(:,:,jk) = zfact(:,:) * ( EXP( ( gde3w_n(:,:,jk ) - zhdep(:,:) ) / hcri_iwm(:,:) ) & 160 & - EXP( ( gde3w_n(:,:,jk-1) - zhdep(:,:) ) / hcri_iwm(:,:) ) ) * wmask(:,:,jk) & 161 & / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) ) 162 159 DO jj = 1, jpj 160 DO ji = 1, jpi 161 IF ( zfact(ji,jj) == 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN ! optimization 162 zemx_iwm(ji,jj,jk) = 0._wp 163 ELSE 164 zemx_iwm(ji,jj,jk) = zfact(ji,jj) * ( EXP( ( gde3w_n(ji,jj,jk ) - zhdep(ji,jj) ) / hcri_iwm(ji,jj) ) & 165 & - EXP( ( gde3w_n(ji,jj,jk-1) - zhdep(ji,jj) ) / hcri_iwm(ji,jj) ) ) & 166 & / ( gde3w_n(ji,jj,jk) - gde3w_n(ji,jj,jk-1) ) 167 ENDIF 168 END DO 169 END DO 163 170 !!gm delta(gde3w_n) = e3t_n !! Please verify the grid-point position w versus t-point 164 171 !!gm it seems to me that only 1/hcri_iwm is used ==> compute it one for all … … 234 241 zwkb(:,:,1) = zhdep(:,:) * wmask(:,:,1) 235 242 ! 236 zweight(:,:,:) = 0._wp 237 DO jk = 2, jpkm1 238 zweight(:,:,jk) = MAX( 0._wp, rn2(:,:,jk) ) * hbot_iwm(:,:) * wmask(:,:,jk) & 239 & * ( EXP( -zwkb(:,:,jk) / hbot_iwm(:,:) ) - EXP( -zwkb(:,:,jk-1) / hbot_iwm(:,:) ) ) 243 DO jk = 2, jpkm1 244 DO jj = 1, jpj 245 DO ji = 1, jpi 246 IF ( rn2(ji,jj,jk) <= 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN ! optimization 247 zweight(ji,jj,jk) = 0._wp 248 ELSE 249 zweight(ji,jj,jk) = rn2(ji,jj,jk) * hbot_iwm(ji,jj) & 250 & * ( EXP( -zwkb(ji,jj,jk) / hbot_iwm(ji,jj) ) - EXP( -zwkb(ji,jj,jk-1) / hbot_iwm(ji,jj) ) ) 251 ENDIF 252 END DO 253 END DO 240 254 END DO 241 255 ! … … 322 336 ! 323 337 IF( ln_tsdiff ) THEN !* Option for differential mixing of salinity and temperature 338 ztmp1 = 0.505_wp + 0.495_wp * TANH( 0.92_wp * ( LOG10( 1.e-20_wp ) - 0.60_wp ) ) 324 339 DO jk = 2, jpkm1 ! Calculate S/T diffusivity ratio as a function of Reb 325 340 DO jj = 1, jpj 326 341 DO ji = 1, jpi 327 zav_ratio(ji,jj,jk) = ( 0.505_wp + 0.495_wp * & 328 & TANH( 0.92_wp * ( LOG10( MAX( 1.e-20_wp, zReb(ji,jj,jk) * 5._wp * r1_6 ) ) - 0.60_wp ) ) & 329 & ) * wmask(ji,jj,jk) 342 ztmp2 = zReb(ji,jj,jk) * 5._wp * r1_6 343 IF ( ztmp2 > 1.e-20_wp .AND. wmask(ji,jj,jk) == 1._wp ) THEN 344 zav_ratio(ji,jj,jk) = 0.505_wp + 0.495_wp * TANH( 0.92_wp * ( LOG10(ztmp2) - 0.60_wp ) ) 345 ELSE 346 zav_ratio(ji,jj,jk) = ztmp1 * wmask(ji,jj,jk) 347 ENDIF 330 348 END DO 331 349 END DO -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/ZDF/zdftke.F90
r10297 r10336 202 202 REAL(wp) :: zzd_up, zzd_lw ! - - 203 203 INTEGER , DIMENSION(jpi,jpj) :: imlc 204 REAL(wp), DIMENSION(jpi,jpj) :: zhlc 204 REAL(wp), DIMENSION(jpi,jpj) :: zhlc, zfr_i 205 205 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpelc, zdiag, zd_up, zd_lw 206 206 !!-------------------------------------------------------------------- … … 290 290 END DO 291 291 zcof = 0.016 / SQRT( zrhoa * zcdrag ) 292 DO jj = 2, jpjm1 293 DO ji = fs_2, fs_jpim1 ! vector opt. 294 zus = zcof * SQRT( taum(ji,jj) ) ! Stokes drift 295 zfr_i(ji,jj) = ( 1._wp - 4._wp * fr_i(ji,jj) ) * zus * zus * zus * tmask(ji,jj,1) ! zus > 0. ok 296 IF (zfr_i(ji,jj) < 0. ) zfr_i(ji,jj) = 0. 297 END DO 298 END DO 292 299 DO jk = 2, jpkm1 !* TKE Langmuir circulation source term added to en 293 300 DO jj = 2, jpjm1 294 301 DO ji = fs_2, fs_jpim1 ! vector opt. 295 zus = zcof * SQRT( taum(ji,jj) ) ! Stokes drift 296 ! ! vertical velocity due to LC 297 zind = 0.5 - SIGN( 0.5, pdepw(ji,jj,jk) - zhlc(ji,jj) ) 298 zwlc = zind * rn_lc * zus * SIN( rpi * pdepw(ji,jj,jk) / zhlc(ji,jj) ) 299 ! ! TKE Langmuir circulation source term 300 en(ji,jj,jk) = en(ji,jj,jk) + rdt * MAX(0.,1._wp - 4.*fr_i(ji,jj) ) * ( zwlc * zwlc * zwlc ) & 301 & / zhlc(ji,jj) * wmask(ji,jj,jk) * tmask(ji,jj,1) 302 IF ( zfr_i(ji,jj) /= 0. ) THEN 303 ! vertical velocity due to LC 304 IF ( pdepw(ji,jj,jk) - zhlc(ji,jj) < 0 .AND. wmask(ji,jj,jk) /= 0. ) THEN 305 ! ! vertical velocity due to LC 306 zwlc = rn_lc * SIN( rpi * pdepw(ji,jj,jk) / zhlc(ji,jj) ) ! warning: optimization: zus^3 is in zfr_i 307 ! ! TKE Langmuir circulation source term 308 en(ji,jj,jk) = en(ji,jj,jk) + rdt * zfr_i(ji,jj) * ( zwlc * zwlc * zwlc ) / zhlc(ji,jj) 309 ENDIF 310 ENDIF 302 311 END DO 303 312 END DO
Note: See TracChangeset
for help on using the changeset viewer.