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