1 | SUBROUTINE concvl(iflag_clos, & |
---|
2 | dtime, paprs, pplay, k_upper_cv, & |
---|
3 | t, q, t_wake, q_wake, s_wake, u, v, tra, ntra, & |
---|
4 | Ale, Alp, sig1, w01, & |
---|
5 | d_t, d_q, d_qcomp, d_u, d_v, d_tra, & |
---|
6 | rain, snow, kbas, ktop, sigd, & |
---|
7 | cbmf, plcl, plfc, wbeff, convoccur, & |
---|
8 | upwd, dnwd, dnwdbis, & |
---|
9 | Ma, mip, Vprecip, & |
---|
10 | cape, cin, tvp, Tconv, iflag, & |
---|
11 | pbase, bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr, & |
---|
12 | qcondc, wd, pmflxr, pmflxs, & |
---|
13 | !RomP >>> |
---|
14 | !! . da,phi,mp,dd_t,dd_q,lalim_conv,wght_th) |
---|
15 | da, phi, mp, phii, d1a, dam, sij, qta, clw, elij, &! RomP |
---|
16 | dd_t, dd_q, lalim_conv, wght_th, & ! RomP |
---|
17 | evap, ep, epmlmMm, eplaMm, & ! RomP |
---|
18 | wdtrainA, wdtrainS, wdtrainM, wght, qtc, sigt, detrain, & |
---|
19 | tau_cld_cv, coefw_cld_cv, & ! RomP+RL, AJ |
---|
20 | !RomP <<< |
---|
21 | epmax_diag & ! epmax_cape |
---|
22 | #ifdef ISO |
---|
23 | ,xt,xt_wake,d_xt,xtrain,xtsnow & |
---|
24 | ,xtVprecip,xtVprecipi & |
---|
25 | ,xtclw,dd_xt,xtevap,xtwdtrainA & |
---|
26 | #ifdef DIAGISO |
---|
27 | , qlp,xtlp,qvp,xtvp & ! juste diagnostique |
---|
28 | , fq_detrainement,fq_ddft,fq_fluxmasse,fq_evapprecip & |
---|
29 | , fxt_detrainement,fxt_ddft,fxt_fluxmasse,fxt_evapprecip & |
---|
30 | , f_detrainement,q_detrainement,xt_detrainement & |
---|
31 | #endif |
---|
32 | #endif |
---|
33 | ) ! ************************************************************** |
---|
34 | ! * |
---|
35 | ! CONCVL * |
---|
36 | ! * |
---|
37 | ! * |
---|
38 | ! written by : Sandrine Bony-Lena, 17/05/2003, 11.16.04 * |
---|
39 | ! modified by : * |
---|
40 | ! ************************************************************** |
---|
41 | |
---|
42 | |
---|
43 | USE dimphy |
---|
44 | USE infotrac_phy, ONLY: nbtr |
---|
45 | #ifdef ISO |
---|
46 | USE infotrac_phy, ONLY: ntraciso=>ntiso |
---|
47 | USE isotopes_mod, ONLY: iso_eau, bidouille_anti_divergence, ridicule, & |
---|
48 | iso_eau,iso_HDO |
---|
49 | #endif |
---|
50 | #ifdef ISOVERIF |
---|
51 | USE isotopes_verif_mod, ONLY: errmax,errmaxrel, & |
---|
52 | iso_verif_egalite_choix,iso_verif_aberrant,iso_verif_egalite, & |
---|
53 | iso_verif_noNaN,iso_verif_aberrant_encadre |
---|
54 | #endif |
---|
55 | #ifdef ISOTRAC |
---|
56 | USE isotrac_routines_mod, ONLY: iso_verif_traceur_jbid_vect |
---|
57 | #ifdef ISOVERIF |
---|
58 | USE isotopes_verif_mod, ONLY: iso_verif_traceur_vect, & |
---|
59 | & iso_verif_trac_masse_vect, iso_verif_traceur, & |
---|
60 | & iso_verif_traceur_justmass |
---|
61 | #endif |
---|
62 | #endif |
---|
63 | USE phys_local_var_mod, ONLY: omega |
---|
64 | USE lmdz_print_control, ONLY: prt_level, lunout |
---|
65 | USE lmdz_clesphys |
---|
66 | USE lmdz_conema3 |
---|
67 | |
---|
68 | IMPLICIT NONE |
---|
69 | ! ====================================================================== |
---|
70 | ! Auteur(s): S. Bony-Lena (LMD/CNRS) date: ??? |
---|
71 | ! Objet: schema de convection de Emanuel (1991) interface |
---|
72 | ! ====================================================================== |
---|
73 | ! Arguments: |
---|
74 | ! dtime--input-R-pas d'integration (s) |
---|
75 | ! s-------input-R-la vAleur "s" pour chaque couche |
---|
76 | ! sigs----input-R-la vAleur "sigma" de chaque couche |
---|
77 | ! sig-----input-R-la vAleur de "sigma" pour chaque niveau |
---|
78 | ! psolpa--input-R-la pression au sol (en Pa) |
---|
79 | ! pskapa--input-R-exponentiel kappa de psolpa |
---|
80 | ! h-------input-R-enthAlpie potentielle (Cp*T/P**kappa) |
---|
81 | ! q-------input-R-vapeur d'eau (en kg/kg) |
---|
82 | |
---|
83 | ! work*: input et output: deux variables de travail, |
---|
84 | ! on peut les mettre a 0 au debut |
---|
85 | ! ALE--------input-R-energie disponible pour soulevement |
---|
86 | ! ALP--------input-R-puissance disponible pour soulevement |
---|
87 | |
---|
88 | ! d_h--------output-R-increment de l'enthAlpie potentielle (h) |
---|
89 | ! d_q--------output-R-increment de la vapeur d'eau |
---|
90 | ! rain-------output-R-la pluie (mm/s) |
---|
91 | ! snow-------output-R-la neige (mm/s) |
---|
92 | ! upwd-------output-R-saturated updraft mass flux (kg/m**2/s) |
---|
93 | ! dnwd-------output-R-saturated downdraft mass flux (kg/m**2/s) |
---|
94 | ! dnwd0------output-R-unsaturated downdraft mass flux (kg/m**2/s) |
---|
95 | ! Ma---------output-R-adiabatic ascent mass flux (kg/m2/s) |
---|
96 | ! mip--------output-R-mass flux shed by adiabatic ascent (kg/m2/s) |
---|
97 | ! Vprecip----output-R-vertical profile of total precipitation (kg/m2/s) |
---|
98 | ! Tconv------output-R-environment temperature seen by convective scheme (K) |
---|
99 | ! Cape-------output-R-CAPE (J/kg) |
---|
100 | ! Cin -------output-R-CIN (J/kg) |
---|
101 | ! Tvp--------output-R-Temperature virtuelle d'une parcelle soulevee |
---|
102 | ! adiabatiquement a partir du niveau 1 (K) |
---|
103 | ! deltapb----output-R-distance entre LCL et base de la colonne (<0 ; Pa) |
---|
104 | ! Ice_flag---input-L-TRUE->prise en compte de la thermodynamique de la glace |
---|
105 | ! dd_t-------output-R-increment de la temperature du aux descentes precipitantes |
---|
106 | ! dd_q-------output-R-increment de la vapeur d'eau du aux desc precip |
---|
107 | ! lalim_conv- |
---|
108 | ! wght_th---- |
---|
109 | ! evap-------output-R |
---|
110 | ! ep---------output-R |
---|
111 | ! epmlmMm----output-R |
---|
112 | ! eplaMm-----output-R |
---|
113 | ! wdtrainA---output-R |
---|
114 | ! wdtrainS---output-R |
---|
115 | ! wdtrainM---output-R |
---|
116 | ! wght-------output-R |
---|
117 | ! ====================================================================== |
---|
118 | |
---|
119 | INTEGER, INTENT(IN) :: iflag_clos |
---|
120 | REAL, INTENT(IN) :: dtime |
---|
121 | REAL, DIMENSION(klon,klev), INTENT(IN) :: pplay |
---|
122 | REAL, DIMENSION(klon,klev+1), INTENT(IN) :: paprs |
---|
123 | INTEGER, INTENT(IN) :: k_upper_cv |
---|
124 | REAL, DIMENSION(klon,klev), INTENT(IN) :: t, q, u, v |
---|
125 | REAL, DIMENSION(klon,klev), INTENT(IN) :: t_wake, q_wake |
---|
126 | REAL, DIMENSION(klon), INTENT(IN) :: s_wake |
---|
127 | REAL, DIMENSION(klon,klev, nbtr),INTENT(IN) :: tra |
---|
128 | INTEGER, INTENT(IN) :: ntra |
---|
129 | REAL, DIMENSION(klon), INTENT(IN) :: Ale, Alp |
---|
130 | !CR:test: on passe lentr et alim_star des thermiques |
---|
131 | INTEGER, DIMENSION(klon), INTENT(IN) :: lalim_conv |
---|
132 | REAL, DIMENSION(klon,klev), INTENT(IN) :: wght_th |
---|
133 | #ifdef ISO |
---|
134 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(IN) :: xt |
---|
135 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(IN) :: xt_wake |
---|
136 | #endif |
---|
137 | |
---|
138 | REAL, DIMENSION(klon,klev), INTENT(INOUT) :: sig1, w01 |
---|
139 | |
---|
140 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_t, d_q, d_qcomp, d_u, d_v |
---|
141 | REAL, DIMENSION(klon,klev, nbtr),INTENT(OUT) :: d_tra |
---|
142 | REAL, DIMENSION(klon), INTENT(OUT) :: rain, snow |
---|
143 | |
---|
144 | INTEGER, DIMENSION(klon), INTENT(OUT) :: kbas, ktop |
---|
145 | REAL, DIMENSION(klon), INTENT(OUT) :: sigd |
---|
146 | REAL, DIMENSION(klon), INTENT(OUT) :: cbmf, plcl, plfc, wbeff |
---|
147 | REAL, DIMENSION(klon), INTENT(OUT) :: convoccur |
---|
148 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: upwd, dnwd, dnwdbis |
---|
149 | |
---|
150 | !! REAL Ma(klon,klev), mip(klon,klev),Vprecip(klon,klev) !jyg |
---|
151 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: Ma, mip |
---|
152 | REAL, DIMENSION(klon,klev+1), INTENT(OUT) :: Vprecip !jyg |
---|
153 | REAL, DIMENSION(klon), INTENT(OUT) :: cape, cin |
---|
154 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: tvp |
---|
155 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: Tconv |
---|
156 | INTEGER, DIMENSION(klon), INTENT(OUT) :: iflag |
---|
157 | REAL, DIMENSION(klon), INTENT(OUT) :: pbase, bbase |
---|
158 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: dtvpdt1, dtvpdq1 |
---|
159 | REAL, DIMENSION(klon), INTENT(OUT) :: dplcldt, dplcldr |
---|
160 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: qcondc |
---|
161 | REAL, DIMENSION(klon), INTENT(OUT) :: wd |
---|
162 | REAL, DIMENSION(klon,klev+1), INTENT(OUT) :: pmflxr, pmflxs |
---|
163 | |
---|
164 | #ifdef ISO |
---|
165 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: d_xt |
---|
166 | REAL, DIMENSION(ntraciso,klon), INTENT(OUT) :: xtrain |
---|
167 | REAL, DIMENSION(ntraciso,klon), INTENT(OUT) :: xtsnow |
---|
168 | REAL, DIMENSION(ntraciso,klon,klev+1), INTENT(OUT) :: xtVprecip |
---|
169 | #endif |
---|
170 | |
---|
171 | |
---|
172 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: da, mp |
---|
173 | REAL, DIMENSION(klon,klev,klev),INTENT(OUT) :: phi |
---|
174 | ! RomP >>> |
---|
175 | REAL, DIMENSION(klon,klev,klev),INTENT(OUT) :: phii |
---|
176 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: d1a, dam |
---|
177 | REAL, DIMENSION(klon,klev,klev),INTENT(OUT) :: sij, elij |
---|
178 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: qta |
---|
179 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: clw |
---|
180 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: dd_t, dd_q |
---|
181 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: evap, ep |
---|
182 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: eplaMm |
---|
183 | REAL, DIMENSION(klon,klev,klev), INTENT(OUT) :: epmlmMm |
---|
184 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: wdtrainA, wdtrainS, wdtrainM |
---|
185 | ! RomP <<< |
---|
186 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: wght !RL |
---|
187 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: qtc |
---|
188 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: sigt, detrain |
---|
189 | REAL, INTENT(OUT) :: tau_cld_cv, coefw_cld_cv |
---|
190 | REAL, DIMENSION(klon), INTENT(OUT) :: epmax_diag ! epmax_cape |
---|
191 | |
---|
192 | #ifdef ISO |
---|
193 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: xtevap |
---|
194 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: xtwdtrainA |
---|
195 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: xtclw |
---|
196 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: dd_xt |
---|
197 | ! juste diagnostique |
---|
198 | #ifdef DIAGISO |
---|
199 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: qlp |
---|
200 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: xtlp |
---|
201 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: qvp |
---|
202 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: xtvp |
---|
203 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: fq_detrainement |
---|
204 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: fq_fluxmasse |
---|
205 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: fq_ddft |
---|
206 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: fq_evapprecip |
---|
207 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: fxt_detrainement |
---|
208 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: fxt_fluxmasse |
---|
209 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: fxt_ddft |
---|
210 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: fxt_evapprecip |
---|
211 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: f_detrainement |
---|
212 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: q_detrainement |
---|
213 | REAL, DIMENSION(ntraciso,klon,klev), INTENT(OUT) :: xt_detrainement |
---|
214 | #endif |
---|
215 | #endif |
---|
216 | |
---|
217 | ! Local |
---|
218 | ! ---- |
---|
219 | REAL, DIMENSION(klon,klev) :: em_p |
---|
220 | REAL, DIMENSION(klon,klev+1) :: em_ph |
---|
221 | REAL :: em_sig1feed ! sigma at lower bound of feeding layer |
---|
222 | REAL :: em_sig2feed ! sigma at upper bound of feeding layer |
---|
223 | REAL, DIMENSION(klev) :: em_wght ! weight density determining the feeding mixture |
---|
224 | REAL, DIMENSION(klon,klev+1) :: Vprecipi !jyg |
---|
225 | !on enleve le save |
---|
226 | ! SAVE em_sig1feed,em_sig2feed,em_wght |
---|
227 | |
---|
228 | REAL, DIMENSION(klon) :: rflag |
---|
229 | REAL, DIMENSION(klon) :: plim1, plim2 |
---|
230 | REAL, DIMENSION(klon) :: ptop2 |
---|
231 | REAL, DIMENSION(klon,klev) :: asupmax |
---|
232 | REAL, DIMENSION(klon) :: supmax0, asupmaxmin |
---|
233 | REAL :: zx_t, zdelta, zx_qs, zcor |
---|
234 | |
---|
235 | ! INTEGER iflag_mix |
---|
236 | ! SAVE iflag_mix |
---|
237 | INTEGER :: noff, minorig |
---|
238 | INTEGER :: i,j, k, itra |
---|
239 | REAL, DIMENSION(klon,klev) :: qs, qs_wake |
---|
240 | !LF SAVE cbmf |
---|
241 | !IM/JYG REAL, SAVE, ALLOCATABLE :: cbmf(:) |
---|
242 | !!!$OMP THREADPRIVATE(cbmf)! |
---|
243 | REAL, DIMENSION(klon) :: cbmflast |
---|
244 | #ifdef ISO |
---|
245 | REAL, DIMENSION(ntraciso,klon,klev+1) :: xtVprecipi |
---|
246 | INTEGER :: ixt |
---|
247 | #endif |
---|
248 | |
---|
249 | |
---|
250 | ! Variables supplementaires liees au bilan d'energie |
---|
251 | ! Real paire(klon) |
---|
252 | !LF Real ql(klon,klev) |
---|
253 | ! Save paire |
---|
254 | !LF Save ql |
---|
255 | !LF Real t1(klon,klev),q1(klon,klev) |
---|
256 | !LF Save t1,q1 |
---|
257 | ! Data paire /1./ |
---|
258 | REAL, SAVE, ALLOCATABLE :: ql(:, :), q1(:, :), t1(:, :) |
---|
259 | !$OMP THREADPRIVATE(ql, q1, t1) |
---|
260 | ! pas besoin d'isos ici |
---|
261 | |
---|
262 | ! Variables liees au bilan d'energie et d'enthAlpi |
---|
263 | REAL ztsol(klon) |
---|
264 | REAL h_vcol_tot, h_dair_tot, h_qw_tot, h_ql_tot, & |
---|
265 | h_qs_tot, qw_tot, ql_tot, qs_tot, ec_tot |
---|
266 | SAVE h_vcol_tot, h_dair_tot, h_qw_tot, h_ql_tot, & |
---|
267 | h_qs_tot, qw_tot, ql_tot, qs_tot, ec_tot |
---|
268 | !$OMP THREADPRIVATE(h_vcol_tot, h_dair_tot, h_qw_tot, h_ql_tot) |
---|
269 | !$OMP THREADPRIVATE(h_qs_tot, qw_tot, ql_tot, qs_tot , ec_tot) |
---|
270 | REAL d_h_vcol, d_h_dair, d_qt, d_qw, d_ql, d_qs, d_ec |
---|
271 | REAL d_h_vcol_phy |
---|
272 | REAL fs_bound, fq_bound |
---|
273 | SAVE d_h_vcol_phy |
---|
274 | !$OMP THREADPRIVATE(d_h_vcol_phy) |
---|
275 | REAL zero_v(klon) |
---|
276 | CHARACTER *15 ztit |
---|
277 | INTEGER ip_ebil ! PRINT level for energy conserv. diag. |
---|
278 | SAVE ip_ebil |
---|
279 | DATA ip_ebil/2/ |
---|
280 | !$OMP THREADPRIVATE(ip_ebil) |
---|
281 | INTEGER if_ebil ! level for energy conserv. dignostics |
---|
282 | SAVE if_ebil |
---|
283 | DATA if_ebil/2/ |
---|
284 | !$OMP THREADPRIVATE(if_ebil) |
---|
285 | !+jld ec_conser |
---|
286 | REAL d_t_ec(klon, klev) ! tendance du a la conersion Ec -> E thermique |
---|
287 | REAL zrcpd |
---|
288 | !-jld ec_conser |
---|
289 | !LF |
---|
290 | INTEGER nloc |
---|
291 | LOGICAL, SAVE :: first = .TRUE. |
---|
292 | !$OMP THREADPRIVATE(first) |
---|
293 | INTEGER, SAVE :: itap, igout |
---|
294 | !$OMP THREADPRIVATE(itap, igout) |
---|
295 | |
---|
296 | |
---|
297 | include "YOMCST.h" |
---|
298 | include "YOMCST2.h" |
---|
299 | include "YOETHF.h" |
---|
300 | include "FCTTRE.h" |
---|
301 | |
---|
302 | IF (first) THEN |
---|
303 | ! Allocate some variables LF 04/2008 |
---|
304 | |
---|
305 | !IM/JYG allocate(cbmf(klon)) |
---|
306 | ALLOCATE (ql(klon,klev)) |
---|
307 | ALLOCATE (t1(klon,klev)) |
---|
308 | ALLOCATE (q1(klon,klev)) |
---|
309 | |
---|
310 | convoccur(:) = 0. |
---|
311 | |
---|
312 | itap = 0 |
---|
313 | igout = klon/2 + 1/klon |
---|
314 | END IF |
---|
315 | ! Incrementer le compteur de la physique |
---|
316 | itap = itap + 1 |
---|
317 | |
---|
318 | ! Copy T into Tconv |
---|
319 | DO k = 1, klev |
---|
320 | DO i = 1, klon |
---|
321 | Tconv(i, k) = t(i, k) |
---|
322 | END DO |
---|
323 | END DO |
---|
324 | |
---|
325 | IF (if_ebil>=1) THEN |
---|
326 | DO i = 1, klon |
---|
327 | ztsol(i) = t(i, 1) |
---|
328 | zero_v(i) = 0. |
---|
329 | DO k = 1, klev |
---|
330 | ql(i, k) = 0. |
---|
331 | END DO |
---|
332 | END DO |
---|
333 | END IF |
---|
334 | |
---|
335 | ! ym |
---|
336 | snow(:) = 0 |
---|
337 | #ifdef ISO |
---|
338 | xtsnow(:,:)=0 |
---|
339 | #endif |
---|
340 | |
---|
341 | IF (first) THEN |
---|
342 | first = .FALSE. |
---|
343 | |
---|
344 | ! =========================================================================== |
---|
345 | ! READ IN PARAMETERS FOR THE CLOSURE AND THE MIXING DISTRIBUTION |
---|
346 | ! =========================================================================== |
---|
347 | |
---|
348 | IF (iflag_con==3) THEN |
---|
349 | ! CALL cv3_inicp() |
---|
350 | CALL cv3_inip() |
---|
351 | END IF |
---|
352 | |
---|
353 | ! =========================================================================== |
---|
354 | ! READ IN PARAMETERS FOR CONVECTIVE INHIBITION BY TROPOS. DRYNESS |
---|
355 | ! =========================================================================== |
---|
356 | |
---|
357 | ! c$$$ open (56,file='supcrit.data') |
---|
358 | ! c$$$ read (56,*) Supcrit1, Supcrit2 |
---|
359 | ! c$$$ close (56) |
---|
360 | |
---|
361 | IF (prt_level>=10) WRITE (lunout, *) 'supcrit1, supcrit2', supcrit1, supcrit2 |
---|
362 | |
---|
363 | ! =========================================================================== |
---|
364 | ! Initialisation pour les bilans d'eau et d'energie |
---|
365 | ! =========================================================================== |
---|
366 | IF (if_ebil>=1) d_h_vcol_phy = 0. |
---|
367 | |
---|
368 | DO i = 1, klon |
---|
369 | cbmf(i) = 0. |
---|
370 | !! plcl(i) = 0. |
---|
371 | sigd(i) = 0. |
---|
372 | END DO |
---|
373 | END IF !(first) |
---|
374 | |
---|
375 | ! Initialisation a chaque pas de temps |
---|
376 | plfc(:) = 0. |
---|
377 | wbeff(:) = 100. |
---|
378 | plcl(:) = 0. |
---|
379 | |
---|
380 | DO k = 1, klev + 1 |
---|
381 | DO i = 1, klon |
---|
382 | em_ph(i, k) = paprs(i, k)/100.0 |
---|
383 | pmflxr(i, k) = 0. |
---|
384 | pmflxs(i, k) = 0. |
---|
385 | END DO |
---|
386 | END DO |
---|
387 | |
---|
388 | DO k = 1, klev |
---|
389 | DO i = 1, klon |
---|
390 | em_p(i, k) = pplay(i, k)/100.0 |
---|
391 | END DO |
---|
392 | END DO |
---|
393 | |
---|
394 | |
---|
395 | ! Feeding layer |
---|
396 | |
---|
397 | em_sig1feed = 1. |
---|
398 | !jyg< |
---|
399 | ! em_sig2feed = 0.97 |
---|
400 | em_sig2feed = cvl_sig2feed |
---|
401 | !>jyg |
---|
402 | ! em_sig2feed = 0.8 |
---|
403 | ! Relative Weight densities |
---|
404 | DO k = 1, klev |
---|
405 | em_wght(k) = 1. |
---|
406 | END DO |
---|
407 | !CRtest: couche alim des tehrmiques ponderee par a* |
---|
408 | ! DO i = 1, klon |
---|
409 | ! do k=1,lalim_conv(i) |
---|
410 | ! em_wght(k)=wght_th(i,k) |
---|
411 | ! PRINT*,'em_wght=',em_wght(k),wght_th(i,k) |
---|
412 | ! END DO |
---|
413 | ! END DO |
---|
414 | |
---|
415 | IF (iflag_con==4) THEN |
---|
416 | DO k = 1, klev |
---|
417 | DO i = 1, klon |
---|
418 | zx_t = t(i, k) |
---|
419 | zdelta = max(0., sign(1.,rtt-zx_t)) |
---|
420 | zx_qs = min(0.5, r2es*foeew(zx_t,zdelta)/em_p(i,k)/100.0) |
---|
421 | zcor = 1./(1.-retv*zx_qs) |
---|
422 | qs(i, k) = zx_qs*zcor |
---|
423 | END DO |
---|
424 | DO i = 1, klon |
---|
425 | zx_t = t_wake(i, k) |
---|
426 | zdelta = max(0., sign(1.,rtt-zx_t)) |
---|
427 | zx_qs = min(0.5, r2es*foeew(zx_t,zdelta)/em_p(i,k)/100.0) |
---|
428 | zcor = 1./(1.-retv*zx_qs) |
---|
429 | qs_wake(i, k) = zx_qs*zcor |
---|
430 | END DO |
---|
431 | END DO |
---|
432 | ELSE ! iflag_con=3 (modif de puristes qui fait la diffce pour la convergence numerique) |
---|
433 | DO k = 1, klev |
---|
434 | DO i = 1, klon |
---|
435 | zx_t = t(i, k) |
---|
436 | zdelta = max(0., sign(1.,rtt-zx_t)) |
---|
437 | zx_qs = r2es*foeew(zx_t, zdelta)/em_p(i, k)/100.0 |
---|
438 | zx_qs = min(0.5, zx_qs) |
---|
439 | zcor = 1./(1.-retv*zx_qs) |
---|
440 | zx_qs = zx_qs*zcor |
---|
441 | qs(i, k) = zx_qs |
---|
442 | END DO |
---|
443 | DO i = 1, klon |
---|
444 | zx_t = t_wake(i, k) |
---|
445 | zdelta = max(0., sign(1.,rtt-zx_t)) |
---|
446 | zx_qs = r2es*foeew(zx_t, zdelta)/em_p(i, k)/100.0 |
---|
447 | zx_qs = min(0.5, zx_qs) |
---|
448 | zcor = 1./(1.-retv*zx_qs) |
---|
449 | zx_qs = zx_qs*zcor |
---|
450 | qs_wake(i, k) = zx_qs |
---|
451 | END DO |
---|
452 | END DO |
---|
453 | END IF ! iflag_con |
---|
454 | |
---|
455 | ! ------------------------------------------------------------------ |
---|
456 | |
---|
457 | ! Main driver for convection: |
---|
458 | ! iflag_con=3 -> nvlle version de KE (JYG) |
---|
459 | ! iflag_con = 30 -> equivAlent to convect3 |
---|
460 | ! iflag_con = 4 -> equivAlent to convect1/2 |
---|
461 | |
---|
462 | |
---|
463 | IF (iflag_con==30) THEN |
---|
464 | |
---|
465 | |
---|
466 | #ifdef ISO |
---|
467 | #ifdef ISOVERIF |
---|
468 | do k = 1, klev |
---|
469 | do i = 1, klon |
---|
470 | do ixt=1,ntraciso |
---|
471 | CALL iso_verif_noNaN(xt(ixt,i,k),'concvl 394') |
---|
472 | enddo |
---|
473 | enddo !do i = 1, klon |
---|
474 | enddo !do k = 1, klev |
---|
475 | IF (iso_eau.gt.0) THEN |
---|
476 | do k = 1, klev |
---|
477 | do i = 1, klon |
---|
478 | CALL iso_verif_egalite_choix(xt(iso_eau,i,k),q(i,k), & |
---|
479 | 'concvl 174',errmax,errmaxrel) |
---|
480 | enddo !do i = 1, klon |
---|
481 | enddo !do k = 1, klev |
---|
482 | endif !if (iso_eau.gt.0) THEN |
---|
483 | IF (iso_HDO.gt.0) THEN |
---|
484 | do k = 1, klev |
---|
485 | do i = 1, klon |
---|
486 | IF (q(i,k).gt.ridicule) THEN |
---|
487 | CALL iso_verif_aberrant(xt(iso_hdo,i,k)/q(i,k),'concvl 175') |
---|
488 | endif ! if (q(i,k).gt.ridicule) THEN |
---|
489 | enddo |
---|
490 | enddo |
---|
491 | endif !if (iso_eau.gt.0) THEN |
---|
492 | #ifdef ISOTRAC |
---|
493 | do k = 1, klev |
---|
494 | do i = 1, klon |
---|
495 | CALL iso_verif_traceur(xt(1,i,k),'concvl 218') |
---|
496 | enddo |
---|
497 | enddo |
---|
498 | #endif |
---|
499 | WRITE(*,*) 'concvl 170: avant appel cv_driver' |
---|
500 | #endif |
---|
501 | ! ISOVERIF ! end verif |
---|
502 | #endif |
---|
503 | |
---|
504 | ! print *, '-> cv_driver' !jyg |
---|
505 | CALL cv_driver(klon, klev, klevp1, ntra, iflag_con, & |
---|
506 | t, q, qs, u, v, tra, & |
---|
507 | em_p, em_ph, iflag, & |
---|
508 | d_t, d_q, d_u, d_v, d_tra, rain, & |
---|
509 | Vprecip, cbmf, sig1, w01, & !jyg |
---|
510 | kbas, ktop, & |
---|
511 | dtime, Ma, upwd, dnwd, dnwdbis, qcondc, wd, cape, & |
---|
512 | da, phi, mp, phii, d1a, dam, sij, clw, elij, & !RomP |
---|
513 | evap, ep, epmlmMm, eplaMm, & !RomP |
---|
514 | wdtrainA, wdtrainM, & !RomP |
---|
515 | epmax_diag & ! epmax_cape |
---|
516 | #ifdef ISO |
---|
517 | , xt,d_xt & |
---|
518 | , xtrain,xtVprecip & |
---|
519 | , xtevap,xtclw,xtwdtrainA & |
---|
520 | #ifdef DIAGISO |
---|
521 | , qlp,xtlp,qvp,xtvp & ! juste diagnostique |
---|
522 | , fq_detrainement,fq_ddft,fq_fluxmasse,fq_evapprecip & |
---|
523 | , fxt_detrainement,fxt_ddft,fxt_fluxmasse,fxt_evapprecip & |
---|
524 | , f_detrainement,q_detrainement,xt_detrainement & |
---|
525 | #endif |
---|
526 | #endif |
---|
527 | ) |
---|
528 | ! print *, 'cv_driver ->' !jyg |
---|
529 | |
---|
530 | #ifdef ISO |
---|
531 | ! verif |
---|
532 | #ifdef ISOVERIF |
---|
533 | WRITE(*,*) 'concvl 463: après appel cv_driver' |
---|
534 | do k = 1, klev |
---|
535 | do i = 1, klon |
---|
536 | IF (iso_eau.gt.0) THEN |
---|
537 | CALL iso_verif_egalite(xt(iso_eau,i,k),q(i,k),'concvl 203') |
---|
538 | CALL iso_verif_egalite(xt_wake(iso_eau,i,k),q_wake(i,k),'concvl 204') |
---|
539 | CALL iso_verif_egalite(d_xt(iso_eau,i,k),d_q(i,k), & |
---|
540 | 'concvl 452') |
---|
541 | endif !if (iso_eau.gt.0) THEN |
---|
542 | #ifdef DIAGISO |
---|
543 | do ixt=1,ntraciso |
---|
544 | CALL iso_verif_noNaN(xt(ixt,i,k),'concvl 460') |
---|
545 | CALL iso_verif_noNaN(xtlp(ixt,i,k),'concvl 295') |
---|
546 | CALL iso_verif_noNaN(xtvp(ixt,i,k),'concvl 260') |
---|
547 | enddo |
---|
548 | #endif |
---|
549 | enddo |
---|
550 | enddo |
---|
551 | #ifdef ISOTRAC |
---|
552 | CALL iso_verif_traceur_vect(xt,klon,klev,'concvl 218') |
---|
553 | CALL iso_verif_trac_masse_vect(d_xt,klon,klev, & |
---|
554 | 'concvl 464',errmax,errmaxrel) |
---|
555 | #endif |
---|
556 | #endif |
---|
557 | ! end verif |
---|
558 | #endif |
---|
559 | |
---|
560 | DO i = 1, klon |
---|
561 | cbmf(i) = Ma(i, kbas(i)) |
---|
562 | END DO |
---|
563 | |
---|
564 | !RL |
---|
565 | wght(:, :) = 0. |
---|
566 | DO i = 1, klon |
---|
567 | wght(i, 1) = 1. |
---|
568 | END DO |
---|
569 | !RL |
---|
570 | |
---|
571 | ELSE |
---|
572 | |
---|
573 | !LF necessary for gathered fields |
---|
574 | nloc = klon |
---|
575 | #ifdef ISOVERIF |
---|
576 | WRITE(*,*) 'concvl 581: juste avant appel de cva_driver' |
---|
577 | #endif |
---|
578 | CALL cva_driver(klon, klev, klev+1, ntra, nloc, k_upper_cv, & |
---|
579 | iflag_con, iflag_mix, iflag_ice_thermo, & |
---|
580 | iflag_clos, ok_conserv_q, dtime, cvl_comp_threshold, & |
---|
581 | t, q, qs, t_wake, q_wake, qs_wake, s_wake, u, v, tra, & |
---|
582 | em_p, em_ph, & |
---|
583 | Ale, Alp, omega, & |
---|
584 | em_sig1feed, em_sig2feed, em_wght, & |
---|
585 | iflag, d_t, d_q, d_qcomp, d_u, d_v, d_tra, rain, kbas, ktop, & |
---|
586 | cbmf, plcl, plfc, wbeff, sig1, w01, ptop2, sigd, & |
---|
587 | Ma, mip, Vprecip, Vprecipi, upwd, dnwd, dnwdbis, qcondc, wd, & |
---|
588 | cape, cin, tvp, & |
---|
589 | dd_t, dd_q, plim1, plim2, asupmax, supmax0, & |
---|
590 | asupmaxmin, lalim_conv, & |
---|
591 | !AC!+!RomP+jyg |
---|
592 | !! da,phi,mp,phii,d1a,dam,sij,clw,elij, & ! RomP |
---|
593 | !! evap,ep,epmlmMm,eplaMm, ! RomP |
---|
594 | da, phi, mp, phii, d1a, dam, sij, wght, & ! RomP+RL |
---|
595 | qta, clw, elij, evap, ep, epmlmMm, eplaMm, & ! RomP+RL |
---|
596 | wdtrainA, wdtrainS, wdtrainM, qtc, sigt, detrain, & |
---|
597 | tau_cld_cv, coefw_cld_cv, & ! RomP,AJ |
---|
598 | !AC!+!RomP+jyg |
---|
599 | epmax_diag & ! epmax_cape |
---|
600 | #ifdef ISO |
---|
601 | ,xt,xt_wake,d_xt, xtrain & |
---|
602 | ,xtvprecip,xtvprecipi & |
---|
603 | ,xtclw,dd_xt,xtevap,xtwdtrainA & |
---|
604 | #ifdef DIAGISO |
---|
605 | , qlp,xtlp,qvp,xtvp & |
---|
606 | , fq_detrainement,fq_ddft,fq_fluxmasse,fq_evapprecip & |
---|
607 | , fxt_detrainement,fxt_ddft,fxt_fluxmasse,fxt_evapprecip & |
---|
608 | , f_detrainement,q_detrainement,xt_detrainement & |
---|
609 | #endif |
---|
610 | #endif |
---|
611 | ) |
---|
612 | END IF |
---|
613 | ! ------------------------------------------------------------------ |
---|
614 | IF (prt_level>=10) WRITE (lunout, *) ' cva_driver -> cbmf,plcl,plfc,wbeff, d_t, d_q ', & |
---|
615 | cbmf(1), plcl(1), plfc(1), wbeff(1), d_t(1,1), d_q(1,1) |
---|
616 | |
---|
617 | DO i = 1, klon |
---|
618 | rain(i) = rain(i)/86400. |
---|
619 | rflag(i) = iflag(i) |
---|
620 | #ifdef ISO |
---|
621 | do ixt = 1, ntraciso |
---|
622 | xtrain(ixt,i) = xtrain(ixt,i)/86400. |
---|
623 | enddo |
---|
624 | #endif |
---|
625 | END DO |
---|
626 | |
---|
627 | DO k = 1, klev |
---|
628 | DO i = 1, klon |
---|
629 | d_t(i, k) = dtime*d_t(i, k) |
---|
630 | d_q(i, k) = dtime*d_q(i, k) |
---|
631 | d_u(i, k) = dtime*d_u(i, k) |
---|
632 | d_v(i, k) = dtime*d_v(i, k) |
---|
633 | #ifdef ISO |
---|
634 | do ixt = 1, ntraciso |
---|
635 | d_xt(ixt,i,k) = dtime*d_xt(ixt,i,k) |
---|
636 | enddo |
---|
637 | #endif |
---|
638 | END DO |
---|
639 | END DO |
---|
640 | |
---|
641 | |
---|
642 | #ifdef ISO |
---|
643 | #ifdef ISOVERIF |
---|
644 | ! k=1 |
---|
645 | ! i= 538 |
---|
646 | WRITE(*,*) 'concvl 640' |
---|
647 | ! WRITE(*,*) 'q(i,k),d_q(i,k)=', q(i,k),d_q(i,k) |
---|
648 | ! WRITE(*,*) 'xt(iso_HDO,i,k),d_xt(iso_HDO,i,k)=', & |
---|
649 | ! & xt(iso_HDO,i,k),d_xt(iso_HDO,i,k) |
---|
650 | DO k = 1, klev |
---|
651 | DO i = 1, klon |
---|
652 | IF (iso_HDO.gt.0) THEN |
---|
653 | IF (q(i,k).gt.ridicule) THEN |
---|
654 | CALL iso_verif_aberrant_encadre((xt(iso_HDO,i,k) & |
---|
655 | +d_xt(iso_HDO,i,k))/(q(i,k)+d_q(i,k)),'concvl 250') |
---|
656 | endif !if (q_seri(i,k).gt.ridicule) THEN |
---|
657 | endif !if (iso_HDO.gt.0) THEN |
---|
658 | IF (iso_eau.gt.0) THEN |
---|
659 | CALL iso_verif_egalite_choix(d_xt(iso_eau,i,k), & |
---|
660 | d_q(i,k),'concvl 530',errmax*dtime,errmaxrel) |
---|
661 | endif !if (iso_HDO.gt.0) THEN |
---|
662 | #ifdef ISOTRAC |
---|
663 | CALL iso_verif_traceur_justmass(d_xt(1,i,k),'concvl 316') |
---|
664 | #endif |
---|
665 | END DO |
---|
666 | END DO |
---|
667 | #endif |
---|
668 | #endif |
---|
669 | |
---|
670 | #ifdef ISO |
---|
671 | IF ((iso_eau.gt.0).AND.(bidouille_anti_divergence)) THEN |
---|
672 | do k=1,klev |
---|
673 | do i=1,klon |
---|
674 | d_xt(iso_eau,i,k)=d_q(i,k) |
---|
675 | enddo !do i=1,klon |
---|
676 | enddo !do k=1,klev |
---|
677 | #ifdef ISOTRAC |
---|
678 | CALL iso_verif_traceur_jbid_vect(d_xt, & |
---|
679 | klon,klev) |
---|
680 | #endif |
---|
681 | endif !if ((iso_eau.gt.0).AND.(bidouille_anti_divergence)) THEN |
---|
682 | #endif |
---|
683 | |
---|
684 | IF (iflag_con==3) THEN |
---|
685 | DO i = 1,klon |
---|
686 | IF (wbeff(i) > 100. .OR. wbeff(i) == 0 .OR. iflag(i) > 3) THEN |
---|
687 | wbeff(i) = 0. |
---|
688 | convoccur(i) = 0. |
---|
689 | ELSE |
---|
690 | convoccur(i) = 1. |
---|
691 | ENDIF |
---|
692 | ENDDO |
---|
693 | ENDIF |
---|
694 | |
---|
695 | IF (iflag_con==30) THEN |
---|
696 | DO itra = 1, ntra |
---|
697 | DO k = 1, klev |
---|
698 | DO i = 1, klon |
---|
699 | !RL! d_tra(i,k,itra) =dtime*d_tra(i,k,itra) |
---|
700 | d_tra(i, k, itra) = 0. |
---|
701 | END DO |
---|
702 | END DO |
---|
703 | END DO |
---|
704 | END IF |
---|
705 | |
---|
706 | !!AC! |
---|
707 | IF (iflag_con==3) THEN |
---|
708 | DO itra = 1, ntra |
---|
709 | DO k = 1, klev |
---|
710 | DO i = 1, klon |
---|
711 | !RL! d_tra(i,k,itra) =dtime*d_tra(i,k,itra) |
---|
712 | d_tra(i, k, itra) = 0. |
---|
713 | END DO |
---|
714 | END DO |
---|
715 | END DO |
---|
716 | END IF |
---|
717 | !!AC! |
---|
718 | |
---|
719 | DO k = 1, klev |
---|
720 | DO i = 1, klon |
---|
721 | t1(i, k) = t(i, k) + d_t(i, k) |
---|
722 | q1(i, k) = q(i, k) + d_q(i, k) |
---|
723 | ! juste diag: pas besoin d'isos ici |
---|
724 | END DO |
---|
725 | END DO |
---|
726 | |
---|
727 | ! !jyg |
---|
728 | IF (iflag_con == 30 .OR. iflag_ice_thermo ==0) THEN |
---|
729 | ! --Separation neige/pluie (pour diagnostics) !jyg |
---|
730 | DO k = 1, klev !jyg |
---|
731 | DO i = 1, klon !jyg |
---|
732 | IF (t1(i,k)<rtt) THEN !jyg |
---|
733 | pmflxs(i, k) = Vprecip(i, k) !jyg |
---|
734 | ELSE !jyg |
---|
735 | pmflxr(i, k) = Vprecip(i, k) !jyg |
---|
736 | END IF !jyg |
---|
737 | END DO !jyg |
---|
738 | END DO !jyg |
---|
739 | ELSE |
---|
740 | DO k = 1, klev !jyg |
---|
741 | DO i = 1, klon !jyg |
---|
742 | pmflxs(i, k) = Vprecipi(i, k) !jyg |
---|
743 | pmflxr(i, k) = Vprecip(i, k)-Vprecipi(i, k) !jyg |
---|
744 | END DO !jyg |
---|
745 | END DO !jyg |
---|
746 | ENDIF |
---|
747 | |
---|
748 | ! c IF (if_ebil.ge.2) THEN |
---|
749 | ! c ztit='after convect' |
---|
750 | ! c CALL diagetpq(paire,ztit,ip_ebil,2,2,dtime |
---|
751 | ! c e , t1,q1,ql,qs,u,v,paprs,pplay |
---|
752 | ! c s , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) |
---|
753 | ! c CALL diagphy(paire,ztit,ip_ebil |
---|
754 | ! c e , zero_v, zero_v, zero_v, zero_v, zero_v |
---|
755 | ! c e , zero_v, rain, zero_v, ztsol |
---|
756 | ! c e , d_h_vcol, d_qt, d_ec |
---|
757 | ! c s , fs_bound, fq_bound ) |
---|
758 | ! c END IF |
---|
759 | |
---|
760 | |
---|
761 | ! les traceurs ne sont pas mis dans cette version de convect4: |
---|
762 | IF (iflag_con==4) THEN |
---|
763 | DO itra = 1, ntra |
---|
764 | DO k = 1, klev |
---|
765 | DO i = 1, klon |
---|
766 | d_tra(i, k, itra) = 0. |
---|
767 | END DO |
---|
768 | END DO |
---|
769 | END DO |
---|
770 | END IF |
---|
771 | ! PRINT*, 'concvl->: dd_t,dd_q ',dd_t(1,1),dd_q(1,1) |
---|
772 | |
---|
773 | DO k = 1, klev |
---|
774 | DO i = 1, klon |
---|
775 | dtvpdt1(i, k) = 0. |
---|
776 | dtvpdq1(i, k) = 0. |
---|
777 | END DO |
---|
778 | END DO |
---|
779 | DO i = 1, klon |
---|
780 | dplcldt(i) = 0. |
---|
781 | dplcldr(i) = 0. |
---|
782 | END DO |
---|
783 | |
---|
784 | IF (prt_level>=20) THEN |
---|
785 | DO k = 1, klev |
---|
786 | ! PRINT*,'physiq apres_add_con i k it d_u d_v d_t d_q qdl0',igout, & |
---|
787 | ! k,itap,d_u_con(igout,k) ,d_v_con(igout,k), d_t_con(igout,k), & |
---|
788 | ! d_q_con(igout,k),dql0(igout,k) |
---|
789 | ! PRINT*,'phys apres_add_con itap Ma cin ALE ALP wak t q undi t q', & |
---|
790 | ! itap,Ma(igout,k),cin(igout),ALE(igout), ALP(igout), & |
---|
791 | ! t_wake(igout,k),q_wake(igout,k),t_undi(igout,k),q_undi(igout,k) |
---|
792 | ! PRINT*,'phy apres_add_con itap CON rain snow EMA wk1 wk2 Vpp mip', & |
---|
793 | ! itap,rain_con(igout),snow_con(igout),ema_work1(igout,k), & |
---|
794 | ! ema_work2(igout,k),Vprecip(igout,k), mip(igout,k) |
---|
795 | ! PRINT*,'phy apres_add_con itap upwd dnwd dnwd0 cape tvp Tconv ', & |
---|
796 | ! itap,upwd(igout,k),dnwd(igout,k),dnwd0(igout,k),cape(igout), & |
---|
797 | ! tvp(igout,k),Tconv(igout,k) |
---|
798 | ! PRINT*,'phy apres_add_con itap dtvpdt dtvdq dplcl dplcldr qcondc', & |
---|
799 | ! itap,dtvpdt1(igout,k),dtvpdq1(igout,k),dplcldt(igout), & |
---|
800 | ! dplcldr(igout),qcondc(igout,k) |
---|
801 | ! PRINT*,'phy apres_add_con itap wd pmflxr Kpmflxr Kp1 Kpmflxs Kp1', & |
---|
802 | ! itap,wd(igout),pmflxr(igout,k),pmflxr(igout,k+1),pmflxs(igout,k), & |
---|
803 | ! pmflxs(igout,k+1) |
---|
804 | ! PRINT*,'phy apres_add_con itap da phi mp ftd fqd lalim wgth', & |
---|
805 | ! itap,da(igout,k),phi(igout,k,k),mp(igout,k),ftd(igout,k), & |
---|
806 | ! fqd(igout,k),lalim_conv(igout),wght_th(igout,k) |
---|
807 | END DO |
---|
808 | END IF !(prt_level.EQ.20) THEN |
---|
809 | |
---|
810 | |
---|
811 | END SUBROUTINE concvl |
---|
812 | |
---|