- Timestamp:
- 2014-05-15T15:56:53+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4642_WavesWG/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r4624 r4644 26 26 !! ! + cleaning of the parameters + bugs correction 27 27 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 28 !! ! 2012-12 (oyvind.breivik@ecwmf.int) Changed to wave breaking source term 28 29 !!---------------------------------------------------------------------- 29 30 #if defined key_zdftke || defined key_esopa … … 42 43 USE domvvl ! domain: variable volume layer 43 44 USE sbc_oce ! surface boundary condition: ocean 45 USE sbcwave ! wave parameters 46 USE sbcwave_ecmwf ! ECMWF wave parameters 44 47 USE zdf_oce ! vertical physics: ocean variables 45 48 USE zdfmxl ! vertical physics: mixed layer … … 78 81 LOGICAL :: ln_lc ! Langmuir cells (LC) as a source term of TKE or not 79 82 REAL(wp) :: rn_lc ! coef to compute vertical velocity of Langmuir cells 83 REAL(wp) :: rn_alpavg = 100.0_wp ! Average alpha (normalized, water-side energy flux, only used in 84 ! case we use the source term formulation with no wave model information 85 ! NB! The option of running with source term and no wave model has 86 ! not been properly tested yet but is included for consistency (Oyvind Breivik, 2013-07-16) 87 REAL(wp) :: rn_deptmaxtkew = 50.0_wp ! maximum depth [m] to be affected by TKE from breaking waves 80 88 81 89 REAL(wp) :: ri_cri ! critic Richardson number (deduced from rn_ediff and rn_ediss values) … … 85 93 86 94 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: en !: now turbulent kinetic energy [m2/s2] 95 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: e0 !: top level turbulent kinetic energy [m2/s2] from waves 96 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: dfac !: wave depth scaling factor 87 97 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:) :: htau ! depth of tke penetration (nn_htau) 88 98 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dissl ! now mixing lenght of dissipation … … 109 119 !! *** FUNCTION zdf_tke_alloc *** 110 120 !!---------------------------------------------------------------------- 121 INTEGER :: iexalloc 111 122 ALLOCATE( & 112 123 #if defined key_c1d … … 118 129 & avmu_k(jpi,jpj,jpk) , avmv_k(jpi,jpj,jpk), STAT= zdf_tke_alloc ) 119 130 ! 131 IF ( ln_wavetke ) THEN 132 ALLOCATE( e0(jpi,jpj) , dfac(jpi,jpj), STAT= iexalloc ) 133 ! Setting arrays to zero initially. 134 e0(:,:) = 0.0_wp 135 dfac(:,:) = 0.0_wp 136 ! 137 zdf_tke_alloc = zdf_tke_alloc + iexalloc 138 ENDIF 120 139 IF( lk_mpp ) CALL mpp_sum ( zdf_tke_alloc ) 121 140 IF( zdf_tke_alloc /= 0 ) CALL ctl_warn('zdf_tke_alloc: failed to allocate arrays') … … 219 238 REAL(wp) :: zus , zwlc , zind ! - - 220 239 REAL(wp) :: zzd_up, zzd_lw ! - - 240 REAL(wp) :: lambda ! - - 241 REAL(wp) :: zphio_flux ! - - 242 REAL(wp) :: sbr, z0, fb ! - - 243 221 244 !!bfr REAL(wp) :: zebot ! - - 222 245 INTEGER , POINTER, DIMENSION(:,: ) :: imlc … … 239 262 ! ! Surface boundary condition on tke 240 263 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 241 DO jj = 2, jpjm1 ! en(1) = rn_ebb taum / rau0 (min value rn_emin0) 242 DO ji = fs_2, fs_jpim1 ! vector opt. 243 en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 244 END DO 245 END DO 246 264 ! Wave parameters read? 265 IF ( ln_wavetke ) THEN 266 ! Breaking-wave TKE injection as flux 267 DO jj = 2, jpjm1 ! en(1) = rn_ebb taum / rau0 (min value rn_emin0) 268 DO ji = fs_2, fs_jpim1 ! vector opt. 269 ! Roughness length proportional to wave height, capped at Hs = 0.1 m 270 z0 = 0.5_wp*MAX(swh_wavepar(ji,jj), 0.1_wp) 271 lambda = 2.38_wp/z0 272 ! The energy flux from the wave model in physical units 273 zphio_flux = MAX(phioc_wavepar(ji,jj), 0.0_wp) 274 ! TKE at surface (Mellor and Blumberg, 2004) 275 e0(ji,jj) = 0.5_wp*( 15.8_wp*zphio_flux/rau0 )**0.67_wp 276 ! Reducing the surface TKE by scaling with T-depth of first vertical level 277 dfac(ji,jj) = MAX( (2.0_wp*lambda*fsdept(ji,jj,1) )/3.0_wp, 0.00001_wp ) 278 ! TKE surface boundary condition weighted by the thickness of the first level 279 en(ji,jj,1) = MAX( rn_emin0, e0(ji,jj) * ( 1.0_wp - EXP(-dfac(ji,jj)) ) / dfac(ji,jj) ) * tmask(ji,jj,1) 280 ENDDO 281 ENDDO 282 ! If wave parameters are not read, use rn_ebb, corresponding to alpha = 100.0 283 ELSE 284 DO jj = 2, jpjm1 ! en(1) = rn_ebb taum / rau0 (min value rn_emin0) 285 DO ji = fs_2, fs_jpim1 ! vector opt. 286 ! Estimate average energy flux from std value found in rn_ebb (corresponds to alpha=100.0) 287 en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 288 ENDDO 289 ENDDO 290 ENDIF 291 247 292 !!bfr - start commented area 248 293 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< … … 443 488 ENDIF 444 489 CALL lbc_lnk( en, 'W', 1. ) ! Lateral boundary conditions (sign unchanged) 490 IF ( ln_wavetke ) THEN 491 CALL lbc_lnk( e0, 'W', 1. ) ! Lateral boundary conditions (sign unchanged) 492 CALL lbc_lnk( dfac, 'W', 1. ) ! Lateral boundary conditions (sign unchanged) 493 ENDIF 445 494 ! 446 495 CALL wrk_dealloc( jpi,jpj, imlc ) ! integer
Note: See TracChangeset
for help on using the changeset viewer.