PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_lima_meyers_nucleation.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 2018-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 lima_meyers_nucleation (LIMAP, LIMAC, D, CST, PTSTEP, &
11 PRHODREF, PEXNREF, PPABST, &
12 PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, &
13 PCCT, PCIT, PINT, &
14 P_TH_HIND, P_RI_HIND, P_CI_HIND, &
15 P_TH_HINC, P_RC_HINC, P_CC_HINC, &
16 PICEFR )
17! #############################################################################
18!!
19!! PURPOSE
20!! -------
21!! The purpose of this routine is to compute the heterogeneous nucleation
22!! following Meyers (1992).
23!!
24!!
25!! AUTHOR
26!! ------
27!! J.-M. Cohard * Laboratoire d'Aerologie*
28!! J.-P. Pinty * Laboratoire d'Aerologie*
29!! S. Berthet * Laboratoire d'Aerologie*
30!! B. Vié * CNRM *
31!!
32!! MODIFICATIONS
33!! -------------
34!! Original 15/03/2018
35! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90
36! P. Wautelet 27/02/2020: add P_TH_HINC dummy argument + change intent of *_HIND and *_HINC dummy arguments (INOUT->OUT)
37!-------------------------------------------------------------------------------
38!
39!* 0. DECLARATIONS
40! ------------
41!
43USE modd_cst, ONLY: cst_t
44
45USE mode_tools, only: countjv
48USE yomhook, ONLY:lhook, dr_hook, jphook
49
50IMPLICIT NONE
51!
52!* 0.1 Declarations of dummy arguments :
53!
54TYPE(param_lima_t),INTENT(IN)::LIMAP
55TYPE(param_lima_cold_t),INTENT(IN)::LIMAC
56TYPE(dimphyex_t), INTENT(IN) :: D
57TYPE(cst_t), INTENT(IN) :: CST
58REAL, INTENT(IN) :: PTSTEP
59!
60REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODREF! Reference density
61REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PEXNREF ! Reference Exner function
62REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPABST ! abs. pressure at time t
63!
64REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PTHT ! Theta at time t
65REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRVT ! Water vapor m.r. at t
66REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRCT ! Cloud water m.r. at t
67REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRRT ! Rain water m.r. at t
68REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRIT ! Cloud ice m.r. at t
69REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRST ! Snow/aggregate m.r. at t
70REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRGT ! Graupel m.r. at t
71!
72REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PCCT ! Cloud water C. at t
73REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PCIT ! Ice crystal C. source
74REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NMOD_IFN), INTENT(INOUT) :: PINT ! Activated ice nuclei C.
75!
76REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_TH_HIND
77REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_RI_HIND
78REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_CI_HIND
79REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_TH_HINC
80REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_RC_HINC
81REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_CC_HINC
82!
83REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PICEFR
84!
85!
86!* 0.2 Declarations of local variables :
87!
88!
89INTEGER :: IL ! Loop index
90INTEGER :: INEGT ! Case number of nucleation
91!
92LOGICAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
93 :: GNEGT ! Test where to compute the nucleation
94!
95INTEGER, DIMENSION(SIZE(PRHODREF)) :: I1,I3 ! Indexes for PACK replacement
96!
97REAL, DIMENSION(:), ALLOCATABLE :: ZRVT ! Water vapor m.r. at t
98REAL, DIMENSION(:), ALLOCATABLE :: ZRCT ! Cloud water m.r. at t
99REAL, DIMENSION(:), ALLOCATABLE :: ZRRT ! Rain water m.r. at t
100REAL, DIMENSION(:), ALLOCATABLE :: ZRIT ! Pristine ice m.r. at t
101REAL, DIMENSION(:), ALLOCATABLE :: ZRST ! Snow/aggregate m.r. at t
102REAL, DIMENSION(:), ALLOCATABLE :: ZRGT ! Graupel/hail m.r. at t
103!
104REAL, DIMENSION(:), ALLOCATABLE :: ZCCT ! Cloud water conc. at t
105REAL, DIMENSION(:), ALLOCATABLE :: ZCIT ! Pristine ice conc. source
106!
107REAL, DIMENSION(:), ALLOCATABLE :: ZTHT ! Theta source
108!
109REAL, DIMENSION(:,:), ALLOCATABLE :: ZINT ! Nucleated Ice nuclei conc. source
110 ! by Deposition/Contact
111!
112REAL, DIMENSION(:), ALLOCATABLE &
113 :: ZRHODREF, & ! RHO Dry REFerence
114 ZZT, & ! Temperature
115 ZPRES, & ! Pressure
116 ZEXNREF, & ! EXNer Pressure REFerence
117 ZZW, & ! Work array
118 ZZX, & ! Work array
119 ZZY, & ! Work array
120 ZLSFACT, & ! L_s/(Pi_ref*C_ph)
121 ZLVFACT, & ! L_v/(Pi_ref*C_ph)
122 ZSSI
123!
124REAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
125 :: ZW, ZT ! work arrays
126!
127REAL, DIMENSION(:), ALLOCATABLE :: ZTCELSIUS
128!
129REAL(KIND=jphook) :: zhook_handle
130!-------------------------------------------------------------------------------
131!
132!
133!* 1. PRELIMINARY COMPUTATIONS
134! ------------------------
135!
136IF (lhook) CALL dr_hook('LIMA_MEYERS_NUCLEATION', 0, zhook_handle)
137p_th_hind(:,:) = 0.
138p_ri_hind(:,:) = 0.
139p_ci_hind(:,:) = 0.
140p_th_hinc(:,:) = 0.
141p_rc_hinc(:,:) = 0.
142p_cc_hinc(:,:) = 0.
143!
144! Temperature
145!
146zt(:,:) = ptht(:,:) * ( ppabst(:,:)/cst%XP00 ) ** (cst%XRD/cst%XCPD)
147!
148! Saturation over ice
149!
150zw(:,:) = exp( cst%XALPI - cst%XBETAI/zt(:,:) - cst%XGAMI*log(zt(:,:) ) )
151zw(:,:) = prvt(:,:)*( ppabst(:,:)-zw(:,:) ) / ( (cst%XMV/cst%XMD) * zw(:,:) )
152!
153!
154!-------------------------------------------------------------------------------
155!
156! optimization by looking for locations where
157! the temperature is negative only !!!
158!
159gnegt(:,:) = .false.
160gnegt(d%NIJB:d%NIJE,d%NKB:d%NKE) = zt(d%NIJB:d%NIJE,d%NKB:d%NKE)<cst%XTT .AND. &
161 zw(d%NIJB:d%NIJE,d%NKB:d%NKE)>0.8
162inegt = countjv( gnegt(:,:),i1(:),i3(:))
163IF( inegt >= 1 ) THEN
164 ALLOCATE(zrvt(inegt))
165 ALLOCATE(zrct(inegt))
166 ALLOCATE(zrrt(inegt))
167 ALLOCATE(zrit(inegt))
168 ALLOCATE(zrst(inegt))
169 ALLOCATE(zrgt(inegt))
170!
171 ALLOCATE(ztht(inegt))
172!
173 ALLOCATE(zcct(inegt))
174 ALLOCATE(zint(inegt,1))
175 ALLOCATE(zcit(inegt))
176!
177 ALLOCATE(zrhodref(inegt))
178 ALLOCATE(zzt(inegt))
179 ALLOCATE(zpres(inegt))
180 ALLOCATE(zexnref(inegt))
181 DO il=1,inegt
182 zrvt(il) = prvt(i1(il),i3(il))
183 zrct(il) = prct(i1(il),i3(il))
184 zrrt(il) = prrt(i1(il),i3(il))
185 zrit(il) = prit(i1(il),i3(il))
186 zrst(il) = prst(i1(il),i3(il))
187 zrgt(il) = prgt(i1(il),i3(il))
188!
189 zcct(il) = pcct(i1(il),i3(il))
190!
191 ztht(il) = ptht(i1(il),i3(il))
192!
193 zcct(il) = pcct(i1(il),i3(il))
194 zcit(il) = pcit(i1(il),i3(il))
195!
196 zrhodref(il) = prhodref(i1(il),i3(il))
197 zzt(il) = zt(i1(il),i3(il))
198 zpres(il) = ppabst(i1(il),i3(il))
199 zexnref(il) = pexnref(i1(il),i3(il))
200 ENDDO
201 ALLOCATE(zzw(inegt))
202 ALLOCATE(zzx(inegt))
203 ALLOCATE(zzy(inegt))
204 ALLOCATE(zlsfact(inegt))
205 ALLOCATE(zlvfact(inegt))
206 ALLOCATE(zssi(inegt))
207 ALLOCATE(ztcelsius(inegt))
208!
209 zzw(:) = zexnref(:)*( cst%XCPD+cst%XCPV*zrvt(:)+cst%XCL*(zrct(:)+zrrt(:)) &
210 +cst%XCI*(zrit(:)+zrst(:)+zrgt(:)) )
211 ztcelsius(:) = max( zzt(:)-cst%XTT,-50.0 )
212 zlsfact(:) = (cst%XLSTT+(cst%XCPV-cst%XCI)*ztcelsius(:))/zzw(:) ! L_s/(Pi_ref*C_ph)
213 zlvfact(:) = (cst%XLVTT+(cst%XCPV-cst%XCL)*ztcelsius(:))/zzw(:) ! L_v/(Pi_ref*C_ph)
214!
215 zzw(:) = exp( cst%XALPI - cst%XBETAI/zzt(:) - cst%XGAMI*log(zzt(:)) ) ! es_i
216 zssi(:) = zrvt(:)*(zpres(:)-zzw(:))/((cst%XMV/cst%XMD)*zzw(:)) - 1.0
217 ! Supersaturation over ice
218!
219!---------------------------------------------------------------------------
220!
221!* compute the heterogeneous nucleation by deposition: RVHNDI
222!
223 DO il=1,inegt
224 zint(il,1) = pint(i1(il),i3(il),1)
225 END DO
226 zzw(:) = 0.0
227 zzx(:) = 0.0
228 zzy(:) = 0.0
229!
230 WHERE( zzt(:)<cst%XTT-5.0 .AND. zssi(:)>0.0 )
231 zzy(:) = limac%XNUC_DEP*exp( limac%XEXSI_DEP*100.*min(1.,zssi(:))+limac%XEX_DEP)/zrhodref(:)
232 zzx(:) = max( zzy(:)-zint(:,1) , 0.0 ) ! number of ice crystals formed at this time step #/kg
233 zzw(:) = min( limac%XMNU0*zzx(:) , zrvt(:) ) ! mass of ice formed at this time step (kg/kg)
234 END WHERE
235 !
236 p_ci_hind(:,:) = unpack( zzx(:), mask=gnegt(:,:), field=0. )
237 p_ri_hind(:,:) = unpack( zzw(:), mask=gnegt(:,:), field=0. )
238 p_th_hind(:,:) = unpack( zzw(:)*(zlsfact(:)-zlvfact(:)), mask=gnegt(:,:), field=0. )
239 ptht(:,:) = ptht(:,:) + p_th_hind(:,:)
240 prvt(:,:) = prvt(:,:) - p_ri_hind(:,:)
241 prit(:,:) = prit(:,:) + p_ri_hind(:,:)
242 pcit(:,:) = pcit(:,:) + p_ci_hind(:,:)
243 pint(:,:,1) = pint(:,:,1) + p_ci_hind(:,:)
244!
245!---------------------------------------------------------------------------
246!
247!* compute the heterogeneous nucleation by contact: RVHNCI
248!
249!
250 DO il=1,inegt
251 zint(il,1) = pint(i1(il),i3(il),1)
252 END DO
253 zzw(:) = 0.0
254 zzx(:) = 0.0
255 zzy(:) = 0.0
256!
257 WHERE( zzt(:)<cst%XTT-2.0 .AND. zcct(:)>limap%XCTMIN(2) .AND. zrct(:)>limap%XRTMIN(2) )
258 zzy(:) = min( limac%XNUC_CON * exp( limac%XEXTT_CON*ztcelsius(:)+limac%XEX_CON ) &
259 /zrhodref(:) , zcct(:) )
260 zzx(:) = max( zzy(:)-zint(:,1),0.0 )
261 zzw(:) = min( (zrct(:)/zcct(:))*zzx(:),zrct(:) )
262 END WHERE
263!
264 p_rc_hinc(:,:) = - unpack( zzw(:), mask=gnegt(:,:), field=0. )
265 p_cc_hinc(:,:) = - unpack( zzx(:), mask=gnegt(:,:), field=0. )
266 p_th_hinc(:,:) = unpack( zzw(:)*(zlsfact(:)-zlvfact(:)), mask=gnegt(:,:), field=0. )
267 ptht(:,:) = ptht(:,:) + p_th_hinc(:,:)
268 prct(:,:) = prct(:,:) + p_rc_hinc(:,:)
269 prit(:,:) = prit(:,:) - p_rc_hinc(:,:)
270 pcct(:,:) = pcct(:,:) + p_cc_hinc(:,:)
271 pcit(:,:) = pcit(:,:) - p_cc_hinc(:,:)
272 pint(:,:,1) = pint(:,:,1) - p_cc_hinc(:,:)
273!
274 DEALLOCATE(zrvt)
275 DEALLOCATE(zrct)
276 DEALLOCATE(zrrt)
277 DEALLOCATE(zrit)
278 DEALLOCATE(zrst)
279 DEALLOCATE(zrgt)
280!
281 DEALLOCATE(ztht)
282!
283 DEALLOCATE(zcct)
284 DEALLOCATE(zint)
285 DEALLOCATE(zcit)
286!
287 DEALLOCATE(zrhodref)
288 DEALLOCATE(zzt)
289 DEALLOCATE(ztcelsius)
290 DEALLOCATE(zpres)
291 DEALLOCATE(zexnref)
292 DEALLOCATE(zssi)
293 DEALLOCATE(zzw)
294 DEALLOCATE(zzx)
295 DEALLOCATE(zzy)
296 DEALLOCATE(zlsfact)
297 DEALLOCATE(zlvfact)
298!
299END IF
300!
301!-------------------------------------------------------------------------------
302!
303IF (lhook) CALL dr_hook('LIMA_MEYERS_NUCLEATION', 1, zhook_handle)
304END SUBROUTINE lima_meyers_nucleation
subroutine lima_meyers_nucleation(limap, limac, d, cst, ptstep, prhodref, pexnref, ppabst, ptht, prvt, prct, prrt, prit, prst, prgt, pcct, pcit, pint, p_th_hind, p_ri_hind, p_ci_hind, p_th_hinc, p_rc_hinc, p_cc_hinc, picefr)