PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_lima_raindrop_shattering_freezing.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 2018-2025 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_raindrop_shattering_freezing (LIMAP, LIMAW, LIMAC, LIMAM, KSIZE, ODCOMPUTE, &
11 PRHODREF, PT, &
12 PRRT, PCRT, PRIT, PCIT, PRGT, &
13 PLBDR, &
14 P_RI_RDSF, P_CI_RDSF )
15! #######################################################################
16!
17!! PURPOSE
18!! -------
19!! Compute the raindrop shattering when freezing (secondary ice production process)
20!!
21!! AUTHOR
22!! ------
23!! J.-P. Pinty * Laboratoire d'Aerologie*
24!!
25!! MODIFICATIONS
26!! -------------
27!! Original 04/2022 duplicate from original for LIMA_SPLIT
28!! I. Vongapseut 01/2024 Add a dependance on temperature
29!
30!-------------------------------------------------------------------------------
31!
32!* 0. DECLARATIONS
33! ------------
34!
39USE yomhook, ONLY:lhook, dr_hook, jphook
40!
41IMPLICIT NONE
42!
43!* 0.1 Declarations of dummy arguments :
44!
45!
46TYPE(param_lima_mixed_t),INTENT(IN)::LIMAM
47TYPE(param_lima_cold_t),INTENT(IN)::LIMAC
48TYPE(param_lima_warm_t),INTENT(IN)::LIMAW
49TYPE(param_lima_t),INTENT(IN)::LIMAP
50INTEGER, INTENT(IN) :: KSIZE
51LOGICAL, DIMENSION(KSIZE),INTENT(IN) :: ODCOMPUTE
52!
53REAL, DIMENSION(KSIZE), INTENT(IN) :: PRHODREF
54REAL, DIMENSION(KSIZE), INTENT(IN) :: PT
55!
56REAL, DIMENSION(KSIZE), INTENT(IN) :: PRRT
57REAL, DIMENSION(KSIZE), INTENT(IN) :: PCRT
58REAL, DIMENSION(KSIZE), INTENT(IN) :: PRIT
59REAL, DIMENSION(KSIZE), INTENT(IN) :: PCIT
60REAL, DIMENSION(KSIZE), INTENT(IN) :: PRGT
61REAL, DIMENSION(KSIZE), INTENT(IN) :: PLBDR
62!
63REAL, DIMENSION(KSIZE), INTENT(OUT) :: P_RI_RDSF
64REAL, DIMENSION(KSIZE), INTENT(OUT) :: P_CI_RDSF
65!
66!
67!* 0.2 Declarations of local variables :
68!
69LOGICAL, DIMENSION(SIZE(PRRT)) :: GRDSF ! Test where to compute collision process
70INTEGER :: IRDSF
71REAL, DIMENSION(:), ALLOCATABLE :: ZVEC1_R ! Work vectors for rain
72REAL, DIMENSION(:), ALLOCATABLE :: ZVEC1_R1 ! Work vectors for rain
73REAL, DIMENSION(:), ALLOCATABLE :: ZVEC2_R ! Work vectors for rain
74INTEGER, DIMENSION(:), ALLOCATABLE :: IVEC2_R ! Rain indice vector
75REAL, DIMENSION(SIZE(PRRT)) :: ZINTG_RAIN ! incomplete gamma function for rain
76REAL, DIMENSION(SIZE(PRRT)) :: ZNI_RDSF,ZRI_RDSF ! RDSF rates
77REAL(KIND=jphook) :: zhook_handle
78!
79REAL, DIMENSION(:), ALLOCATABLE :: ZT_RDSF ! Temperature where RDSF
80REAL, DIMENSION(:), ALLOCATABLE :: ZNORMT ! Normal distribution temperature shattering probability
81REAL, DIMENSION(:), ALLOCATABLE :: ZPSH_R ! Shattering probability work vectors
82REAL, DIMENSION(SIZE(PRRT)) :: ZPSH ! Shattering probability
83LOGICAL, DIMENSION(:), ALLOCATABLE :: LTEMP ! Define the mask where ZNORMT is negligible
84!-------------------------------------------------------------------------------
85IF (lhook) CALL dr_hook('LIMA_RAINDROP_SHATTERING_FREEZING', 0, zhook_handle)
86p_ri_rdsf(:)=0.
87p_ci_rdsf(:)=0.
88!
89grdsf(:) = limap%LRDSF .AND. odcompute(:) .AND. (prit(:)>limap%XRTMIN(4)) .AND. (prrt(:)>limap%XRTMIN(3)) &
90 .AND. (pcit(:)>limap%XCTMIN(4)) .AND. (pcrt(:)>limap%XCTMIN(3)) &
91 .AND. (prgt(:)>limap%XRTMIN(6))
92
93irdsf = count( grdsf(:) )
94!
95IF (irdsf > 0) THEN
96!
97 ALLOCATE(zvec1_r(irdsf))
98 ALLOCATE(zvec1_r1(irdsf))
99 ALLOCATE(zvec2_r(irdsf))
100 ALLOCATE(ivec2_r(irdsf))
101 ALLOCATE(zt_rdsf(irdsf))
102 ALLOCATE(znormt(irdsf))
103 ALLOCATE(zpsh_r(irdsf))
104 ALLOCATE(ltemp(irdsf))
105!
106!
107!* 2.2.1 select the ZLBDAR
108!
109 zvec1_r(:) = pack( plbdr(:),mask=grdsf(:) )
110 zt_rdsf(:) = pack( pt(:),mask=grdsf(:) )
111!
112!* 2.2.2 find the next lower indice for the ZLBDAR in the
113! geometrical set of Lbda_r used to tabulate some moments of the
114! incomplete gamma function, for the lower boundary (0.1 mm)
115!
116 zvec2_r(1:irdsf) = max( 1.00001, min( float(limam%NGAMINC)-0.00001,limam%XRDSFINTP_R &
117 * log( zvec1_r(1:irdsf) ) + limam%XRDSFINTP1_R ) )
118 ivec2_r(1:irdsf) = int( zvec2_r(1:irdsf) )
119 zvec2_r(1:irdsf) = zvec2_r(1:irdsf) - float( ivec2_r(1:irdsf) )
120!
121!* 2.2.3 perform the linear interpolation of the
122! normalized "2+XDR"-moment of the incomplete gamma function
123!
124 zvec1_r1(1:irdsf) = limam%XGAMINC_RDSF_R(ivec2_r(1:irdsf)+1) * zvec2_r(1:irdsf) &
125 - limam%XGAMINC_RDSF_R(ivec2_r(1:irdsf)) * (zvec2_r(1:irdsf) - 1.0)
126!
127! From 0.1 mm to infinity we need
128 zvec1_r1(1:irdsf) = limam%XMOMGR_RDSF * (1.0 - zvec1_r1(1:irdsf))
129!
130 zintg_rain(:) = unpack( vector=zvec1_r1(:),mask=grdsf,field=0.0 )
131!
132!* 2.2.4 To compute final "RDSF" contributions
133!
134! Add shattering probability
135 ltemp(1:irdsf) = .false.
136 znormt(1:irdsf) = 1. / sqrt(2.*limam%XSIG_PSH*3.141592653589) * &
137 exp(-(zt_rdsf(1:irdsf)-limam%XTM_PSH)**2. / (2.*limam%XSIG_PSH**2.))
138 ltemp(1:irdsf) = znormt(1:irdsf) >= 0. .AND. znormt(1:irdsf) < 0.1
139!
140 zpsh_r(1:irdsf) = limap%XPSH_MAX_RDSF / maxval(znormt(1:irdsf)) * znormt(1:irdsf)
141 !
142 zpsh(:) = unpack( vector=zpsh_r(:),mask=grdsf,field=0.0 )
143!
144 zni_rdsf(:) = (limam%XFACTOR_RDSF_NI * zpsh(:) / (prhodref(:)**(limap%XCEXVT-1.0))) * ( &
145 pcit(:) * pcrt(:) * zintg_rain(:) * plbdr(:)**(-(limaw%XDR+6.0)) )
146!
147 p_ci_rdsf(:) = max(zni_rdsf(:),0.)
148!
149! The value of rg removed by RDSF is determined by the mean mass of pristine ice
150 zri_rdsf(:) = max( zni_rdsf(:)*limac%XMNU0,0. )
151!
152 p_ri_rdsf(:) = zri_rdsf(:)
153!
154 DEALLOCATE(zvec1_r)
155 DEALLOCATE(zvec1_r1)
156 DEALLOCATE(zvec2_r)
157 DEALLOCATE(ivec2_r)
158 DEALLOCATE(zt_rdsf)
159 DEALLOCATE(znormt)
160 DEALLOCATE(zpsh_r)
161 DEALLOCATE(ltemp)
162 !
163ENDIF
164!
165!-------------------------------------------------------------------------------
166!
167IF (lhook) CALL dr_hook('LIMA_RAINDROP_SHATTERING_FREEZING', 1, zhook_handle)
subroutine lima_raindrop_shattering_freezing(limap, limaw, limac, limam, ksize, odcompute, prhodref, pt, prrt, pcrt, prit, pcit, prgt, plbdr, p_ri_rdsf, p_ci_rdsf)