PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
lima_precip_scavenging.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 2013-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!########################################################################
7 SUBROUTINE lima_precip_scavenging (TNSV, D, CST, BUCONF, TBUDGETS, KBUDGETS, &
8 HCLOUD, HDCONF, KLUOUT, KTCOUNT, PTSTEP, &
9 PRRT, PRHODREF, PRHODJ, PZZ, &
10 PPABST, PTHT, PSVT, PRSVS, PINPAP )
11!########################################################################x
12!
13!! PURPOSE
14!! -------
15!! The purpose of this routine is to compute the total number
16!! below-cloud scavenging rate.
17!!
18!!
19!!** METHOD
20!! ------
21!! We assume a generalized gamma distribution law for the raindrop.
22!! The aerosols particles distribution follows a log-normal law.
23!! First, we have to compute the Collision Efficiency, which takes
24!! account of the three most important wet removal mechanism :
25!! Brownian diffusion, interception and inertial impaction.
26!! It is a function of several number (like Reynolds, Schmidt
27!! or Stokes number for instance). Consequently,
28!! we need first to calculate these numbers.
29!!
30!! Then the scavenging coefficient is deduced from the integration
31!! of the droplet size distribution, the falling velocity of
32!! raindrop and aerosol, their diameter, and the collision
33!! (or collection) efficiency, over the spectrum of droplet
34!! diameters.
35!!
36!! The total scavenging rate of aerosol is computed from the
37!! integration, over all the spectrum of particles aerosols
38!! diameters, of the scavenging coefficient.
39!!
40!!
41!! EXTERNAL
42!! --------
43!! Subroutine SCAV_MASS_SEDIMENTATION
44!!
45!! Function COLL_EFFIC : computes the collision efficiency
46!!
47!! Function CONTJV |
48!! Function GAUHER |
49!! Function GAULAG |-> in lima_functions.f90
50!! Function GAMMLN |
51!!
52!!
53!! REFERENCES
54!! ----------
55!! Seinfeld and Pandis
56!! Andronache
57!!
58!! AUTHOR
59!! ------
60!! J.-P. Pinty * Laboratoire d'Aerologie*
61!! S. Berthet * Laboratoire d'Aerologie*
62!! B. Vié * Laboratoire d'Aerologie*
63!!
64!! MODIFICATIONS
65!! -------------
66!! Original ??/??/13
67!!
68! P. Wautelet 28/05/2018: corrected truncated integer division (3/2 -> 1.5)
69! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function
70! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90
71! P. Wautelet 03/2020: use the new data structures and subroutines for budgets
72! P. Wautelet 03/06/2020: bugfix: correct array starts for PSVT and PRSVS
73! P. Wautelet 11/02/2021: bugfix: ZRTMIN was of wrong size (replaced by a scalar)
74! P. Wautelet 11/02/2021: budgets: add missing term SCAV for NSV_LIMA_SCAVMASS budget
75!-------------------------------------------------------------------------------
76!
77!* 0.DECLARATIONS
78! --------------
79!
82USE modd_cst, ONLY: cst_t
83USE modd_nsv, ONLY: nsv_t
87 xalphar, xnur, &
92
93USE mode_tools, only: countjv
94
96USE yomhook, ONLY:lhook, dr_hook, jphook
97
98IMPLICIT NONE
99!
100!* 0.1 declarations of dummy arguments :
101!
102TYPE(nsv_t), INTENT(IN) :: TNSV
103TYPE(dimphyex_t), INTENT(IN) :: D
104TYPE(cst_t), INTENT(IN) :: CST
105TYPE(tbudgetconf_t), INTENT(IN) :: BUCONF
106TYPE(tbudgetdata_ptr), DIMENSION(KBUDGETS), INTENT(INOUT) :: TBUDGETS
107INTEGER, INTENT(IN) :: KBUDGETS
108!
109CHARACTER(LEN=4), INTENT(IN) :: HCLOUD ! cloud paramerization
110CHARACTER(LEN=5), INTENT(IN) :: HDCONF ! CCONF from MODD_CONF
111INTEGER, INTENT(IN) :: KLUOUT ! unit for output listing
112INTEGER, INTENT(IN) :: KTCOUNT ! iteration count
113REAL, INTENT(IN) :: PTSTEP ! Double timestep except
114 ! for the first time step
115!
116REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRRT ! Rain mixing ratio at t
117REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODREF ! Air Density [kg/m**3]
118REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! Dry Density [kg]
119REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! Altitude
120REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPABST ! Absolute pressure at t
121REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTHT ! Theta at time t
122!
123REAL, DIMENSION(D%NIJT,D%NKT,TNSV%NSV_LIMA), INTENT(IN) :: PSVT ! Particle Concentration [/m**3]
124REAL, DIMENSION(D%NIJT,D%NKT,TNSV%NSV_LIMA), INTENT(INOUT) :: PRSVS ! Total Number Scavenging Rate
125!
126REAL, DIMENSION(D%NIJT), INTENT(INOUT) :: PINPAP
127!
128!* 0.2 Declarations of local variables :
129!
130INTEGER :: ISV ! CCN or IFN mode
131INTEGER :: J1, J2, IMOD
132!
133LOGICAL, DIMENSION(D%NIJT,D%NKT) &
134 :: GRAIN, &! Test where rain is present
135 GSCAV ! Test where rain is present
136INTEGER , DIMENSION(SIZE(GSCAV)) :: I1,I3 ! Used to replace the COUNT
137INTEGER :: IL ! and PACK intrinsics
138INTEGER :: ISCAV
139!
140REAL :: ZDENS_RATIO, & !density ratio
141 ZNUM !PNU-1.
142!
143REAL, DIMENSION(D%NIJT,D%NKT) :: ZCRT ! cloud droplet conc.
144!
145REAL, DIMENSION(:), ALLOCATABLE :: ZLAMBDAR, & !slope parameter of the
146 ! generalized Gamma
147 !distribution law for the
148 !raindrop
149 zvisc_ratio, & !viscosity ratio
150 zmfpa, & !Mean Free Path
151 zrhodref, & !Air Density [kg/m**3]
152 zvisca, & !Viscosity of Air [kg/(m*s)]
153 zt, & !Absolute Temperature
154 zpabst, &
155 zrrt, &
156 zconcp, &
157 zconcr, &
158 ztot_scav_rate1d,&
159 ztot_mass_rate1d,&
160 zmean_scav_coef1d
161!
162REAL, DIMENSION(:,:), ALLOCATABLE :: &
163 ZVOLDR, & !Mean volumic Raindrop diameter [m]
164 ZBC_SCAV_COEF2D, &
165 ZCUNSLIP, & !CUnningham SLIP correction factor
166 ZST_STAR, & !critical Stokes number for impaction
167 ZSC, & !aerosol particle Schmidt number
168 ZRE, & !raindrop Reynolds number (for radius)
169 ZFVELR, & !Falling VELocity of the Raindrop
170 ZRELT, & !RELaxation Time of the particle [s]
171 ZDIFF !Particle Diffusivity
172!
173REAL, DIMENSION(NDIAMP) :: ZVOLDP, & !Mean volumic diameter [m]
174 ZABSCISSP, & !Aerosol Abscisses
175 ZWEIGHTP !Aerosol Weights
176REAL, DIMENSION(NDIAMR) :: ZABSCISSR, & !Raindrop Abscisses
177 ZWEIGHTR !Raindrop Weights
178!
179REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZCOL_EF, &! Collision efficiency
180 ZSIZE_RATIO, &! Size Ratio
181 ZST ! Stokes number
182!
183!
184REAL, DIMENSION(D%NIJT,D%NKT) &
185 :: ZMEAN_SCAV_COEF, & !Mean Scavenging
186 ! Coefficient
187 ztot_scav_rate, & !Total Number
188 ! Scavenging Rate
189 ztot_mass_rate !Total Mass
190 ! Scavenging Rate
191REAL, DIMENSION(D%NIJT,D%NKT,NDIAMP) &
192 ::ZBC_SCAV_COEF !Scavenging Coefficient
193REAL, DIMENSION(:), ALLOCATABLE :: ZKNUDSEN ! Knuudsen number
194!
195! Opt. BVIE
196REAL, DIMENSION(D%NIJT,D%NKT) &
197 :: ZT_3D, ZCONCR_3D, ZVISCA_3D, ZMFPA_3D, &
198 ZVISC_RATIO_3D, ZLAMBDAR_3D, ZFACTOR_3D
199REAL, DIMENSION(D%NIJT,D%NKT,NDIAMP) &
200 :: ZVOLDR_3D, ZVOLDR_3D_INV, ZVOLDR_3D_POW, &
201 ZFVELR_3D, ZRE_3D, ZRE_3D_SQRT, ZST_STAR_3D
202REAL, DIMENSION(:), ALLOCATABLE :: ZFACTOR
203REAL, DIMENSION(:,:), ALLOCATABLE :: &
204 ZRE_SQRT, & ! SQRT of raindrop Reynolds number
205 ZRE_INV, & ! INV of raindrop Reynolds number
206 ZSC_INV, & ! INV of aerosol particle Schmidt number
207 ZSC_SQRT, & ! SQRT of aerosol particle Schmidt number
208 ZSC_3SQRT, & ! aerosol particle Schmidt number**(1./3.)
209 ZVOLDR_POW, & ! Mean volumic Raindrop diameter [m] **(2+ZDR)
210 ZVOLDR_INV ! INV of Mean volumic Raindrop diameter [m]
211REAL :: ZDENS_RATIO_SQRT
212INTEGER :: ISV_VAR, INM, IJM
213INTEGER :: IDX
214REAL :: ZMDIAMP
215REAL :: ZSIGMAP
216REAL :: ZRHOP
217REAL :: ZFRACP
218!
219INTEGER :: ISV_LIMA_NR
220INTEGER :: ISV_LIMA_SCAVMASS
221REAL(KIND=jphook) :: zhook_handle
222!
223!------------------------------------------------------------------------------
224IF (lhook) CALL dr_hook('LIMA_PRECIP_SCAVENGING', 0, zhook_handle)
225isv_lima_nr = tnsv%NSV_LIMA_NR - tnsv%NSV_LIMA_BEG + 1
226isv_lima_scavmass = tnsv%NSV_LIMA_SCAVMASS - tnsv%NSV_LIMA_BEG + 1
227
228IF ( buconf%LBUDGET_SV ) then
229 DO il = 1, nmod_ccn
230 idx = tnsv%NSV_LIMA_CCN_FREE - 1 + il
231 CALL tbudgets(nbudget_sv1 - 1 + idx)%PTR%INIT_PHY(d, 'SCAV', prsvs( :, :, idx) )
232 END DO
233 DO il = 1, nmod_ifn
234 idx = tnsv%NSV_LIMA_IFN_FREE - 1 + il
235 CALL tbudgets(nbudget_sv1 - 1 + idx)%PTR%INIT_PHY(d, 'SCAV', prsvs( :, :, idx) )
236 END DO
237 IF ( laero_mass ) then
238 CALL tbudgets(nbudget_sv1 - 1 + tnsv%NSV_LIMA_SCAVMASS)%PTR%INIT_PHY(d, 'SCAV', &
239 prsvs( :, :, tnsv%NSV_LIMA_SCAVMASS) )
240 END IF
241END IF
242!
243!* 1. PRELIMINARY COMPUTATIONS
244! ------------------------
245!
246!
247! ZCRT
248zcrt(:,:)=psvt(:,:,isv_lima_nr)
249!
250! Rain mask
251grain(:,:) = .false.
252grain(d%NIJB:d%NIJE,d%NKB:d%NKE) = (prrt(d%NIJB:d%NIJE,d%NKB:d%NKE)>xrtmin(3) &
253 .AND. zcrt(d%NIJB:d%NIJE,d%NKB:d%NKE)>xctmin(3) )
254!
255! Initialize the total mass scavenging rate if LAERO_MASS=T
256IF (laero_mass) ztot_mass_rate(:,:) = 0.
257!
258! Quadrature method: compute absissae and weights
259CALL gauher(zabscissp,zweightp,ndiamp)
260znum = xnur-1.0e0
261CALL gaulag(zabscissr,zweightr,ndiamr,znum)
262!
263!
264!------------------------------------------------------------------------------
265!
266!
267!* 2. NUMERICAL OPTIMIZATION
268! ----------------------
269!
270!
271! Optimization : compute in advance parameters depending on rain particles and
272! environment conditions only, to avoid multiple identical computations in loops
273!
274!
275WHERE ( grain(:,:) )
276 !
277 zt_3d(:,:) = ptht(:,:) * ( ppabst(:,:)/cst%XP00 )**(cst%XRD/cst%XCPD)
278 zconcr_3d(:,:) = zcrt(:,:) * prhodref(:,:) ![/m3]
279 ! Sutherland law for viscosity of air
280 zvisca_3d(:,:) = xmua0*(zt_3d(:,:)/xtref)**1.5*(xtref+xt_suth_a) &
281 /(xt_suth_a+zt_3d(:,:))
282 ! Air mean free path
283 zmfpa_3d(:,:) = xmfpa0*(cst%XP00*zt_3d(:,:))/(ppabst(:,:)*xt0scav)
284 ! Viscosity ratio
285 zvisc_ratio_3d(:,:) = zvisca_3d(:,:)/xviscw !!!!! inversé par rapport à orig. !
286 ! Rain drops parameters
287 zlambdar_3d(:,:) = ( ((cst%XPI/6.)*xshape_factor*cst%XRHOLW*zconcr_3d(:,:)) &
288 /(prhodref(:,:)*prrt(:,:)) )**(1./3.) ![/m]
289 zfactor_3d(:,:) = cst%XPI*0.25*zconcr_3d(:,:)*xcr*(xrho00/prhodref(:,:))**(0.4)
290 !
291END WHERE
292!
293DO j2=1,ndiamr
294 WHERE ( grain(:,:) )
295 ! exchange of variables: [m]
296 zvoldr_3d(:,:,j2) = zabscissr(j2)**(1./xalphar)/zlambdar_3d(:,:)
297 zvoldr_3d_inv(:,:,j2) = 1./zvoldr_3d(:,:,j2)
298 zvoldr_3d_pow(:,:,j2) = zvoldr_3d(:,:,j2)**(2.+xdr)
299 ! Raindrop Falling VELocity [m/s]
300 zfvelr_3d(:,:,j2) = xcr*(zvoldr_3d(:,:,j2)**xdr)*(xrho00/prhodref(:,:))**(0.4)
301 ! Reynolds number
302 zre_3d(:,:,j2) = zvoldr_3d(:,:,j2)*zfvelr_3d(:,:,j2) &
303 *prhodref(:,:)/(2.0*zvisca_3d(:,:))
304 zre_3d_sqrt(:,:,j2) = sqrt( zre_3d(:,:,j2) )
305 ! Critical Stokes number
306 zst_star_3d(:,:,j2) = (1.2+(log(1.+zre_3d(:,:,j2)))/12.) &
307 /(1.+log(1.+zre_3d(:,:,j2)))
308 END WHERE
309END DO
310!
311!
312!------------------------------------------------------------------------------
313!
314!
315!* 3. AEROSOL SCAVENGING
316! ------------------
317!
318!
319! Iteration over the aerosol type and mode
320!
321DO isv = 1, nmod_ccn+nmod_ifn
322!
323 IF (isv .LE. nmod_ccn) THEN
324 imod = isv
325 isv_var = tnsv%NSV_LIMA_CCN_FREE - tnsv%NSV_LIMA_BEG + imod ! Variable number in PSVT
326 inm = 1 ! Number of species (for IFN int. mixing)
327 ELSE
328 imod = isv - nmod_ccn
329 isv_var = tnsv%NSV_LIMA_IFN_FREE - tnsv%NSV_LIMA_BEG + imod
330 inm = nspecie
331 END IF
332!
333 zbc_scav_coef(:,:,:) = 0.
334 zmean_scav_coef(:,:) = 0.
335 ztot_scav_rate(:,:) = 0.
336!
337 gscav(:,:) = .false.
338 gscav(d%NIJB:d%NIJE,d%NKB:d%NKE) =grain(d%NIJB:d%NIJE,d%NKB:d%NKE) .AND. &
339 (psvt(d%NIJB:d%NIJE,d%NKB:d%NKE,isv_var)>1.0e-2)
340 iscav = countjv(gscav(:,:),i1(:),i3(:))
341!
342 IF( iscav>=1 ) THEN
343 ALLOCATE(zvisc_ratio(iscav))
344 ALLOCATE(zrhodref(iscav))
345 ALLOCATE(zvisca(iscav))
346 ALLOCATE(zt(iscav))
347 ALLOCATE(zrrt(iscav))
348 ALLOCATE(zconcr(iscav))
349 ALLOCATE(zlambdar(iscav))
350 ALLOCATE(zconcp(iscav))
351 ALLOCATE(zmfpa(iscav))
352 ALLOCATE(ztot_scav_rate1d(iscav))
353 ALLOCATE(ztot_mass_rate1d(iscav))
354 ALLOCATE(zmean_scav_coef1d(iscav))
355 ALLOCATE(zpabst(iscav))
356 ALLOCATE(zknudsen(iscav))
357 ALLOCATE(zfactor(iscav))
358!
359 ALLOCATE(zcunslip(iscav,ndiamp))
360 ALLOCATE(zbc_scav_coef2d(iscav,ndiamp))
361 ALLOCATE(zsc(iscav,ndiamp))
362 ALLOCATE(zsc_inv(iscav,ndiamp))
363 ALLOCATE(zsc_sqrt(iscav,ndiamp))
364 ALLOCATE(zsc_3sqrt(iscav,ndiamp))
365 ALLOCATE(zrelt(iscav,ndiamp))
366 ALLOCATE(zdiff(iscav,ndiamp))
367 ALLOCATE(zvoldr(iscav,ndiamr))
368 ALLOCATE(zvoldr_pow(iscav,ndiamr))
369 ALLOCATE(zvoldr_inv(iscav,ndiamr))
370 ALLOCATE(zre(iscav,ndiamr))
371 ALLOCATE(zre_inv(iscav,ndiamr))
372 ALLOCATE(zre_sqrt(iscav,ndiamr))
373 ALLOCATE(zst_star(iscav,ndiamr))
374 ALLOCATE(zfvelr(iscav,ndiamr))
375 ALLOCATE(zst(iscav,ndiamp,ndiamr))
376 ALLOCATE(zcol_ef(iscav,ndiamp,ndiamr))
377 ALLOCATE(zsize_ratio(iscav,ndiamp,ndiamr))
378!
379 zmean_scav_coef1d(:)=0.
380 ztot_scav_rate1d(:) =0.
381 ztot_mass_rate1d(:) =0.
382 DO il=1,iscav
383 zrhodref(il) = prhodref(i1(il),i3(il))
384 zt(il) = zt_3d(i1(il),i3(il))
385 zrrt(il) = prrt(i1(il),i3(il))
386 zpabst(il) = ppabst(i1(il),i3(il))
387 zconcp(il) = psvt(i1(il),i3(il),isv_var)*zrhodref(il)![/m3]
388 zconcr(il) = zconcr_3d(i1(il),i3(il)) ![/m3]
389 zvisca(il) = zvisca_3d(i1(il),i3(il))
390 zmfpa(il) = zmfpa_3d(i1(il),i3(il))
391 zvisc_ratio(il) = zvisc_ratio_3d(i1(il),i3(il))
392 zlambdar(il) = zlambdar_3d(i1(il),i3(il))
393 zfactor(il) = zfactor_3d(i1(il),i3(il))
394 zvoldr(il,:) = zvoldr_3d(i1(il),i3(il),:)
395 zvoldr_pow(il,:) = zvoldr_3d_pow(i1(il),i3(il),:)
396 zvoldr_inv(il,:) = zvoldr_3d_inv(i1(il),i3(il),:)
397 zfvelr(il,:) = zfvelr_3d(i1(il),i3(il),:)
398 zre(il,:) = zre_3d(i1(il),i3(il),:)
399 zre_sqrt(il,:) = zre_3d_sqrt(i1(il),i3(il),:)
400 zst_star(il,:) = zst_star_3d(i1(il),i3(il),:)
401 ENDDO
402 zre_inv(:,:) = 1./zre(:,:)
403
404 IF (any(zconcr .EQ. 0.)) print *, 'VALEUR NULLE DANS ZLAMBDAR !'
405 IF (any(zlambdar .EQ. 0.)) print *, 'VALEUR NULLE DANS ZLAMBDAR !'
406!
407!------------------------------------------------------------------------------------
408!
409! Loop over the different species (for IFN int. mixing)
410!
411 DO ijm = 1, inm ! species (DM1,DM2,BC,O) for IFN
412 IF ( isv .LE. nmod_ccn ) THEN ! CCN case
413 zrhop = xrho_ccn(imod)
414 zmdiamp = 2*xr_mean_ccn(imod)
415 zsigmap = exp(xlogsig_ccn(imod))
416 zfracp = 1.0
417 ELSE ! IFN case
418 zrhop = xrho_ifn(ijm)
419 zmdiamp = xmdiam_ifn(ijm)
420 zsigmap = xsigma_ifn(ijm)
421 zfracp = xfrac(ijm,imod)
422 END IF
423 !-----------------------------------------------------------------------------
424 ! Loop over the aerosols particles diameters (log normal distribution law) :
425 !
426 DO j1=1,ndiamp
427 ! exchange of variables: [m]
428 zvoldp(j1) = zmdiamp * exp(zabscissp(j1)*sqrt(2.)*log(zsigmap))
429 ! Cunningham slip correction factor (1+alpha*Knudsen)
430 zknudsen(:) = min( 20.,zvoldp(j1)/zmfpa(:) )
431 zcunslip(:,j1) = 1.0+2.0/zknudsen(:)*(1.257+0.4*exp(-0.55*zknudsen(:)))
432 ! Diffusion coefficient
433 zdiff(:,j1) = cst%XBOLTZ*zt(:)*zcunslip(:,j1)/(3.*cst%XPI*zvisca(:)*zvoldp(j1))
434 ! Schmidt number
435 zsc(:,j1) = zvisca(:)/(zrhodref(:)*zdiff(:,j1))
436 zsc_inv(:,j1) = 1./zsc(:,j1)
437 zsc_sqrt(:,j1) = sqrt( zsc(:,j1) )
438 zsc_3sqrt(:,j1) = zsc(:,j1)**(1./3.)
439 ! Characteristic Time Required for reaching terminal velocity
440 zrelt(:,j1) = (zvoldp(j1)**2)*zcunslip(:,j1)*zrhop/(18.*zvisca(:))
441 ! Density number
442 zdens_ratio = zrhop/cst%XRHOLW
443 zdens_ratio_sqrt = sqrt(zdens_ratio)
444 ! Initialisation
445 zbc_scav_coef2d(:,j1)=0.
446 !-------------------------------------------------------------------------
447 ! Loop over the drops diameters (generalized Gamma distribution) :
448 !
449 DO j2=1,ndiamr
450 ! Stokes number
451 zst(:,j1,j2) = 2.*zrelt(:,j1)*(zfvelr(:,j2)-zrelt(1,j1)*cst%XG) &
452 *zvoldr_inv(:,j2)
453 ! Size Ratio
454 zsize_ratio(:,j1,j2) = zvoldp(j1)*zvoldr_inv(:,j2)
455 ! Collision Efficiency
456 zcol_ef(:,j1,j2) = coll_effi(iscav, ndiamp, ndiamr, &
457 zre, zre_inv, zre_sqrt, zsc, zsc_inv, &
458 zsc_sqrt, zsc_3sqrt, zst, zst_star, &
459 zsize_ratio, zvisc_ratio, zdens_ratio_sqrt)
460 ! Below-Cloud Scavenging Coefficient for a fixed ZVOLDP: [/s]
461 zbc_scav_coef2d(:,j1) = zbc_scav_coef2d(:,j1) + &
462 zcol_ef(:,j1,j2) * zweightr(j2) * zfactor(:) * zvoldr_pow(:,j2)
463 END DO
464 ! End of the loop over the drops diameters
465 !--------------------------------------------------------------------------
466
467 ! Total NUMBER Scavenging Rate of aerosol [m**-3.s**-1]
468 ztot_scav_rate1d(:) = ztot_scav_rate1d(:) - &
469 zweightp(j1)*zfracp*zconcp(:)*zbc_scav_coef2d(:,j1)
470 ! Total MASS Scavenging Rate of aerosol [kg.m**-3.s**-1]
471 ztot_mass_rate1d(:) = ztot_mass_rate1d(:) + &
472 zweightp(j1)*zfracp*zconcp(:)*zbc_scav_coef2d(:,j1) &
473 *cst%XPI/6.*zrhop*(zvoldp(j1)**3)
474 END DO
475 ! End of the loop over the drops diameters
476 !--------------------------------------------------------------------------
477
478 ! Total NUMBER Scavenging Rate of aerosol [m**-3.s**-1]
479 ztot_scav_rate(:,:)=unpack(ztot_scav_rate1d(:),mask=gscav(:,:),field=0.0)
480 ! Free particles (CCN or IFN) [/s]:
481 prsvs(:,:,isv_var) = max(prsvs(:,:,isv_var)+ztot_scav_rate(:,:) &
482 * prhodj(:,:)/prhodref(:,:) , 0.0 )
483 ! Total MASS Scavenging Rate of aerosol which REACH THE FLOOR because of
484 ! rain sedimentation [kg.m**-3.s**-1]
485 IF (laero_mass)THEN
486 ztot_mass_rate(:,:) = ztot_mass_rate(:,:) + &
487 unpack(ztot_mass_rate1d(:), mask=gscav(:,:), field=0.0)
488 CALL scav_mass_sedimentation( d, hcloud, hdconf, ptstep, ktcount, pzz, prhodj, &
489 prhodref, prrt, psvt(:,:,isv_lima_scavmass),&
490 prsvs(:,:,isv_lima_scavmass), pinpap )
491 prsvs(:,:,isv_lima_scavmass)=prsvs(:,:,isv_lima_scavmass) + &
492 ztot_mass_rate(:,:)*prhodj(:,:)/prhodref(:,:)
493 END IF
494 ENDDO
495! End of the loop over the aerosol species
496!--------------------------------------------------------------------------
497!
498!
499!
500 DEALLOCATE(zfactor)
501 DEALLOCATE(zsc_inv)
502 DEALLOCATE(zsc_sqrt)
503 DEALLOCATE(zsc_3sqrt)
504 DEALLOCATE(zre_inv)
505 DEALLOCATE(zre_sqrt)
506 DEALLOCATE(zvoldr_pow)
507 DEALLOCATE(zvoldr_inv)
508!
509 DEALLOCATE(zfvelr)
510 DEALLOCATE(zre)
511 DEALLOCATE(zst_star)
512 DEALLOCATE(zst)
513 DEALLOCATE(zsize_ratio)
514 DEALLOCATE(zcol_ef)
515 DEALLOCATE(zvoldr)
516 DEALLOCATE(zdiff)
517 DEALLOCATE(zrelt)
518 DEALLOCATE(zsc)
519 DEALLOCATE(zcunslip)
520 DEALLOCATE(zbc_scav_coef2d)
521!
522 DEALLOCATE(ztot_scav_rate1d)
523 DEALLOCATE(ztot_mass_rate1d)
524 DEALLOCATE(zmean_scav_coef1d)
525!
526 DEALLOCATE(zrrt)
527 DEALLOCATE(zconcr)
528 DEALLOCATE(zlambdar)
529 DEALLOCATE(zconcp)
530 DEALLOCATE(zvisc_ratio)
531 DEALLOCATE(zrhodref)
532 DEALLOCATE(zvisca)
533 DEALLOCATE(zpabst)
534 DEALLOCATE(zknudsen)
535 DEALLOCATE(zt)
536 DEALLOCATE(zmfpa)
537 ENDIF
538ENDDO
539!
540IF ( buconf%LBUDGET_SV ) then
541 DO il = 1, nmod_ccn
542 idx = tnsv%NSV_LIMA_CCN_FREE - 1 + il
543 CALL tbudgets(nbudget_sv1 - 1 + idx)%PTR%END_PHY(d, 'SCAV', prsvs(:, :, idx) )
544 END DO
545 DO il = 1, nmod_ifn
546 idx = tnsv%NSV_LIMA_IFN_FREE - 1 + il
547 CALL tbudgets(nbudget_sv1 - 1 + idx)%PTR%END_PHY(d, 'SCAV', prsvs(:, :, idx) )
548 END DO
549 IF ( laero_mass ) then
550 CALL tbudgets(nbudget_sv1 - 1 + tnsv%NSV_LIMA_SCAVMASS)%PTR%END_PHY(d, &
551 'SCAV', prsvs(:, :, tnsv%NSV_LIMA_SCAVMASS) )
552 END IF
553END IF
554!------------------------------------------------------------------------------
555!
556!
557!* 3. SUBROUTINE AND FUNCTION
558! -----------------------
559!
560!
561IF (lhook) CALL dr_hook('LIMA_PRECIP_SCAVENGING', 1, zhook_handle)
562CONTAINS
563!
564!------------------------------------------------------------------------------
565! ##########################################################################
566 SUBROUTINE scav_mass_sedimentation( D, HCLOUD, HDCONF, PTSTEP, KTCOUNT, PZZ, PRHODJ,&
567 PRHODREF, PRAIN, PSVT_MASS, PRSVS_MASS, PINPAP )
568! ##########################################################################
569!
570!!
571!! PURPOSE
572!! -------
573!! The purpose of this routine is to compute the total mass of aerosol
574!! scavenged by precipitations
575!!
576!!
577!!** METHOD
578!! ------
579!!
580!! EXTERNAL
581!! --------
582!! None
583!!
584!! IMPLICIT ARGUMENTS
585!! ------------------
586!!
587!! REFERENCE
588!! ---------
589!! Book1 of the documentation ( routine CH_AQUEOUS_SEDIMENTATION )
590!!
591!! AUTHOR
592!! ------
593!! J.-P. Pinty * Laboratoire d'Aerologie*
594!!
595!! MODIFICATIONS
596!! -------------
597!! Original 22/07/07
598!!
599!-------------------------------------------------------------------------------
600!
601!* 0. DECLARATIONS
602! ------------
603!
604USE modd_dimphyex, ONLY: dimphyex_t
605!
606USE modd_param_lima, ONLY : xcexvt, xrtmin
608USE yomhook, ONLY:lhook, dr_hook, jphook
609!
610IMPLICIT NONE
611!
612!* 0.1 Declarations of dummy arguments :
613!
614!
615TYPE(dimphyex_t), INTENT(IN) :: d
616CHARACTER (LEN=4), INTENT(IN) :: hcloud ! Cloud parameterization
617CHARACTER(LEN=5), INTENT(IN) :: hdconf
618REAL, INTENT(IN) :: ptstep ! Time step
619INTEGER, INTENT(IN) :: ktcount ! Current time step number
620!
621REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pzz ! Height (z)
622REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: prhodj ! Dry Density [kg]
623REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: prhodref! Reference density
624REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: prain ! Rain water m.r. source
625REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: psvt_mass ! Precip. aerosols at t
626REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: prsvs_mass ! Precip. aerosols source
627!
628REAL, DIMENSION(D%NIJT), INTENT(INOUT) :: pinpap
629!
630!* 0.2 Declarations of local variables :
631!
632INTEGER :: ik, in ! Loop indexes
633INTEGER :: ikb, ike ! Physical domain
634!
635REAL :: ztsplitr ! Small time step for rain sedimentation
636REAL :: ztstep ! Large time step for rain sedimentation
637!
638!
639LOGICAL, DIMENSION(D%NIJT,D%NKT) &
640 :: gsedim ! where to compute the SED processes
641INTEGER :: isedim
642INTEGER , DIMENSION(SIZE(GSEDIM)) :: i1,i3 ! Used to replace the COUNT
643INTEGER :: il ! and PACK intrinsics
644!
645!
646REAL, DIMENSION(D%NIJT,D%NKT) &
647 :: zw, & ! work array
648 zwsed, & ! sedimentation fluxes
649 zzs ! Rain water m.r. source
650!
651REAL, DIMENSION(:), ALLOCATABLE :: zrrs, & ! Rain water m.r. source
652 zrhodref, & ! RHO Dry REFerence
653 zzw ! Work array
654!
655REAL :: zrtmin3
656!
657!
658REAL :: zvtrmax, zdzmin, zt
659REAL, SAVE :: zexsedr
660LOGICAL, SAVE :: gsfirstcall = .true.
661INTEGER, SAVE :: isplitr
662REAL(kind=jphook) :: zhook_handle
663!
664!-------------------------------------------------------------------------------
665!
666!* 1. COMPUTE THE LOOP BOUNDS
667! -----------------------
668!
669IF (lhook) CALL dr_hook('SCAV_MASS_SEDIMENTATION', 0, zhook_handle)
670!
671!-------------------------------------------------------------------------------
672!
673!* 2. COMPUTE THE SEDIMENTATION (RS) SOURCE
674! -------------------------------------
675!
676!* 2.1 splitting factor for high Courant number C=v_fall*(del_Z/del_T)
677!
678firstcall : IF (gsfirstcall) THEN
679 gsfirstcall = .false.
680 zvtrmax = 10.
681 zdzmin = minval(pzz(d%NIJB:d%NIJE,d%NKB+1:d%NKE+1)-pzz(d%NIJB:d%NIJE,d%NKB:d%NKE))
682 isplitr = 1
683 split : DO
684 zt = 2.* ptstep / real(isplitr)
685 IF ( zt * zvtrmax / zdzmin .LT. 1.) EXIT split
686 isplitr = isplitr + 1
687 END DO split
688!
689 zexsedr = (xbr+xdr+1.0)/(xbr+1.0)
690!
691END IF firstcall
692!
693!* 2.2 time splitting loop initialization
694!
695IF( (ktcount==1) .AND. (hdconf=='START') ) THEN
696 ztsplitr = ptstep / real(isplitr) ! Small time step
697 ztstep = ptstep ! Large time step
698 ELSE
699 ztsplitr= 2. * ptstep / real(isplitr)
700 ztstep = 2. * ptstep
701END IF
702!
703!* 2.3 compute the fluxes
704!
705! optimization by looking for locations where
706! the precipitating fields are larger than a minimal value only !!!
707!
708zrtmin3 = xrtmin(3) / ztstep
709zzs(:,:) = prain(:,:)
710DO in = 1 , isplitr
711 gsedim(:,:) = .false.
712 gsedim(d%NIJB:d%NIJE,d%NKB:d%NKE) = zzs(d%NIJB:d%NIJE,d%NKB:d%NKE) > zrtmin3
713!
714 isedim = countjv( gsedim(:,:),i1(:),i3(:))
715 IF( isedim >= 1 ) THEN
716 IF( in==1 ) THEN
717 zzs(:,:) = zzs(:,:) * ztstep
718 DO ik = ikb , ike-1
719 zw(:,ik) =ztsplitr*2./(prhodref(:,ik)*(pzz(:,ik+2)-pzz(:,ik)))
720 END DO
721 zw(:,ike) =ztsplitr/(prhodref(:,ike)*(pzz(:,ike+1)-pzz(:,ike)))
722 END IF
723 ALLOCATE(zrrs(isedim))
724 ALLOCATE(zrhodref(isedim))
725 DO il=1,isedim
726 zrrs(il) = zzs(i1(il),i3(il))
727 zrhodref(il) = prhodref(i1(il),i3(il))
728 ENDDO
729 ALLOCATE(zzw(isedim)) ; zzw(:) = 0.0
730!
731!* 2.2.1 for rain
732!
733 zzw(:) = xfsedrr * zrrs(:)**(zexsedr) * zrhodref(:)**(zexsedr-xcexvt)
734 zwsed(:,:) = unpack( zzw(:),mask=gsedim(:,:),field=0.0 )
735 DO ik = ikb , ike
736 zzs(:,ik) = zzs(:,ik) + zw(:,ik)*(zwsed(:,ik+1)-zwsed(:,ik))
737 END DO
738 IF( in==1 ) THEN
739 pinpap(:) = zwsed(:,ikb)* &
740 ( psvt_mass(:,ikb)/max(zrtmin3,prrt(:,ikb)) )
741 END IF
742 DEALLOCATE(zrhodref)
743 DEALLOCATE(zrrs)
744 DEALLOCATE(zzw)
745 IF( in==isplitr ) THEN
746 gsedim(:,:) = .false.
747 gsedim(d%NIJB:d%NIJE,d%NKB:d%NKE) = zzs(d%NIJB:d%NIJE,d%NKB:d%NKE) > zrtmin3
748 zwsed(:,:) = 0.0
749 WHERE( gsedim(:,:) )
750 zwsed(:,:) = 1.0/ztstep - prain(:,:)/zzs(:,:)
751 END WHERE
752 END IF
753 END IF
754END DO
755!
756! Apply the rain sedimentation rate to the WR_xxx aqueous species
757!
758prsvs_mass(:,:) = prsvs_mass(:,:) + zwsed(:,:)*psvt_mass(:,:)
759!
760IF (lhook) CALL dr_hook('SCAV_MASS_SEDIMENTATION', 1, zhook_handle)
761END SUBROUTINE scav_mass_sedimentation
762!
763!------------------------------------------------------------------------------
764!
765!###################################################################
766FUNCTION coll_effi (KSCAV,KDIAMP,KDIAMR, &
767 PRE, PRE_INV, PRE_SQRT, PSC, PSC_INV, PSC_SQRT, &
768 PSC_3SQRT, PST, PST_STAR, PSIZE_RATIO, &
769 PVISC_RATIO, PDENS_RATIO_SQRT) RESULT(PCOL_EF)
770!###################################################################
771!
772!Compute the Raindrop-Aerosol Collision Efficiency
773!
774!* 0. DECLARATIONS
775! ---------------
776!
777 IMPLICIT NONE
778!
779 INTEGER :: i
780 !
781 INTEGER, INTENT(IN) :: kscav
782 INTEGER, INTENT(IN) :: kdiamp
783 INTEGER, INTENT(IN) :: kdiamr
784 REAL, DIMENSION(KSCAV,KDIAMR), INTENT(IN) :: pre
785 REAL, DIMENSION(KSCAV,KDIAMR), INTENT(IN) :: pre_inv
786 REAL, DIMENSION(KSCAV,KDIAMR), INTENT(IN) :: pre_sqrt
787 REAL, DIMENSION(KSCAV,KDIAMP), INTENT(IN) :: psc
788 REAL, DIMENSION(KSCAV,KDIAMP), INTENT(IN) :: psc_inv
789 REAL, DIMENSION(KSCAV,KDIAMP), INTENT(IN) :: psc_sqrt
790 REAL, DIMENSION(KSCAV,KDIAMP), INTENT(IN) :: psc_3sqrt
791 REAL, DIMENSION(KSCAV,KDIAMR), INTENT(IN) :: pst_star
792!
793 REAL, DIMENSION(KSCAV,KDIAMP,KDIAMR), INTENT(IN) :: pst
794 REAL, DIMENSION(KSCAV,KDIAMP,KDIAMR), INTENT(IN) :: psize_ratio
795!
796 REAL, DIMENSION(KSCAV), INTENT(IN) :: pvisc_ratio
797 REAL, INTENT(IN) :: pdens_ratio_sqrt
798!
799 REAL, DIMENSION(KSCAV) :: pcol_ef !result : collision efficiency
800!
801 REAL(kind=jphook) :: zhook_handle
802!
803!-------------------------------------------------------------------------------
804!
805 IF (lhook) CALL dr_hook('COLL_EFFI', 0, zhook_handle)
806 pcol_ef(:) = (4.*psc_inv(:,j1)*pre_inv(:,j2)*(1.+0.4*pre_sqrt(:,j2) &
807 *psc_3sqrt(:,j1)+0.16*pre_sqrt(:,j2)*psc_sqrt(:,j1))) &
808 +(4.*psize_ratio(:,j1,j2)*(pvisc_ratio(:) &
809 +(1.+2.*pre_sqrt(:,j2))*psize_ratio(:,j1,j2)))
810 DO i=1,kscav
811 IF (pst(i,j1,j2)>pst_star(i,j2)) THEN
812 pcol_ef(i) = pcol_ef(i) &
813 +(pdens_ratio_sqrt*((pst(i,j1,j2)-pst_star(i,j2)) &
814 /(pst(i,j1,j2)-pst_star(i,j2)+2./3.))**(3./2.))
815 ENDIF
816 ENDDO
817 IF (lhook) CALL dr_hook('COLL_EFFI', 1, zhook_handle)
818 END FUNCTION coll_effi
819!
820!------------------------------------------------------------------------------
821!
822END SUBROUTINE lima_precip_scavenging
subroutine lima_precip_scavenging(tnsv, d, cst, buconf, tbudgets, kbudgets, hcloud, hdconf, kluout, ktcount, ptstep, prrt, prhodref, prhodj, pzz, ppabst, ptht, psvt, prsvs, pinpap)
subroutine scav_mass_sedimentation(d, hcloud, hdconf, ptstep, ktcount, pzz, prhodj, prhodref, prain, psvt_mass, prsvs_mass, pinpap)
integer, parameter nbudget_sv1
real, dimension(:), pointer xmdiam_ifn
integer, pointer nmod_ccn
integer, pointer nspecie
integer, pointer nmod_ifn
real, pointer xmua0
real, pointer xcexvt
real, dimension(:), pointer xctmin
real, pointer xt_suth_a
real, dimension(:), pointer xsigma_ifn
real, pointer xt0scav
real, pointer xalphar
real, pointer xmfpa0
real, pointer xrho00
real, dimension(:), pointer xrho_ifn
real, pointer xviscw
real, dimension(:), pointer xrho_ccn
logical, pointer laero_mass
real, dimension(:), pointer xlogsig_ccn
real, pointer xtref
integer, pointer ndiamr
integer, pointer ndiamp
real, dimension(:), pointer xr_mean_ccn
real, dimension(:,:), pointer xfrac
real, dimension(:), pointer xrtmin
subroutine gaulag(x, w, n, alf)
subroutine gauher(x, w, n)