1 | ! |
---|
2 | ! |
---|
3 | ! |
---|
4 | SUBROUTINE thermcell_plume(itap,ngrid,nlay,ptimestep,ztv, & |
---|
5 | zthl,po,zl,rhobarz,zlev,pplev,pphi,zpspsk, & |
---|
6 | alim_star,alim_star_tot,lalim,f0,detr_star, & |
---|
7 | entr_star,f_star,ztva,ztla,zqla,zqta,zha, & |
---|
8 | zw2,w_est,ztva_est,zqsatth,lmix,lmix_bis, & |
---|
9 | lmin,lev_out,lunout1,igout) |
---|
10 | |
---|
11 | |
---|
12 | !============================================================================== |
---|
13 | ! thermcell_plume: calcule les valeurs de qt, thetal et w dans l ascendance |
---|
14 | ! AB : ql means "liquid water mass mixing ratio" |
---|
15 | ! qt means "total water mass mixing ratio" |
---|
16 | ! TP means "potential temperature" |
---|
17 | ! TRPV means "virtual potential temperature with latent heat release" |
---|
18 | ! TPV means "virtual potential temperature" |
---|
19 | ! TR means "temperature with latent heat release" |
---|
20 | !============================================================================== |
---|
21 | |
---|
22 | USE print_control_mod, ONLY: prt_level |
---|
23 | USE watercommon_h, ONLY: RLvCp, RETV, Psat_water |
---|
24 | USE thermcell_mod |
---|
25 | |
---|
26 | IMPLICIT NONE |
---|
27 | |
---|
28 | |
---|
29 | !============================================================================== |
---|
30 | ! Declaration |
---|
31 | !============================================================================== |
---|
32 | |
---|
33 | ! Inputs: |
---|
34 | ! ------- |
---|
35 | |
---|
36 | INTEGER itap |
---|
37 | INTEGER ngrid |
---|
38 | INTEGER nlay |
---|
39 | INTEGER lunout1 |
---|
40 | INTEGER igout |
---|
41 | INTEGER lev_out ! niveau pour les print |
---|
42 | |
---|
43 | REAL ptimestep ! time step |
---|
44 | REAL ztv(ngrid,nlay) ! TRPV environment |
---|
45 | REAL zthl(ngrid,nlay) ! TP environment |
---|
46 | REAL po(ngrid,nlay) ! qt environment |
---|
47 | REAL zl(ngrid,nlay) ! ql environment |
---|
48 | REAL rhobarz(ngrid,nlay) ! levels density |
---|
49 | REAL zlev(ngrid,nlay+1) ! levels altitude |
---|
50 | REAL pplev(ngrid,nlay+1) ! levels pressure |
---|
51 | REAL pphi(ngrid,nlay) ! geopotential |
---|
52 | REAL zpspsk(ngrid,nlay) ! Exner function |
---|
53 | |
---|
54 | ! Outputs: |
---|
55 | ! -------- |
---|
56 | |
---|
57 | INTEGER lmin(ngrid) ! plume base level (first unstable level) |
---|
58 | INTEGER lalim(ngrid) ! higher alimentation level |
---|
59 | INTEGER lmix(ngrid) ! maximum vertical speed level |
---|
60 | INTEGER lmix_bis(ngrid) ! maximum vertical speed level (modified) |
---|
61 | |
---|
62 | REAL alim_star(ngrid,nlay) ! normalized alimentation |
---|
63 | REAL alim_star_tot(ngrid) ! integrated alimentation |
---|
64 | |
---|
65 | REAL f0(ngrid) ! previous time step mass flux norm |
---|
66 | |
---|
67 | REAL detr_star(ngrid,nlay) ! normalized detrainment |
---|
68 | REAL entr_star(ngrid,nlay) ! normalized entrainment |
---|
69 | REAL f_star(ngrid,nlay+1) ! normalized mass flux |
---|
70 | |
---|
71 | REAL ztva(ngrid,nlay) ! TRPV plume (after mixing) |
---|
72 | REAL ztva_est(ngrid,nlay) ! TRPV plume (before mixing) |
---|
73 | REAL ztla(ngrid,nlay) ! TP plume |
---|
74 | REAL zqla(ngrid,nlay) ! ql plume (after mixing) |
---|
75 | REAL zqta(ngrid,nlay) ! qt plume |
---|
76 | REAL zha(ngrid,nlay) ! TRPV plume |
---|
77 | |
---|
78 | REAL w_est(ngrid,nlay+1) ! updraft square vertical speed (before mixing) |
---|
79 | REAL zw2(ngrid,nlay+1) ! updraft square vertical speed (after mixing) |
---|
80 | |
---|
81 | REAL zqsatth(ngrid,nlay) ! saturation vapor pressure (after mixing) |
---|
82 | |
---|
83 | ! Local: |
---|
84 | ! ------ |
---|
85 | |
---|
86 | INTEGER ig, l, k |
---|
87 | INTEGER lt |
---|
88 | INTEGER lm |
---|
89 | |
---|
90 | REAL zqla_est(ngrid,nlay) ! ql plume (before mixing) |
---|
91 | REAL zta_est(ngrid,nlay) ! TR plume (before mixing) |
---|
92 | REAL zbuoy(ngrid,nlay) ! plume buoyancy |
---|
93 | REAL zbuoyjam(ngrid,nlay) ! plume buoyancy (modified) |
---|
94 | |
---|
95 | REAL ztemp(ngrid) ! temperature for saturation vapor pressure computation in plume |
---|
96 | REAL zqsat(ngrid) ! saturation vapor pressure (before mixing) |
---|
97 | REAL zdz ! layers height |
---|
98 | REAL ztv2(ngrid,nlay) ! ztv + d_temp * Dirac(l=lmin) |
---|
99 | |
---|
100 | REAL zalpha ! |
---|
101 | REAL zdqt(ngrid,nlay) ! |
---|
102 | REAL zbetalpha ! |
---|
103 | REAL zdw2 ! |
---|
104 | REAL zdw2bis ! |
---|
105 | REAL zw2fact ! |
---|
106 | REAL zw2factbis ! |
---|
107 | REAL zw2m ! |
---|
108 | REAL zdzbis ! |
---|
109 | REAL coefzlmel ! |
---|
110 | REAL zdz2 ! |
---|
111 | REAL zdz3 ! |
---|
112 | REAL lmel ! |
---|
113 | REAL zlmel ! |
---|
114 | REAL zlmelup ! |
---|
115 | REAL zlmeldwn ! |
---|
116 | REAL zlt ! |
---|
117 | REAL zltdwn ! |
---|
118 | REAL zltup ! useless here |
---|
119 | |
---|
120 | REAL psat ! dummy argument for Psat_water() |
---|
121 | |
---|
122 | LOGICAL active(ngrid) ! if the plume is active at ig,l (speed and incoming mass flux > 0 or l=lmin) |
---|
123 | LOGICAL activetmp(ngrid) ! if the plus is active at ig,l (active=true and outgoing mass flux > 0) |
---|
124 | LOGICAL, SAVE :: first = .true. ! if it is the first time step |
---|
125 | |
---|
126 | !$OMP THREADPRIVATE(first) |
---|
127 | |
---|
128 | !============================================================================== |
---|
129 | ! Initialization |
---|
130 | !============================================================================== |
---|
131 | |
---|
132 | zbetalpha = betalpha / (1. + betalpha) |
---|
133 | |
---|
134 | ztva(:,:) = ztv(:,:) ! ztva is set to the virtual potential temperature without latent heat release |
---|
135 | ztva_est(:,:) = ztva(:,:) ! ztva_est is set to the virtual potential temperature without latent heat release |
---|
136 | ztla(:,:) = zthl(:,:) ! ztla is set to the potential temperature |
---|
137 | zqta(:,:) = po(:,:) ! zqta is set to qt |
---|
138 | zqla(:,:) = 0. ! zqla is set to ql |
---|
139 | zqla_est(:,:) = 0. ! zqla_est is set to ql |
---|
140 | zha(:,:) = ztva(:,:) ! zha is set to the plume virtual potential temperature without latent heat release |
---|
141 | |
---|
142 | zqsat(:) = 0. |
---|
143 | zqsatth(:,:) = 0. |
---|
144 | |
---|
145 | w_est(:,:) = 0. |
---|
146 | zw2(:,:) = 0. |
---|
147 | |
---|
148 | zbuoy(:,:) = 0. |
---|
149 | zbuoyjam(:,:) = 0. |
---|
150 | |
---|
151 | f_star(:,:) = 0. |
---|
152 | detr_star(:,:) = 0. |
---|
153 | entr_star(:,:) = 0. |
---|
154 | alim_star(:,:) = 0. |
---|
155 | alim_star_tot(:) = 0. |
---|
156 | |
---|
157 | lmix(:) = 1 |
---|
158 | lmix_bis(:) = 2 |
---|
159 | lalim(:) = 1 |
---|
160 | lmin(:) = linf |
---|
161 | |
---|
162 | ztv2(:,:) = ztv(:,:) |
---|
163 | ztv2(:,linf) = ztv(:,linf) + d_temp |
---|
164 | |
---|
165 | !============================================================================== |
---|
166 | ! 0. Calcul de l'alimentation |
---|
167 | !============================================================================== |
---|
168 | |
---|
169 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
170 | ! AB : Convective plumes can go off from every layer above the linf-th and |
---|
171 | ! where pressure is lesser than pres_limit (cf. thermcell_plume). |
---|
172 | ! The second constraint is added to avoid the parametrization occurs too |
---|
173 | ! high when the low atmosphere is stable. |
---|
174 | ! However, once there is a triggered plume, it can rise as high as its |
---|
175 | ! velocity allows it (it can overshoot). |
---|
176 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
177 | DO ig=1,ngrid |
---|
178 | active(ig) = .false. |
---|
179 | l = linf |
---|
180 | DO WHILE ((.not.active(ig)) .and. pplev(ig,l+1).gt.pres_limit .and. l.lt.nlay) |
---|
181 | IF (ztv2(ig,l).gt.ztv2(ig,l+1)) THEN |
---|
182 | active(ig) = .true. |
---|
183 | lmin(ig) = l |
---|
184 | ENDIF |
---|
185 | l = l + 1 |
---|
186 | ENDDO |
---|
187 | ENDDO |
---|
188 | |
---|
189 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
190 | ! AB : On pourrait n'appeler thermcell_alim que si la plume est active |
---|
191 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
192 | CALL thermcell_alim(ngrid,nlay,ztv2,zlev,alim_star,lalim,lmin) |
---|
193 | |
---|
194 | !============================================================================== |
---|
195 | ! 1. Calcul dans la premiere couche |
---|
196 | !============================================================================== |
---|
197 | |
---|
198 | DO ig=1,ngrid |
---|
199 | IF (active(ig)) THEN |
---|
200 | |
---|
201 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
202 | ! AB : plume takes the environment features for every layer below lmin. |
---|
203 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
204 | DO l=1,lmin(ig) |
---|
205 | ztla(ig,l) = zthl(ig,l) |
---|
206 | zqta(ig,l) = po(ig,l) |
---|
207 | zqla(ig,l) = zl(ig,l) |
---|
208 | ENDDO |
---|
209 | |
---|
210 | l = lmin(ig) |
---|
211 | f_star(ig,l+1) = alim_star(ig,l) |
---|
212 | |
---|
213 | zw2(ig,l+1) = 2. * RG * (zlev(ig,l+1) - zlev(ig,l)) & |
---|
214 | & * (ztv2(ig,l) - ztv2(ig,l+1)) / ztv2(ig,l+1) |
---|
215 | |
---|
216 | w_est(ig,l+1) = zw2(ig,l+1) |
---|
217 | ENDIF |
---|
218 | ENDDO |
---|
219 | |
---|
220 | !============================================================================== |
---|
221 | ! 2. Boucle de calcul de la vitesse verticale dans le thermique |
---|
222 | !============================================================================== |
---|
223 | |
---|
224 | DO l=2,nlay-1 |
---|
225 | |
---|
226 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
227 | ! AB : we decide here if the plume is still active or not. When the plume's |
---|
228 | ! first level is reached, we set active to "true". Otherwise, it is given |
---|
229 | ! by zw2, f_star, alim_star and entr_star. |
---|
230 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
231 | DO ig=1,ngrid |
---|
232 | IF (l==lmin(ig)+1) THEN |
---|
233 | active(ig) = .true. |
---|
234 | ENDIF |
---|
235 | |
---|
236 | active(ig) = active(ig) & |
---|
237 | & .and. zw2(ig,l)>1.e-10 & |
---|
238 | & .and. f_star(ig,l)+alim_star(ig,l)+entr_star(ig,l)>1.e-10 |
---|
239 | ENDDO |
---|
240 | |
---|
241 | ztemp(:) = zpspsk(:,l) * ztla(:,l-1) |
---|
242 | |
---|
243 | DO ig=1,ngrid |
---|
244 | CALL Psat_water(ztemp(ig), pplev(ig,l), psat, zqsat(ig)) |
---|
245 | ENDDO |
---|
246 | |
---|
247 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
248 | ! AB : we compute thermodynamical values and speed in the plume in the layer l |
---|
249 | ! without mixing with environment. |
---|
250 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
251 | |
---|
252 | DO ig=1,ngrid |
---|
253 | IF (active(ig)) THEN |
---|
254 | zqla_est(ig,l) = max(0.,zqta(ig,l-1)-zqsat(ig)) ! zqla_est set to ql plume |
---|
255 | ztva_est(ig,l) = ztla(ig,l-1)*zpspsk(ig,l)+RLvCp*zqla_est(ig,l) ! ztva_est set to TR plume |
---|
256 | zta_est(ig,l) = ztva_est(ig,l) ! zta_est set to TR plume |
---|
257 | ztva_est(ig,l) = ztva_est(ig,l)/zpspsk(ig,l) ! ztva_est set to TRP plume |
---|
258 | ztva_est(ig,l) = ztva_est(ig,l)*(1.+RETV*(zqta(ig,l-1) & ! ztva_est set to TRPV plume |
---|
259 | & - zqla_est(ig,l))-zqla_est(ig,l)) |
---|
260 | |
---|
261 | zbuoy(ig,l) = RG * (ztva_est(ig,l)-ztv(ig,l)) / ztv(ig,l) |
---|
262 | zdz = zlev(ig,l+1) - zlev(ig,l) |
---|
263 | |
---|
264 | !============================================================================== |
---|
265 | ! 3. Calcul de la flotabilite modifiee par melange avec l'air au dessus |
---|
266 | !============================================================================== |
---|
267 | |
---|
268 | lmel = fact_thermals_ed_dz * zlev(ig,l) |
---|
269 | zlmel = zlev(ig,l) + lmel |
---|
270 | lt = l + 1 |
---|
271 | zlt = zlev(ig,lt) |
---|
272 | zdz2 = zlev(ig,lt) - zlev(ig,l) |
---|
273 | |
---|
274 | DO while (lmel.gt.zdz2) |
---|
275 | lt = lt + 1 |
---|
276 | zlt = zlev(ig,lt) |
---|
277 | zdz2 = zlev(ig,lt) - zlev(ig,l) |
---|
278 | ENDDO |
---|
279 | |
---|
280 | ! IF (lt-l.gt.1) THEN |
---|
281 | ! print *, 'WARNING: lt is greater than l+1!' |
---|
282 | ! print *, 'l,lt', l, lt |
---|
283 | ! ENDIF |
---|
284 | |
---|
285 | zdz3 = zlev(ig,lt+1) - zlt |
---|
286 | zltdwn = zlev(ig,lt) - zdz3 / 2 |
---|
287 | zlmelup = zlmel + (zdz / 2) |
---|
288 | coefzlmel = Min(1.,(zlmelup - zltdwn) / zdz) |
---|
289 | |
---|
290 | zbuoyjam(ig,l) = 1.* RG * (coefzlmel * & |
---|
291 | & (ztva_est(ig,l) - ztv(ig,lt)) / ztv(ig,lt) & |
---|
292 | & + (1. - coefzlmel) * & |
---|
293 | & (ztva_est(ig,l) - ztv(ig,lt-1)) / ztv(ig,lt-1)) & |
---|
294 | & + 0. * zbuoy(ig,l) |
---|
295 | |
---|
296 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
297 | ! AB : initial formulae |
---|
298 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
299 | ! zw2fact = fact_epsilon * 2. * zdz / (1. + betalpha) |
---|
300 | ! zdw2 = afact * zbuoy(ig,l) / fact_epsilon |
---|
301 | ! zdw2bis = afact * zbuoy(ig,l-1) / fact_epsilon |
---|
302 | ! w_est(ig,l+1) = Max(0.0001,exp(-zw2fact)*(w_est(ig,l)-zdw2)+zdw2) |
---|
303 | ! w_est(ig,l+1) = Max(0.0001,exp(-zw2fact)*(w_est(ig,l)-zdw2bis)+zdw2) |
---|
304 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
305 | ! AB : own derivation for w_est (Rio 2010 formula with e=d=0) |
---|
306 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
307 | ! zw2fact = 2. * fact_epsilon * zdz |
---|
308 | ! zdw2 = 2. * afact * zbuoy(ig,l) * zdz |
---|
309 | zw2fact = 2. * fact_epsilon * zdz / (1. + betalpha) |
---|
310 | zdw2 = 2. * afact * zbuoy(ig,l) * zdz / (1. + betalpha) |
---|
311 | w_est(ig,l+1) = Max(0., exp(-zw2fact) * w_est(ig,l) + zdw2) |
---|
312 | |
---|
313 | ! IF (w_est(ig,l+1).le.0.) THEN |
---|
314 | ! print *, 'WARNING: w_est is negative!' |
---|
315 | ! print *, 'l,w_est', l+1, w_est(ig,l+1) |
---|
316 | ! ENDIF |
---|
317 | ENDIF |
---|
318 | ENDDO |
---|
319 | |
---|
320 | !============================================================================== |
---|
321 | ! 4. Calcul de l'entrainement et du detrainement |
---|
322 | !============================================================================== |
---|
323 | |
---|
324 | DO ig=1,ngrid |
---|
325 | IF (active(ig)) THEN |
---|
326 | |
---|
327 | zdz = zlev(ig,l+1) - zlev(ig,l) |
---|
328 | |
---|
329 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
330 | ! AB : The next test is added to avoid divisions by zero when w_est vanishes. |
---|
331 | ! Indeed, entr and detr computed here are of no importance because w_est |
---|
332 | ! <= 0 means it will be the last layer reached by the plume and then they |
---|
333 | ! will be reset in thermcell_flux. |
---|
334 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
335 | IF (w_est(ig,l+1).eq.0.) THEN |
---|
336 | zw2m = 1. |
---|
337 | zalpha = 0. |
---|
338 | ELSE |
---|
339 | zw2m = w_est(ig,l+1) |
---|
340 | zalpha = f0(ig) * f_star(ig,l) / sqrt(w_est(ig,l+1)) / rhobarz(ig,l) |
---|
341 | ENDIF |
---|
342 | |
---|
343 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
344 | ! AB : The next test is added to avoid a division by zero if there is no water |
---|
345 | ! in the environment. |
---|
346 | ! In the case where there is no water in the env. but water in the plume |
---|
347 | ! (ascending from depth) we set the effect on detrainment equal to zero |
---|
348 | ! but at the next time step, po will be positive thanks to the mixing and |
---|
349 | ! then the physical effect of the water gradient will be taken on board. |
---|
350 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
351 | IF (po(ig,l).lt.1.e-6) THEN |
---|
352 | ! print *, 'WARNING: po=0 in layer',l,'!' |
---|
353 | ! print *, 'po,zqta', po(ig,l), zqta(ig,l-1) |
---|
354 | zdqt(ig,l) = 0.0 |
---|
355 | ELSE |
---|
356 | zdqt(ig,l) = max(zqta(ig,l-1)-po(ig,l),0.) / po(ig,l) |
---|
357 | ENDIF |
---|
358 | |
---|
359 | !------------------------------------------------------------------------------ |
---|
360 | ! Detrainment |
---|
361 | !------------------------------------------------------------------------------ |
---|
362 | |
---|
363 | detr_star(ig,l) = f_star(ig,l) * zdz * ( & |
---|
364 | & mix0 * 0.1 / (zalpha + 0.001) & |
---|
365 | & + MAX(detr_min, & |
---|
366 | & -afact * zbetalpha * zbuoyjam(ig,l) / zw2m & |
---|
367 | & + detr_q_coef*(zdqt(ig,l)/zw2m)**detr_q_power) ) |
---|
368 | |
---|
369 | ! IF (detr_star(ig,l).lt.0.) THEN |
---|
370 | ! print *, 'WARNING: detrainment is negative!' |
---|
371 | ! print *, 'l,detr', l, detr_star(ig,l) |
---|
372 | ! ENDIF |
---|
373 | |
---|
374 | !------------------------------------------------------------------------------ |
---|
375 | ! Entrainment |
---|
376 | !------------------------------------------------------------------------------ |
---|
377 | |
---|
378 | entr_star(ig,l) = f_star(ig,l) * zdz * ( & |
---|
379 | & mix0 * 0.1 / (zalpha+0.001) & |
---|
380 | & + MAX(entr_min, & |
---|
381 | & zbetalpha * afact * zbuoyjam(ig,l) / zw2m & |
---|
382 | & - zbetalpha * fact_epsilon) ) |
---|
383 | |
---|
384 | ! IF (entr_star(ig,l).lt.0.) THEN |
---|
385 | ! print *, 'WARNING: entrainment is negative!' |
---|
386 | ! print *, 'l,entr', l, entr_star(ig,l) |
---|
387 | ! ENDIF |
---|
388 | |
---|
389 | !------------------------------------------------------------------------------ |
---|
390 | ! Alimentation and entrainment |
---|
391 | !------------------------------------------------------------------------------ |
---|
392 | |
---|
393 | IF (l.lt.lalim(ig)) THEN |
---|
394 | alim_star(ig,l) = max(alim_star(ig,l),entr_star(ig,l)) |
---|
395 | entr_star(ig,l) = 0. |
---|
396 | ENDIF |
---|
397 | |
---|
398 | !------------------------------------------------------------------------------ |
---|
399 | ! Mass flux |
---|
400 | !------------------------------------------------------------------------------ |
---|
401 | |
---|
402 | f_star(ig,l+1) = f_star(ig,l) + alim_star(ig,l) & |
---|
403 | & + entr_star(ig,l) - detr_star(ig,l) |
---|
404 | |
---|
405 | ! IF (f_star(ig,l+1).le.0.) THEN |
---|
406 | ! print *, 'WARNING: mass flux is negative!' |
---|
407 | ! print *, 'l,f_star', l+1, f_star(ig,l+1) |
---|
408 | ! ENDIF |
---|
409 | |
---|
410 | ENDIF |
---|
411 | ENDDO |
---|
412 | |
---|
413 | !============================================================================== |
---|
414 | ! 5. Calcul de la vitesse verticale en melangeant Tl et qt du thermique |
---|
415 | !============================================================================== |
---|
416 | |
---|
417 | activetmp(:) = active(:) .and. f_star(:,l+1)>1.e-10 |
---|
418 | |
---|
419 | !------------------------------------------------------------------------------ |
---|
420 | ! Calcul du melange avec l'environnement |
---|
421 | !------------------------------------------------------------------------------ |
---|
422 | |
---|
423 | DO ig=1,ngrid |
---|
424 | IF (activetmp(ig)) THEN |
---|
425 | ztla(ig,l) = (f_star(ig,l) * ztla(ig,l-1) & ! ztla is set to TP in plume (mixed) |
---|
426 | & + (alim_star(ig,l) + entr_star(ig,l)) * zthl(ig,l)) & |
---|
427 | & / (f_star(ig,l+1) + detr_star(ig,l)) |
---|
428 | zqta(ig,l) = (f_star(ig,l) * zqta(ig,l-1) + & ! zqta is set to qt in plume (mixed) |
---|
429 | & + (alim_star(ig,l) + entr_star(ig,l)) * po(ig,l)) & |
---|
430 | & / (f_star(ig,l+1) + detr_star(ig,l)) |
---|
431 | ENDIF |
---|
432 | ENDDO |
---|
433 | |
---|
434 | ztemp(:) = zpspsk(:,l) * ztla(:,l) |
---|
435 | |
---|
436 | DO ig=1,ngrid |
---|
437 | IF (activetmp(ig)) THEN |
---|
438 | CALL Psat_water(ztemp(ig), pplev(ig,l), psat, zqsatth(ig,l)) |
---|
439 | ENDIF |
---|
440 | ENDDO |
---|
441 | |
---|
442 | !------------------------------------------------------------------------------ |
---|
443 | ! Calcul de la vitesse verticale zw2 apres le melange |
---|
444 | !------------------------------------------------------------------------------ |
---|
445 | |
---|
446 | DO ig=1,ngrid |
---|
447 | IF (activetmp(ig)) THEN |
---|
448 | zqla(ig,l) = max(0.,zqta(ig,l)-zqsatth(ig,l)) ! zqla is set to ql plume (mixed) |
---|
449 | ztva(ig,l) = ztla(ig,l) * zpspsk(ig,l)+RLvCp*zqla(ig,l) ! ztva is set to TR plume (mixed) |
---|
450 | ztva(ig,l) = ztva(ig,l) / zpspsk(ig,l) ! ztva is set to TRP plume (mixed) |
---|
451 | zha(ig,l) = ztva(ig,l) ! zha is set to TRP plume (mixed) |
---|
452 | ztva(ig,l) = ztva(ig,l) * (1. + RETV*(zqta(ig,l)-zqla(ig,l)) & ! ztva is set to TRPV plume (mixed) |
---|
453 | & - zqla(ig,l)) |
---|
454 | |
---|
455 | zbuoy(ig,l) = RG * (ztva(ig,l) - ztv(ig,l)) / ztv(ig,l) |
---|
456 | zdz = zlev(ig,l+1) - zlev(ig,l) |
---|
457 | |
---|
458 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
459 | ! AB : initial formula |
---|
460 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
461 | ! zw2fact = fact_epsilon * 2. * zdz / (1. + betalpha) |
---|
462 | ! zdw2 = afact * zbuoy(ig,l) / fact_epsilon |
---|
463 | ! zw2(ig,l+1) = Max(0.0001,exp(-zw2fact)*(zw2(ig,l)-zdw2)+zdw2) |
---|
464 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
465 | ! AB : own derivation for zw2 (Rio 2010 formula) |
---|
466 | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
467 | ! zw2fact = 2. * (fact_epsilon * zdz + entr_star(ig,l) / f_star(ig,l)) |
---|
468 | ! zdw2 = 2. * afact * zbuoy(ig,l) * zdz |
---|
469 | zw2fact = 2. * fact_epsilon * zdz / (1. + betalpha) |
---|
470 | zdw2 = 2. * afact * zbuoy(ig,l) * zdz / (1. + betalpha) |
---|
471 | zw2(ig,l+1) = Max(0., exp(-zw2fact) * zw2(ig,l) + zdw2) |
---|
472 | |
---|
473 | ! IF (zw2(ig,l+1).le.0.) THEN |
---|
474 | ! print *, 'WARNING: zw2 is negative!' |
---|
475 | ! print *, 'l,zw2', l+1, zw2(ig,l+1) |
---|
476 | ! ENDIF |
---|
477 | ENDIF |
---|
478 | ENDDO |
---|
479 | |
---|
480 | ENDDO |
---|
481 | |
---|
482 | !============================================================================== |
---|
483 | ! 6. New computation of alim_star_tot |
---|
484 | !============================================================================== |
---|
485 | |
---|
486 | DO ig=1,ngrid |
---|
487 | alim_star_tot(ig) = 0. |
---|
488 | ENDDO |
---|
489 | |
---|
490 | DO ig=1,ngrid |
---|
491 | DO l=1,lalim(ig)-1 |
---|
492 | alim_star_tot(ig) = alim_star_tot(ig) + alim_star(ig,l) |
---|
493 | ENDDO |
---|
494 | ENDDO |
---|
495 | |
---|
496 | |
---|
497 | RETURN |
---|
498 | END |
---|