source: LMDZ6/trunk/libf/phylmd/lmdz_lscp_poprecip.F90 @ 4830

Last change on this file since 4830 was 4830, checked in by evignon, 4 months ago

changements suite à l'atelier nuage d'aujourd'hui.

File size: 36.8 KB
Line 
1MODULE lmdz_lscp_poprecip
2!----------------------------------------------------------------
3! Module for the process-oriented treament of precipitation
4! that are called in LSCP
5! Authors: Atelier Nuage (G. Riviere, L. Raillard, M. Wimmer,
6! N. Dutrievoz, E. Vignon, A. Borella, et al.)
7! Jan. 2024
8
9
10IMPLICIT NONE
11
12CONTAINS
13
14!----------------------------------------------------------------
15! Computes the processes-oriented precipitation formulations for
16! evaporation and sublimation
17!
18SUBROUTINE poprecip_evapsub( &
19           klon, dtime, iftop, paprsdn, paprsup, pplay, temp, tempupnew, qvap, &
20           qprecip, precipfracclr, precipfraccld, &
21           rain, rainclr, raincld, snow, snowclr, snowcld, dqreva, dqssub &
22           )
23
24USE lmdz_lscp_ini, ONLY : prt_level, lunout
25USE lmdz_lscp_ini, ONLY : coef_eva, coef_sub, expo_eva, expo_sub, thresh_precip_frac
26USE lmdz_lscp_ini, ONLY : RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RG
27USE lmdz_lscp_tools, ONLY : calc_qsat_ecmwf
28
29IMPLICIT NONE
30
31
32INTEGER, INTENT(IN)                     :: klon           !--number of horizontal grid points [-]
33REAL,    INTENT(IN)                     :: dtime          !--time step [s]
34LOGICAL, INTENT(IN)                     :: iftop          !--if top of the column
35
36
37REAL,    INTENT(IN),    DIMENSION(klon) :: paprsdn        !--pressure at the bottom interface of the layer [Pa]
38REAL,    INTENT(IN),    DIMENSION(klon) :: paprsup        !--pressure at the top interface of the layer [Pa]
39REAL,    INTENT(IN),    DIMENSION(klon) :: pplay          !--pressure in the middle of the layer [Pa]
40
41REAL,    INTENT(INOUT), DIMENSION(klon) :: temp           !--current temperature [K]
42REAL,    INTENT(INOUT), DIMENSION(klon) :: tempupnew      !--updated temperature of the overlying layer [K]
43
44REAL,    INTENT(INOUT), DIMENSION(klon) :: qvap           !--current water vapor specific humidity (includes evaporated qi and ql) [kg/kg]
45REAL,    INTENT(INOUT), DIMENSION(klon) :: qprecip        !--specific humidity in the precipitation falling from the upper layer [kg/kg]
46
47REAL,    INTENT(INOUT), DIMENSION(klon) :: precipfracclr  !--fraction of precipitation in the clear sky IN THE LAYER ABOVE [-]
48REAL,    INTENT(INOUT), DIMENSION(klon) :: precipfraccld  !--fraction of precipitation in the cloudy air IN THE LAYER ABOVE [-]
49
50REAL,    INTENT(INOUT), DIMENSION(klon) :: rain           !--flux of rain gridbox-mean coming from the layer above [kg/s/m2]
51REAL,    INTENT(INOUT), DIMENSION(klon) :: rainclr        !--flux of rain gridbox-mean in clear sky coming from the layer above [kg/s/m2]
52REAL,    INTENT(IN),    DIMENSION(klon) :: raincld        !--flux of rain gridbox-mean in cloudy air coming from the layer above [kg/s/m2]
53REAL,    INTENT(INOUT), DIMENSION(klon) :: snow           !--flux of snow gridbox-mean coming from the layer above [kg/s/m2]
54REAL,    INTENT(INOUT), DIMENSION(klon) :: snowclr        !--flux of snow gridbox-mean in clear sky coming from the layer above [kg/s/m2]
55REAL,    INTENT(IN),    DIMENSION(klon) :: snowcld        !--flux of snow gridbox-mean in cloudy air coming from the layer above [kg/s/m2]
56
57REAL,    INTENT(OUT),   DIMENSION(klon) :: dqreva         !--rain tendency due to evaporation [kg/kg/s]
58REAL,    INTENT(OUT),   DIMENSION(klon) :: dqssub         !--snow tendency due to sublimation [kg/kg/s]
59
60
61
62
63!--Integer for interating over klon
64INTEGER :: i
65!--hum_to_flux: coef to convert a specific quantity to a flux
66REAL, DIMENSION(klon) :: hum_to_flux
67
68!--Saturation values
69REAL, DIMENSION(klon) :: qzero, qsat, dqsat, qsatl, dqsatl, qsati, dqsati
70!--Fluxes tendencies because of evaporation and sublimation
71REAL :: dprecip_evasub_max, draineva, dsnowsub, dprecip_evasub_tot
72!--Specific humidity tendencies because of evaporation and sublimation
73REAL :: dqrevap, dqssubl
74!--Specific heat constant
75REAL :: cpair, cpw
76
77!--Initialisation
78qzero(:)  = 0.
79dqreva(:) = 0.
80dqssub(:) = 0.
81dqrevap   = 0.
82dqssubl   = 0.
83
84!-- hum_to_flux = rho * dz/dt = 1 / g * dP/dt
85hum_to_flux(:) = ( paprsdn(:) - paprsup(:) ) / RG / dtime
86
87!--Calculation of saturation specific humidity
88!--depending on temperature:
89CALL calc_qsat_ecmwf(klon,temp(:),qzero(:),pplay(:),RTT,0,.false.,qsat(:),dqsat(:))
90!--wrt liquid water
91CALL calc_qsat_ecmwf(klon,temp(:),qzero(:),pplay(:),RTT,1,.false.,qsatl(:),dqsatl(:))
92!--wrt ice
93CALL calc_qsat_ecmwf(klon,temp(:),qzero(:),pplay(:),RTT,2,.false.,qsati(:),dqsati(:))
94
95
96
97!--First step consists in "thermalizing" the layer:
98!--as the flux of precip from layer above "advects" some heat (as the precip is at the temperature
99!--of the overlying layer) we recalculate a mean temperature that both the air and the precip in the
100!--layer have.
101
102IF (iftop) THEN
103
104  DO i = 1, klon
105    qprecip(i) = 0.
106  ENDDO
107
108ELSE
109
110  DO i = 1, klon
111    !--No condensed water so cp=cp(vapor+dry air)
112    !-- RVTMP2=rcpv/rcpd-1
113    cpair = RCPD * ( 1. + RVTMP2 * qvap(i) )
114    cpw = RCPD * RVTMP2
115    !--qprecip has to be thermalized with
116    !--layer's air so that precipitation at the ground has the
117    !--same temperature as the lowermost layer
118    !--we convert the flux into a specific quantity qprecip
119    qprecip(i) = ( rain(i) + snow(i) ) / hum_to_flux(i)
120    !-- t(i,k+1) + d_t(i,k+1): new temperature of the overlying layer
121    temp(i) = ( tempupnew(i) * qprecip(i) * cpw + cpair * temp(i) ) &
122            / ( cpair + qprecip(i) * cpw )
123  ENDDO
124
125ENDIF
126
127
128DO i = 1, klon
129
130  !--If there is precipitation from the layer above
131  IF ( ( rain(i) + snow(i) ) .GT. 0. ) THEN
132
133    !--Evaporation of liquid precipitation coming from above
134    !--in the clear sky only
135    !--dP/dz=beta*(1-q/qsat)*(P**expo_eva) (lines 1-2)
136    !--multiplying by dz = - dP / g / rho (line 3-4)
137    !--formula from Sundqvist 1988, Klemp & Wilhemson 1978
138
139    draineva = - precipfracclr(i) * coef_eva * (1. - qvap(i) / qsatl(i)) &
140             * ( rainclr(i) / MAX(thresh_precip_frac, precipfracclr(i)) ) ** expo_eva &
141             * temp(i) * RD / pplay(i) &
142             * ( paprsdn(i) - paprsup(i) ) / RG
143
144    !--Evaporation is limited by 0 and by the total water amount in
145    !--the precipitation
146    draineva = MIN(0., MAX(draineva, -rainclr(i)))
147
148
149    !--Sublimation of the solid precipitation coming from above
150    !--(same formula as for liquid precip)
151    dsnowsub = - precipfracclr(i) * coef_sub * (1. - qvap(i) / qsati(i)) &
152             * ( snowclr(i) / MAX(thresh_precip_frac, precipfracclr(i)) ) ** expo_sub &
153             * temp(i) * RD / pplay(i) &
154             * ( paprsdn(i) - paprsup(i) ) / RG
155
156    !--Sublimation is limited by 0 and by the total water amount in
157    !--the precipitation
158    ! TODO: change max when we will allow for vapor deposition in supersaturated regions
159    dsnowsub = MIN(0., MAX(dsnowsub, -snowclr(i)))
160
161    !--Evaporation limit: we ensure that the layer's fraction below
162    !--the clear sky does not reach saturation. In this case, we
163    !--redistribute the maximum flux dprecip_evasub_max conserving the ratio liquid/ice
164    !--Max evaporation is computed not to saturate the clear sky precip fraction
165    !--(i.e., the fraction where evaporation occurs)
166    !--It is expressed as a max flux dprecip_evasub_max
167   
168    dprecip_evasub_max = MIN(0., ( qvap(i) - qsat(i) ) * precipfracclr(i)) &
169                     * hum_to_flux(i)
170    dprecip_evasub_tot = draineva + dsnowsub
171
172    !--Barriers
173    !--If activates if the total is LOWER than the max because
174    !--everything is negative
175    IF ( dprecip_evasub_tot .LT. dprecip_evasub_max ) THEN
176      draineva = dprecip_evasub_max * draineva / dprecip_evasub_tot
177      dsnowsub = dprecip_evasub_max * dsnowsub / dprecip_evasub_tot
178    ENDIF
179
180
181    !--New solid and liquid precipitation fluxes after evap and sublimation
182    dqrevap = draineva / hum_to_flux(i)
183    dqssubl = dsnowsub / hum_to_flux(i)
184
185
186    !--Vapor is updated after evaporation/sublimation (it is increased)
187    qvap(i) = qvap(i) - dqrevap - dqssubl
188    !--qprecip is the total condensed water in the precip flux (it is decreased)
189    qprecip(i) = qprecip(i) + dqrevap + dqssubl
190    !--Air and precip temperature (i.e., gridbox temperature)
191    !--is updated due to latent heat cooling
192    temp(i) = temp(i) &
193            + dqrevap * RLVTT / RCPD &
194            / ( 1. + RVTMP2 * ( qvap(i) + qprecip(i) ) ) &
195            + dqssubl * RLSTT / RCPD &
196            / ( 1. + RVTMP2 * ( qvap(i) + qprecip(i) ) )
197
198    !--Add tendencies
199    rainclr(i) = rainclr(i) + draineva
200    snowclr(i) = snowclr(i) + dsnowsub
201
202    !--If there is no more precip fluxes, the precipitation fraction in clear
203    !--sky is set to 0
204    IF ( ( rainclr(i) + snowclr(i) ) .LE. 0. ) precipfracclr(i) = 0.
205
206    !--Calculation of the total fluxes
207    rain(i) = rainclr(i) + raincld(i)
208    snow(i) = snowclr(i) + snowcld(i)
209
210  ELSE
211    !--If no precip, we reinitialize the cloud fraction used for the precip to 0
212    precipfraccld(i) = 0.
213    precipfracclr(i) = 0.
214
215  ENDIF ! ( ( rain(i) + snow(i) ) .GT. 0. )
216
217  !--Diagnostic tendencies
218  dqssub(i) = dqssubl / dtime
219  dqreva(i) = dqrevap / dtime
220
221ENDDO ! loop on klon
222
223
224END SUBROUTINE poprecip_evapsub
225
226!----------------------------------------------------------------
227! Computes the processes-oriented precipitation formulations for
228! - autoconversion (auto) via a deposition process
229! - aggregation (agg)
230! - riming (rim)
231! - collection (col)
232! - melting (melt)
233! - freezing (freez)
234!
235SUBROUTINE poprecip_postcld( &
236           klon, dtime, paprsdn, paprsup, pplay, ctot_vol, ptconv, &
237           temp, qvap, qliq, qice, icefrac, cldfra, &
238           precipfracclr, precipfraccld, &
239           rain, rainclr, raincld, snow, snowclr, snowcld, &
240           qraindiag, qsnowdiag, dqrauto, dqrcol, dqrmelt, dqrfreez, &
241           dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
242
243USE lmdz_lscp_ini, ONLY : prt_level, lunout
244USE lmdz_lscp_ini, ONLY : RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RG, RPI
245USE lmdz_lscp_tools, ONLY : calc_qsat_ecmwf
246
247USE lmdz_lscp_ini, ONLY : cld_lc_con, cld_tau_con, cld_expo_con, seuil_neb,    &
248                          cld_lc_lsc, cld_tau_lsc, cld_expo_lsc, rain_int_min, &
249                          thresh_precip_frac, gamma_col, gamma_agg, gamma_rim, &
250                          rho_rain, rho_snow, r_rain, r_snow,                  &
251                          tau_auto_snow_min, tau_auto_snow_max,                &
252                          thresh_precip_frac, eps, air_thermal_conduct,        &
253                          coef_ventil, alpha_freez, beta_freez, temp_nowater,  &
254                          iflag_cloudth_vert, iflag_rain_incloud_vol,          &
255                          cld_lc_lsc_snow, cld_lc_con_snow, gamma_freez,       &
256                          rain_fallspeed_clr, rain_fallspeed_cld,              &
257                          snow_fallspeed_clr, snow_fallspeed_cld
258
259
260IMPLICIT NONE
261
262INTEGER, INTENT(IN)                     :: klon           !--number of horizontal grid points [-]
263REAL,    INTENT(IN)                     :: dtime          !--time step [s]
264
265REAL,    INTENT(IN),    DIMENSION(klon) :: paprsdn        !--pressure at the bottom interface of the layer [Pa]
266REAL,    INTENT(IN),    DIMENSION(klon) :: paprsup        !--pressure at the top interface of the layer [Pa]
267REAL,    INTENT(IN),    DIMENSION(klon) :: pplay          !--pressure in the middle of the layer [Pa]
268
269REAL,    INTENT(IN),    DIMENSION(klon) :: ctot_vol       !--volumic cloud fraction [-]
270LOGICAL, INTENT(IN),    DIMENSION(klon) :: ptconv         !--true if we are in a convective point
271
272REAL,    INTENT(INOUT), DIMENSION(klon) :: temp           !--current temperature [K]
273REAL,    INTENT(INOUT), DIMENSION(klon) :: qvap           !--current water vapor specific humidity [kg/kg]
274REAL,    INTENT(INOUT), DIMENSION(klon) :: qliq           !--current liquid water specific humidity [kg/kg]
275REAL,    INTENT(INOUT), DIMENSION(klon) :: qice           !--current ice water specific humidity [kg/kg]
276REAL,    INTENT(IN),    DIMENSION(klon) :: icefrac        !--ice fraction [-]
277REAL,    INTENT(IN),    DIMENSION(klon) :: cldfra         !--cloud fraction [-]
278
279REAL,    INTENT(INOUT), DIMENSION(klon) :: precipfracclr  !--fraction of precipitation in the clear sky IN THE LAYER ABOVE [-]
280REAL,    INTENT(INOUT), DIMENSION(klon) :: precipfraccld  !--fraction of precipitation in the cloudy air IN THE LAYER ABOVE [-]
281                                                          !--NB. at the end of the routine, becomes the fraction of precip
282                                                          !--in the current layer
283
284REAL,    INTENT(INOUT), DIMENSION(klon) :: rain           !--flux of rain gridbox-mean coming from the layer above [kg/s/m2]
285REAL,    INTENT(INOUT), DIMENSION(klon) :: rainclr        !--flux of rain gridbox-mean in clear sky coming from the layer above [kg/s/m2]
286REAL,    INTENT(INOUT), DIMENSION(klon) :: raincld        !--flux of rain gridbox-mean in cloudy air coming from the layer above [kg/s/m2]
287REAL,    INTENT(INOUT), DIMENSION(klon) :: snow           !--flux of snow gridbox-mean coming from the layer above [kg/s/m2]
288REAL,    INTENT(INOUT), DIMENSION(klon) :: snowclr        !--flux of snow gridbox-mean in clear sky coming from the layer above [kg/s/m2]
289REAL,    INTENT(INOUT), DIMENSION(klon) :: snowcld        !--flux of snow gridbox-mean in cloudy air coming from the layer above [kg/s/m2]
290
291REAL,    INTENT(OUT),   DIMENSION(klon) :: qraindiag      !--DIAGNOSTIC specific rain content [kg/kg]
292REAL,    INTENT(OUT),   DIMENSION(klon) :: qsnowdiag      !--DIAGNOSTIC specific snow content [kg/kg]
293REAL,    INTENT(OUT),   DIMENSION(klon) :: dqrcol         !--rain tendendy due to collection by rain of liquid cloud droplets [kg/kg/s]
294REAL,    INTENT(OUT),   DIMENSION(klon) :: dqsagg         !--snow tendency due to collection of lcoud ice by aggregation [kg/kg/s]
295REAL,    INTENT(OUT),   DIMENSION(klon) :: dqrauto        !--rain tendency due to autoconversion of cloud liquid [kg/kg/s]
296REAL,    INTENT(OUT),   DIMENSION(klon) :: dqsauto        !--snow tendency due to autoconversion of cloud ice [kg/kg/s]
297REAL,    INTENT(OUT),   DIMENSION(klon) :: dqsrim         !--snow tendency due to riming [kg/kg/s]
298REAL,    INTENT(OUT),   DIMENSION(klon) :: dqsmelt        !--snow tendency due to melting [kg/kg/s]
299REAL,    INTENT(OUT),   DIMENSION(klon) :: dqrmelt        !--rain tendency due to melting [kg/kg/s]
300REAL,    INTENT(OUT),   DIMENSION(klon) :: dqsfreez       !--snow tendency due to freezing [kg/kg/s]
301REAL,    INTENT(OUT),   DIMENSION(klon) :: dqrfreez       !--rain tendency due to freezing [kg/kg/s]
302
303
304
305!--Local variables
306
307INTEGER :: i
308REAL, DIMENSION(klon) :: hum_to_flux
309REAL, DIMENSION(klon) :: qtot !--includes vap, liq, ice and precip
310
311!--Partition of the fluxes
312REAL :: dcldfra
313REAL :: precipfractot
314REAL :: dprecipfracclr, dprecipfraccld
315REAL :: drainclr, dsnowclr
316REAL :: draincld, dsnowcld
317
318!--Collection, aggregation and riming
319REAL :: eff_cldfra
320REAL :: coef_col, coef_agg, coef_rim, coef_tmp, qrain_tmp
321REAL :: Eff_rain_liq, Eff_snow_ice, Eff_snow_liq
322REAL :: dqlcol           !--loss of liquid cloud content due to collection by rain [kg/kg/s]
323REAL :: dqiagg           !--loss of ice cloud content due to collection by aggregation [kg/kg/s]
324REAL :: dqlrim           !--loss of liquid cloud content due to riming on snow [kg/kg/s]
325
326!--Autoconversion
327REAL :: qthresh_auto_rain, tau_auto_rain, expo_auto_rain
328REAL :: qthresh_auto_snow, tau_auto_snow, expo_auto_snow
329REAL :: dqlauto          !--loss of liquid cloud content due to autoconversion to rain [kg/kg/s]
330REAL :: dqiauto          !--loss of ice cloud content due to autoconversion to snow [kg/kg/s]
331
332!--Melting
333REAL :: dqsmelt_max
334REAL :: nb_snowflake_clr, nb_snowflake_cld
335REAL :: capa_snowflake, temp_wetbulb
336REAL :: dqsclrmelt, dqscldmelt, dqstotmelt
337REAL, DIMENSION(klon) :: qzero, qsat, dqsat
338
339!--Freezing
340REAL :: dqrfreez_max
341REAL :: tau_freez
342REAL :: dqrclrfreez, dqrcldfreez, dqrtotfreez
343REAL :: coef_freez
344REAL :: dqifreez        !--loss of ice cloud content due to collection of ice from rain [kg/kg/s]
345REAL :: Eff_rain_ice
346
347
348!--Initialisation of variables
349
350qzero(:)    = 0.
351
352dqrcol(:)   = 0.
353dqsagg(:)   = 0.
354dqsauto(:)  = 0.
355dqrauto(:)  = 0.
356dqsrim(:)   = 0.
357dqrmelt(:)  = 0.
358dqsmelt(:)  = 0.
359dqrfreez(:) = 0.
360dqsfreez(:) = 0.
361
362
363DO i = 1, klon
364
365  !--Variables initialisation
366  dqlcol  = 0.
367  dqiagg  = 0.
368  dqiauto = 0.
369  dqlauto = 0.
370  dqlrim  = 0.
371  dqifreez= 0.
372
373  !--hum_to_flux: coef to convert a specific quantity to a flux
374  !-- hum_to_flux = rho * dz/dt = 1 / g * dP/dt
375  hum_to_flux(i) = ( paprsdn(i) - paprsup(i) ) / RG / dtime
376  qtot(i) = qvap(i) + qliq(i) + qice(i) &
377          + ( raincld(i) + rainclr(i) + snowcld(i) + snowclr(i) ) / hum_to_flux(i)
378
379  !------------------------------------------------------------
380  !--     PRECIPITATION FRACTIONS UPDATE
381  !------------------------------------------------------------
382  !--The goal of this routine is to reattribute precipitation fractions
383  !--and fluxes to clear or cloudy air, depending on the variation of
384  !--the cloud fraction on the vertical dimension. We assume a
385  !--maximum-random overlap of the cloud cover (see Jakob and Klein, 2000,
386  !--and LTP thesis, 2021)
387  !--NB. in fact, we assume a maximum-random overlap of the total precip. frac
388
389  !--Initialisation
390  precipfractot = precipfracclr(i) + precipfraccld(i)
391
392  !--Instead of using the cloud cover which was use in LTP thesis, we use the
393  !--total precip. fraction to compute the maximum-random overlap. This is
394  !--because all the information of the cloud cover is embedded into
395  !--precipfractot, and this allows for taking into account the potential
396  !--reduction of the precipitation fraction because either the flux is too
397  !--small (see barrier at the end of poprecip_postcld) or the flux is completely
398  !--evaporated (see barrier at the end of poprecip_precld)
399  !--NB. precipfraccld(i) is here the cloud fraction of the layer above
400  precipfractot = 1. - ( 1. - precipfractot ) * &
401                 ( 1. - MAX( cldfra(i), precipfraccld(i) ) ) &
402               / ( 1. - MIN( precipfraccld(i), 1. - eps ) )
403
404
405  !--precipfraccld(i) is here the cloud fraction of the layer above
406  dcldfra = cldfra(i) - precipfraccld(i)
407  !--Tendency of the clear-sky precipitation fraction. We add a MAX on the
408  !--calculation of the current CS precip. frac.
409  !dprecipfracclr = MAX( 0., ( precipfractot - cldfra(i) ) ) - precipfracclr(i)
410  !--We remove it, because precipfractot is guaranteed to be > cldfra (the MAX is activated
411  !--if precipfractot < cldfra)
412  dprecipfracclr = ( precipfractot - cldfra(i) ) - precipfracclr(i)
413  !--Tendency of the cloudy precipitation fraction. We add a MAX on the
414  !--calculation of the current CS precip. frac.
415  !dprecipfraccld = MAX( dcldfra , - precipfraccld(i) )
416  !--We remove it, because cldfra is guaranteed to be > 0 (the MAX is activated
417  !--if cldfra < 0)
418  dprecipfraccld = dcldfra
419
420
421  !--If the cloud extends
422  IF ( dprecipfraccld .GT. 0. ) THEN
423    !--If there is no CS precip, nothing happens.
424    !--If there is, we reattribute some of the CS precip flux
425    !--to the cloud precip flux, proportionnally to the
426    !--decrease of the CS precip fraction
427    IF ( precipfracclr(i) .LE. 0. ) THEN
428      drainclr = 0.
429      dsnowclr = 0.
430    ELSE
431      drainclr = dprecipfracclr / precipfracclr(i) * rainclr(i)
432      dsnowclr = dprecipfracclr / precipfracclr(i) * snowclr(i)
433    ENDIF
434  !--If the cloud narrows
435  ELSEIF ( dprecipfraccld .LT. 0. ) THEN
436    !--We reattribute some of the cloudy precip flux
437    !--to the CS precip flux, proportionnally to the
438    !--decrease of the cloud precip fraction
439    draincld = dprecipfraccld / precipfraccld(i) * raincld(i)
440    dsnowcld = dprecipfraccld / precipfraccld(i) * snowcld(i)
441    drainclr = - draincld
442    dsnowclr = - dsnowcld
443  !--If the cloud stays the same or if there is no cloud above and
444  !--in the current layer, nothing happens
445  ELSE
446    drainclr = 0.
447    dsnowclr = 0.
448  ENDIF
449
450  !--We add the tendencies
451  precipfraccld(i) = precipfraccld(i) + dprecipfraccld
452  precipfracclr(i) = precipfracclr(i) + dprecipfracclr
453  rainclr(i) = rainclr(i) + drainclr
454  snowclr(i) = snowclr(i) + dsnowclr
455  raincld(i) = raincld(i) - drainclr
456  snowcld(i) = snowcld(i) - dsnowclr
457 
458
459  !--If vertical heterogeneity is taken into account, we use
460  !--the "true" volume fraction instead of a modified
461  !--surface fraction (which is larger and artificially
462  !--reduces the in-cloud water).
463  IF ( ( iflag_cloudth_vert .GE. 3 ) .AND. ( iflag_rain_incloud_vol .EQ. 1 ) ) THEN
464    eff_cldfra = ctot_vol(i)
465  ELSE
466    eff_cldfra = cldfra(i)
467  ENDIF
468
469
470  !--Start precipitation growth processes
471
472  !--If the cloud is big enough, the precipitation processes activate
473  IF ( cldfra(i) .GE. seuil_neb ) THEN
474
475    !---------------------------------------------------------
476    !--           COLLECTION AND AGGREGATION
477    !---------------------------------------------------------
478    !--Collection: processus through which rain collects small liquid droplets
479    !--in suspension, and add it to the rain flux
480    !--Aggregation: same for snow (precip flux) and ice crystals (in suspension)
481    !--Those processes are treated before autoconversion because we do not
482    !--want to collect/aggregate the newly formed fluxes, which already
483    !--"saw" the cloud as they come from it
484    !--The formulas come from Muench and Lohmann 2020
485
486    !--gamma_col: tuning coefficient [-]
487    !--rho_rain: volumic mass of rain [kg/m3]
488    !--r_rain: size of the rain droplets [m]
489    !--Eff_rain_liq: efficiency of the collection process [-] (between 0 and 1)
490    !--dqlcol is a gridbox-mean quantity, as is qliq and raincld. They are
491    !--divided by respectively eff_cldfra, eff_cldfra and precipfraccld to
492    !--get in-cloud mean quantities. The two divisions by eff_cldfra are
493    !--then simplified.
494
495    !--The sticking efficacy is perfect.
496    Eff_rain_liq = 1.
497    coef_col = gamma_col * 3. / 4. / rho_rain / r_rain * Eff_rain_liq
498    IF ((raincld(i) .GT. 0.) .AND. (coef_col .GT. 0.)) THEN
499      !-- ATTENTION Double implicit version
500      !-- BEWARE the formule below is FALSE (because raincld is a flux, not a delta flux)
501      !qrain_tmp = raincld(i) / hum_to_flux(i)
502      !coef_tmp = coef_col * dtime * ( qrain_tmp / precipfraccld(i) + qliq(i) / eff_cldfra )
503      !dqlcol = qliq(i) * ( 1. / ( 1. + 0.5 * ( coef_tmp - 1. + SQRT( &
504      !    ( 1. - coef_tmp )**2. + 4. * coef_col * dtime * qrain_tmp / precipfraccld(i) ) &
505      !                   ) ) - 1. )
506      !--Barriers so that the processes do not consume more liquid/ice than
507      !--available.
508      !dqlcol = MAX( - qliq(i), dqlcol )
509      !--Exact explicit version, which does not need a barrier because of
510      !--the exponential decrease
511      dqlcol = qliq(i) * ( EXP( - dtime * coef_col * raincld(i) / precipfraccld(i) ) - 1. )
512
513      !--Add tendencies
514      qliq(i) = qliq(i) + dqlcol
515      raincld(i) = raincld(i) - dqlcol * hum_to_flux(i)
516
517      !--Diagnostic tendencies
518      dqrcol(i)  = - dqlcol  / dtime
519    ENDIF
520
521    !--Same as for aggregation
522    !--Eff_snow_liq formula: following Milbrandt and Yau 2005,
523    !--it s a product of a collection efficiency and a sticking efficiency
524    Eff_snow_ice = 0.05 * EXP( 0.1 * ( temp(i) - RTT ) )
525    coef_agg = gamma_agg * 3. / 4. / rho_snow / r_snow * Eff_snow_ice
526    IF ((snowcld(i) .GT. 0.) .AND. (coef_agg .GT. 0.)) THEN
527      !-- ATTENTION Double implicit version?
528      !--Barriers so that the processes do not consume more liquid/ice than
529      !--available.
530      !dqiagg = MAX( - qice(i), dqiagg )
531      !--Exact explicit version, which does not need a barrier because of
532      !--the exponential decrease
533      dqiagg = qice(i) * ( EXP( - dtime * coef_agg * snowcld(i) / precipfraccld(i) ) - 1. )
534
535      !--Add tendencies
536      qice(i) = qice(i) + dqiagg
537      snowcld(i) = snowcld(i) - dqiagg * hum_to_flux(i)
538
539      !--Diagnostic tendencies
540      dqsagg(i)  = - dqiagg  / dtime
541    ENDIF
542
543
544    !---------------------------------------------------------
545    !--                  AUTOCONVERSION
546    !---------------------------------------------------------
547    !--Autoconversion converts liquid droplets/ice crystals into
548    !--rain drops/snowflakes. It relies on the formulations by
549    !--Sundqvist 1978.
550
551    !--If we are in a convective point, we have different parameters
552    !--for the autoconversion
553    IF ( ptconv(i) ) THEN
554        qthresh_auto_rain = cld_lc_con
555        qthresh_auto_snow = cld_lc_con_snow
556
557        tau_auto_rain = cld_tau_con
558        !--tau for snow depends on the ice fraction in mixed-phase clouds     
559        tau_auto_snow = tau_auto_snow_max &
560                      + ( tau_auto_snow_min - tau_auto_snow_max ) * ( 1. - icefrac(i) )
561
562        expo_auto_rain = cld_expo_con
563        expo_auto_snow = cld_expo_con
564    ELSE
565        qthresh_auto_rain = cld_lc_lsc
566        qthresh_auto_snow = cld_lc_lsc_snow
567
568        tau_auto_rain = cld_tau_lsc
569        !--tau for snow depends on the ice fraction in mixed-phase clouds     
570        tau_auto_snow = tau_auto_snow_max &
571                      + ( tau_auto_snow_min - tau_auto_snow_max ) * ( 1. - icefrac(i) )
572
573        expo_auto_rain = cld_expo_lsc
574        expo_auto_snow = cld_expo_lsc
575    ENDIF
576
577
578    ! Liquid water quantity to remove according to (Sundqvist, 1978)
579    ! dqliq/dt = -qliq/tau * ( 1-exp(-(qliqincld/qthresh)**2) )
580    !
581    !--And same formula for ice
582    !
583    !--We first treat the second term (with exponential) in an explicit way
584    !--and then treat the first term (-q/tau) in an exact way
585
586    dqlauto = - qliq(i) * ( 1. - exp( - dtime / tau_auto_rain * ( 1. - exp( &
587               - ( qliq(i) / eff_cldfra / qthresh_auto_rain ) ** expo_auto_rain ) ) ) )
588
589    dqiauto = - qice(i) * ( 1. - exp( - dtime / tau_auto_snow * ( 1. - exp( &
590               - ( qice(i) / eff_cldfra / qthresh_auto_snow ) ** expo_auto_snow ) ) ) )
591
592
593    !--Barriers so that we don t create more rain/snow
594    !--than there is liquid/ice
595    dqlauto = MAX( - qliq(i), dqlauto )
596    dqiauto = MAX( - qice(i), dqiauto )
597
598    !--Add tendencies
599    qliq(i) = qliq(i) + dqlauto
600    qice(i) = qice(i) + dqiauto
601    raincld(i) = raincld(i) - dqlauto * hum_to_flux(i)
602    snowcld(i) = snowcld(i) - dqiauto * hum_to_flux(i)
603
604    !--Diagnostic tendencies
605    dqsauto(i) = - dqiauto / dtime
606    dqrauto(i) = - dqlauto / dtime
607
608
609    !---------------------------------------------------------
610    !--                  RIMING
611    !---------------------------------------------------------
612    !--Process which converts liquid droplets in suspension into
613    !--snow (graupel in fact) because of the collision between
614    !--those and falling snowflakes.
615    !--The formula comes from Muench and Lohmann 2020
616    !--NB.: this process needs a temperature adjustment
617
618    !--Eff_snow_liq formula: following Seifert and Beheng 2006,
619    !--assuming a cloud droplet diameter of 20 microns.
620    Eff_snow_liq = 0.2
621    coef_rim = gamma_rim * 3. / 4. / rho_snow / r_snow * Eff_snow_liq
622    IF ((snowcld(i) .GT. 0.) .AND. (coef_rim .GT. 0.)) THEN
623      !-- ATTENTION Double implicit version?
624      !--Barriers so that the processes do not consume more liquid than
625      !--available.
626      !dqlrim = MAX( - qliq(i), dqlrim )
627      !--Exact version, which does not need a barrier because of
628      !--the exponential decrease
629      dqlrim = qliq(i) * ( EXP( - dtime * coef_col * snowcld(i) / precipfraccld(i) ) - 1. )
630
631      !--Add tendencies
632      qliq(i) = qliq(i) + dqlrim
633      snowcld(i) = snowcld(i) - dqlrim * hum_to_flux(i)
634
635      !--Temperature adjustment with the release of latent
636      !--heat because of solid condensation
637      temp(i) = temp(i) - dqlrim * RLMLT / RCPD &
638                        / ( 1. + RVTMP2 * qtot(i) )
639
640      !--Diagnostic tendencies
641      dqsrim(i)  = - dqlrim  / dtime
642    ENDIF
643
644  ENDIF ! cldfra .GE. seuil_neb
645
646ENDDO ! loop on klon
647
648
649!--Re-calculation of saturation specific humidity
650!--because riming changed temperature
651CALL calc_qsat_ecmwf(klon, temp, qzero, pplay, RTT, 0, .FALSE., qsat, dqsat)
652
653DO i = 1, klon
654
655  !---------------------------------------------------------
656  !--                  MELTING
657  !---------------------------------------------------------
658  !--Process through which snow melts into rain.
659  !--The formula is homemade.
660  !--NB.: this process needs a temperature adjustment
661
662  !--dqsmelt_max: maximum snow melting so that temperature
663  !--             stays higher than 273 K [kg/kg]
664  !--capa_snowflake: capacitance of a snowflake, equal to
665  !--                the radius if the snowflake is a sphere [m]
666  !--temp_wetbulb: wet-bulb temperature [K]
667  !--snow_fallspeed: snow fall velocity (in clear/cloudy sky) [m/s]
668  !--air_thermal_conduct: thermal conductivity of the air [J/m/K/s]
669  !--coef_ventil: ventilation coefficient [-]
670  !--nb_snowflake: number of snowflakes (in clear/cloudy air) [-]
671
672  IF ( ( snowclr(i) + snowcld(i) ) .GT. 0. ) THEN
673    !--Computed according to
674    !--Cpdry * Delta T * (1 + (Cpvap/Cpdry - 1) * qtot) = Lfusion * Delta q
675    dqsmelt_max = MIN(0., ( RTT - temp(i) ) / RLMLT * RCPD &
676                        * ( 1. + RVTMP2 * qtot(i) ))
677   
678    !--Initialisation
679    dqsclrmelt = 0.
680    dqscldmelt = 0.
681
682    capa_snowflake = r_snow
683    ! ATTENTION POUR L'INSTANT C'EST UN WBULB SELON FORMULE ECMWF
684    ! ATTENTION EST-CE QVAP ?????
685    temp_wetbulb = temp(i) - ( qsat(i) - qvap(i) ) &
686                 * ( 1329.31 + 0.0074615 * ( pplay(i) - 0.85e5 ) &
687                 - 40.637 * ( temp(i) - 275. ) )
688
689    !--In clear air
690    IF ( snowclr(i) .GT. 0. ) THEN
691      !--Calculated according to
692      !-- flux = velocity_snowflakes * nb_snowflakes * volume_snowflakes * rho_snow
693      nb_snowflake_clr = snowclr(i) / precipfracclr(i) / snow_fallspeed_clr &
694                       / ( 4. / 3. * RPI * r_snow**3. * rho_snow )
695      dqsclrmelt = - nb_snowflake_clr * 4. * RPI * air_thermal_conduct &
696                   * capa_snowflake / RLMLT * coef_ventil &
697                   * MAX(0., temp_wetbulb - RTT) * dtime
698
699      !--Barrier to limit the melting flux to the clr snow flux in the mesh
700      dqsclrmelt = MAX( dqsclrmelt , -snowclr(i) / hum_to_flux(i))
701   ENDIF
702
703    !--In cloudy air
704    IF ( snowcld(i) .GT. 0. ) THEN
705      !--Calculated according to
706      !-- flux = velocity_snowflakes * nb_snowflakes * volume_snowflakes * rho_snow
707      nb_snowflake_cld = snowcld(i) / precipfraccld(i) / snow_fallspeed_cld &
708                       / ( 4. / 3. * RPI * r_snow**3. * rho_snow )
709      dqscldmelt = - nb_snowflake_cld * 4. * RPI * air_thermal_conduct &
710                   * capa_snowflake / RLMLT * coef_ventil &
711                   * MAX(0., temp_wetbulb - RTT) * dtime
712
713      !--Barrier to limit the melting flux to the cld snow flux in the mesh
714      dqscldmelt = MAX( dqscldmelt , -snowcld(i) / hum_to_flux(i))
715    ENDIF
716   
717    !--Barrier on temperature. If the total melting flux leads to a
718    !--positive temperature, it is limited to keep temperature above 0 degC.
719    !--It is activated if the total is LOWER than the max
720    !--because everything is negative
721    dqstotmelt = dqsclrmelt + dqscldmelt
722    IF ( dqstotmelt .LT. dqsmelt_max ) THEN
723      !--We redistribute the max melted snow keeping
724      !--the clear/cloud partition of the melted snow
725      dqsclrmelt = dqsmelt_max * dqsclrmelt / dqstotmelt
726      dqscldmelt = dqsmelt_max * dqscldmelt / dqstotmelt
727      dqstotmelt = dqsmelt_max
728    ENDIF
729
730    !--Add tendencies
731    rainclr(i) = rainclr(i) - dqsclrmelt * hum_to_flux(i)
732    raincld(i) = raincld(i) - dqscldmelt * hum_to_flux(i)
733    snowclr(i) = snowclr(i) + dqsclrmelt * hum_to_flux(i)
734    snowcld(i) = snowcld(i) + dqscldmelt * hum_to_flux(i)
735
736    !--Temperature adjustment with the release of latent
737    !--heat because of melting
738    temp(i) = temp(i) + dqstotmelt * RLMLT / RCPD &
739                      / ( 1. + RVTMP2 * qtot(i) )
740
741    !--Diagnostic tendencies
742    dqrmelt(i) = - dqstotmelt / dtime
743    dqsmelt(i) = dqstotmelt / dtime
744
745  ENDIF
746
747
748  !---------------------------------------------------------
749  !--                  FREEZING
750  !---------------------------------------------------------
751  !--Process through which rain freezes into snow. This is
752  !--parameterized as an exponential decrease of the rain
753  !--water content.
754  !--The formula is homemade.
755  !--This is based on a caracteritic time of freezing, which
756  !--exponentially depends on temperature so that it is
757  !--equal to 1 for temp_nowater (see below) and is close to
758  !--0 for RTT (=273.15 K).
759  !--NB.: this process needs a temperature adjustment
760
761  !--dqrfreez_max: maximum rain freezing so that temperature
762  !--              stays lower than 273 K [kg/kg]
763  !--tau_freez: caracteristic time of freezing [s]
764  !--gamma_freez: tuning parameter [s-1]
765  !--alpha_freez: tuning parameter for the shape of the exponential curve [-]
766  !--temp_nowater: temperature below which no liquid water exists [K] (about -40 degC)
767
768  IF ( ( rainclr(i) + raincld(i) ) .GT. 0. ) THEN
769
770    !--Computed according to
771    !--Cpdry * Delta T * (1 + (Cpvap/Cpdry - 1) * qtot) = Lfusion * Delta q
772    dqrfreez_max = MIN(0., ( temp(i) - RTT ) / RLMLT * RCPD &
773                         * ( 1. + RVTMP2 * qtot(i) ))
774 
775    tau_freez = 1. / ( beta_freez &
776              * EXP( - alpha_freez * ( temp(i) - temp_nowater ) / ( RTT - temp_nowater ) ) )
777
778    !--Initialisation
779    dqrclrfreez = 0.
780    dqrcldfreez = 0.
781
782    !--In clear air
783    IF ( rainclr(i) .GT. 0. ) THEN
784      !--Exact solution of dqrain/dt = -qrain/tau_freez
785      dqrclrfreez = rainclr(i) / hum_to_flux(i) * ( EXP( - dtime / tau_freez ) - 1. )
786    ENDIF
787
788    !--In cloudy air
789    IF ( raincld(i) .GT. 0. ) THEN
790      !--Exact solution of dqrain/dt = -qrain/tau_freez
791      dqrcldfreez = raincld(i) / hum_to_flux(i) * ( EXP( - dtime / tau_freez ) - 1. )
792
793      !---------------------------------------------------------
794      !--    FREEZING OF RAIN WITH CONTACT OF ICE CRYSTALS
795      !---------------------------------------------------------
796      !--Sub-process of freezing which quantifies the collision between
797      !--ice crystals in suspension and falling rain droplets.
798      !--The rain droplets freeze, becoming graupel, and carrying
799      !--the ice crystal (which acted as an ice nucleating particle).
800      !--The formula is adapted from the riming formula.
801
802      !--The sticking efficacy is perfect.
803      Eff_rain_ice = 1.
804      coef_freez = gamma_freez * 3. / 4. / rho_rain / r_rain * Eff_rain_ice
805      !-- ATTENTION Double implicit version? + barriers if needed
806      !--Exact version, which does not need a barrier because of
807      !--the exponential decrease
808      dqifreez = qice(i) * ( EXP( - dtime * coef_freez * raincld(i) / precipfraccld(i) ) - 1. )
809
810      !--We add the two freezing processes in cloud
811      dqrcldfreez = dqrcldfreez - dqifreez
812    ENDIF
813
814    !--Barriers
815    !--It is activated if the total is LOWER than the max
816    !--because everything is negative
817    dqrtotfreez = dqrclrfreez + dqrcldfreez
818    IF ( dqrtotfreez .LT. dqrfreez_max ) THEN
819      !--We redistribute the max freezed rain keeping
820      !--the clear/cloud partition of the freezing rain
821      dqrclrfreez = dqrfreez_max * dqrclrfreez / dqrtotfreez
822      dqrcldfreez = dqrfreez_max * dqrcldfreez / dqrtotfreez
823      dqrtotfreez = dqrfreez_max
824    ENDIF
825
826
827    !--Add tendencies
828    rainclr(i) = rainclr(i) + dqrclrfreez * hum_to_flux(i)
829    raincld(i) = raincld(i) + dqrcldfreez * hum_to_flux(i)
830    snowclr(i) = snowclr(i) - dqrclrfreez * hum_to_flux(i)
831    snowcld(i) = snowcld(i) - dqrcldfreez * hum_to_flux(i)
832
833    !--Temperature adjustment with the uptake of latent
834    !--heat because of freezing
835    temp(i) = temp(i) - dqrtotfreez * RLMLT / RCPD &
836                      / ( 1. + RVTMP2 * qtot(i) )
837
838    !--Diagnostic tendencies
839    dqrfreez(i) = dqrtotfreez / dtime
840    dqsfreez(i) = - dqrtotfreez / dtime
841
842  ENDIF
843
844  !--If the local flux of rain+snow in clear/cloudy air is lower than rain_int_min,
845  !--we reduce the precipiration fraction in the clear/cloudy air so that the new
846  !--local flux of rain+snow is equal to rain_int_min.
847  !--Here, rain+snow is the gridbox-mean flux of precip.
848  !--Therefore, (rain+snow)/precipfrac is the local flux of precip.
849  !--If the local flux of precip is lower than rain_int_min, i.e.,
850  !-- (rain+snow)/precipfrac < rain_int_min , i.e.,
851  !-- (rain+snow)/rain_int_min < precipfrac , then we want to reduce
852  !--the precip fraction to the equality, i.e., precipfrac = (rain+snow)/rain_int_min.
853  !--Note that this is physically different than what is proposed in LTP thesis.
854  precipfracclr(i) = MIN( precipfracclr(i), ( rainclr(i) + snowclr(i) ) / rain_int_min )
855  precipfraccld(i) = MIN( precipfraccld(i), ( raincld(i) + snowcld(i) ) / rain_int_min )
856
857  !--Calculate outputs
858  rain(i) = rainclr(i) + raincld(i)
859  snow(i) = snowclr(i) + snowcld(i)
860
861  !--Diagnostics
862  !--BEWARE this is indeed a diagnostic: this is an estimation from
863  !--the value of the flux at the bottom interface of the mesh and
864  !--and assuming an upstream numerical calculation
865  !--If ok_radocond_snow is TRUE, then the diagnostic qsnowdiag is
866  !--used for computing the total ice water content in the mesh
867  !--for radiation only
868  qraindiag(i) = ( rainclr(i) / ( pplay(i) / RD / temp(i) ) / rain_fallspeed_clr &
869                 + raincld(i) / ( pplay(i) / RD / temp(i) ) / rain_fallspeed_cld )
870  qsnowdiag(i) = ( snowclr(i) / ( pplay(i) / RD / temp(i) ) / snow_fallspeed_clr &
871                 + snowcld(i) / ( pplay(i) / RD / temp(i) ) / snow_fallspeed_cld )
872
873ENDDO ! loop on klon
874
875END SUBROUTINE poprecip_postcld
876
877END MODULE lmdz_lscp_poprecip
Note: See TracBrowser for help on using the repository browser.