PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_compute_lambda.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 2022-2023 CNRS, Meteo-France and Universite Paul Sabatier
2!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4!MNH_LIC for details. version 1.
5!-----------------------------------------------------------------
6!
7! ##########################
9! ##########################
10IMPLICIT NONE
11CONTAINS
12!
13! #########################################################
14 SUBROUTINE compute_lambda (KID, KMOMENT, KSIZE, HCLOUD, &
15 PRHO, PRTMIN, PRX, PCX, PLBDX)
16! #########################################################
17!
18! Purpose : compute lambda, the slope parameter of the distribution
19! - for 1-moment species: lbda_x = [(rho r_x) / (a_x C_x G(b/alpha))]^(1/(x-b))
20! - for 2-moment species: lbda_x = [(rho r_x) / (a_x N_x G(b/alpha))]^(-1/b)
21!
22! AUTHOR
23! ------
24! C. Barthe * LAERO *
25!
26! MODIFICATIONS
27! -------------
28! Original June 2022
29! C. Barthe 12/07/23 adapt the code for LIMA2
30!
31!------------------------------------------------------------------
32!
33!* 0. DECLARATIONS
34! ------------
35!
36USE modd_rain_ice_descr_n, ONLY: xlbr_i=>xlbr, xlbi_i=>xlbi, xlbs_i=>xlbs, xlbg_i=>xlbg, xlbh_i=>xlbh, &
37 xlbexr_i=>xlbexr, xlbexi_i=>xlbexi, xlbexs_i=>xlbexs, &
38 xlbexg_i=>xlbexg, xlbexh_i=>xlbexh, &
39 xlbdas_max_i=>xlbdas_max, &
40 xccr_i=>xccr, xccs_i=>xccs, xccg_i=>xccg, xcch_i=>xcch, &
41 xcxs_i=>xcxs, xcxg_i=>xcxg, xcxh_i=>xcxh
42USE modd_elec_descr, ONLY: xcxr_i=>xcxr
43USE modd_param_lima_warm, ONLY: xlbc_l=>xlbc, xlbr_l=>xlbr, xlbexc_l=>xlbexc, xlbexr_l=>xlbexr, &
44 xcxr_l=>xcxr, xccr_l=>xccr
45USE modd_param_lima_cold, ONLY: xlbi_l=>xlbi, xlbs_l=>xlbs, xlbexi_l=>xlbexi, xlbexs_l=>xlbexs, &
46 xlbdas_max_l=>xlbdas_max, &
47 xcxs_l=>xcxs, xccs_l=>xccs
48USE modd_param_lima_mixed, ONLY: xlbg_l=>xlbg, xlbh_l=>xlbh, xlbexg_l=>xlbexg, xlbexh_l=>xlbexh, &
49 xcxg_l=>xcxg, xccg_l=>xccg, xcxh_l=>xcxh, xcch_l=>xcch
50!
51!
52IMPLICIT NONE
53!
54!* 0.1 Declaration of dummy arguments
55!
56INTEGER, INTENT(IN) :: KID ! nb of the hydrometeor category
57CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of microphysical scheme
58INTEGER, INTENT(IN) :: KMOMENT ! nb of moments of the microphysics scheme
59INTEGER, INTENT(IN) :: KSIZE
60REAL, INTENT(IN) :: PRTMIN
61REAL, DIMENSION(KSIZE), INTENT(IN) :: PRHO ! reference density
62REAL, DIMENSION(KSIZE), INTENT(IN) :: PRX ! Mixing ratio
63REAL, DIMENSION(KSIZE), INTENT(INOUT) :: PCX ! Nb concentration
64REAL, DIMENSION(KSIZE), INTENT(INOUT) :: PLBDX ! Slope parameter of the distribution
65!
66!* 0.2 Declaration of local variables
67!
68REAL :: ZRTMIN, ZLBX, ZLBEX, ZLBDAX_MAX, ZCCX, ZCXX
69!
70!---------------------------------------------------------------------------------
71!
72!* 1. PRELIMINARIES
73! -------------
74!
75zrtmin = prtmin
76!
77IF (kid == 2) THEN
78 IF (hcloud == 'LIMA' .AND. kmoment == 2) THEN
79 zlbx = xlbc_l
80 zlbex = xlbexc_l
81! ELSE
82! print*, 'ERROR: the computation of lambda_c is not available if c is 1-moment species'
83 END IF
84ELSE IF (kid == 3) THEN
85 IF (hcloud == 'LIMA') THEN
86 zlbx = xlbr_l
87 zlbex = xlbexr_l
88 IF (kmoment == 1) THEN
89 zccx = xccr_l
90 zcxx = xcxr_l
91 END IF
92 ELSE IF (hcloud(1:3) == 'ICE') THEN
93 zlbx = xlbr_i
94 zlbex = xlbexr_i
95 zccx = xccr_i
96 zcxx = xcxr_i
97 ELSE
98 print*, 'ERROR: something wrong with the computation of lambda_r'
99 END IF
100ELSE IF (kid == 4) THEN
101 IF (hcloud == 'LIMA') THEN
102 zlbx = xlbi_l
103 zlbex = xlbexi_l
104 ELSE IF (hcloud(1:3) == 'ICE') THEN
105 zlbx = xlbi_i
106 zlbex = xlbexi_i
107 ELSE
108 print*, 'ERROR: something wrong with the computation of lambda_i'
109 END IF
110ELSE IF (kid == 5) THEN
111 IF (hcloud == 'LIMA') THEN
112 zlbx = xlbs_l
113 zlbex = xlbexs_l
114 zlbdax_max = xlbdas_max_l
115 IF (kmoment == 1) THEN
116 zccx = xccs_l
117 zcxx = xcxs_l
118 END IF
119 ELSE IF (hcloud(1:3) == 'ICE') THEN
120 zlbx = xlbs_i
121 zlbex = xlbexs_i
122 zlbdax_max = xlbdas_max_i
123 zccx = xccs_i
124 zcxx = xcxs_i
125 ELSE
126 print*, 'ERROR: something wrong with the computation of lambda_s'
127 END IF
128ELSE IF (kid == 6) THEN
129 IF (hcloud == 'LIMA') THEN ! .AND. KMOMENT == 1) THEN
130 zlbx = xlbg_l
131 zlbex = xlbexg_l
132 IF (kmoment == 1) THEN
133 zccx = xccg_l
134 zcxx = xcxg_l
135 END IF
136 ELSE IF (hcloud(1:3) == 'ICE') THEN
137 zlbx = xlbg_i
138 zlbex = xlbexg_i
139 zccx = xccg_i
140 zcxx = xcxg_i
141 ELSE
142 print*, 'ERROR: something wrong with the computation of lambda_g'
143 END IF
144ELSE IF (kid == 7) THEN
145 IF (hcloud == 'LIMA') THEN ! .AND. KMOMENT == 1) THEN
146 zlbx = xlbh_l
147 zlbex = xlbexh_l
148 IF (kmoment == 1) THEN
149 zccx = xcch_l
150 zcxx = xcxh_l
151 END IF
152 ELSE IF (hcloud(1:3) == 'ICE') THEN
153 zlbx = xlbh_i
154 zlbex = xlbexh_i
155 zccx = xcch_i
156 zcxx = xcxh_i
157 ELSE
158 print*, 'ERROR: something wrong with the computation of lambda_h'
159 END IF
160END IF
161!
162plbdx(:) = 0. !1.E10
163!
164!
165!* 2. COMPUTE LBDA_x FOR 2-MOMENT SPECIES
166! -----------------------------------
167!
168IF (kmoment == 2) THEN
169 WHERE (prx(:) > zrtmin .AND. pcx(:) > 0.)
170 plbdx(:) = (zlbx * pcx(:) / prx(:))**zlbex
171 END WHERE
172 IF (kid == 5) plbdx(:) = min(zlbdax_max, plbdx(:))
173!
174!
175!* 3. COMPUTE LBDA_x and N_x FOR 1-MOMENT SPECIES
176! -------------------------------------------
177!
178ELSE IF (kmoment == 1) THEN
179!
180!* 3.1 Special case of cloud droplets
181!
182 IF (kid == 2) THEN
183! print*, 'computation of lambda_c in 1-moment configuration not treated'
184!
185!* 3.2 Special case of ice crystals
186!
187 ELSE IF (kid == 4) THEN
188! formulation utilisee dans rain_ice_fast_ri
189 WHERE (prx(:) > zrtmin .AND. pcx(:) > 0.0)
190 plbdx(:) = zlbx * (prho(:) * prx(:) / pcx(:))**zlbex
191 ENDWHERE
192!
193!* 3.3 Special case of snow
194!
195 ELSE IF (kid == 5) THEN
196! limitation of lbdas
197 WHERE (prx(:) > zrtmin)
198 plbdx(:) = min(200000., zlbx * (prho(:) * prx(:))**zlbex)
199 pcx(:) = zccx * plbdx(:)**zcxx / prho(:)
200 ENDWHERE
201!
202!* 3.4 Computation for all other hydrometeors
203!
204 ELSE
205 WHERE (prx(:) > zrtmin)
206 plbdx(:) = zlbx * (prho(:) * prx(:))**zlbex
207 pcx(:) = zccx * plbdx(:)**zcxx / prho(:)
208 ENDWHERE
209 END IF
210END IF
211!
212END SUBROUTINE compute_lambda
213END MODULE mode_compute_lambda
subroutine compute_lambda(kid, kmoment, ksize, hcloud, prho, prtmin, prx, pcx, plbdx)