source: LMDZ6/branches/contrails/libf/phylmd/lmdz_aviation.f90 @ 5551

Last change on this file since 5551 was 5551, checked in by aborella, 5 months ago

Changed input: from absolute to concentration (per mesh to per m3)

File size: 28.3 KB
Line 
1MODULE lmdz_aviation
2!----------------------------------------------------------------
3! Module for aviation and contrails
4
5IMPLICIT NONE
6
7CONTAINS
8
9SUBROUTINE aviation_water_emissions( &
10      klon, klev, dtime, pplay, temp, qtot, &
11      flight_h2o, d_q_avi &
12      )
13
14USE lmdz_lscp_ini, ONLY: RD
15
16IMPLICIT NONE
17
18INTEGER,                      INTENT(IN)  :: klon, klev ! number of horizontal grid points and vertical levels
19REAL,                         INTENT(IN)  :: dtime      ! time step [s]
20REAL, DIMENSION(klon,klev),   INTENT(IN)  :: pplay      ! mid-layer pressure [Pa]
21REAL, DIMENSION(klon,klev),   INTENT(IN)  :: temp       ! temperature (K)
22REAL, DIMENSION(klon,klev),   INTENT(IN)  :: qtot       ! total specific humidity (in vapor phase) [kg/kg]
23REAL, DIMENSION(klon,klev),   INTENT(IN)  :: flight_h2o ! aviation emitted H2O concentration [kgH2O/s/m3]
24REAL, DIMENSION(klon,klev),   INTENT(OUT) :: d_q_avi    ! water vapor tendency from aviation [kg/kg]
25! Local
26INTEGER :: i, k
27REAL :: rho
28
29DO i=1, klon
30  DO k=1, klev
31    !--Dry density [kg/m3]
32    rho = pplay(i,k) / temp(i,k) / RD
33    !--Dry air mass [kg/m2]
34    !rhodz = ( paprs(i,k) - paprs(i,k+1) ) / RG
35    !--Cell thickness [m]
36    !dz = rhodz / rho
37    !--Cell dry air mass [kg]
38    !M_cell = rhodz * cell_area(i)
39
40    !--q is the specific humidity (kg/kg humid air) hence the complicated equation to update q
41    ! qnew = ( m_humid_air * qold + dm_H2O ) / ( m_humid_air + dm_H2O ) 
42    !      = ( m_dry_air * qold + dm_h2O * (1-qold) ) / (m_dry_air + dm_H2O * (1-qold) )
43    !--The equation is derived by writing m_humid_air = m_dry_air + m_H2O = m_dry_air / (1-q)
44    !--flight_h2O is in kg H2O / s / m3
45   
46    !d_q_avi(i,k) = ( M_cell * qtot(i,k) + V_cell * flight_h2o(i,k) * dtime * ( 1. - qtot(i,k) ) ) &
47    !             / ( M_cell             + V_cell * flight_h2o(i,k) * dtime * ( 1. - qtot(i,k) ) ) &
48    !             - qtot(i,k)
49    !--NB., M_cell = V_cell * rho
50    !d_q_avi(i,k) = ( rho * qtot(i,k) + flight_h2o(i,k) * dtime * ( 1. - qtot(i,k) ) ) &
51    !             / ( rho             + flight_h2o(i,k) * dtime * ( 1. - qtot(i,k) ) ) &
52    !             - qtot(i,k)
53    !--Same formula, more computationally effective but less readable
54    d_q_avi(i,k) = flight_h2o(i,k) * ( 1. - qtot(i,k) ) &
55                 / ( rho / dtime / ( 1. - qtot(i,k) ) + flight_h2o(i,k) )
56  ENDDO
57ENDDO
58
59END SUBROUTINE aviation_water_emissions
60
61
62!**********************************************************************************
63SUBROUTINE contrails_formation_evolution( &
64      dtime, pplay, temp, qsat, qsatl, gamma_cond, rcont_seri, flight_dist, &
65      cldfra, qvc, dz, pdf_loc, pdf_scale, pdf_alpha, &
66      Tcritcont, qcritcont, potcontfraP, potcontfraNP, contfra, &
67      dcontfra_cir, dcf_avi, dqvc_avi, dqi_avi &
68      )
69
70USE lmdz_lscp_ini, ONLY: RCPD, EPS_W, RTT
71USE lmdz_lscp_ini, ONLY: EI_H2O_aviation, qheat_fuel_aviation, prop_efficiency_aviation
72USE lmdz_lscp_ini, ONLY: linear_contrails_lifetime
73USE lmdz_lscp_ini, ONLY: eps
74
75USE lmdz_lscp_tools, ONLY: GAMMAINC, calc_qsat_ecmwf
76
77IMPLICIT NONE
78
79!
80! Input
81!
82REAL, INTENT(IN)  :: dtime        ! time step [s]
83REAL, INTENT(IN)  :: pplay        ! layer pressure [Pa]
84REAL, INTENT(IN)  :: temp         ! temperature [K]
85REAL, INTENT(IN)  :: qsat         ! saturation specific humidity [kg/kg]
86REAL, INTENT(IN)  :: qsatl        ! saturation specific humidity w.r.t. liquid [kg/kg]
87REAL, INTENT(IN)  :: gamma_cond   ! condensation threshold w.r.t. qsat [-]
88REAL, INTENT(IN)  :: rcont_seri   ! ratio of contrails fraction to total cloud fraction [-]
89REAL, INTENT(IN)  :: flight_dist  ! aviation distance flown concentration [m/s/m3]
90REAL, INTENT(IN)  :: cldfra       ! cloud fraction [-]
91REAL, INTENT(IN)  :: qvc          ! gridbox-mean vapor in the cloud [kg/kg]
92REAL, INTENT(IN)  :: dz           ! cell width [m]
93REAL, INTENT(IN)  :: pdf_loc      ! location parameter of the clear sky PDF [%]
94REAL, INTENT(IN)  :: pdf_scale    ! scale parameter of the clear sky PDF [%]
95REAL, INTENT(IN)  :: pdf_alpha    ! shape parameter of the clear sky PDF [-]
96!
97! Output
98!
99REAL, INTENT(OUT) :: Tcritcont    ! critical temperature for contrail formation [K]
100REAL, INTENT(OUT) :: qcritcont    ! critical specific humidity for contrail formation [kg/kg]
101REAL, INTENT(OUT) :: potcontfraP  ! potential persistent contrail fraction [-]
102REAL, INTENT(OUT) :: potcontfraNP ! potential non-persistent contrail fraction [-]
103REAL, INTENT(OUT) :: contfra      ! linear contrail fraction [-]
104REAL, INTENT(OUT) :: dcontfra_cir ! linear contrail fraction to cirrus cloud fraction tendency [s-1]
105REAL, INTENT(OUT) :: dcf_avi      ! cloud fraction tendency because of aviation [s-1]
106REAL, INTENT(OUT) :: dqvc_avi     ! specific ice content tendency because of aviation [kg/kg/s]
107REAL, INTENT(OUT) :: dqi_avi      ! specific cloud water vapor tendency because of aviation [kg/kg/s]
108!
109! Local
110!
111! for Schmidt-Appleman criteria
112REAL, DIMENSION(1) :: ztemp, zpplay, qzero, zqsatl, zdqsatl
113REAL :: Gcont, qsatl_crit, psatl_crit, pcrit
114REAL :: pdf_x, pdf_y, pdf_e2, pdf_e3
115REAL :: pdf_fra_above_qcritcont, pdf_fra_above_qsat, pdf_fra_above_qnuc
116REAL :: pdf_q_above_qcritcont, pdf_q_above_qsat, pdf_q_above_qnuc
117REAL :: qpotcontP
118!
119! for new contrail formation
120REAL :: contrail_cross_section, contfra_new
121
122qzero(:) = 0.
123
124!---------------------------------
125!--  SCHIMDT-APPLEMAN CRITERIA  --
126!---------------------------------
127!--Revised by Schumann (1996) and Rap et al. (2010)
128
129!--Gcont is the slope of the mean phase trajectory in the turbulent exhaust field on an absolute
130!--in Pa / K. See Rap et al. (2010) in JGR.
131!--kg H2O/kg fuel * J kg air-1 K-1 * Pa / (kg H2O / kg air * J kg fuel-1)
132Gcont = EI_H2O_aviation * RCPD * pplay &
133       / ( EPS_W * qheat_fuel_aviation * ( 1. - prop_efficiency_aviation ) )
134!--critical temperature below which no liquid contrail can form in exhaust
135!--noted T_LM in Schumann (1996), their Eq. 31 in Appendix 2
136!--in Kelvins
137Tcritcont = 226.69 + 9.43 * LOG( MAX(Gcont, 0.1) - 0.053 ) &
138       + 0.72 * LOG( MAX(Gcont, 0.1) - 0.053 )**2
139
140ztemp(1) = Tcritcont
141zpplay(1) = pplay
142CALL calc_qsat_ecmwf(1, ztemp, qzero, zpplay, RTT, 1, .FALSE., zqsatl, zdqsatl)
143qsatl_crit = zqsatl(1)
144
145psatl_crit = qsatl_crit / ( EPS_W + ( 1. - EPS_W ) * qsatl_crit ) * pplay
146pcrit = Gcont * ( temp - Tcritcont ) + psatl_crit
147qcritcont = EPS_W * pcrit / ( pplay - ( 1. - EPS_W ) * pcrit )
148
149
150IF ( ( ( 1. - cldfra ) .GT. eps ) .AND. ( temp .LT. Tcritcont ) ) THEN
151
152  pdf_x = qcritcont / qsatl * 100.
153  pdf_y = ( MAX( pdf_x - pdf_loc, 0. ) / pdf_scale ) ** pdf_alpha
154  pdf_e2 = GAMMA(1. + 1. / pdf_alpha)
155  pdf_e3 = GAMMAINC ( 1. + 1. / pdf_alpha , pdf_y )
156  pdf_e3 = pdf_scale * ( 1. - pdf_e3 ) * pdf_e2
157  pdf_fra_above_qcritcont = EXP( - pdf_y ) * ( 1. - cldfra )
158  pdf_q_above_qcritcont = ( pdf_e3 * ( 1. - cldfra ) + pdf_loc * pdf_fra_above_qcritcont ) * qsatl / 100.
159
160  pdf_x = gamma_cond * qsat / qsatl * 100.
161  pdf_y = ( MAX( pdf_x - pdf_loc, 0. ) / pdf_scale ) ** pdf_alpha
162  pdf_e2 = GAMMA(1. + 1. / pdf_alpha)
163  pdf_e3 = GAMMAINC ( 1. + 1. / pdf_alpha , pdf_y )
164  pdf_e3 = pdf_scale * ( 1. - pdf_e3 ) * pdf_e2
165  pdf_fra_above_qnuc = EXP( - pdf_y ) * ( 1. - cldfra )
166  pdf_q_above_qnuc = ( pdf_e3 * ( 1. - cldfra ) + pdf_loc * pdf_fra_above_qnuc ) * qsatl / 100.
167
168  pdf_x = qsat / qsatl * 100.
169  pdf_y = ( MAX( pdf_x - pdf_loc, 0. ) / pdf_scale ) ** pdf_alpha
170  pdf_e2 = GAMMA(1. + 1. / pdf_alpha)
171  pdf_e3 = GAMMAINC ( 1. + 1. / pdf_alpha , pdf_y )
172  pdf_e3 = pdf_scale * ( 1. - pdf_e3 ) * pdf_e2
173  pdf_fra_above_qsat = EXP( - pdf_y ) * ( 1. - cldfra )
174  pdf_q_above_qsat = ( pdf_e3 * ( 1. - cldfra ) + pdf_loc * pdf_fra_above_qsat ) * qsatl / 100.
175
176  potcontfraNP = MAX(0., pdf_fra_above_qcritcont - pdf_fra_above_qsat)
177  potcontfraP = MAX(0., MIN(pdf_fra_above_qsat - pdf_fra_above_qnuc, &
178                    pdf_fra_above_qcritcont - pdf_fra_above_qnuc))
179  qpotcontP = MAX(0., MIN(pdf_q_above_qsat - pdf_q_above_qnuc, &
180                  pdf_q_above_qcritcont - pdf_q_above_qnuc))
181
182ELSE
183
184  potcontfraNP = 0.
185  potcontfraP = 0.
186
187ENDIF ! temp .LT. Tcritcont
188
189!--Convert existing contrail fraction into "natural" cirrus cloud fraction
190contfra = rcont_seri * cldfra
191dcontfra_cir = contfra * ( EXP( - dtime / linear_contrails_lifetime ) - 1. )
192contfra = contfra + dcontfra_cir
193
194!--Add a source of contrails from aviation
195dcf_avi = 0.
196dqi_avi = 0.
197dqvc_avi = 0.
198IF ( potcontfraP .GT. eps ) THEN
199  contrail_cross_section = CONTRAIL_CROSS_SECTION_ONERA(dz)
200  contfra_new = MIN(1., flight_dist * dtime * contrail_cross_section)
201  dcf_avi = potcontfraP * contfra_new
202  IF ( cldfra .GT. eps ) THEN
203    dqvc_avi = dcf_avi * qvc / cldfra
204  ELSE
205    dqvc_avi = dcf_avi * qsat
206  ENDIF
207  dqi_avi = dcf_avi * qpotcontP / potcontfraP - dqvc_avi
208
209  !--Add tendencies
210  contfra = contfra + dcf_avi
211ENDIF
212
213END SUBROUTINE contrails_formation_evolution
214
215
216!**********************************************************************************
217SUBROUTINE contrails_mixing( &
218      dtime, pplay, shear, pbl_eps, cell_area, dz, temp, qtot, qsat, &
219      subfra, qsub, issrfra, qissr, cldfra, qcld, qvc, rcont_seri, &
220      dcf_mix, dqvc_mix, dqi_mix, dqt_mix, dcf_mix_issr, dqt_mix_issr &
221      )
222
223!----------------------------------------------------------------------
224! This subroutine calculates the mixing of contrails in their environment.
225! Authors: Audran Borella, Etienne Vignon, Olivier Boucher
226! December 2024
227!----------------------------------------------------------------------
228
229USE lmdz_lscp_ini,        ONLY: RPI, eps, ok_unadjusted_clouds
230USE lmdz_lscp_ini,        ONLY: aspect_ratio_contrails, coef_mixing_contrails, &
231                                coef_shear_contrails, chi_mixing_contrails
232
233IMPLICIT NONE
234
235!
236! Input
237!
238REAL, INTENT(IN)    :: dtime        ! time step [s]
239!
240REAL, INTENT(IN)    :: pplay        ! layer pressure [Pa]
241REAL, INTENT(IN)    :: shear        ! vertical shear [s-1]
242REAL, INTENT(IN)    :: pbl_eps      ! TKE dissipation[m2/s3]
243REAL, INTENT(IN)    :: cell_area    ! cell area [m2]
244REAL, INTENT(IN)    :: dz           ! cell width [m]
245REAL, INTENT(IN)    :: temp         ! temperature [K]
246REAL, INTENT(IN)    :: qtot         ! total specific humidity (without precip) [kg/kg]
247REAL, INTENT(IN)    :: qsat         ! saturation specific humidity [kg/kg]
248REAL, INTENT(IN)    :: subfra       ! subsaturated clear sky fraction [-]
249REAL, INTENT(IN)    :: qsub         ! gridbox-mean subsaturated clear sky specific water [kg/kg]
250REAL, INTENT(IN)    :: issrfra      ! ISSR fraction [-]
251REAL, INTENT(IN)    :: qissr        ! gridbox-mean ISSR specific water [kg/kg]
252REAL, INTENT(IN)    :: cldfra       ! cloud fraction [-]
253REAL, INTENT(IN)    :: qcld         ! gridbox-mean cloudy specific total water [kg/kg]
254REAL, INTENT(IN)    :: qvc          ! gridbox-mean cloudy specific water vapor [kg/kg]
255REAL, INTENT(IN)    :: rcont_seri   ! ratio of contrails fraction to total cloud fraction [-]
256!
257!  Input/Output
258!
259REAL, INTENT(INOUT) :: dcf_mix      ! cloud fraction tendency because of cloud mixing [s-1]
260REAL, INTENT(INOUT) :: dqvc_mix     ! specific cloud water vapor tendency because of cloud mixing [kg/kg/s]
261REAL, INTENT(INOUT) :: dqi_mix      ! specific ice content tendency because of cloud mixing [kg/kg/s]
262REAL, INTENT(INOUT) :: dqt_mix      ! total water tendency because of cloud mixing [kg/kg/s]
263REAL, INTENT(INOUT) :: dcf_mix_issr ! cloud fraction tendency because of cloud mixing in ISSR [s-1]
264REAL, INTENT(INOUT) :: dqt_mix_issr ! total water tendency because of cloud mixing in ISSR [kg/kg/s]
265!
266! Local
267!
268REAL :: dqt_mix_sub_cont, dqt_mix_issr_cont
269REAL :: dcf_mix_sub_cont, dcf_mix_issr_cont
270REAL :: dqvc_mix_sub_cont, dqvc_mix_issr_cont
271REAL :: dcf_mix_cont, dqvc_mix_cont, dqi_mix_cont, dqt_mix_cont
272REAL :: a_mix, bovera, Povera, N_cld_mix, L_mix
273REAL :: envfra_mix, cldfra_mix
274REAL :: L_shear, shear_fra
275REAL :: sigma_mix, issrfra_mix, subfra_mix
276REAL :: qvapincld, qvapinmix, qvapincld_new, qiceincld
277
278!--Initialisation
279dcf_mix_sub_cont   = 0.
280dqt_mix_sub_cont   = 0.
281dqvc_mix_sub_cont  = 0.
282dcf_mix_issr_cont  = 0.
283dqt_mix_issr_cont  = 0.
284dqvc_mix_issr_cont = 0.
285
286!-- PART 1 - TURBULENT DIFFUSION
287
288!--Clouds within the mesh are assumed to be ellipses. The length of the
289!--semi-major axis is a and the length of the semi-minor axis is b.
290!--N_cld_mix is the number of clouds in contact with clear sky, and can be non-integer.
291!--In particular, it is 0 if cldfra = 1.
292!--clouds_perim is the total perimeter of the clouds within the mesh,
293!--not considering interfaces with other meshes (only the interfaces with clear
294!--sky are taken into account).
295!--
296!--The area of each cloud is A = a * b * RPI,
297!--and the perimeter of each cloud is
298!-- P ~= RPI * ( 3 * (a + b) - SQRT( (3 * a + b) * (a + 3 * b) ) )
299!--
300!--With cell_area the area of the cell, we have:
301!-- cldfra = A * N_cld_mix / cell_area
302!-- clouds_perim = P * N_cld_mix
303!--
304!--We assume that the ratio between b and a is a function of
305!--cldfra such that it is 1 for cldfra = 1 and it is low for little cldfra, because
306!--if cldfra is low the clouds are linear, and if cldfra is high, the clouds
307!--are spherical.
308!-- b / a = bovera = MAX(0.1, cldfra)
309bovera = aspect_ratio_contrails
310!--P / a is a function of b / a only, that we can calculate
311!-- P / a = RPI * ( 3. * ( 1. + b / a ) - SQRT( (3. + b / a) * (1. + 3. * b / a) ) )
312Povera = RPI * ( 3. * (1. + bovera) - SQRT( (3. + bovera) * (1. + 3. * bovera) ) )
313!--The clouds perimeter is imposed using the formula from Morcrette 2012,
314!--based on observations.
315!-- clouds_perim / cell_area = N_cld_mix * ( P / a * a ) / cell_area = coef_mix_lscp * cldfra * ( 1. - cldfra )
316!--With cldfra = a * ( b / a * a ) * RPI * N_cld_mix / cell_area, we have:
317!-- cldfra = a * b / a * RPI / (P / a) * coef_mix_lscp * cldfra * ( 1. - cldfra )
318!-- a = (P / a) / ( coef_mix_lscp * RPI * ( 1. - cldfra ) * (b / a) )
319a_mix = Povera / coef_mixing_contrails / RPI / ( 1. - cldfra ) / bovera
320!--and finally,
321!-- N_cld_mix = coef_mix_lscp * cldfra * ( 1. - cldfra ) * cell_area / ( P / a * a )
322N_cld_mix = coef_mixing_contrails * cldfra * ( 1. - cldfra ) * cell_area &
323          / Povera / a_mix
324
325!--The time required for turbulent diffusion to homogenize a region of size
326!--L_mix is defined as (L_mix**2/tke_dissip)**(1./3.) (Pope, 2000; Field et al., 2014)
327!--We compute L_mix and assume that the cloud is mixed over this length
328L_mix = SQRT( dtime**3 * pbl_eps )
329!--The mixing length cannot be greater than the semi-minor axis. In this case,
330!--the entire cloud is mixed.
331L_mix = MIN(L_mix, a_mix * bovera)
332
333!--The fraction of clear sky mixed is
334!-- N_cld_mix * ( (a + L_mix) * (b + L_mix) - a * b ) * RPI / cell_area
335envfra_mix = N_cld_mix * RPI / cell_area &
336           * ( a_mix * ( 1. + bovera ) * L_mix + L_mix**2 )
337!--The fraction of cloudy sky mixed is
338!-- N_cld_mix * ( a * b - (a - L_mix) * (b - L_mix) ) * RPI / cell_area
339cldfra_mix = N_cld_mix * RPI / cell_area &
340           * ( a_mix * ( 1. + bovera ) * L_mix - L_mix**2 )
341
342
343!-- PART 2 - SHEARING
344
345!--The clouds are then sheared. We keep the shape and number
346!--assumptions from before. The clouds are sheared with a random orientation
347!--of the wind, on average we assume that the wind and the semi-major axis
348!--make a 45 degrees angle. Moreover, the contrails only mix
349!--along their semi-minor axis (b), because it is easier to compute.
350!--With this, the clouds increase in size along b only, by a factor
351!--L_shear * SQRT(2.) / 2. (to account for the 45 degrees orientation of the wind)
352L_shear = coef_shear_contrails * shear * dz * dtime
353!--therefore, the fraction of clear sky mixed is
354!-- N_cld_mix * ( a * (b + L_shear * SQRT(2.) / 2.) - a * b ) * RPI / 2. / cell_area
355!--and the fraction of cloud mixed is
356!-- N_cld_mix * ( a * b - a * (b - L_shear * SQRT(2.) / 2.) ) * RPI / 2. / cell_area
357!--(note that they are equal)
358shear_fra = RPI * SQRT(2.) / 2. * L_shear * a_mix / 2. * N_cld_mix / cell_area
359!--and the environment and cloud mixed fractions are the same,
360!--which we add to the previous calculated mixed fractions.
361!--We therefore assume that the sheared clouds and the turbulent
362!--mixed clouds are different.
363envfra_mix = envfra_mix + shear_fra
364cldfra_mix = cldfra_mix + shear_fra
365
366
367!-- PART 3 - CALCULATION OF THE MIXING PROPERTIES
368
369!--The environment fraction is allocated to subsaturated sky or supersaturated sky,
370!--according to the factor sigma_mix. This is computed as the ratio of the
371!--subsaturated sky fraction to the environment fraction, corrected by a factor
372!--chi_mixing_lscp for the supersaturated part. If chi is greater than 1, the
373!--supersaturated sky is favoured. Physically, this means that it is more likely
374!--to have supersaturated sky around the cloud than subsaturated sky.
375sigma_mix = subfra / ( subfra + chi_mixing_contrails * issrfra )
376subfra_mix = MIN( sigma_mix * envfra_mix, subfra )
377issrfra_mix = MIN( ( 1. - sigma_mix ) * envfra_mix, issrfra )
378cldfra_mix = MIN( cldfra_mix, cldfra )
379
380!--First, we mix the subsaturated sky (subfra_mix) and the cloud close
381!--to this fraction (sigma_mix * cldfra_mix).
382IF ( subfra .GT. eps ) THEN
383  !--We compute the total humidity in the mixed air, which
384  !--can be either sub- or supersaturated.
385  qvapinmix = ( qsub * subfra_mix / subfra &
386            + qcld * cldfra_mix * sigma_mix / cldfra ) &
387            / ( subfra_mix + cldfra_mix * sigma_mix )
388
389  IF ( ok_unadjusted_clouds ) THEN
390    qiceincld = ( qcld - qvc ) * cldfra_mix * sigma_mix / cldfra &
391              / ( subfra_mix + cldfra_mix * sigma_mix )
392    qvapincld_new = QVAPINCLD_DEPSUB_CONTRAILS( &
393        qvapinmix, qiceincld, temp, qsat, pplay, dtime)
394    IF ( qvapincld_new .EQ. 0. ) THEN
395      !--If all the ice has been sublimated, we sublimate
396      !--completely the cloud and do not activate the sublimation
397      !--process
398      !--Tendencies and diagnostics
399      dcf_mix_sub_cont = - sigma_mix * cldfra_mix
400      dqt_mix_sub_cont = dcf_mix_sub_cont * qcld / cldfra
401      dqvc_mix_sub_cont = dcf_mix_sub_cont * qvc / cldfra
402    ELSE
403      dcf_mix_sub_cont = subfra_mix
404      dqt_mix_sub_cont = dcf_mix_sub_cont * qsub / subfra
405      dqvc_mix_sub_cont = dcf_mix_sub_cont * qvapincld_new
406    ENDIF
407  ELSE
408    IF ( qvapinmix .GT. qsat ) THEN
409      !--If the mixed air is supersaturated, we condense the subsaturated
410      !--region which was mixed.
411      dcf_mix_sub_cont = subfra_mix
412      dqt_mix_sub_cont = dcf_mix_sub_cont * qsub / subfra
413      dqvc_mix_sub_cont = dcf_mix_sub_cont * qsat
414    ELSE
415      !--Else, we sublimate the cloud which was mixed.
416      dcf_mix_sub_cont = - sigma_mix * cldfra_mix
417      dqt_mix_sub_cont = dcf_mix_sub_cont * qcld / cldfra
418      dqvc_mix_sub_cont = dcf_mix_sub_cont * qsat
419    ENDIF
420  ENDIF ! ok_unadjusted_clouds
421ENDIF ! subfra .GT. eps
422
423!--We then mix the supersaturated sky (issrfra_mix) and the cloud,
424!--for which the mixed air is always supersatured, therefore
425!--the cloud necessarily expands
426IF ( issrfra .GT. eps ) THEN
427
428  IF ( ok_unadjusted_clouds ) THEN
429    qvapinmix = ( qissr * issrfra_mix / issrfra &
430              + qcld * cldfra_mix * (1. - sigma_mix) / cldfra ) &
431              / ( issrfra_mix + cldfra_mix * (1. -  sigma_mix) )
432    qiceincld = ( qcld - qvc ) * cldfra_mix * (1. - sigma_mix) / cldfra &
433              / ( issrfra_mix + cldfra_mix * (1. - sigma_mix) )
434    qvapincld_new = QVAPINCLD_DEPSUB_CONTRAILS( &
435        qvapinmix, qiceincld, temp, qsat, pplay, dtime)
436    dcf_mix_issr_cont = issrfra_mix
437    dqt_mix_issr_cont = dcf_mix_issr_cont * qissr / issrfra
438    dqvc_mix_issr_cont = dcf_mix_issr_cont * qvapincld_new
439  ELSE
440    !--In this case, the additionnal vapor condenses
441    dcf_mix_issr_cont = issrfra_mix
442    dqt_mix_issr_cont = dcf_mix_issr_cont * qissr / issrfra
443    dqvc_mix_issr_cont = dcf_mix_issr_cont * qsat
444  ENDIF ! ok_unadjusted_clouds
445
446ENDIF ! issrfra .GT. eps
447
448!--Sum up the tendencies from subsaturated sky and supersaturated sky
449dcf_mix_cont  = dcf_mix_sub_cont  + dcf_mix_issr_cont
450dqt_mix_cont  = dqt_mix_sub_cont  + dqt_mix_issr_cont
451dqvc_mix_cont = dqvc_mix_sub_cont + dqvc_mix_issr_cont
452dqi_mix_cont  = dqt_mix_cont - dqvc_mix_cont
453
454!--Outputs
455!--The mixing tendencies are a linear combination of the calculation done for "classical" cirrus
456!--and contrails
457dcf_mix = ( 1. - rcont_seri ) * dcf_mix + rcont_seri * dcf_mix_cont
458dqvc_mix = ( 1. - rcont_seri ) * dqvc_mix + rcont_seri * dqvc_mix_cont
459dqi_mix = ( 1. - rcont_seri ) * dqi_mix + rcont_seri * dqi_mix_cont
460dqt_mix = ( 1. - rcont_seri ) * dqt_mix + rcont_seri * dqt_mix_cont
461dcf_mix_issr = ( 1. - rcont_seri ) * dcf_mix_issr + rcont_seri * dcf_mix_issr_cont
462dqt_mix_issr = ( 1. - rcont_seri ) * dqt_mix_issr + rcont_seri * dqt_mix_issr_cont
463
464END SUBROUTINE contrails_mixing
465
466
467!**********************************************************************************
468FUNCTION qvapincld_depsub_contrails( &
469    qvapincld, qiceincld, temp, qsat, pplay, dtime)
470
471USE lmdz_lscp_ini,        ONLY: RV, RLSTT, RTT, EPS_W
472USE lmdz_lscp_ini,        ONLY: depo_coef_cirrus, capa_cond_cirrus, rho_ice
473USE lmdz_lscp_ini,        ONLY: rm_ice_crystals_contrails
474
475IMPLICIT NONE
476
477! inputs
478REAL :: qvapincld     !
479REAL :: qiceincld     !
480REAL :: temp          !
481REAL :: qsat          !
482REAL :: pplay         !
483REAL :: dtime         ! time step [s]
484! output
485REAL :: qvapincld_depsub_contrails
486! local
487REAL :: qice_ratio
488REAL :: pres_sat, rho, kappa
489REAL :: air_thermal_conduct, water_vapor_diff
490REAL :: rm_ice
491
492!--If ok_unadjusted_clouds is set to TRUE, then the saturation adjustment
493!--hypothesis is lost, and the vapor in the cloud is purely prognostic.
494!
495!--The deposition equation is
496!-- dmi/dt = alpha*4pi*C*Svi / ( R_v*T/esi/Dv + Ls/ka/T * (Ls/R_v/T - 1) )
497!--from Lohmann et al. (2016), where
498!--alpha is the deposition coefficient [-]
499!--mi is the mass of one ice crystal [kg]
500!--C is the capacitance of an ice crystal [m]
501!--Svi is the supersaturation ratio equal to (qvc - qsat)/qsat [-]
502!--R_v is the specific gas constant for humid air [J/kg/K]
503!--T is the temperature [K]
504!--esi is the saturation pressure w.r.t. ice [Pa]
505!--Dv is the diffusivity of water vapor [m2/s]
506!--Ls is the specific latent heat of sublimation [J/kg/K]
507!--ka is the thermal conductivity of dry air [J/m/s/K]
508!
509!--alpha is a coefficient to take into account the fact that during deposition, a water
510!--molecule cannot join the crystal from everywhere, it must do so that the crystal stays
511!--coherent (with the same structure). It has no impact for sublimation.
512!--We fix alpha = depo_coef_cirrus (=0.5 by default following Lohmann et al. (2016))
513!--during deposition, and alpha = 1. during sublimation.
514!--The capacitance of the ice crystals is proportional to a parameter capa_cond_cirrus
515!-- C = capa_cond_cirrus * rm_ice
516!
517!--We have qice = Nice * mi, where Nice is the ice crystal
518!--number concentration per kg of moist air
519!--HYPOTHESIS 1: the ice crystals are spherical, therefore
520!-- mi = 4/3 * pi * rm_ice**3 * rho_ice
521!--HYPOTHESIS 2: the ice crystals are monodisperse with the
522!--initial radius rm_ice_0.
523!--NB. this is notably different than the assumption
524!--of a distributed qice in the cloud made in the sublimation process;
525!--should it be consistent?
526!
527!--As the deposition process does not create new ice crystals,
528!--and because we assume a same rm_ice value for all crystals
529!--therefore the sublimation process does not destroy ice crystals
530!--(or, in a limit case, it destroys all ice crystals), then
531!--Nice is a constant during the sublimation/deposition process.
532!-- dmi = dqi, et Nice = qi_0 / ( 4/3 RPI rm_ice_0**3 rho_ice )
533!
534!--The deposition equation then reads:
535!-- dqi/dt = alpha*4pi*capa_cond_cirrus*rm_ice*(qvc-qsat)/qsat / ( R_v*T/esi/Dv + Ls/ka/T * (Ls/R_v/T - 1) ) * Nice
536!-- dqi/dt = alpha*4pi*capa_cond_cirrus* (qi / qi_0)**(1/3) *rm_ice_0*(qvc-qsat)/qsat &
537!--             / ( R_v*T/esi/Dv + Ls/ka/T * (Ls*R_v/T - 1) ) &
538!--                         * qi_0 / ( 4/3 RPI rm_ice_0**3 rho_ice )
539!-- dqi/dt = qi**(1/3) * (qvc - qsat) * qi_0**(2/3) &
540!--  *alpha/qsat*capa_cond_cirrus/ (R_v*T/esi/Dv + Ls/ka/T*(Ls*R_v/T - 1)) / ( 1/3 rm_ice_0**2 rho_ice )
541!--and we have
542!-- dqvc/dt = - qi**(1/3) * (qvc - qsat) / kappa * alpha * qi_0**(2/3) / rm_ice_0**2
543!-- dqi/dt  =   qi**(1/3) * (qvc - qsat) / kappa * alpha * qi_0**(2/3) / rm_ice_0**2
544!--where kappa = 1/3*rho_ice/capa_cond_cirrus*qsat*(R_v*T/esi/Dv + Ls/ka/T*(Ls/R_v/T - 1))
545!
546!--This system of equations can be resolved with an exact
547!--explicit numerical integration, having one variable resolved
548!--explicitly, the other exactly. The exactly resolved variable is
549!--the one decreasing, so it is qvc if the process is
550!--condensation, qi if it is sublimation.
551!
552!--kappa is computed as an initialisation constant, as it depends only
553!--on temperature and other pre-computed values
554pres_sat = qsat / ( EPS_W + ( 1. - EPS_W ) * qsat ) * pplay
555!--This formula for air thermal conductivity comes from Beard and Pruppacher (1971)
556air_thermal_conduct = ( 5.69 + 0.017 * ( temp - RTT ) ) * 1.e-3 * 4.184
557!--This formula for water vapor diffusivity comes from Hall and Pruppacher (1976)
558water_vapor_diff = 0.211 * ( temp / RTT )**1.94 * ( 101325. / pplay ) * 1.e-4
559kappa = 1. / 3. * rho_ice / capa_cond_cirrus * qsat &
560      * ( RV * temp / water_vapor_diff / pres_sat &
561        + RLSTT / air_thermal_conduct / temp * ( RLSTT / RV / temp - 1. ) )
562!--NB. the greater kappa, the lower the efficiency of the deposition/sublimation process
563
564!--Here, the initial vapor in the cloud is qvapincld, and we compute
565!--the new vapor qvapincld_depsub_contrails
566
567rm_ice = rm_ice_crystals_contrails
568
569IF ( qvapincld .GE. qsat ) THEN
570  !--If the cloud is initially supersaturated
571  !--Exact explicit integration (qvc exact, qice explicit)
572  qvapincld_depsub_contrails = qsat + ( qvapincld - qsat ) &
573                * EXP( - depo_coef_cirrus * dtime * qiceincld / kappa / rm_ice**2 )
574ELSE
575  !--If the cloud is initially subsaturated
576  !--Exact explicit integration (qice exact, qvc explicit)
577  !--The barrier is set so that the resulting vapor in cloud
578  !--cannot be greater than qsat
579  !--qice_ratio is the ratio between the new ice content and
580  !--the old one, it is comprised between 0 and 1
581  qice_ratio = ( 1. - 2. / 3. / kappa / rm_ice**2 * dtime * ( qsat - qvapincld ) )
582
583  IF ( qice_ratio .LT. 0. ) THEN
584    !--The new vapor in cloud is set to 0 so that the
585    !--sublimation process does not activate
586    qvapincld_depsub_contrails = 0.
587  ELSE
588    !--Else, the sublimation process is activated with the
589    !--diagnosed new cloud water vapor
590    !--The new vapor in the cloud is increased with the
591    !--sublimated ice
592    qvapincld_depsub_contrails = qvapincld + qiceincld * ( 1. - qice_ratio**1.5 )
593    !--The new vapor in the cloud cannot be greater than qsat
594    qvapincld_depsub_contrails = MIN(qvapincld_depsub_contrails, qsat)
595  ENDIF ! qice_ratio .LT. 0.
596ENDIF ! qvapincld .GT. qsat
597
598END FUNCTION qvapincld_depsub_contrails
599
600
601!**********************************************************************************
602FUNCTION contrail_cross_section_onera(dz)
603
604USE lmdz_lscp_ini, ONLY: initial_width_contrails
605
606IMPLICIT NONE
607
608!
609! Input
610!
611REAL :: dz ! cell width [m]
612!
613! Output
614!
615REAL :: contrail_cross_section_onera ! [m2]
616!
617! Local
618!
619
620contrail_cross_section_onera = initial_width_contrails * dz
621
622END FUNCTION contrail_cross_section_onera
623
624SUBROUTINE read_aviation_emissions(klon, klev, flight_dist, flight_h2o)
625    ! This subroutine allows to read the traffic density data read in the file aviation.nc
626    ! This file is defined in ./COMP/lmdz.card
627    ! Field names in context_input_lmdz.xml should be the same as in the file.
628    USE netcdf
629    USE mod_phys_lmdz_para
630    USE mod_grid_phy_lmdz, ONLY: nbp_lon_=>nbp_lon, nbp_lat_=>nbp_lat, nbp_lev_=>nbp_lev, &
631                                 klon_glo, grid2Dto1D_glo, grid_type, unstructured
632    USE lmdz_xios
633    USE print_control_mod, ONLY: lunout
634    IMPLICIT NONE
635
636    INTEGER,                    INTENT(IN)  :: klon, klev  ! number of horizontal grid points and vertical levels
637    REAL, DIMENSION(klon,klev), INTENT(OUT) :: flight_dist ! Aviation distance flown concentration [m/s/m3]
638    REAL, DIMENSION(klon,klev), INTENT(OUT) :: flight_h2o  ! Aviation emitted H2O [kgH2O/s/m3]
639
640    !----------------------------------------------------
641    ! Local variable
642    !----------------------------------------------------
643    REAL, DIMENSION(klon_mpi,klev,1) :: flight_dist_mpi
644
645    !--Initialisation
646    flight_dist(:,:) = 0.
647    flight_h2o(:,:) = 0.
648
649    ! Read the data from the file
650    ! is_omp_master is necessary to make XIOS works
651    IF (is_omp_master) CALL xios_recv_field("KMFLOWN_interp", flight_dist_mpi(:,:,1))
652
653    ! Propagate to other OMP threads: flight_dist_mpi(klon_mpi,klev) to flight_dist(klon,klev)
654    ! (klon_mpi,klon) = (200,50) avec 80 MPI, 4 OMP, nbp40
655    CALL scatter_omp(flight_dist_mpi(:,:,1), flight_dist)
656
657END SUBROUTINE read_aviation_emissions
658
659END MODULE lmdz_aviation
Note: See TracBrowser for help on using the repository browser.