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