PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_lima_collisional_ice_breakup.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 2018-2021 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 lima_collisional_ice_breakup (LIMAP, LIMAC, LIMAM, KSIZE, ODCOMPUTE, &
11 PRHODREF, &
12 PRIT, PRST, PRGT, PCIT, PCST, PCGT, &
13 PLBDS, PLBDG, &
14 P_RI_CIBU, P_CI_CIBU )
15! #######################################################################
16!
17!! PURPOSE
18!! -------
19!! Compute the collisional ice break-up (secondary ice production process)
20!!
21!! AUTHOR
22!! ------
23!! J.-P. Pinty * Laboratoire d'Aerologie*
24!! T. Hoarau * Laboratoire d'Aerologie*
25!!
26!! MODIFICATIONS
27!! -------------
28!! Original 04/2022 duplicate from original for LIMA_SPLIT
29! B. Vié 04/2022 Adapt to the new snow characteristics
30!
31!-------------------------------------------------------------------------------
32!
33!* 0. DECLARATIONS
34! ------------
35!
39USE yomhook, ONLY:lhook, dr_hook, jphook
40!
41IMPLICIT NONE
42!
43!* 0.1 Declarations of dummy arguments :
44!
45!
46INTEGER, INTENT(IN) :: KSIZE
47LOGICAL, DIMENSION(KSIZE),INTENT(IN) :: ODCOMPUTE
48!
49REAL, DIMENSION(KSIZE), INTENT(IN) :: PRHODREF
50!
51REAL, DIMENSION(KSIZE), INTENT(IN) :: PRIT
52REAL, DIMENSION(KSIZE), INTENT(IN) :: PRST
53REAL, DIMENSION(KSIZE), INTENT(IN) :: PRGT
54REAL, DIMENSION(KSIZE), INTENT(IN) :: PCIT
55REAL, DIMENSION(KSIZE), INTENT(IN) :: PCST
56REAL, DIMENSION(KSIZE), INTENT(IN) :: PCGT
57REAL, DIMENSION(KSIZE), INTENT(IN) :: PLBDS
58REAL, DIMENSION(KSIZE), INTENT(IN) :: PLBDG
59!
60REAL, DIMENSION(KSIZE), INTENT(OUT) :: P_RI_CIBU
61REAL, DIMENSION(KSIZE), INTENT(OUT) :: P_CI_CIBU
62!
63!
64!* 0.2 Declarations of local variables :
65!
66LOGICAL, DIMENSION(SIZE(PRST)) :: GCIBU ! Test where to compute collision process
67LOGICAL, SAVE :: GFIRSTCALL = .true. ! control switch for the first call
68!
69INTEGER :: ICIBU
70INTEGER, DIMENSION(:), ALLOCATABLE :: IVEC2_S1,IVEC2_S2 ! Snow indice vector
71INTEGER, DIMENSION(:), ALLOCATABLE :: IVEC2_G ! Graupel indice vector
72INTEGER, PARAMETER :: I_SEED_PARAM = 26032012
73INTEGER, DIMENSION(:), ALLOCATABLE :: I_SEED
74INTEGER :: INI_SEED
75!
76REAL, DIMENSION(:), ALLOCATABLE :: ZVEC1_S, ZVEC1_SW, ZVEC1_S1, ZVEC1_S2, & ! Work vectors
77 ZVEC1_S3, ZVEC1_S4, &
78 ZVEC1_S11, ZVEC1_S12, & ! for snow
79 ZVEC1_S21, ZVEC1_S22, &
80 ZVEC1_S31, ZVEC1_S32, &
81 ZVEC1_S41, ZVEC1_S42, &
82 ZVEC2_S1, ZVEC2_S2
83REAL, DIMENSION(:), ALLOCATABLE :: ZVEC1_G, ZVEC1_G1, ZVEC1_G2, & ! Work vectors
84 ZVEC2_G ! for graupel
85REAL, DIMENSION(:), ALLOCATABLE :: ZFRAGMENTS, ZHARVEST
86REAL, DIMENSION(SIZE(PRST)) :: ZINTG_SNOW_1, & ! incomplete gamma function
87 ZINTG_SNOW_2, & ! for snow
88 ZINTG_SNOW_3, &
89 ZINTG_SNOW_4
90REAL, DIMENSION(SIZE(PRST)) :: ZINTG_GRAUPEL_1, & ! incomplete gamma
91 ZINTG_GRAUPEL_2 ! function for graupel
92REAL, DIMENSION(SIZE(PRST)) :: ZNI_CIBU, ZRI_CIBU ! CIBU rates
93REAL, DIMENSION(SIZE(PRST)) :: ZFRAG_CIBU
94TYPE(param_lima_mixed_t),INTENT(IN)::LIMAM
95TYPE(param_lima_cold_t),INTENT(IN)::LIMAC
96TYPE(param_lima_t),INTENT(IN)::LIMAP
97REAL :: ZFACT1_XNDEBRIS, ZFACT2_XNDEBRIS
98REAL(KIND=jphook) :: zhook_handle
99!
100!-------------------------------------------------------------------------------
101
102IF (lhook) CALL dr_hook('LIMA_COLLISIONAL_ICE_BREAKUP', 0, zhook_handle)
103gcibu(:) = limap%LCIBU .AND. prst(:)>limap%XRTMIN(5) .AND. prgt(:)>limap%XRTMIN(6) .AND. &
104 odcompute(:) .AND. pcst(:)>limap%XCTMIN(5) .AND. pcgt(:)>limap%XCTMIN(6)
105icibu = count( gcibu(:) )
106!
107p_ri_cibu(:)=0.
108p_ci_cibu(:)=0.
109!
110IF (icibu > 0) THEN
111!
112! 1.3.0 randomization of LIMAP%XNDEBRIS_CIBU values
113!
114 IF (gfirstcall) THEN
115 CALL random_seed(size=ini_seed) ! get size of seed
116 ALLOCATE(i_seed(ini_seed))
117 i_seed(:) = i_seed_param !
118 CALL random_seed(put=i_seed)
119 gfirstcall = .false.
120 END IF
121!
122 ALLOCATE(zfragments(icibu))
123!
124 IF (limap%XNDEBRIS_CIBU >= 0.0) THEN
125 zfragments(:) = limap%XNDEBRIS_CIBU
126 ELSE
127!
128! Mantissa gives the mean value (randomization around 10**MANTISSA)
129! First digit after the comma provides the full range around 10**MANTISSA
130!
131 ALLOCATE(zharvest(icibu))
132!
133 zfact1_xndebris = aint(limap%XNDEBRIS_CIBU)
134 zfact2_xndebris = abs(anint(10.0*(limap%XNDEBRIS_CIBU - zfact1_xndebris)))
135!
136 CALL random_number(zharvest)
137!
138 zfragments(:) = 10.0**(zfact2_xndebris*zharvest(:) + zfact1_xndebris)
139!
140 DEALLOCATE(zharvest)
141!
142! ZFRAGMENTS is a random variable containing the number of fragments per collision
143! For LIMAP%XNDEBRIS_CIBU=-1.2345 => ZFRAGMENTS(:) = 10.0**(2.0*RANDOM_NUMBER(ZHARVEST(:)) - 1.0)
144! and ZFRAGMENTS=[0.1, 10.0] centered around 1.0
145!
146 END IF
147!
148!
149! 1.3.1 To compute the partial integration of snow gamma function
150!
151! 1.3.1.0 allocations
152!
153 ALLOCATE(zvec1_s(icibu))
154 ALLOCATE(zvec1_sw(icibu))
155 ALLOCATE(zvec1_s1(icibu))
156 ALLOCATE(zvec1_s2(icibu))
157 ALLOCATE(zvec1_s3(icibu))
158 ALLOCATE(zvec1_s4(icibu))
159 ALLOCATE(zvec1_s11(icibu))
160 ALLOCATE(zvec1_s12(icibu))
161 ALLOCATE(zvec1_s21(icibu))
162 ALLOCATE(zvec1_s22(icibu))
163 ALLOCATE(zvec1_s31(icibu))
164 ALLOCATE(zvec1_s32(icibu))
165 ALLOCATE(zvec1_s41(icibu))
166 ALLOCATE(zvec1_s42(icibu))
167 ALLOCATE(zvec2_s1(icibu))
168 ALLOCATE(ivec2_s1(icibu))
169 ALLOCATE(zvec2_s2(icibu))
170 ALLOCATE(ivec2_s2(icibu))
171!
172!
173! 1.3.1.1 select the PLBDS
174!
175 zvec1_s(:) = pack( plbds(:),mask=gcibu(:) )
176 zvec1_sw(:)= ( limac%XFVELOS**limap%XALPHAS + zvec1_s(:)**limap%XALPHAS ) ** (1./limap%XALPHAS) ! modified equivalent lambda
177!
178!
179! 1.3.1.2 find the next lower indice for the PLBDS in the
180! geometrical set of Lbda_s used to tabulate some moments of the
181! incomplete gamma function, for boundary 1 (0.2 mm)
182!
183 zvec2_s1(1:icibu) = max( 1.0001, min( float(limam%NGAMINC)-0.0001,limam%XCIBUINTP_S &
184 * log( zvec1_s(1:icibu) ) + limam%XCIBUINTP1_S ) )
185 ivec2_s1(1:icibu) = int( zvec2_s1(1:icibu) )
186 zvec2_s1(1:icibu) = zvec2_s1(1:icibu) - float( ivec2_s1(1:icibu) )
187!
188!
189! 1.3.1.3 find the next lower indice for the PLBDS in the
190! geometrical set of Lbda_s used to tabulate some moments of the
191! incomplete gamma function, for boundary 2 (1 mm)
192!
193 zvec2_s2(1:icibu) = max( 1.0001, min( float(limam%NGAMINC)-0.0001,limam%XCIBUINTP_S &
194 * log( zvec1_s(1:icibu) ) + limam%XCIBUINTP2_S ) )
195 ivec2_s2(1:icibu) = int( zvec2_s2(1:icibu) )
196 zvec2_s2(1:icibu) = zvec2_s2(1:icibu) - float( ivec2_s2(1:icibu) )
197!
198!
199! 1.3.1.4 perform the linear interpolation of the
200! normalized "0"-moment of the incomplete gamma function
201!
202! For lower boundary (0.2 mm)
203 zvec1_s11(1:icibu) = limam%XGAMINC_CIBU_S(1,ivec2_s1(1:icibu)+1) * zvec2_s1(1:icibu) &
204 - limam%XGAMINC_CIBU_S(1,ivec2_s1(1:icibu)) * (zvec2_s1(1:icibu)-1.0)
205!
206! For upper boundary (1 mm)
207 zvec1_s12(1:icibu) = limam%XGAMINC_CIBU_S(1,ivec2_s2(1:icibu)+1) * zvec2_s2(1:icibu) &
208 - limam%XGAMINC_CIBU_S(1,ivec2_s2(1:icibu)) * (zvec2_s2(1:icibu)-1.0)
209!
210! Computation of spectrum from 0.2 mm to 1 mm
211 zvec1_s1(1:icibu) = zvec1_s12(1:icibu) - zvec1_s11(1:icibu)
212!
213!
214! 1.3.1.5 perform the linear interpolation of the
215! normalized "LIMAC%XBS"-moment of the incomplete gamma function
216!
217! For lower boundary (0.2 mm)
218 zvec1_s31(1:icibu) = limam%XGAMINC_CIBU_S(3,ivec2_s1(1:icibu)+1) * zvec2_s1(1:icibu) &
219 - limam%XGAMINC_CIBU_S(3,ivec2_s1(1:icibu)) * (zvec2_s1(1:icibu)-1.0)
220!
221! For upper boundary (1 mm)
222 zvec1_s32(1:icibu) = limam%XGAMINC_CIBU_S(3,ivec2_s2(1:icibu)+1) * zvec2_s2(1:icibu) &
223 - limam%XGAMINC_CIBU_S(3,ivec2_s2(1:icibu)) * (zvec2_s2(1:icibu)-1.0)
224!
225! From 0.2 mm to 1 mm we need
226 zvec1_s3(1:icibu) = limam%XMOMGS_CIBU_2 * (zvec1_s32(1:icibu) - zvec1_s31(1:icibu))
227!
228!
229! 1.3.1.2 find the next lower indice for the PLBDS in the
230! geometrical set of Lbda_s used to tabulate some moments of the
231! incomplete gamma function, for boundary 1 (0.2 mm) for modified lambda (Wurtz snow fall speed)
232!
233 zvec2_s1(1:icibu) = max( 1.0001, min( float(limam%NGAMINC)-0.0001,limam%XCIBUINTP_S &
234 * log( zvec1_sw(1:icibu) ) + limam%XCIBUINTP1_S ) )
235 ivec2_s1(1:icibu) = int( zvec2_s1(1:icibu) )
236 zvec2_s1(1:icibu) = zvec2_s1(1:icibu) - float( ivec2_s1(1:icibu) )
237!
238!
239! 1.3.1.3 find the next lower indice for the PLBDS in the
240! geometrical set of Lbda_s used to tabulate some moments of the
241! incomplete gamma function, for boundary 2 (1 mm) for modified lambda (Wurtz snow fall speed)
242!
243 zvec2_s2(1:icibu) = max( 1.0001, min( float(limam%NGAMINC)-0.0001,limam%XCIBUINTP_S &
244 * log( zvec1_sw(1:icibu) ) + limam%XCIBUINTP2_S ) )
245 ivec2_s2(1:icibu) = int( zvec2_s2(1:icibu) )
246 zvec2_s2(1:icibu) = zvec2_s2(1:icibu) - float( ivec2_s2(1:icibu) )
247!
248!
249! 1.3.1.5 perform the linear interpolation of the
250! normalized "LIMAC%XDS"-moment of the incomplete gamma function
251!
252! For lower boundary (0.2 mm)
253 zvec1_s21(1:icibu) = limam%XGAMINC_CIBU_S(2,ivec2_s1(1:icibu)+1) * zvec2_s1(1:icibu) &
254 - limam%XGAMINC_CIBU_S(2,ivec2_s1(1:icibu)) * (zvec2_s1(1:icibu)-1.0)
255!
256! For upper boundary (1 mm)
257 zvec1_s22(1:icibu) = limam%XGAMINC_CIBU_S(2,ivec2_s2(1:icibu)+1) * zvec2_s2(1:icibu) &
258 - limam%XGAMINC_CIBU_S(2,ivec2_s2(1:icibu)) * (zvec2_s2(1:icibu)-1.0)
259!
260! From 0.2 mm to 1 mm we need
261 zvec1_s2(1:icibu) = limam%XMOMGS_CIBU_1 * (zvec1_s22(1:icibu) - zvec1_s21(1:icibu))
262!
263!
264! 1.3.1.6 perform the linear interpolation of the
265! normalized "LIMAC%XBS+LIMAC%XDS"-moment of the incomplete gamma function
266!
267! For lower boundary (0.2 mm)
268 zvec1_s41(1:icibu) = limam%XGAMINC_CIBU_S(4,ivec2_s1(1:icibu)+1) * zvec2_s1(1:icibu) &
269 - limam%XGAMINC_CIBU_S(4,ivec2_s1(1:icibu)) * (zvec2_s1(1:icibu)-1.0)
270!
271! For upper boundary (1 mm)
272 zvec1_s42(1:icibu) = limam%XGAMINC_CIBU_S(4,ivec2_s2(1:icibu)+1) * zvec2_s2(1:icibu) &
273 - limam%XGAMINC_CIBU_S(4,ivec2_s2(1:icibu)) * (zvec2_s2(1:icibu)-1.0)
274!
275! From 0.2 mm to 1 mm we need
276 zvec1_s4(1:icibu) = limam%XMOMGS_CIBU_3 * (zvec1_s42(1:icibu) - zvec1_s41(1:icibu))
277!
278 zintg_snow_1(:) = unpack( vector=zvec1_s1(:),mask=gcibu,field=0.0 )
279 zintg_snow_2(:) = unpack( vector=zvec1_s2(:),mask=gcibu,field=0.0 )
280 zintg_snow_3(:) = unpack( vector=zvec1_s3(:),mask=gcibu,field=0.0 )
281 zintg_snow_4(:) = unpack( vector=zvec1_s4(:),mask=gcibu,field=0.0 )
282!
283!
284! 1.3.2 Compute the partial integration of graupel gamma function
285!
286! 1.3.2.0 allocations
287!
288 ALLOCATE(zvec1_g(icibu))
289 ALLOCATE(zvec1_g1(icibu))
290 ALLOCATE(zvec1_g2(icibu))
291 ALLOCATE(zvec2_g(icibu))
292 ALLOCATE(ivec2_g(icibu))
293!
294!
295! 1.3.2.1 select the PLBDG
296!
297 zvec1_g(:) = pack( plbdg(:),mask=gcibu(:) )
298!
299!
300! 1.3.2.2 find the next lower indice for the PLBDG in the
301! geometrical set of Lbda_g used to tabulate some moments of the
302! incomplete gamma function, for the "2mm" boundary
303!
304 zvec2_g(1:icibu) = max( 1.0001, min( float(limam%NGAMINC)-0.0001,limam%XCIBUINTP_G &
305 * log( zvec1_g(1:icibu) ) + limam%XCIBUINTP1_G ) )
306 ivec2_g(1:icibu) = int( zvec2_g(1:icibu) )
307 zvec2_g(1:icibu) = zvec2_g(1:icibu) - float( ivec2_g(1:icibu) )
308!
309!
310! 1.3.2.3 perform the linear interpolation of the
311! normalized "2+LIMAM%XDG"-moment of the incomplete gamma function
312!
313 zvec1_g1(1:icibu) = limam%XGAMINC_CIBU_G(1,ivec2_g(1:icibu)+1) * zvec2_g(1:icibu) &
314 - limam%XGAMINC_CIBU_G(1,ivec2_g(1:icibu)) * (zvec2_g(1:icibu)-1.0)
315!
316! From 2 mm to infinity we need
317 zvec1_g1(1:icibu) = limam%XMOMGG_CIBU_1 * (1.0 - zvec1_g1(1:icibu))
318!
319!
320! 1.3.2.4 perform the linear interpolation of the
321! normalized "2.0"-moment of the incomplete gamma function
322!
323 zvec1_g2(1:icibu) = limam%XGAMINC_CIBU_G(2,ivec2_g(1:icibu)+1) * zvec2_g(1:icibu) &
324 - limam%XGAMINC_CIBU_G(2,ivec2_g(1:icibu)) * (zvec2_g(1:icibu)-1.0)
325!
326! From 2 mm to infinity we need
327 zvec1_g2(1:icibu) = limam%XMOMGG_CIBU_2 * (1.0 - zvec1_g2(1:icibu))
328!
329!
330 zintg_graupel_1(:) = unpack( vector=zvec1_g1(:),mask=gcibu,field=0.0 )
331 zintg_graupel_2(:) = unpack( vector=zvec1_g2(:),mask=gcibu,field=0.0 )
332!
333!
334! 1.3.3 To compute final "CIBU" contributions
335!
336 zfrag_cibu(:) = unpack( vector=zfragments(:),mask=gcibu,field=0.0 )
337 zni_cibu(:) = zfrag_cibu(:) * (limam%XFACTOR_CIBU_NI * pcst(:) * pcgt(:) / (prhodref(:)**limap%XCEXVT)) * &
338 (limam%XCG * zintg_graupel_1(:) * zintg_snow_1(:) * &
339 plbdg(:)**(-(limam%XDG+2.0)) &
340 - limac%XCS * zintg_graupel_2(:) * zintg_snow_2(:) * &
341 plbds(:)**(-limac%XDS) * plbdg(:)**(-2.0) * &
342 (1+(limac%XFVELOS/plbds(:))**limap%XALPHAS)**(-limap%XNUS-limac%XDS/limap%XALPHAS) )
343
344 p_ci_cibu(:) = max(zni_cibu(:),0.)
345!
346 DEALLOCATE(zfragments)
347!
348! Max value of rs removed by CIBU
349 zri_cibu(:) = (limam%XFACTOR_CIBU_RI * pcst(:) * pcgt(:) / (prhodref(:)**limap%XCEXVT)) * &
350 (limam%XCG * zintg_graupel_1(:) * zintg_snow_3(:) * &
351 plbds(:)**(-limac%XBS) * plbdg(:)**(-(limam%XDG+2.0)) &
352 - limac%XCS * zintg_graupel_2(:) * zintg_snow_4(:) * &
353 plbds(:)**(-limac%XBS-limac%XDS) * plbdg(:)**(-2.0) * &
354 (1+(limac%XFVELOS/plbds(:))**limap%XALPHAS)**(-limap%XNUS-(limac%XBS+limac%XDS)/limap%XALPHAS) )
355!
356! The value of rs removed by CIBU is determined by the mean mass of pristine ice
357 WHERE( prit(:)>limap%XRTMIN(4) .AND. pcit(:)>limap%XCTMIN(4) )
358 zri_cibu(:) = min( zri_cibu(:), zni_cibu(:)*prit(:)/pcit(:) )
359 ELSE WHERE
360 zri_cibu(:) = min( zri_cibu(:), max( zni_cibu(:)*limac%XMNU0,limap%XRTMIN(4) ) )
361 END WHERE
362!
363 p_ri_cibu(:) = max(zri_cibu(:), 0.)
364!
365 DEALLOCATE(zvec1_s)
366 DEALLOCATE(zvec1_sw)
367 DEALLOCATE(zvec1_s1)
368 DEALLOCATE(zvec1_s2)
369 DEALLOCATE(zvec1_s3)
370 DEALLOCATE(zvec1_s4)
371 DEALLOCATE(zvec1_s11)
372 DEALLOCATE(zvec1_s12)
373 DEALLOCATE(zvec1_s21)
374 DEALLOCATE(zvec1_s22)
375 DEALLOCATE(zvec1_s31)
376 DEALLOCATE(zvec1_s32)
377 DEALLOCATE(zvec1_s41)
378 DEALLOCATE(zvec1_s42)
379 DEALLOCATE(zvec2_s1)
380 DEALLOCATE(ivec2_s1)
381 DEALLOCATE(zvec2_s2)
382 DEALLOCATE(ivec2_s2)
383 DEALLOCATE(zvec1_g)
384 DEALLOCATE(zvec1_g1)
385 DEALLOCATE(zvec1_g2)
386 DEALLOCATE(zvec2_g)
387 DEALLOCATE(ivec2_g)
388END IF
389!
390!-------------------------------------------------------------------------------
391!
392IF (lhook) CALL dr_hook('LIMA_COLLISIONAL_ICE_BREAKUP', 1, zhook_handle)
393END SUBROUTINE lima_collisional_ice_breakup
subroutine lima_collisional_ice_breakup(limap, limac, limam, ksize, odcompute, prhodref, prit, prst, prgt, pcit, pcst, pcgt, plbds, plbdg, p_ri_cibu, p_ci_cibu)