PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_lima_ccn_hom_freezing.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!-------------------------------------------------------------------------------
7 IMPLICIT NONE
8CONTAINS
9! ##########################################################################
10 SUBROUTINE lima_ccn_hom_freezing (LIMAP, LIMAC, D, CST, PRHODREF, PEXNREF, PPABST, PW_NU, &
11 PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, &
12 PCCT, PCRT, PCIT, PCIT_SHAPE, PNFT, PNHT, &
13 PICEFR, PTOT_RV_HONH )
14! ##########################################################################
15!
16!! PURPOSE
17!! -------
18!! Compute the homogeneous freezing of CCN where T<-35°C
19!!
20!!
21!! AUTHOR
22!! ------
23!! J.-M. Cohard * Laboratoire d'Aerologie*
24!! J.-P. Pinty * Laboratoire d'Aerologie*
25!! S. Berthet * Laboratoire d'Aerologie*
26!! B. Vié * Laboratoire d'Aerologie*
27!!
28!! MODIFICATIONS
29!! -------------
30!! Original 15/03/2018
31! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90
32! C. Barthe 07/06/2022: save mixing ratio change for cloud electrification
33! C. Barthe 25/01/2024: add several shapes for ice crystals
34!
35!-------------------------------------------------------------------------------
36!
37!* 0. DECLARATIONS
38! ------------
39!
41USE modd_cst, ONLY: cst_t
42!
43USE mode_tools, only: countjv
46USE yomhook, ONLY:lhook, dr_hook, jphook
47!
48IMPLICIT NONE
49!
50!* 0.1 Declarations of dummy arguments :
51!
52TYPE(param_lima_cold_t),INTENT(IN)::LIMAC
53TYPE(param_lima_t),INTENT(IN)::LIMAP
54TYPE(dimphyex_t), INTENT(IN) :: D
55TYPE(cst_t), INTENT(IN) :: CST
56REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODREF! Reference density
57REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PEXNREF ! Reference Exner function
58REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPABST ! abs. pressure at time t
59REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PW_NU ! updraft velocity used for
60 ! the nucleation param.
61!
62REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PTHT ! Theta at time t
63REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRVT ! Water vapor m.r. at t
64REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRCT ! Cloud water m.r. at t
65REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRRT ! Rain water m.r. at t
66REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRIT ! Cloud ice m.r. at t
67REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRST ! Snow/aggregate m.r. at t
68REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRGT ! Graupel m.r. at t
69!
70REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PCCT ! Cloud water C. at t
71REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PCRT ! Rain water C. source
72REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PCIT ! Ice crystal C. source
73REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NNB_CRYSTAL_SHAPE), INTENT(INOUT) :: PCIT_SHAPE ! Ice crystal conc. at t for each shape
74!
75REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NMOD_CCN), INTENT(INOUT) :: PNFT ! Free CCN conc.
76REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PNHT ! haze homogeneous freezing
77!
78REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PICEFR ! Ice fraction
79!
80REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PTOT_RV_HONH ! Mixing ratio change due to HONH
81!
82!* 0.2 Declarations of local variables :
83!
84REAL, DIMENSION(:), ALLOCATABLE :: ZRVT ! Water vapor m.r. at t
85REAL, DIMENSION(:), ALLOCATABLE :: ZRCT ! Cloud water m.r. at t
86REAL, DIMENSION(:), ALLOCATABLE :: ZRRT ! Rain water m.r. at t
87REAL, DIMENSION(:), ALLOCATABLE :: ZRIT ! Pristine ice m.r. at t
88REAL, DIMENSION(:), ALLOCATABLE :: ZRST ! Snow/aggregate m.r. at t
89REAL, DIMENSION(:), ALLOCATABLE :: ZRGT ! Graupel/hail m.r. at t
90!
91REAL, DIMENSION(:), ALLOCATABLE :: ZTHT ! Theta source
92!
93REAL, DIMENSION(:), ALLOCATABLE :: ZCCT ! Cloud water conc. source
94REAL, DIMENSION(:), ALLOCATABLE :: ZCRT ! Rain water conc. source
95REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFT ! available nucleus conc. source
96REAL, DIMENSION(:), ALLOCATABLE :: ZCIT ! Pristine ice conc. source
97REAL, DIMENSION(:,:), ALLOCATABLE :: ZCIT_SHAPE ! Ice crystal conc. at t for each shape
98REAL, DIMENSION(:), ALLOCATABLE :: ZZNHT ! Nucleated Ice nuclei conc. source
99 ! by Homogeneous freezing
100!
101REAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
102 :: ZNHT ! Nucleated Ice nuclei conc. source
103 ! by Homogeneous freezing of haze
104REAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
105 :: ZT ! work arrays
106!
107REAL, DIMENSION(:), ALLOCATABLE &
108 :: ZRHODREF, & ! RHO Dry REFerence
109 ZZT, & ! Temperature
110 ZPRES, & ! Pressure
111 ZEXNREF, & ! EXNer Pressure REFerence
112 ZZW, & ! Work array
113 ZZX, & ! Work array
114 ZZY, & ! Work array
115 ZLSFACT, & ! L_s/(Pi_ref*C_ph)
116 ZLVFACT, & ! L_v/(Pi_ref*C_ph)
117 ZLBDAC, & ! Slope parameter of the cloud droplet distr.
118 ZSI, & ! Saturation over ice
119 ZTCELSIUS,&
120 ZLS, &
121 ZPSI1, &
122 ZPSI2, &
123 ZTAU, &
124 ZBFACT, &
125 ZW_NU, &
126 ZFREECCN, &
127 ZCCNFROZEN
128!
129INTEGER :: IL, IMOD_CCN, ISH ! Loop index
130!
131INTEGER :: INEGT ! Case number of hom. nucleation
132LOGICAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
133 :: GNEGT ! Test where to compute the hom. nucleation
134INTEGER , DIMENSION(SIZE(GNEGT)) :: I1,I3 ! Used to replace the COUNT
135!
136REAL :: ZEPS ! molar mass ratio
137REAL(KIND=jphook) :: zhook_handle
138!
139!-------------------------------------------------------------------------------
140!
141!
142!* 1. Preliminary computations and packing
143! ------------------------------------
144!
145IF (lhook) CALL dr_hook('LIMA_CCN_HOM_FREEZING', 0, zhook_handle)
146!
147! Temperature
148zt(:,:) = ptht(:,:) * ( ppabst(:,:)/cst%XP00 ) ** (cst%XRD/cst%XCPD)
149!
150znht(:,:) = pnht(:,:)
151!
152! Computations only where the temperature is below -35°C
153! PACK variables
154!
155gnegt(:,:) = .false.
156gnegt(d%NIJB:d%NIJE,d%NKB:d%NKE) = zt(d%NIJB:d%NIJE,d%NKB:d%NKE)<cst%XTT-35.0
157inegt = countjv( gnegt(:,:),i1(:),i3(:))
158!
159IF (inegt.GT.0) THEN
160
161 ALLOCATE(zrvt(inegt))
162 ALLOCATE(zrct(inegt))
163 ALLOCATE(zrrt(inegt))
164 ALLOCATE(zrit(inegt))
165 ALLOCATE(zrst(inegt))
166 ALLOCATE(zrgt(inegt))
167 !
168 ALLOCATE(ztht(inegt))
169 !
170 ALLOCATE(zcct(inegt))
171 ALLOCATE(zcrt(inegt))
172 ALLOCATE(zcit(inegt))
173 IF (limap%LCRYSTAL_SHAPE) ALLOCATE(zcit_shape(inegt,limap%NNB_CRYSTAL_SHAPE)) !++cb--
174 !
175 ALLOCATE(znft(inegt,limap%NMOD_CCN))
176 ALLOCATE(zznht(inegt))
177 !
178 ALLOCATE(zrhodref(inegt))
179 ALLOCATE(zzt(inegt))
180 ALLOCATE(zpres(inegt))
181 ALLOCATE(zexnref(inegt))
182 !
183 DO il=1,inegt
184 zrvt(il) = prvt(i1(il),i3(il))
185 zrct(il) = prct(i1(il),i3(il))
186 zrrt(il) = prrt(i1(il),i3(il))
187 zrit(il) = prit(i1(il),i3(il))
188 zrst(il) = prst(i1(il),i3(il))
189 zrgt(il) = prgt(i1(il),i3(il))
190 !
191 ztht(il) = ptht(i1(il),i3(il))
192 !
193 zcct(il) = pcct(i1(il),i3(il))
194 zcrt(il) = pcrt(i1(il),i3(il))
195 zcit(il) = pcit(i1(il),i3(il))
196 !
197 IF (limap%LCRYSTAL_SHAPE) THEN
198 DO ish = 1, limap%NNB_CRYSTAL_SHAPE
199 zcit_shape(il,ish) = pcit_shape(i1(il),i3(il),ish)
200 END DO
201 END IF
202 DO imod_ccn = 1, limap%NMOD_CCN
203 znft(il,imod_ccn) = pnft(i1(il),i3(il),imod_ccn)
204 ENDDO
205 zznht(il) = znht(i1(il),i3(il))
206 zrhodref(il) = prhodref(i1(il),i3(il))
207 zzt(il) = zt(i1(il),i3(il))
208 zpres(il) = ppabst(i1(il),i3(il))
209 zexnref(il) = pexnref(i1(il),i3(il))
210 ENDDO
211!
212! PACK : done
213! Prepare computations
214!
215 ALLOCATE( zlsfact(inegt) )
216 ALLOCATE( zlvfact(inegt) )
217 ALLOCATE( zsi(inegt) )
218 ALLOCATE( ztcelsius(inegt) )
219 ALLOCATE( zlbdac(inegt) )
220!
221 ALLOCATE( zzw(inegt) ) ; zzw(:) = 0.0
222 ALLOCATE( zzx(inegt) ) ; zzx(:) = 0.0
223 ALLOCATE( zzy(inegt) ) ; zzy(:) = 0.0
224!
225 ztcelsius(:) = zzt(:)-cst%XTT ! T [°C]
226 zzw(:) = zexnref(:)*( cst%XCPD+cst%XCPV*zrvt(:)+cst%XCL*(zrct(:)+zrrt(:)) &
227 +cst%XCI*(zrit(:)+zrst(:)+zrgt(:)) )
228 zlsfact(:) = (cst%XLSTT+(cst%XCPV-cst%XCI)*ztcelsius(:))/zzw(:) ! L_s/(Pi_ref*C_ph)
229 zlvfact(:) = (cst%XLVTT+(cst%XCPV-cst%XCL)*ztcelsius(:))/zzw(:) ! L_v/(Pi_ref*C_ph)
230!
231 zzw(:) = exp( cst%XALPI - cst%XBETAI/zzt(:) - cst%XGAMI*log(zzt(:) ) ) ! es_i
232 zsi(:) = zrvt(:)*(zpres(:)-zzw(:))/((cst%XMV/cst%XMD)*zzw(:)) ! Saturation over ice
233!
234!
235!-------------------------------------------------------------------------------
236!
237!
238!* 2. Haze homogeneous freezing
239! ------------------------
240!
241!
242! Compute the haze homogeneous nucleation source: RHHONI
243!
244 IF( limap%NMOD_CCN.GT.0 ) THEN
245
246! Sum of the available CCN
247 ALLOCATE( zfreeccn(inegt) )
248 ALLOCATE( zccnfrozen(inegt) )
249 zfreeccn(:)=0.
250 zccnfrozen(:)=0.
251 DO imod_ccn = 1, limap%NMOD_CCN
252 zfreeccn(:) = zfreeccn(:) + znft(:,imod_ccn)
253 END DO
254!
255 ALLOCATE(zw_nu(inegt))
256 DO il=1,inegt
257 zw_nu(il) = pw_nu(i1(il),i3(il))
258 END DO
259!
260 zzw(:) = 0.0
261 zzx(:) = 0.0
262 zeps = cst%XMV / cst%XMD
263 zzy(:) = limac%XCRITSAT1_HONH - & ! Critical Sat.
264 (min( limac%XTMAX_HONH,max( limac%XTMIN_HONH,zzt(:) ) )/limac%XCRITSAT2_HONH)
265!
266 ALLOCATE(zls(inegt))
267 ALLOCATE(zpsi1(inegt))
268 ALLOCATE(zpsi2(inegt))
269 ALLOCATE(ztau(inegt))
270 ALLOCATE(zbfact(inegt))
271!
272 WHERE( (zzt(:)<cst%XTT-35.0) .AND. (zsi(:)>zzy(:)) )
273 zls(:) = cst%XLSTT+(cst%XCPV-cst%XCI)*ztcelsius(:) ! Ls
274!
275 zpsi1(:) = zzy(:) * (cst%XG/(cst%XRD*zzt(:)))*(zeps*zls(:)/(cst%XCPD*zzt(:))-1.)
276! ! Psi1 (a1*Scr in KL01)
277! BV correction PSI2 enlever 1/ZEPS ?
278! ZPSI2(:) = ZSI(:) * (1.0/ZEPS+1.0/ZRVT(:)) + &
279 zpsi2(:) = zsi(:) * (1.0/zrvt(:)) + &
280 zzy(:) * ((zls(:)/zzt(:))**2)/(cst%XCPD*cst%XRV)
281! ! Psi2 (a2+a3*Scr in KL01)
282 ztau(:) = 1.0 / ( max( limac%XC1_HONH,limac%XC1_HONH*(limac%XC2_HONH-limac%XC3_HONH*zzt(:)) ) *&
283 abs( (limac%XDLNJODT1_HONH - limac%XDLNJODT2_HONH*zzt(:)) * &
284 ((zpres(:)/cst%XP00)**(cst%XRD/cst%XCPD))*ztht(:) ) )
285!
286 zbfact(:) = (limac%XRHOI_HONH/zrhodref(:)) * (zsi(:)/(zzy(:)-1.0)) &
287! BV correction ZBFACT enlever 1/ZEPS ?
288! * (1.0/ZRVT(:)+1.0/ZEPS) &
289 * (1.0/zrvt(:)) &
290 / (limac%XCOEF_DIFVAP_HONH*(zzt(:)**limac%XCEXP_DIFVAP_HONH /zpres(:)))
291!
292! BV correction ZZX rho_i{-1} ?
293! ZZX(:) = MAX( MIN( LIMAC%XRHOI_HONH*ZBFACT(:)**1.5 * (ZPSI1(:)/ZPSI2(:)) &
294 zzx(:) = max( min( (1/limac%XRHOI_HONH)*zbfact(:)**1.5 * (zpsi1(:)/zpsi2(:)) &
295 * (zw_nu(:)/sqrt(ztau(:))) , zfreeccn(:) ) , 0.)
296!
297 zzw(:) = min( limac%XRCOEF_HONH*zzx(:)*(ztau(:)/zbfact(:))**1.5 , zrvt(:) )
298 END WHERE
299!
300! Apply the changes
301 DO imod_ccn = 1, limap%NMOD_CCN
302 WHERE(zfreeccn(:)>1.)
303 zccnfrozen(:) = zzx(:) * znft(:,imod_ccn)/zfreeccn(:)
304 END WHERE
305 pnft(:,:,imod_ccn) = pnft(:,:,imod_ccn) - unpack( zccnfrozen(:), mask=gnegt(:,:),field=0.)
306 END DO
307!
308 ptot_rv_honh(:,:) = unpack( zzw(:), mask=gnegt(:,:),field=0.)
309!
310 ptht(:,:) = ptht(:,:) + unpack( zzw(:)*(zlsfact(:)-zlvfact(:)), mask=gnegt(:,:),field=0.)
311 prvt(:,:) = prvt(:,:) - unpack( zzw(:), mask=gnegt(:,:),field=0.)
312 prit(:,:) = prit(:,:) + unpack( zzw(:), mask=gnegt(:,:),field=0.)
313 IF (.NOT. limap%LCRYSTAL_SHAPE) THEN
314 pcit(:,:) = pcit(:,:) + unpack( zzx(:), mask=gnegt(:,:),field=0.)
315 ELSE
316 !--> Hyp : etant donnee la gamme de temperatures, formation de 20% de colonnes et
317 ! 80% de polycristaux
318 !PCIT_SHAPE(:,:,:,2) = PCIT_SHAPE(:,:,:,2) + &
319 ! 0.2 * UNPACK( ZZX(:), MASK=GNEGT(:,:,:),FIELD=0.)
320 !PCIT_SHAPE(:,:,:,3) = PCIT_SHAPE(:,:,:,3) + &
321 ! 0.8 * UNPACK( ZZX(:), MASK=GNEGT(:,:,:),FIELD=0.)
322 !--> Hyp : la congelation des CCN et des gouttelettes produit des droxtals
323 pcit_shape(:,:,4) = pcit_shape(:,:,4) + unpack( zzx(:), mask=gnegt(:,:),field=0.)
324 pcit(:,:) = sum(pcit_shape, dim=3)
325 END IF
326 pnht(:,:) = pnht(:,:) + unpack( zzx(:), mask=gnegt(:,:),field=0.)
327
328 DEALLOCATE(zfreeccn)
329 DEALLOCATE(zccnfrozen)
330 DEALLOCATE(zls)
331 DEALLOCATE(zpsi1)
332 DEALLOCATE(zpsi2)
333 DEALLOCATE(ztau)
334 DEALLOCATE(zbfact)
335 DEALLOCATE(zw_nu)
336!
337 END IF
338!
339!
340 DEALLOCATE(zrvt)
341 DEALLOCATE(zrct)
342 DEALLOCATE(zrrt)
343 DEALLOCATE(zrit)
344 DEALLOCATE(zrst)
345 DEALLOCATE(zrgt)
346!
347 DEALLOCATE(ztht)
348!
349 DEALLOCATE(zcct)
350 DEALLOCATE(zcrt)
351 DEALLOCATE(zcit)
352!
353 IF (ALLOCATED(zcit_shape)) DEALLOCATE(zcit_shape) !++cb-- 19/02/24
354!
355 DEALLOCATE(znft)
356 DEALLOCATE(zznht)
357!
358 DEALLOCATE(zrhodref)
359 DEALLOCATE(zzt)
360 DEALLOCATE(zpres)
361 DEALLOCATE(zexnref)
362!
363 DEALLOCATE(zlsfact)
364 DEALLOCATE(zlvfact)
365 DEALLOCATE(zsi)
366 DEALLOCATE(ztcelsius)
367 DEALLOCATE(zlbdac)
368!
369 DEALLOCATE(zzw)
370 DEALLOCATE(zzx)
371 DEALLOCATE(zzy)
372!
373!
374END IF ! INEGT>0
375!
376!
377!-------------------------------------------------------------------------------
378!
379IF (lhook) CALL dr_hook('LIMA_CCN_HOM_FREEZING', 1, zhook_handle)
380END SUBROUTINE lima_ccn_hom_freezing
subroutine lima_ccn_hom_freezing(limap, limac, d, cst, prhodref, pexnref, ppabst, pw_nu, ptht, prvt, prct, prrt, prit, prst, prgt, pcct, pcrt, pcit, pcit_shape, pnft, pnht, picefr, ptot_rv_honh)