PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_rzcolx.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 1995-2024 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! ##################
8! ##################
9!
10IMPLICIT NONE
11CONTAINS
12 SUBROUTINE rzcolx( KND, PALPHAX, PNUX, PALPHAZ, PNUZ, &
13 PEXZ, PEXMASSZ, PFALLX, PEXFALLX, PFALLEXPX, &
14 PFALLZ, PEXFALLZ, PFALLEXPZ, &
15 PLBDAXMAX, PLBDAZMAX, PLBDAXMIN, PLBDAZMIN, &
16 PDINFTY, PRZCOLX )
17 USE yomhook , ONLY : lhook, dr_hook, jphook
18! ########################################################################
19!
20!
21!
22!!**** * - Build up a look-up table containing the scaled fall speed
23!! difference between size distributed particles of specy X and Z
24!!
25!!
26!! PURPOSE
27!! -------
28!! The purpose of this routine is to integrate numerically the scaled fall
29!! speed difference between specy X and specy Z for use in collection
30!! kernels. A first integral of the form
31!!
32!! infty
33!! / /
34!! |{| }
35!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| Dz^bz g(Dz) dDz} g(Dx) dDx
36!! |{| }
37!! / /
38!! 0
39!!
40!! is evaluated and normalised by a second integral of the form
41!!
42!! infty
43!! / /
44!! |{| }
45!! |{| (Dx+Dz)^2 Dz^bz g(Dz) dDz} g(Dx) dDx
46!! |{| }
47!! / /
48!! 0
49!!
50!! where E_xz is a collection efficiency, g(D) is the generalized Gamma
51!! distribution law. The 'infty' diameter is defined according to the
52!! current value of the Lbda that is D_x=PDINFTY/Lbda_x or
53!! D_z=PINFTY/Lbda_z.
54!! The result is stored in a two-dimensional array.
55!!
56!!** METHOD
57!! ------
58!! The free parameters of the size distribution function of specy X and Z
59!! (slope parameter LAMBDA) are discretized with a geometrical rate in a
60!! specific range
61!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval )
62!! The two above integrals are performed using the trapezoidal scheme and
63!! the [0,infty] interval is discretized over KND values of D_x or D_z.
64!!
65!! EXTERNAL
66!! --------
67!! MODI_GENERAL_GAMMA: Generalized gamma distribution law
68!!
69!! IMPLICIT ARGUMENTS
70!! ------------------
71!! None
72!!
73!! REFERENCE
74!! ---------
75!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class
76!! Bulk Ice Scheme,JAS,51,249-280.
77!!
78!! AUTHOR
79!! ------
80!! J.-P. Pinty * Laboratoire d'Aerologie *
81!!
82!! MODIFICATIONS
83!! -------------
84!! Original 8/11/95
85!!
86! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function
87! J. Wurtz 03/2022: new snow characteristics
88!
89!-------------------------------------------------------------------------------
90!
91!
92!* 0. DECLARATIONS
93! ------------
94!
95USE modi_general_gamma, ONLY: general_gamma
96!
97IMPLICIT NONE
98!
99!
100!* 0.1 Declarations of dummy arguments
101! -------------------------------
102!
103!
104INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DX and DZ
105!
106!
107REAL, INTENT(IN) :: PALPHAX ! First shape parameter of the specy X
108 ! size distribution (generalized gamma law)
109REAL, INTENT(IN) :: PNUX ! Second shape parameter of the specy X
110 ! size distribution (generalized gamma law)
111REAL, INTENT(IN) :: PALPHAZ ! First shape parameter of the specy Z
112 ! size distribution (generalized gamma law)
113REAL, INTENT(IN) :: PNUZ ! Second shape parameter of the specy Z
114 ! size distribution (generalized gamma law)
115REAL, INTENT(IN) :: PEXZ ! Efficiency of specy X collecting specy Z
116REAL, INTENT(IN) :: PEXMASSZ ! Mass exponent of specy Z
117REAL, INTENT(IN) :: PFALLX ! Fall speed constant of specy X
118REAL, INTENT(IN) :: PEXFALLX ! Fall speed exponent of specy X
119REAL, INTENT(IN) :: PFALLEXPX ! Fall speed exponential constant of specy X
120REAL, INTENT(IN) :: PFALLZ ! Fall speed constant of specy Z
121REAL, INTENT(IN) :: PEXFALLZ ! Fall speed exponent of specy Z
122REAL, INTENT(IN) :: PFALLEXPZ ! Fall speed exponential constant of specy Z
123REAL, INTENT(IN) :: PLBDAXMAX ! Maximun slope of size distribution of specy X
124REAL, INTENT(IN) :: PLBDAZMAX ! Maximun slope of size distribution of specy Z
125REAL, INTENT(IN) :: PLBDAXMIN ! Minimun slope of size distribution of specy X
126REAL, INTENT(IN) :: PLBDAZMIN ! Minimun slope of size distribution of specy Z
127REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to
128 ! which the diameter integration is performed
129!
130REAL, DIMENSION(:,:), INTENT(INOUT) :: PRZCOLX ! Scaled fall speed difference in
131 ! the mass collection kernel as a
132 ! function of LAMBDAX and LAMBDAZ
133!
134!
135!* 0.2 Declarations of local variables
136! -------------------------------
137!
138!
139INTEGER :: JLBDAX ! Slope index of the size distribution of specy X
140INTEGER :: JLBDAZ ! Slope index of the size distribution of specy Z
141INTEGER :: JDX ! Diameter index of a particle of specy X
142INTEGER :: JDZ ! Diameter index of a particle of specy Z
143!
144!
145REAL :: ZLBDAX ! Current slope parameter LAMBDA of specy X
146REAL :: ZLBDAZ ! Current slope parameter LAMBDA of specy Z
147REAL :: ZDLBDAX ! Growth rate of the slope parameter LAMBDA of specy X
148REAL :: ZDLBDAZ ! Growth rate of the slope parameter LAMBDA of specy Z
149REAL :: ZDDX ! Integration step of the diameter of specy X
150REAL :: ZDDZ ! Integration step of the diameter of specy Z
151REAL :: ZDX ! Current diameter of the particle specy X
152REAL :: ZDZ ! Current diameter of the particle specy Z
153REAL :: ZCOLLZ ! Single integral of the mass weighted fall speed difference
154 ! over the spectrum of specy Z
155REAL :: ZCOLLXZ ! Double integral of the mass weighted fall speed difference
156 ! over the spectra of specy X and specy Z
157REAL :: ZSCALZ ! Single integral of the scaling factor over
158 ! the spectrum of specy Z
159REAL :: ZSCALXZ ! Double integral of the scaling factor over
160 ! the spectra of specy X and specy Z
161REAL :: ZFUNC ! Ancillary function
162!
163!
164!-------------------------------------------------------------------------------
165!
166!
167!* 1 COMPUTE THE SCALED VELOCITZ DIFFERENCE IN THE MASS
168!* COLLECTION KERNEL,
169! -------------------------------------------------
170!
171!
172!
173!* 1.1 Compute the growth rate of the slope factors LAMBDA
174!
175REAL(KIND=jphook) :: zhook_handle
176IF (lhook) CALL dr_hook('RZCOLX',0,zhook_handle)
177zdlbdax = exp( log(plbdaxmax/plbdaxmin)/real(SIZE(przcolx(:,:),1)-1) )
178zdlbdaz = exp( log(plbdazmax/plbdazmin)/real(SIZE(przcolx(:,:),2)-1) )
179!
180!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ
181!
182DO jlbdax = 1,SIZE(przcolx(:,:),1)
183 zlbdax = plbdaxmin * zdlbdax ** (jlbdax-1)
184 DO jlbdaz = 1,SIZE(przcolx(:,:),2)
185 zlbdaz = plbdazmin * zdlbdaz ** (jlbdaz-1)
186!
187!* 1.3 Initialize the collection integrals
188!
189 zscalxz = 0.0
190 zcollxz = 0.0
191!
192!* 1.4 Compute the diameter steps
193!
194 zddx = pdinfty / (real(knd) * zlbdax)
195 zddz = pdinfty / (real(knd) * zlbdaz)
196!
197!* 1.5 Scan over the diameters DX and DZ
198!
199 DO jdx = 1,knd-1
200 zdx = zddx * real(jdx)
201!
202 zscalz = 0.0
203 zcollz = 0.0
204 DO jdz = 1,knd-1
205 zdz = zddz * real(jdz)
206!
207!* 1.6 Compute the normalization factor by integration over the
208! dimensional spectrum of specy Z
209!
210 zfunc = (zdx+zdz)**2 * zdz**pexmassz &
211 * general_gamma(palphaz,pnuz,zlbdaz,zdz)
212 zscalz = zscalz + zfunc
213!
214!* 1.7 Compute the scaled fall speed difference by integration over
215! the dimensional spectrum of specy Z
216!
217 zcollz = zcollz + zfunc * pexz * abs( pfallx*zdx**pexfallx * exp(-(zdx*pfallexpx)**palphax) &
218 - pfallz*zdz**pexfallz * exp(-(zdz*pfallexpz)**palphaz))
219 END DO
220!
221!* 1.8 Compute the normalization factor by integration over the
222! dimensional spectrum of specy X
223!
224 zfunc = general_gamma(palphax,pnux,zlbdax,zdx)
225 zscalxz = zscalxz + zscalz * zfunc
226!
227!* 1.9 Compute the scaled fall speed difference by integration over
228! the dimensional spectrum of specy X
229!
230 zcollxz = zcollxz + zcollz * zfunc
231 END DO
232!
233!* 1.10 Scale the fall speed difference
234!
235 przcolx(jlbdax,jlbdaz) = zcollxz / zscalxz
236 END DO
237END DO
238!
239IF (lhook) CALL dr_hook('RZCOLX',1,zhook_handle)
240END SUBROUTINE rzcolx
241END MODULE mode_rzcolx
real function general_gamma(palpha, pnu, plbda, px)
subroutine rzcolx(knd, palphax, pnux, palphaz, pnuz, pexz, pexmassz, pfallx, pexfallx, pfallexpx, pfallz, pexfallz, pfallexpz, plbdaxmax, plbdazmax, plbdaxmin, plbdazmin, pdinfty, przcolx)