1 | MODULE zdftmx |
---|
2 | !!======================================================================== |
---|
3 | !! *** MODULE zdftmx *** |
---|
4 | !! Ocean physics: Internal gravity wave-driven vertical mixing |
---|
5 | !!======================================================================== |
---|
6 | !! History : 1.0 ! 2004-04 (L. Bessieres, G. Madec) Original code |
---|
7 | !! - ! 2006-08 (A. Koch-Larrouy) Indonesian strait |
---|
8 | !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase |
---|
9 | !! 3.6 ! 2016-03 (C. de Lavergne) New param: internal wave-driven mixing |
---|
10 | !! 4.0 ! 2017-04 (G. Madec) Remove the old tidal mixing param. and key zdftmx(_new) |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | !! zdf_tmx : global momentum & tracer Kz with wave induced Kz |
---|
15 | !! zdf_tmx_init : global momentum & tracer Kz with wave induced Kz |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | USE oce ! ocean dynamics and tracers variables |
---|
18 | USE dom_oce ! ocean space and time domain variables |
---|
19 | USE zdf_oce ! ocean vertical physics variables |
---|
20 | USE zdfddm ! ocean vertical physics: double diffusive mixing |
---|
21 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
22 | USE eosbn2 ! ocean equation of state |
---|
23 | USE phycst ! physical constants |
---|
24 | USE prtctl ! Print control |
---|
25 | USE in_out_manager ! I/O manager |
---|
26 | USE iom ! I/O Manager |
---|
27 | USE lib_mpp ! MPP library |
---|
28 | USE wrk_nemo ! work arrays |
---|
29 | USE timing ! Timing |
---|
30 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
31 | |
---|
32 | IMPLICIT NONE |
---|
33 | PRIVATE |
---|
34 | |
---|
35 | PUBLIC zdf_tmx ! called in step module |
---|
36 | PUBLIC zdf_tmx_init ! called in nemogcm module |
---|
37 | PUBLIC zdf_tmx_alloc ! called in nemogcm module |
---|
38 | |
---|
39 | ! !!* Namelist namzdf_tmx : internal wave-driven mixing * |
---|
40 | INTEGER :: nn_zpyc ! pycnocline-intensified mixing energy proportional to N (=1) or N^2 (=2) |
---|
41 | LOGICAL :: ln_mevar ! variable (=T) or constant (=F) mixing efficiency |
---|
42 | LOGICAL :: ln_tsdiff ! account for differential T/S wave-driven mixing (=T) or not (=F) |
---|
43 | |
---|
44 | REAL(wp) :: r1_6 = 1._wp / 6._wp |
---|
45 | |
---|
46 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ebot_tmx ! power available from high-mode wave breaking (W/m2) |
---|
47 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: epyc_tmx ! power available from low-mode, pycnocline-intensified wave breaking (W/m2) |
---|
48 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ecri_tmx ! power available from low-mode, critical slope wave breaking (W/m2) |
---|
49 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: hbot_tmx ! WKB decay scale for high-mode energy dissipation (m) |
---|
50 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: hcri_tmx ! decay scale for low-mode critical slope dissipation (m) |
---|
51 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: emix_tmx ! local energy density available for mixing (W/kg) |
---|
52 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: bflx_tmx ! buoyancy flux Kz * N^2 (W/kg) |
---|
53 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: pcmap_tmx ! vertically integrated buoyancy flux (W/m2) |
---|
54 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zav_ratio ! S/T diffusivity ratio (only for ln_tsdiff=T) |
---|
55 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zav_wave ! Internal wave-induced diffusivity |
---|
56 | |
---|
57 | !! * Substitutions |
---|
58 | # include "vectopt_loop_substitute.h90" |
---|
59 | !!---------------------------------------------------------------------- |
---|
60 | !! NEMO/OPA 4.0 , NEMO Consortium (2016) |
---|
61 | !! $Id$ |
---|
62 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
63 | !!---------------------------------------------------------------------- |
---|
64 | CONTAINS |
---|
65 | |
---|
66 | INTEGER FUNCTION zdf_tmx_alloc() |
---|
67 | !!---------------------------------------------------------------------- |
---|
68 | !! *** FUNCTION zdf_tmx_alloc *** |
---|
69 | !!---------------------------------------------------------------------- |
---|
70 | ALLOCATE( ebot_tmx(jpi,jpj), epyc_tmx(jpi,jpj), ecri_tmx(jpi,jpj) , & |
---|
71 | & hbot_tmx(jpi,jpj), hcri_tmx(jpi,jpj), emix_tmx(jpi,jpj,jpk), & |
---|
72 | & bflx_tmx(jpi,jpj,jpk), pcmap_tmx(jpi,jpj), zav_ratio(jpi,jpj,jpk), & |
---|
73 | & zav_wave(jpi,jpj,jpk), STAT=zdf_tmx_alloc ) |
---|
74 | ! |
---|
75 | IF( lk_mpp ) CALL mpp_sum ( zdf_tmx_alloc ) |
---|
76 | IF( zdf_tmx_alloc /= 0 ) CALL ctl_warn('zdf_tmx_alloc: failed to allocate arrays') |
---|
77 | END FUNCTION zdf_tmx_alloc |
---|
78 | |
---|
79 | |
---|
80 | SUBROUTINE zdf_tmx( kt ) |
---|
81 | !!---------------------------------------------------------------------- |
---|
82 | !! *** ROUTINE zdf_tmx *** |
---|
83 | !! |
---|
84 | !! ** Purpose : add to the vertical mixing coefficients the effect of |
---|
85 | !! breaking internal waves. |
---|
86 | !! |
---|
87 | !! ** Method : - internal wave-driven vertical mixing is given by: |
---|
88 | !! Kz_wave = min( 100 cm2/s, f( Reb = emix_tmx /( Nu * N^2 ) ) |
---|
89 | !! where emix_tmx is the 3D space distribution of the wave-breaking |
---|
90 | !! energy and Nu the molecular kinematic viscosity. |
---|
91 | !! The function f(Reb) is linear (constant mixing efficiency) |
---|
92 | !! if the namelist parameter ln_mevar = F and nonlinear if ln_mevar = T. |
---|
93 | !! |
---|
94 | !! - Compute emix_tmx, the 3D power density that allows to compute |
---|
95 | !! Reb and therefrom the wave-induced vertical diffusivity. |
---|
96 | !! This is divided into three components: |
---|
97 | !! 1. Bottom-intensified low-mode dissipation at critical slopes |
---|
98 | !! emix_tmx(z) = ( ecri_tmx / rau0 ) * EXP( -(H-z)/hcri_tmx ) |
---|
99 | !! / ( 1. - EXP( - H/hcri_tmx ) ) * hcri_tmx |
---|
100 | !! where hcri_tmx is the characteristic length scale of the bottom |
---|
101 | !! intensification, ecri_tmx a map of available power, and H the ocean depth. |
---|
102 | !! 2. Pycnocline-intensified low-mode dissipation |
---|
103 | !! emix_tmx(z) = ( epyc_tmx / rau0 ) * ( sqrt(rn2(z))^nn_zpyc ) |
---|
104 | !! / SUM( sqrt(rn2(z))^nn_zpyc * e3w(z) ) |
---|
105 | !! where epyc_tmx is a map of available power, and nn_zpyc |
---|
106 | !! is the chosen stratification-dependence of the internal wave |
---|
107 | !! energy dissipation. |
---|
108 | !! 3. WKB-height dependent high mode dissipation |
---|
109 | !! emix_tmx(z) = ( ebot_tmx / rau0 ) * rn2(z) * EXP(-z_wkb(z)/hbot_tmx) |
---|
110 | !! / SUM( rn2(z) * EXP(-z_wkb(z)/hbot_tmx) * e3w(z) ) |
---|
111 | !! where hbot_tmx is the characteristic length scale of the WKB bottom |
---|
112 | !! intensification, ebot_tmx is a map of available power, and z_wkb is the |
---|
113 | !! WKB-stretched height above bottom defined as |
---|
114 | !! z_wkb(z) = H * SUM( sqrt(rn2(z'>=z)) * e3w(z'>=z) ) |
---|
115 | !! / SUM( sqrt(rn2(z')) * e3w(z') ) |
---|
116 | !! |
---|
117 | !! - update the model vertical eddy viscosity and diffusivity: |
---|
118 | !! avt = avt + av_wave |
---|
119 | !! avm = avm + av_wave |
---|
120 | !! avmu = avmu + mi(av_wave) |
---|
121 | !! avmv = avmv + mj(av_wave) |
---|
122 | !! |
---|
123 | !! - if namelist parameter ln_tsdiff = T, account for differential mixing: |
---|
124 | !! avs = avt + av_wave * diffusivity_ratio(Reb) |
---|
125 | !! |
---|
126 | !! ** Action : - Define emix_tmx used to compute internal wave-induced mixing |
---|
127 | !! - avt, avs, avm, avmu, avmv increased by internal wave-driven mixing |
---|
128 | !! |
---|
129 | !! References : de Lavergne et al. 2015, JPO; 2016, in prep. |
---|
130 | !!---------------------------------------------------------------------- |
---|
131 | INTEGER, INTENT(in) :: kt ! ocean time-step |
---|
132 | ! |
---|
133 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
134 | REAL(wp) :: ztpc ! scalar workspace |
---|
135 | REAL(wp), DIMENSION(:,:) , POINTER :: zfact ! Used for vertical structure |
---|
136 | REAL(wp), DIMENSION(:,:) , POINTER :: zhdep ! Ocean depth |
---|
137 | REAL(wp), DIMENSION(:,:,:), POINTER :: zwkb ! WKB-stretched height above bottom |
---|
138 | REAL(wp), DIMENSION(:,:,:), POINTER :: zweight ! Weight for high mode vertical distribution |
---|
139 | REAL(wp), DIMENSION(:,:,:), POINTER :: znu_t ! Molecular kinematic viscosity (T grid) |
---|
140 | REAL(wp), DIMENSION(:,:,:), POINTER :: znu_w ! Molecular kinematic viscosity (W grid) |
---|
141 | REAL(wp), DIMENSION(:,:,:), POINTER :: zReb ! Turbulence intensity parameter |
---|
142 | !!---------------------------------------------------------------------- |
---|
143 | ! |
---|
144 | IF( nn_timing == 1 ) CALL timing_start('zdf_tmx') |
---|
145 | ! |
---|
146 | CALL wrk_alloc( jpi,jpj, zfact, zhdep ) |
---|
147 | CALL wrk_alloc( jpi,jpj,jpk, zwkb, zweight, znu_t, znu_w, zReb ) |
---|
148 | |
---|
149 | ! ! ----------------------------- ! |
---|
150 | ! ! Internal wave-driven mixing ! (compute zav_wave) |
---|
151 | ! ! ----------------------------- ! |
---|
152 | ! |
---|
153 | ! !* Critical slope mixing: distribute energy over the time-varying ocean depth, |
---|
154 | ! using an exponential decay from the seafloor. |
---|
155 | DO jj = 1, jpj ! part independent of the level |
---|
156 | DO ji = 1, jpi |
---|
157 | zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1) ! depth of the ocean |
---|
158 | zfact(ji,jj) = rau0 * ( 1._wp - EXP( -zhdep(ji,jj) / hcri_tmx(ji,jj) ) ) |
---|
159 | IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = ecri_tmx(ji,jj) / zfact(ji,jj) |
---|
160 | END DO |
---|
161 | END DO |
---|
162 | |
---|
163 | DO jk = 2, jpkm1 ! complete with the level-dependent part |
---|
164 | emix_tmx(:,:,jk) = zfact(:,:) * ( EXP( ( gde3w_n(:,:,jk ) - zhdep(:,:) ) / hcri_tmx(:,:) ) & |
---|
165 | & - EXP( ( gde3w_n(:,:,jk-1) - zhdep(:,:) ) / hcri_tmx(:,:) ) ) * wmask(:,:,jk) & |
---|
166 | !!gm delta(gde3w_n) = e3t_n !! Please verify the grid-point position w versus t-point |
---|
167 | & / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) ) |
---|
168 | END DO |
---|
169 | |
---|
170 | ! !* Pycnocline-intensified mixing: distribute energy over the time-varying |
---|
171 | ! !* ocean depth as proportional to sqrt(rn2)^nn_zpyc |
---|
172 | |
---|
173 | SELECT CASE ( nn_zpyc ) |
---|
174 | |
---|
175 | CASE ( 1 ) ! Dissipation scales as N (recommended) |
---|
176 | |
---|
177 | zfact(:,:) = 0._wp |
---|
178 | DO jk = 2, jpkm1 ! part independent of the level |
---|
179 | zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * SQRT( MAX( 0._wp, rn2(:,:,jk) ) ) * wmask(:,:,jk) |
---|
180 | END DO |
---|
181 | |
---|
182 | DO jj = 1, jpj |
---|
183 | DO ji = 1, jpi |
---|
184 | IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = epyc_tmx(ji,jj) / ( rau0 * zfact(ji,jj) ) |
---|
185 | END DO |
---|
186 | END DO |
---|
187 | |
---|
188 | DO jk = 2, jpkm1 ! complete with the level-dependent part |
---|
189 | emix_tmx(:,:,jk) = emix_tmx(:,:,jk) + zfact(:,:) * SQRT( MAX( 0._wp, rn2(:,:,jk) ) ) * wmask(:,:,jk) |
---|
190 | END DO |
---|
191 | |
---|
192 | CASE ( 2 ) ! Dissipation scales as N^2 |
---|
193 | |
---|
194 | zfact(:,:) = 0._wp |
---|
195 | DO jk = 2, jpkm1 ! part independent of the level |
---|
196 | zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) |
---|
197 | END DO |
---|
198 | |
---|
199 | DO jj= 1, jpj |
---|
200 | DO ji = 1, jpi |
---|
201 | IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = epyc_tmx(ji,jj) / ( rau0 * zfact(ji,jj) ) |
---|
202 | END DO |
---|
203 | END DO |
---|
204 | |
---|
205 | DO jk = 2, jpkm1 ! complete with the level-dependent part |
---|
206 | emix_tmx(:,:,jk) = emix_tmx(:,:,jk) + zfact(:,:) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) |
---|
207 | END DO |
---|
208 | |
---|
209 | END SELECT |
---|
210 | |
---|
211 | ! !* WKB-height dependent mixing: distribute energy over the time-varying |
---|
212 | ! !* ocean depth as proportional to rn2 * exp(-z_wkb/rn_hbot) |
---|
213 | |
---|
214 | zwkb(:,:,:) = 0._wp |
---|
215 | zfact(:,:) = 0._wp |
---|
216 | DO jk = 2, jpkm1 |
---|
217 | zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * SQRT( MAX( 0._wp, rn2(:,:,jk) ) ) * wmask(:,:,jk) |
---|
218 | zwkb(:,:,jk) = zfact(:,:) |
---|
219 | END DO |
---|
220 | |
---|
221 | DO jk = 2, jpkm1 |
---|
222 | DO jj = 1, jpj |
---|
223 | DO ji = 1, jpi |
---|
224 | IF( zfact(ji,jj) /= 0 ) zwkb(ji,jj,jk) = zhdep(ji,jj) * ( zfact(ji,jj) - zwkb(ji,jj,jk) ) & |
---|
225 | & * tmask(ji,jj,jk) / zfact(ji,jj) |
---|
226 | END DO |
---|
227 | END DO |
---|
228 | END DO |
---|
229 | zwkb(:,:,1) = zhdep(:,:) * tmask(:,:,1) |
---|
230 | |
---|
231 | zweight(:,:,:) = 0._wp |
---|
232 | DO jk = 2, jpkm1 |
---|
233 | zweight(:,:,jk) = MAX( 0._wp, rn2(:,:,jk) ) * hbot_tmx(:,:) * wmask(:,:,jk) & |
---|
234 | & * ( EXP( -zwkb(:,:,jk) / hbot_tmx(:,:) ) - EXP( -zwkb(:,:,jk-1) / hbot_tmx(:,:) ) ) |
---|
235 | END DO |
---|
236 | |
---|
237 | zfact(:,:) = 0._wp |
---|
238 | DO jk = 2, jpkm1 ! part independent of the level |
---|
239 | zfact(:,:) = zfact(:,:) + zweight(:,:,jk) |
---|
240 | END DO |
---|
241 | |
---|
242 | DO jj = 1, jpj |
---|
243 | DO ji = 1, jpi |
---|
244 | IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = ebot_tmx(ji,jj) / ( rau0 * zfact(ji,jj) ) |
---|
245 | END DO |
---|
246 | END DO |
---|
247 | |
---|
248 | DO jk = 2, jpkm1 ! complete with the level-dependent part |
---|
249 | emix_tmx(:,:,jk) = emix_tmx(:,:,jk) + zweight(:,:,jk) * zfact(:,:) * wmask(:,:,jk) & |
---|
250 | & / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) ) |
---|
251 | END DO |
---|
252 | |
---|
253 | |
---|
254 | ! Calculate molecular kinematic viscosity |
---|
255 | znu_t(:,:,:) = 1.e-4_wp * ( 17.91_wp - 0.53810_wp * tsn(:,:,:,jp_tem) + 0.00694_wp * tsn(:,:,:,jp_tem) * tsn(:,:,:,jp_tem) & |
---|
256 | & + 0.02305_wp * tsn(:,:,:,jp_sal) ) * tmask(:,:,:) * r1_rau0 |
---|
257 | DO jk = 2, jpkm1 |
---|
258 | znu_w(:,:,jk) = 0.5_wp * ( znu_t(:,:,jk-1) + znu_t(:,:,jk) ) * wmask(:,:,jk) |
---|
259 | END DO |
---|
260 | |
---|
261 | ! Calculate turbulence intensity parameter Reb |
---|
262 | DO jk = 2, jpkm1 |
---|
263 | zReb(:,:,jk) = emix_tmx(:,:,jk) / MAX( 1.e-20_wp, znu_w(:,:,jk) * rn2(:,:,jk) ) |
---|
264 | END DO |
---|
265 | |
---|
266 | ! Define internal wave-induced diffusivity |
---|
267 | DO jk = 2, jpkm1 |
---|
268 | zav_wave(:,:,jk) = znu_w(:,:,jk) * zReb(:,:,jk) * r1_6 ! This corresponds to a constant mixing efficiency of 1/6 |
---|
269 | END DO |
---|
270 | |
---|
271 | IF( ln_mevar ) THEN ! Variable mixing efficiency case : modify zav_wave in the |
---|
272 | DO jk = 2, jpkm1 ! energetic (Reb > 480) and buoyancy-controlled (Reb <10.224 ) regimes |
---|
273 | DO jj = 1, jpj |
---|
274 | DO ji = 1, jpi |
---|
275 | IF( zReb(ji,jj,jk) > 480.00_wp ) THEN |
---|
276 | zav_wave(ji,jj,jk) = 3.6515_wp * znu_w(ji,jj,jk) * SQRT( zReb(ji,jj,jk) ) |
---|
277 | ELSEIF( zReb(ji,jj,jk) < 10.224_wp ) THEN |
---|
278 | zav_wave(ji,jj,jk) = 0.052125_wp * znu_w(ji,jj,jk) * zReb(ji,jj,jk) * SQRT( zReb(ji,jj,jk) ) |
---|
279 | ENDIF |
---|
280 | END DO |
---|
281 | END DO |
---|
282 | END DO |
---|
283 | ENDIF |
---|
284 | |
---|
285 | DO jk = 2, jpkm1 ! Bound diffusivity by molecular value and 100 cm2/s |
---|
286 | zav_wave(:,:,jk) = MIN( MAX( 1.4e-7_wp, zav_wave(:,:,jk) ), 1.e-2_wp ) * wmask(:,:,jk) |
---|
287 | END DO |
---|
288 | |
---|
289 | IF( kt == nit000 ) THEN !* Control print at first time-step: diagnose the energy consumed by zav_wave |
---|
290 | ztpc = 0._wp |
---|
291 | !!gm used of glosum 3D.... |
---|
292 | DO jk = 2, jpkm1 |
---|
293 | DO jj = 1, jpj |
---|
294 | DO ji = 1, jpi |
---|
295 | ztpc = ztpc + e3w_n(ji,jj,jk) * e1e2t(ji,jj) & |
---|
296 | & * MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
297 | END DO |
---|
298 | END DO |
---|
299 | END DO |
---|
300 | IF( lk_mpp ) CALL mpp_sum( ztpc ) |
---|
301 | ztpc = rau0 * ztpc ! Global integral of rauo * Kz * N^2 = power contributing to mixing |
---|
302 | |
---|
303 | IF(lwp) THEN |
---|
304 | WRITE(numout,*) |
---|
305 | WRITE(numout,*) 'zdf_tmx : Internal wave-driven mixing (tmx)' |
---|
306 | WRITE(numout,*) '~~~~~~~ ' |
---|
307 | WRITE(numout,*) |
---|
308 | WRITE(numout,*) ' Total power consumption by av_wave: ztpc = ', ztpc * 1.e-12_wp, 'TW' |
---|
309 | ENDIF |
---|
310 | ENDIF |
---|
311 | |
---|
312 | ! ! ----------------------- ! |
---|
313 | ! ! Update mixing coefs ! |
---|
314 | ! ! ----------------------- ! |
---|
315 | ! |
---|
316 | IF( ln_tsdiff ) THEN !* Option for differential mixing of salinity and temperature |
---|
317 | DO jk = 2, jpkm1 ! Calculate S/T diffusivity ratio as a function of Reb |
---|
318 | DO jj = 1, jpj |
---|
319 | DO ji = 1, jpi |
---|
320 | zav_ratio(ji,jj,jk) = ( 0.505_wp + 0.495_wp * & |
---|
321 | & TANH( 0.92_wp * ( LOG10( MAX( 1.e-20_wp, zReb(ji,jj,jk) * 5._wp * r1_6 ) ) - 0.60_wp ) ) & |
---|
322 | & ) * wmask(ji,jj,jk) |
---|
323 | END DO |
---|
324 | END DO |
---|
325 | END DO |
---|
326 | CALL iom_put( "av_ratio", zav_ratio ) |
---|
327 | DO jk = 2, jpkm1 !* update momentum & tracer diffusivity with wave-driven mixing |
---|
328 | avs(:,:,jk) = avs(:,:,jk) + zav_wave(:,:,jk) * zav_ratio(:,:,jk) |
---|
329 | avt(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) |
---|
330 | avm(:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk) |
---|
331 | END DO |
---|
332 | ! |
---|
333 | ELSE !* update momentum & tracer diffusivity with wave-driven mixing |
---|
334 | DO jk = 2, jpkm1 |
---|
335 | avs(:,:,jk) = avs(:,:,jk) + zav_wave(:,:,jk) |
---|
336 | avt(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) |
---|
337 | avm(:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk) |
---|
338 | END DO |
---|
339 | ENDIF |
---|
340 | |
---|
341 | DO jk = 2, jpkm1 !* update momentum diffusivity at wu and wv points |
---|
342 | DO jj = 2, jpjm1 |
---|
343 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
344 | avmu(ji,jj,jk) = avmu(ji,jj,jk) + 0.5_wp * ( zav_wave(ji,jj,jk) + zav_wave(ji+1,jj ,jk) ) * wumask(ji,jj,jk) |
---|
345 | avmv(ji,jj,jk) = avmv(ji,jj,jk) + 0.5_wp * ( zav_wave(ji,jj,jk) + zav_wave(ji ,jj+1,jk) ) * wvmask(ji,jj,jk) |
---|
346 | END DO |
---|
347 | END DO |
---|
348 | END DO |
---|
349 | CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. ) ! lateral boundary condition |
---|
350 | |
---|
351 | ! !* output internal wave-driven mixing coefficient |
---|
352 | CALL iom_put( "av_wave", zav_wave ) |
---|
353 | !* output useful diagnostics: N^2, Kz * N^2 (bflx_tmx), |
---|
354 | ! vertical integral of rau0 * Kz * N^2 (pcmap_tmx), energy density (emix_tmx) |
---|
355 | IF( iom_use("bflx_tmx") .OR. iom_use("pcmap_tmx") ) THEN |
---|
356 | bflx_tmx(:,:,:) = MAX( 0._wp, rn2(:,:,:) ) * zav_wave(:,:,:) |
---|
357 | pcmap_tmx(:,:) = 0._wp |
---|
358 | DO jk = 2, jpkm1 |
---|
359 | pcmap_tmx(:,:) = pcmap_tmx(:,:) + e3w_n(:,:,jk) * bflx_tmx(:,:,jk) * wmask(:,:,jk) |
---|
360 | END DO |
---|
361 | pcmap_tmx(:,:) = rau0 * pcmap_tmx(:,:) |
---|
362 | CALL iom_put( "bflx_tmx", bflx_tmx ) |
---|
363 | CALL iom_put( "pcmap_tmx", pcmap_tmx ) |
---|
364 | ENDIF |
---|
365 | CALL iom_put( "bn2", rn2 ) |
---|
366 | CALL iom_put( "emix_tmx", emix_tmx ) |
---|
367 | |
---|
368 | CALL wrk_dealloc( jpi,jpj, zfact, zhdep ) |
---|
369 | CALL wrk_dealloc( jpi,jpj,jpk, zwkb, zweight, znu_t, znu_w, zReb ) |
---|
370 | |
---|
371 | IF(ln_ctl) CALL prt_ctl(tab3d_1=zav_wave , clinfo1=' tmx - av_wave: ', tab3d_2=avt, clinfo2=' avt: ', ovlap=1, kdim=jpk) |
---|
372 | ! |
---|
373 | IF( nn_timing == 1 ) CALL timing_stop('zdf_tmx') |
---|
374 | ! |
---|
375 | END SUBROUTINE zdf_tmx |
---|
376 | |
---|
377 | |
---|
378 | SUBROUTINE zdf_tmx_init |
---|
379 | !!---------------------------------------------------------------------- |
---|
380 | !! *** ROUTINE zdf_tmx_init *** |
---|
381 | !! |
---|
382 | !! ** Purpose : Initialization of the wave-driven vertical mixing, reading |
---|
383 | !! of input power maps and decay length scales in netcdf files. |
---|
384 | !! |
---|
385 | !! ** Method : - Read the namzdf_tmx namelist and check the parameters |
---|
386 | !! |
---|
387 | !! - Read the input data in NetCDF files : |
---|
388 | !! power available from high-mode wave breaking (mixing_power_bot.nc) |
---|
389 | !! power available from pycnocline-intensified wave-breaking (mixing_power_pyc.nc) |
---|
390 | !! power available from critical slope wave-breaking (mixing_power_cri.nc) |
---|
391 | !! WKB decay scale for high-mode wave-breaking (decay_scale_bot.nc) |
---|
392 | !! decay scale for critical slope wave-breaking (decay_scale_cri.nc) |
---|
393 | !! |
---|
394 | !! ** input : - Namlist namzdf_tmx |
---|
395 | !! - NetCDF files : mixing_power_bot.nc, mixing_power_pyc.nc, mixing_power_cri.nc, |
---|
396 | !! decay_scale_bot.nc decay_scale_cri.nc |
---|
397 | !! |
---|
398 | !! ** Action : - Increase by 1 the nstop flag is setting problem encounter |
---|
399 | !! - Define ebot_tmx, epyc_tmx, ecri_tmx, hbot_tmx, hcri_tmx |
---|
400 | !! |
---|
401 | !! References : de Lavergne et al. 2015, JPO; 2016, in prep. |
---|
402 | !! |
---|
403 | !!---------------------------------------------------------------------- |
---|
404 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
405 | INTEGER :: inum ! local integer |
---|
406 | INTEGER :: ios |
---|
407 | REAL(wp) :: zbot, zpyc, zcri ! local scalars |
---|
408 | !! |
---|
409 | NAMELIST/namzdf_tmx_new/ nn_zpyc, ln_mevar, ln_tsdiff |
---|
410 | !!---------------------------------------------------------------------- |
---|
411 | ! |
---|
412 | IF( nn_timing == 1 ) CALL timing_start('zdf_tmx_init') |
---|
413 | ! |
---|
414 | REWIND( numnam_ref ) ! Namelist namzdf_tmx in reference namelist : Wave-driven mixing |
---|
415 | READ ( numnam_ref, namzdf_tmx_new, IOSTAT = ios, ERR = 901) |
---|
416 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist', lwp ) |
---|
417 | ! |
---|
418 | REWIND( numnam_cfg ) ! Namelist namzdf_tmx in configuration namelist : Wave-driven mixing |
---|
419 | READ ( numnam_cfg, namzdf_tmx_new, IOSTAT = ios, ERR = 902 ) |
---|
420 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist', lwp ) |
---|
421 | IF(lwm) WRITE ( numond, namzdf_tmx_new ) |
---|
422 | ! |
---|
423 | IF(lwp) THEN ! Control print |
---|
424 | WRITE(numout,*) |
---|
425 | WRITE(numout,*) 'zdf_tmx_init : internal wave-driven mixing' |
---|
426 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
427 | WRITE(numout,*) ' Namelist namzdf_tmx_new : set wave-driven mixing parameters' |
---|
428 | WRITE(numout,*) ' Pycnocline-intensified diss. scales as N (=1) or N^2 (=2) = ', nn_zpyc |
---|
429 | WRITE(numout,*) ' Variable (T) or constant (F) mixing efficiency = ', ln_mevar |
---|
430 | WRITE(numout,*) ' Differential internal wave-driven mixing (T) or not (F) = ', ln_tsdiff |
---|
431 | ENDIF |
---|
432 | |
---|
433 | ! The new wave-driven mixing parameterization elevates avt and avm in the interior, and |
---|
434 | ! ensures that avt remains larger than its molecular value (=1.4e-7). Therefore, avtb should |
---|
435 | ! be set here to a very small value, and avmb to its (uniform) molecular value (=1.4e-6). |
---|
436 | avmb(:) = 1.4e-6_wp ! viscous molecular value |
---|
437 | avtb(:) = 1.e-10_wp ! very small diffusive minimum (background avt is specified in zdf_tmx) |
---|
438 | avtb_2d(:,:) = 1.e0_wp ! uniform |
---|
439 | IF(lwp) THEN ! Control print |
---|
440 | WRITE(numout,*) |
---|
441 | WRITE(numout,*) ' Force the background value applied to avm & avt in TKE to be everywhere ', & |
---|
442 | & 'the viscous molecular value & a very small diffusive value, resp.' |
---|
443 | ENDIF |
---|
444 | |
---|
445 | ! ! allocate tmx arrays |
---|
446 | IF( zdf_tmx_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' ) |
---|
447 | ! |
---|
448 | ! ! read necessary fields |
---|
449 | CALL iom_open('mixing_power_bot',inum) ! energy flux for high-mode wave breaking [W/m2] |
---|
450 | CALL iom_get (inum, jpdom_data, 'field', ebot_tmx, 1 ) |
---|
451 | CALL iom_close(inum) |
---|
452 | ! |
---|
453 | CALL iom_open('mixing_power_pyc',inum) ! energy flux for pynocline-intensified wave breaking [W/m2] |
---|
454 | CALL iom_get (inum, jpdom_data, 'field', epyc_tmx, 1 ) |
---|
455 | CALL iom_close(inum) |
---|
456 | ! |
---|
457 | CALL iom_open('mixing_power_cri',inum) ! energy flux for critical slope wave breaking [W/m2] |
---|
458 | CALL iom_get (inum, jpdom_data, 'field', ecri_tmx, 1 ) |
---|
459 | CALL iom_close(inum) |
---|
460 | ! |
---|
461 | CALL iom_open('decay_scale_bot',inum) ! spatially variable decay scale for high-mode wave breaking [m] |
---|
462 | CALL iom_get (inum, jpdom_data, 'field', hbot_tmx, 1 ) |
---|
463 | CALL iom_close(inum) |
---|
464 | ! |
---|
465 | CALL iom_open('decay_scale_cri',inum) ! spatially variable decay scale for critical slope wave breaking [m] |
---|
466 | CALL iom_get (inum, jpdom_data, 'field', hcri_tmx, 1 ) |
---|
467 | CALL iom_close(inum) |
---|
468 | |
---|
469 | ebot_tmx(:,:) = ebot_tmx(:,:) * ssmask(:,:) |
---|
470 | epyc_tmx(:,:) = epyc_tmx(:,:) * ssmask(:,:) |
---|
471 | ecri_tmx(:,:) = ecri_tmx(:,:) * ssmask(:,:) |
---|
472 | |
---|
473 | ! Set once for all to zero the first and last vertical levels of appropriate variables |
---|
474 | emix_tmx (:,:, 1 ) = 0._wp |
---|
475 | emix_tmx (:,:,jpk) = 0._wp |
---|
476 | zav_ratio(:,:, 1 ) = 0._wp |
---|
477 | zav_ratio(:,:,jpk) = 0._wp |
---|
478 | zav_wave (:,:, 1 ) = 0._wp |
---|
479 | zav_wave (:,:,jpk) = 0._wp |
---|
480 | |
---|
481 | zbot = glob_sum( e1e2t(:,:) * ebot_tmx(:,:) ) |
---|
482 | zpyc = glob_sum( e1e2t(:,:) * epyc_tmx(:,:) ) |
---|
483 | zcri = glob_sum( e1e2t(:,:) * ecri_tmx(:,:) ) |
---|
484 | IF(lwp) THEN |
---|
485 | WRITE(numout,*) ' High-mode wave-breaking energy: ', zbot * 1.e-12_wp, 'TW' |
---|
486 | WRITE(numout,*) ' Pycnocline-intensifed wave-breaking energy: ', zpyc * 1.e-12_wp, 'TW' |
---|
487 | WRITE(numout,*) ' Critical slope wave-breaking energy: ', zcri * 1.e-12_wp, 'TW' |
---|
488 | ENDIF |
---|
489 | ! |
---|
490 | IF( nn_timing == 1 ) CALL timing_stop('zdf_tmx_init') |
---|
491 | ! |
---|
492 | END SUBROUTINE zdf_tmx_init |
---|
493 | |
---|
494 | !!====================================================================== |
---|
495 | END MODULE zdftmx |
---|