1 | MODULE zdftmx |
---|
2 | !!======================================================================== |
---|
3 | !! *** MODULE zdftmx *** |
---|
4 | !! Ocean physics: vertical tidal mixing coefficient |
---|
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 | !!---------------------------------------------------------------------- |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! 'key_zdftmx' Tidal vertical mixing |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! zdf_tmx : global momentum & tracer Kz with tidal induced Kz |
---|
14 | !! tmx_itf : Indonesian momentum & tracer Kz with tidal induced Kz |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | USE oce ! ocean dynamics and tracers variables |
---|
17 | USE dom_oce ! ocean space and time domain variables |
---|
18 | USE zdf_oce ! ocean vertical physics variables |
---|
19 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
20 | USE eosbn2 ! ocean equation of state |
---|
21 | USE phycst ! physical constants |
---|
22 | USE prtctl ! Print control |
---|
23 | USE in_out_manager ! I/O manager |
---|
24 | USE iom ! I/O Manager |
---|
25 | USE lib_mpp ! MPP library |
---|
26 | USE timing ! Timing |
---|
27 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
28 | |
---|
29 | IMPLICIT NONE |
---|
30 | PRIVATE |
---|
31 | |
---|
32 | PUBLIC zdf_tmx ! called in step module |
---|
33 | PUBLIC zdf_tmx_init ! called in opa module |
---|
34 | PUBLIC zdf_tmx_alloc ! called in nemogcm module |
---|
35 | |
---|
36 | LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .TRUE. !: tidal mixing flag |
---|
37 | |
---|
38 | ! !!* Namelist namzdf_tmx : tidal mixing * |
---|
39 | REAL(wp) :: rn_htmx ! vertical decay scale for turbulence (meters) |
---|
40 | REAL(wp) :: rn_n2min ! threshold of the Brunt-Vaisala frequency (s-1) |
---|
41 | REAL(wp) :: rn_tfe ! tidal dissipation efficiency (St Laurent et al. 2002) |
---|
42 | REAL(wp) :: rn_me ! mixing efficiency (Osborn 1980) |
---|
43 | LOGICAL :: ln_tmx_itf ! Indonesian Through Flow (ITF): Koch-Larrouy et al. (2007) parameterization |
---|
44 | REAL(wp) :: rn_tfe_itf ! ITF tidal dissipation efficiency (St Laurent et al. 2002) |
---|
45 | |
---|
46 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: en_tmx ! energy available for tidal mixing (W/m2) |
---|
47 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: mask_itf ! mask to use over Indonesian area |
---|
48 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: az_tmx ! coefficient used to evaluate the tidal induced Kz |
---|
49 | |
---|
50 | !! * Substitutions |
---|
51 | # include "vectopt_loop_substitute.h90" |
---|
52 | !!---------------------------------------------------------------------- |
---|
53 | !! NEMO/OPA 4.0 , NEMO Consortium (2011) |
---|
54 | !! $Id: zdftmx.F90 8788 2017-11-22 18:01:02Z davestorkey $ |
---|
55 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
56 | !!---------------------------------------------------------------------- |
---|
57 | CONTAINS |
---|
58 | |
---|
59 | INTEGER FUNCTION zdf_tmx_alloc() |
---|
60 | !!---------------------------------------------------------------------- |
---|
61 | !! *** FUNCTION zdf_tmx_alloc *** |
---|
62 | !!---------------------------------------------------------------------- |
---|
63 | ALLOCATE(en_tmx(jpi,jpj), mask_itf(jpi,jpj), az_tmx(jpi,jpj,jpk), STAT=zdf_tmx_alloc ) |
---|
64 | ! |
---|
65 | IF( lk_mpp ) CALL mpp_sum ('zdftmx', zdf_tmx_alloc ) |
---|
66 | IF( zdf_tmx_alloc /= 0 ) CALL ctl_warn('zdf_tmx_alloc: failed to allocate arrays') |
---|
67 | END FUNCTION zdf_tmx_alloc |
---|
68 | |
---|
69 | |
---|
70 | SUBROUTINE zdf_tmx( kt, p_avm, p_avt, p_avs) |
---|
71 | !!---------------------------------------------------------------------- |
---|
72 | !! *** ROUTINE zdf_tmx *** |
---|
73 | !! |
---|
74 | !! ** Purpose : add to the vertical mixing coefficients the effect of |
---|
75 | !! tidal mixing (Simmons et al 2004). |
---|
76 | !! |
---|
77 | !! ** Method : - tidal-induced vertical mixing is given by: |
---|
78 | !! Kz_tides = az_tmx / max( rn_n2min, N^2 ) |
---|
79 | !! where az_tmx is a coefficient that specified the 3D space |
---|
80 | !! distribution of the faction of tidal energy taht is used |
---|
81 | !! for mixing. Its expression is set in zdf_tmx_init routine, |
---|
82 | !! following Simmons et al. 2004. |
---|
83 | !! NB: a specific bounding procedure is performed on av_tide |
---|
84 | !! so that the input tidal energy is actually almost used. The |
---|
85 | !! basic maximum value is 60 cm2/s, but values of 300 cm2/s |
---|
86 | !! can be reached in area where bottom stratification is too |
---|
87 | !! weak. |
---|
88 | !! |
---|
89 | !! - update av_tide in the Indonesian Through Flow area |
---|
90 | !! following Koch-Larrouy et al. (2007) parameterisation |
---|
91 | !! (see tmx_itf routine). |
---|
92 | !! |
---|
93 | !! - update the model vertical eddy viscosity and diffusivity: |
---|
94 | !! avt = avt + av_tides |
---|
95 | !! avm = avm + av_tides |
---|
96 | !! |
---|
97 | !! ** Action : avt, avm increased by tidal mixing |
---|
98 | !! |
---|
99 | !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. |
---|
100 | !! Koch-Larrouy et al. 2007, GRL. |
---|
101 | !!---------------------------------------------------------------------- |
---|
102 | INTEGER, INTENT(in) :: kt ! ocean time-step |
---|
103 | REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: p_avm ! momentum Kz (w-points) |
---|
104 | REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: p_avt, p_avs ! tracer Kz (w-points) |
---|
105 | !! |
---|
106 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
107 | REAL(wp) :: ztpc ! scalar workspace |
---|
108 | REAL(wp), DIMENSION(jpi,jpj) :: zkz |
---|
109 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zav_tide |
---|
110 | !!---------------------------------------------------------------------- |
---|
111 | ! |
---|
112 | ! ! ----------------------- ! |
---|
113 | ! ! Standard tidal mixing ! (compute zav_tide) |
---|
114 | ! ! ----------------------- ! |
---|
115 | ! !* First estimation (with n2 bound by rn_n2min) bounded by 60 cm2/s |
---|
116 | zav_tide(:,:,:) = MIN( 60.e-4, az_tmx(:,:,:) / MAX( rn_n2min, rn2(:,:,:) ) ) |
---|
117 | |
---|
118 | zkz(:,:) = 0.e0 !* Associated potential energy consummed over the whole water column |
---|
119 | DO jk = 2, jpkm1 |
---|
120 | zkz(:,:) = zkz(:,:) + e3w_n(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * zav_tide(:,:,jk) * wmask(:,:,jk) |
---|
121 | END DO |
---|
122 | |
---|
123 | DO jj = 1, jpj !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx |
---|
124 | DO ji = 1, jpi |
---|
125 | IF( zkz(ji,jj) /= 0.e0 ) zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) |
---|
126 | END DO |
---|
127 | END DO |
---|
128 | |
---|
129 | DO jk = 2, jpkm1 !* Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zav_tide bound by 300 cm2/s |
---|
130 | DO jj = 1, jpj !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx |
---|
131 | DO ji = 1, jpi |
---|
132 | zav_tide(ji,jj,jk) = zav_tide(ji,jj,jk) * MIN( zkz(ji,jj), 30./6. ) * wmask(ji,jj,jk) !kz max = 300 cm2/s |
---|
133 | END DO |
---|
134 | END DO |
---|
135 | END DO |
---|
136 | |
---|
137 | IF( kt == nit000 ) THEN !* check at first time-step: diagnose the energy consumed by zav_tide |
---|
138 | ztpc = 0.e0 |
---|
139 | DO jk= 1, jpk |
---|
140 | DO jj= 1, jpj |
---|
141 | DO ji= 1, jpi |
---|
142 | ztpc = ztpc + e3w_n(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) & |
---|
143 | & * MAX( 0.e0, rn2(ji,jj,jk) ) * zav_tide(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
144 | END DO |
---|
145 | END DO |
---|
146 | END DO |
---|
147 | ztpc= rau0 / ( rn_tfe * rn_me ) * ztpc |
---|
148 | IF(lwp) WRITE(numout,*) |
---|
149 | IF(lwp) WRITE(numout,*) ' N Total power consumption by av_tide : ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
150 | ENDIF |
---|
151 | |
---|
152 | ! ! ----------------------- ! |
---|
153 | ! ! ITF tidal mixing ! (update zav_tide) |
---|
154 | ! ! ----------------------- ! |
---|
155 | IF( ln_tmx_itf ) CALL tmx_itf( kt, zav_tide ) |
---|
156 | |
---|
157 | ! ! ----------------------- ! |
---|
158 | ! ! Update mixing coefs ! |
---|
159 | ! ! ----------------------- ! |
---|
160 | DO jk = 2, jpkm1 !* update momentum & tracer diffusivity with tidal mixing |
---|
161 | DO jj = 1, jpj !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx |
---|
162 | DO ji = 1, jpi |
---|
163 | p_avt(ji,jj,jk) = p_avt(ji,jj,jk) + zav_tide(ji,jj,jk) * wmask(ji,jj,jk) |
---|
164 | p_avs(ji,jj,jk) = p_avs(ji,jj,jk) + zav_tide(ji,jj,jk) * wmask(ji,jj,jk) |
---|
165 | p_avm(ji,jj,jk) = p_avm(ji,jj,jk) + zav_tide(ji,jj,jk) * wmask(ji,jj,jk) |
---|
166 | END DO |
---|
167 | END DO |
---|
168 | END DO |
---|
169 | |
---|
170 | ! !* output tidal mixing coefficient |
---|
171 | CALL iom_put( "av_tmx", zav_tide ) |
---|
172 | |
---|
173 | IF(ln_ctl) CALL prt_ctl(tab3d_1=zav_tide , clinfo1=' tmx - av_tide: ', tab3d_2=p_avt, clinfo2=' p_avt: ', kdim=jpk) |
---|
174 | ! |
---|
175 | END SUBROUTINE zdf_tmx |
---|
176 | |
---|
177 | |
---|
178 | SUBROUTINE tmx_itf( kt, pav ) |
---|
179 | !!---------------------------------------------------------------------- |
---|
180 | !! *** ROUTINE tmx_itf *** |
---|
181 | !! |
---|
182 | !! ** Purpose : modify the vertical eddy diffusivity coefficients |
---|
183 | !! (pav) in the Indonesian Through Flow area (ITF). |
---|
184 | !! |
---|
185 | !! ** Method : - Following Koch-Larrouy et al. (2007), in the ITF defined |
---|
186 | !! by msk_itf (read in a file, see tmx_init), the tidal |
---|
187 | !! mixing coefficient is computed with : |
---|
188 | !! * q=1 (i.e. all the tidal energy remains trapped in |
---|
189 | !! the area and thus is used for mixing) |
---|
190 | !! * the vertical distribution of the tifal energy is a |
---|
191 | !! proportional to N above the thermocline (d(N^2)/dz > 0) |
---|
192 | !! and to N^2 below the thermocline (d(N^2)/dz < 0) |
---|
193 | !! |
---|
194 | !! ** Action : av_tide updated in the ITF area (msk_itf) |
---|
195 | !! |
---|
196 | !! References : Koch-Larrouy et al. 2007, GRL |
---|
197 | !!---------------------------------------------------------------------- |
---|
198 | INTEGER , INTENT(in ) :: kt ! ocean time-step |
---|
199 | REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) :: pav ! Tidal mixing coef. |
---|
200 | !! |
---|
201 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
202 | REAL(wp) :: zcoef, ztpc ! temporary scalar |
---|
203 | REAL(wp), DIMENSION(jpi,jpj) :: zkz ! 2D workspace |
---|
204 | REAL(wp), DIMENSION(jpi,jpj) :: zsum1 , zsum2 , zsum ! - - |
---|
205 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zempba_3d_1, zempba_3d_2 ! 3D workspace |
---|
206 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zempba_3d , zdn2dz ! - - |
---|
207 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zavt_itf ! - - |
---|
208 | !!---------------------------------------------------------------------- |
---|
209 | ! |
---|
210 | ! ! compute the form function using N2 at each time step |
---|
211 | zdn2dz (:,:,jpk) = 0.e0 |
---|
212 | zempba_3d_1(:,:,jpk) = 0.e0 |
---|
213 | zempba_3d_2(:,:,jpk) = 0.e0 |
---|
214 | DO jk = 1, jpkm1 |
---|
215 | zdn2dz (:,:,jk) = rn2(:,:,jk) - rn2(:,:,jk+1) ! Vertical profile of dN2/dz |
---|
216 | !CDIR NOVERRCHK |
---|
217 | zempba_3d_1(:,:,jk) = SQRT( MAX( 0.e0, rn2(:,:,jk) ) ) ! - - of N |
---|
218 | zempba_3d_2(:,:,jk) = MAX( 0.e0, rn2(:,:,jk) ) ! - - of N^2 |
---|
219 | END DO |
---|
220 | ! |
---|
221 | zsum (:,:) = 0.e0 |
---|
222 | zsum1(:,:) = 0.e0 |
---|
223 | zsum2(:,:) = 0.e0 |
---|
224 | DO jk= 2, jpk |
---|
225 | zsum1(:,:) = zsum1(:,:) + zempba_3d_1(:,:,jk) * e3w_n(:,:,jk) * tmask(:,:,jk) * tmask(:,:,jk-1) |
---|
226 | zsum2(:,:) = zsum2(:,:) + zempba_3d_2(:,:,jk) * e3w_n(:,:,jk) * tmask(:,:,jk) * tmask(:,:,jk-1) |
---|
227 | END DO |
---|
228 | DO jj = 1, jpj |
---|
229 | DO ji = 1, jpi |
---|
230 | IF( zsum1(ji,jj) /= 0.e0 ) zsum1(ji,jj) = 1.e0 / zsum1(ji,jj) |
---|
231 | IF( zsum2(ji,jj) /= 0.e0 ) zsum2(ji,jj) = 1.e0 / zsum2(ji,jj) |
---|
232 | END DO |
---|
233 | END DO |
---|
234 | |
---|
235 | DO jk= 1, jpk |
---|
236 | DO jj = 1, jpj |
---|
237 | DO ji = 1, jpi |
---|
238 | zcoef = 0.5 - SIGN( 0.5, zdn2dz(ji,jj,jk) ) ! =0 if dN2/dz > 0, =1 otherwise |
---|
239 | ztpc = zempba_3d_1(ji,jj,jk) * zsum1(ji,jj) * zcoef & |
---|
240 | & + zempba_3d_2(ji,jj,jk) * zsum2(ji,jj) * ( 1. - zcoef ) |
---|
241 | ! |
---|
242 | zempba_3d(ji,jj,jk) = ztpc |
---|
243 | zsum (ji,jj) = zsum(ji,jj) + ztpc * e3w_n(ji,jj,jk) |
---|
244 | END DO |
---|
245 | END DO |
---|
246 | END DO |
---|
247 | DO jj = 1, jpj |
---|
248 | DO ji = 1, jpi |
---|
249 | IF( zsum(ji,jj) > 0.e0 ) zsum(ji,jj) = 1.e0 / zsum(ji,jj) |
---|
250 | END DO |
---|
251 | END DO |
---|
252 | |
---|
253 | ! ! first estimation bounded by 10 cm2/s (with n2 bounded by rn_n2min) |
---|
254 | zcoef = rn_tfe_itf / ( rn_tfe * rau0 ) |
---|
255 | DO jk = 1, jpk |
---|
256 | zavt_itf(:,:,jk) = MIN( 10.e-4, zcoef * en_tmx(:,:) * zsum(:,:) * zempba_3d(:,:,jk) & |
---|
257 | & / MAX( rn_n2min, rn2(:,:,jk) ) * tmask(:,:,jk) ) |
---|
258 | END DO |
---|
259 | |
---|
260 | zkz(:,:) = 0.e0 ! Associated potential energy consummed over the whole water column |
---|
261 | DO jk = 2, jpkm1 |
---|
262 | zkz(:,:) = zkz(:,:) + e3w_n(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * zavt_itf(:,:,jk) * tmask(:,:,jk) * tmask(:,:,jk-1) |
---|
263 | END DO |
---|
264 | |
---|
265 | DO jj = 1, jpj ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx |
---|
266 | DO ji = 1, jpi |
---|
267 | IF( zkz(ji,jj) /= 0.e0 ) zkz(ji,jj) = en_tmx(ji,jj) * rn_tfe_itf / rn_tfe / zkz(ji,jj) |
---|
268 | END DO |
---|
269 | END DO |
---|
270 | |
---|
271 | DO jk = 2, jpkm1 ! Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zavt_itf bound by 300 cm2/s |
---|
272 | zavt_itf(:,:,jk) = zavt_itf(:,:,jk) * MIN( zkz(:,:), 120./10. ) * tmask(:,:,jk) * tmask(:,:,jk-1) ! kz max = 120 cm2/s |
---|
273 | END DO |
---|
274 | |
---|
275 | IF( kt == nit000 ) THEN ! diagnose the nergy consumed by zavt_itf |
---|
276 | ztpc = 0.e0 |
---|
277 | DO jk= 1, jpk |
---|
278 | DO jj= 1, jpj |
---|
279 | DO ji= 1, jpi |
---|
280 | ztpc = ztpc + e1t(ji,jj) * e2t(ji,jj) * e3w_n(ji,jj,jk) * MAX( 0.e0, rn2(ji,jj,jk) ) & |
---|
281 | & * zavt_itf(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
282 | END DO |
---|
283 | END DO |
---|
284 | END DO |
---|
285 | ztpc= rau0 * ztpc / ( rn_me * rn_tfe_itf ) |
---|
286 | IF(lwp) WRITE(numout,*) ' N Total power consumption by zavt_itf: ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
287 | ENDIF |
---|
288 | |
---|
289 | ! ! Update pav with the ITF mixing coefficient |
---|
290 | DO jk = 2, jpkm1 |
---|
291 | pav(:,:,jk) = pav (:,:,jk) * ( 1.e0 - mask_itf(:,:) ) & |
---|
292 | & + zavt_itf(:,:,jk) * mask_itf(:,:) |
---|
293 | END DO |
---|
294 | ! |
---|
295 | END SUBROUTINE tmx_itf |
---|
296 | |
---|
297 | |
---|
298 | SUBROUTINE zdf_tmx_init |
---|
299 | !!---------------------------------------------------------------------- |
---|
300 | !! *** ROUTINE zdf_tmx_init *** |
---|
301 | !! |
---|
302 | !! ** Purpose : Initialization of the vertical tidal mixing, Reading |
---|
303 | !! of M2 and K1 tidal energy in nc files |
---|
304 | !! |
---|
305 | !! ** Method : - Read the namtmx namelist and check the parameters |
---|
306 | !! |
---|
307 | !! - Read the input data in NetCDF files : |
---|
308 | !! M2 and K1 tidal energy. The total tidal energy, en_tmx, |
---|
309 | !! is the sum of M2, K1 and S2 energy where S2 is assumed |
---|
310 | !! to be: S2=(1/2)^2 * M2 |
---|
311 | !! mask_itf, a mask array that determine where substituing |
---|
312 | !! the standard Simmons et al. (2005) formulation with the |
---|
313 | !! one of Koch_Larrouy et al. (2007). |
---|
314 | !! |
---|
315 | !! - Compute az_tmx, a 3D coefficient that allows to compute |
---|
316 | !! the standard tidal-induced vertical mixing as follows: |
---|
317 | !! Kz_tides = az_tmx / max( rn_n2min, N^2 ) |
---|
318 | !! with az_tmx a bottom intensified coefficient is given by: |
---|
319 | !! az_tmx(z) = en_tmx / ( rau0 * rn_htmx ) * EXP( -(H-z)/rn_htmx ) |
---|
320 | !! / ( 1. - EXP( - H /rn_htmx ) ) |
---|
321 | !! where rn_htmx the characteristic length scale of the bottom |
---|
322 | !! intensification, en_tmx the tidal energy, and H the ocean depth |
---|
323 | !! |
---|
324 | !! ** input : - Namlist namtmx |
---|
325 | !! - NetCDF file : M2_ORCA2.nc, K1_ORCA2.nc, and mask_itf.nc |
---|
326 | !! |
---|
327 | !! ** Action : - Increase by 1 the nstop flag is setting problem encounter |
---|
328 | !! - defined az_tmx used to compute tidal-induced mixing |
---|
329 | !! |
---|
330 | !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. |
---|
331 | !! Koch-Larrouy et al. 2007, GRL. |
---|
332 | !!---------------------------------------------------------------------- |
---|
333 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
334 | INTEGER :: inum ! local integer |
---|
335 | INTEGER :: ios |
---|
336 | REAL(wp) :: ztpc, ze_z ! local scalars |
---|
337 | REAL(wp), DIMENSION(jpi,jpj) :: zem2, zek1 ! read M2 and K1 tidal energy |
---|
338 | REAL(wp), DIMENSION(jpi,jpj) :: zkz ! total M2, K1 and S2 tidal energy |
---|
339 | REAL(wp), DIMENSION(jpi,jpj) :: zfact ! used for vertical structure function |
---|
340 | REAL(wp), DIMENSION(jpi,jpj) :: zhdep ! Ocean depth |
---|
341 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpc ! power consumption |
---|
342 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zav_tide ! tidal mixing coefficient |
---|
343 | !! |
---|
344 | NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf |
---|
345 | !!---------------------------------------------------------------------- |
---|
346 | ! |
---|
347 | |
---|
348 | REWIND( numnam_ref ) ! Namelist namzdf_tmx in reference namelist : Tidal Mixing |
---|
349 | READ ( numnam_ref, namzdf_tmx, IOSTAT = ios, ERR = 901) |
---|
350 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist', lwp ) |
---|
351 | |
---|
352 | REWIND( numnam_cfg ) ! Namelist namzdf_tmx in configuration namelist : Tidal Mixing |
---|
353 | READ ( numnam_cfg, namzdf_tmx, IOSTAT = ios, ERR = 902 ) |
---|
354 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist', lwp ) |
---|
355 | IF(lwm) WRITE ( numond, namzdf_tmx ) |
---|
356 | |
---|
357 | IF(lwp) THEN ! Control print |
---|
358 | WRITE(numout,*) |
---|
359 | WRITE(numout,*) 'zdf_tmx_init : tidal mixing' |
---|
360 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
361 | WRITE(numout,*) ' Namelist namzdf_tmx : set tidal mixing parameters' |
---|
362 | WRITE(numout,*) ' Vertical decay scale for turbulence = ', rn_htmx |
---|
363 | WRITE(numout,*) ' Brunt-Vaisala frequency threshold = ', rn_n2min |
---|
364 | WRITE(numout,*) ' Tidal dissipation efficiency = ', rn_tfe |
---|
365 | WRITE(numout,*) ' Mixing efficiency = ', rn_me |
---|
366 | WRITE(numout,*) ' ITF specific parameterisation = ', ln_tmx_itf |
---|
367 | WRITE(numout,*) ' ITF tidal dissipation efficiency = ', rn_tfe_itf |
---|
368 | ENDIF |
---|
369 | |
---|
370 | ! ! allocate tmx arrays |
---|
371 | IF( zdf_tmx_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' ) |
---|
372 | |
---|
373 | IF( ln_tmx_itf ) THEN ! read the Indonesian Through Flow mask |
---|
374 | CALL iom_open('mask_itf',inum) |
---|
375 | CALL iom_get (inum, jpdom_data, 'tmaskitf',mask_itf,1) ! |
---|
376 | CALL iom_close(inum) |
---|
377 | ENDIF |
---|
378 | |
---|
379 | ! read M2 tidal energy flux : W/m2 ( zem2 < 0 ) |
---|
380 | CALL iom_open('M2rowdrg',inum) |
---|
381 | CALL iom_get (inum, jpdom_data, 'field',zem2,1) ! |
---|
382 | CALL iom_close(inum) |
---|
383 | |
---|
384 | ! read K1 tidal energy flux : W/m2 ( zek1 < 0 ) |
---|
385 | CALL iom_open('K1rowdrg',inum) |
---|
386 | CALL iom_get (inum, jpdom_data, 'field',zek1,1) ! |
---|
387 | CALL iom_close(inum) |
---|
388 | |
---|
389 | ! Total tidal energy ( M2, S2 and K1 with S2=(1/2)^2 * M2 ) |
---|
390 | ! only the energy available for mixing is taken into account, |
---|
391 | ! (mixing efficiency tidal dissipation efficiency) |
---|
392 | en_tmx(:,:) = - rn_tfe * rn_me * ( zem2(:,:) * 1.25 + zek1(:,:) ) * ssmask(:,:) |
---|
393 | |
---|
394 | !============ |
---|
395 | !TG: Bug for VVL? Should this section be moved out of _init and be updated at every timestep? |
---|
396 | ! Vertical structure (az_tmx) |
---|
397 | DO jj = 1, jpj ! part independent of the level |
---|
398 | DO ji = 1, jpi |
---|
399 | zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1) ! depth of the ocean |
---|
400 | zfact(ji,jj) = rau0 * rn_htmx * ( 1. - EXP( -zhdep(ji,jj) / rn_htmx ) ) |
---|
401 | IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = en_tmx(ji,jj) / zfact(ji,jj) |
---|
402 | END DO |
---|
403 | END DO |
---|
404 | DO jk= 1, jpk ! complete with the level-dependent part |
---|
405 | DO jj = 1, jpj |
---|
406 | DO ji = 1, jpi |
---|
407 | az_tmx(ji,jj,jk) = zfact(ji,jj) * EXP( -( zhdep(ji,jj)-gdepw_0(ji,jj,jk) ) / rn_htmx ) * tmask(ji,jj,jk) |
---|
408 | END DO |
---|
409 | END DO |
---|
410 | END DO |
---|
411 | !=========== |
---|
412 | |
---|
413 | IF( nprint == 1 .AND. lwp ) THEN |
---|
414 | ! Control print |
---|
415 | ! Total power consumption due to vertical mixing |
---|
416 | ! zpc = rau0 * 1/rn_me * rn2 * zav_tide |
---|
417 | zav_tide(:,:,:) = 0.e0 |
---|
418 | DO jk = 2, jpkm1 |
---|
419 | zav_tide(:,:,jk) = az_tmx(:,:,jk) / MAX( rn_n2min, rn2(:,:,jk) ) |
---|
420 | END DO |
---|
421 | |
---|
422 | ztpc = 0.e0 |
---|
423 | zpc(:,:,:) = MAX(rn_n2min,rn2(:,:,:)) * zav_tide(:,:,:) |
---|
424 | DO jk= 2, jpkm1 |
---|
425 | DO jj = 1, jpj |
---|
426 | DO ji = 1, jpi |
---|
427 | ztpc = ztpc + e3w_0(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) * zpc(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
428 | END DO |
---|
429 | END DO |
---|
430 | END DO |
---|
431 | ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc |
---|
432 | |
---|
433 | WRITE(numout,*) |
---|
434 | WRITE(numout,*) ' Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
435 | |
---|
436 | |
---|
437 | ! control print 2 |
---|
438 | zav_tide(:,:,:) = MIN( zav_tide(:,:,:), 60.e-4 ) |
---|
439 | zkz(:,:) = 0.e0 |
---|
440 | DO jk = 2, jpkm1 |
---|
441 | DO jj = 1, jpj |
---|
442 | DO ji = 1, jpi |
---|
443 | zkz(ji,jj) = zkz(ji,jj) + e3w_0(ji,jj,jk) * MAX(0.e0, rn2(ji,jj,jk)) * rau0 * zav_tide(ji,jj,jk) * wmask(ji,jj,jk) |
---|
444 | END DO |
---|
445 | END DO |
---|
446 | END DO |
---|
447 | ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz |
---|
448 | DO jj = 1, jpj |
---|
449 | DO ji = 1, jpi |
---|
450 | IF( zkz(ji,jj) /= 0.e0 ) THEN |
---|
451 | zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) |
---|
452 | ENDIF |
---|
453 | END DO |
---|
454 | END DO |
---|
455 | ztpc = 1.e50 |
---|
456 | DO jj = 1, jpj |
---|
457 | DO ji = 1, jpi |
---|
458 | IF( zkz(ji,jj) /= 0.e0 ) THEN |
---|
459 | ztpc = Min( zkz(ji,jj), ztpc) |
---|
460 | ENDIF |
---|
461 | END DO |
---|
462 | END DO |
---|
463 | WRITE(numout,*) ' Min de zkz ', ztpc, ' Max = ', maxval(zkz(:,:) ) |
---|
464 | |
---|
465 | DO jk = 2, jpkm1 |
---|
466 | DO jj = 1, jpj |
---|
467 | DO ji = 1, jpi |
---|
468 | zav_tide(ji,jj,jk) = zav_tide(ji,jj,jk) * MIN( zkz(ji,jj), 30./6. ) * wmask(ji,jj,jk) !kz max = 300 cm2/s |
---|
469 | END DO |
---|
470 | END DO |
---|
471 | END DO |
---|
472 | ztpc = 0.e0 |
---|
473 | zpc(:,:,:) = Max(0.e0,rn2(:,:,:)) * zav_tide(:,:,:) |
---|
474 | DO jk= 1, jpk |
---|
475 | DO jj = 1, jpj |
---|
476 | DO ji = 1, jpi |
---|
477 | ztpc = ztpc + e3w_0(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) * zpc(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
478 | END DO |
---|
479 | END DO |
---|
480 | END DO |
---|
481 | ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc |
---|
482 | WRITE(numout,*) ' 2 Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
483 | |
---|
484 | DO jk = 1, jpk |
---|
485 | ze_z = SUM( e1t(:,:) * e2t(:,:) * zav_tide(:,:,jk) * tmask_i(:,:) ) & |
---|
486 | & / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) ) |
---|
487 | ztpc = 1.E50 |
---|
488 | DO jj = 1, jpj |
---|
489 | DO ji = 1, jpi |
---|
490 | IF( zav_tide(ji,jj,jk) /= 0.e0 ) ztpc =Min( ztpc, zav_tide(ji,jj,jk) ) |
---|
491 | END DO |
---|
492 | END DO |
---|
493 | WRITE(numout,*) ' N2 min - jk= ', jk,' ', ze_z * 1.e4,' cm2/s min= ',ztpc*1.e4, & |
---|
494 | & 'max= ', MAXVAL(zav_tide(:,:,jk) )*1.e4, ' cm2/s' |
---|
495 | END DO |
---|
496 | |
---|
497 | WRITE(numout,*) ' e_tide : ', SUM( e1t*e2t*en_tmx ) / ( rn_tfe * rn_me ) * 1.e-12, 'TW' |
---|
498 | WRITE(numout,*) |
---|
499 | WRITE(numout,*) ' Initial profile of tidal vertical mixing' |
---|
500 | DO jk = 1, jpk |
---|
501 | DO jj = 1,jpj |
---|
502 | DO ji = 1,jpi |
---|
503 | zkz(ji,jj) = az_tmx(ji,jj,jk) /MAX( rn_n2min, rn2(ji,jj,jk) ) |
---|
504 | END DO |
---|
505 | END DO |
---|
506 | ze_z = SUM( e1t(:,:) * e2t(:,:) * zkz(:,:) * tmask_i(:,:) ) & |
---|
507 | & / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) ) |
---|
508 | WRITE(numout,*) ' jk= ', jk,' ', ze_z * 1.e4,' cm2/s' |
---|
509 | END DO |
---|
510 | DO jk = 1, jpk |
---|
511 | zkz(:,:) = az_tmx(:,:,jk) /rn_n2min |
---|
512 | ze_z = SUM( e1t(:,:) * e2t(:,:) * zkz(:,:) * tmask_i(:,:) ) & |
---|
513 | & / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) ) |
---|
514 | WRITE(numout,*) |
---|
515 | WRITE(numout,*) ' N2 min - jk= ', jk,' ', ze_z * 1.e4,' cm2/s min= ',MINVAL(zkz)*1.e4, & |
---|
516 | & 'max= ', MAXVAL(zkz)*1.e4, ' cm2/s' |
---|
517 | END DO |
---|
518 | ! |
---|
519 | ENDIF |
---|
520 | ! |
---|
521 | END SUBROUTINE zdf_tmx_init |
---|
522 | |
---|
523 | !!====================================================================== |
---|
524 | END MODULE zdftmx |
---|