PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_lima_phillips_ifn_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_phillips_ifn_nucleation (LIMAP, LIMAC, D, CST, PTSTEP, &
11 PRHODREF, PEXNREF, PPABST, &
12 PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, &
13 PCCT, PCIT, PCIT_SHAPE, PNAT, PIFT, PINT, PNIT, &
14 P_TH_HIND, P_RI_HIND, P_CI_HIND, P_SHCI_HIND, &
15 P_TH_HINC, P_RC_HINC, P_CC_HINC, P_SHCI_HINC, &
16 PICEFR )
17! #################################################################################
18!!
19!! PURPOSE
20!! -------
21!! The purpose of this routine is to compute the heterogeneous nucleation
22!! following Phillips (2008) for the time-split version of LIMA
23!!
24!!
25!!** METHOD
26!! ------
27!! The parameterization of Phillips (2008) is based on observed nucleation
28!! in the CFDC for a range of T and Si values. Phillips therefore defines a
29!! reference activity spectrum, that is, for given T and Si values, the
30!! reference concentration of primary ice crystals.
31!!
32!! The activation of IFN is closely related to their total surface. Thus,
33!! the activable fraction of each IFN specie is determined by an integration
34!! over the particle size distributions.
35!!
36!! Subroutine organisation :
37!!
38!! 1- Preliminary computations
39!! 2- Check where computations are necessary, and pack variables
40!! 3- Compute the saturation over water and ice
41!! 4- Compute the reference activity spectrum
42!! -> CALL LIMA_PHILLIPS_REF_SPECTRUM
43!! Integrate over the size distributions to compute the IFN activable fraction
44!! -> CALL LIMA_PHILLIPS_INTEG
45!! 5- Heterogeneous nucleation of insoluble IFN
46!! 6- Heterogeneous nucleation of coated IFN
47!! 7- Unpack variables & deallocations
48!!
49!!
50!! REFERENCE
51!! ---------
52!!
53!! Phillips et al., 2008: An empirical parameterization of heterogeneous
54!! ice nucleation for multiple chemical species of aerosols, J. Atmos. Sci.
55!!
56!! AUTHOR
57!! ------
58!! J.-M. Cohard * Laboratoire d'Aerologie*
59!! J.-P. Pinty * Laboratoire d'Aerologie*
60!! S. Berthet * Laboratoire d'Aerologie*
61!! B. Vié * Laboratoire d'Aerologie*
62!!
63!! MODIFICATIONS
64!! -------------
65!! Original 15/03/2018
66! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90
67! P. Wautelet 27/02/2020: bugfix: P_TH_HIND was not accumulated (will affect budgets) + add P_TH_HINC dummy argument
68! + change intent of *_HIND and *_HINC dummy arguments (INOUT->OUT)
69! C. Barthe 25/01/2024: add several shapes for ice crystals
70!-------------------------------------------------------------------------------
71!
72!* 0. DECLARATIONS
73! ------------
74!
76USE modd_cst, ONLY: cst_t
77
78USE mode_tools, only: countjv
79
84USE yomhook, ONLY:lhook, dr_hook, jphook
85
86IMPLICIT NONE
87!
88!* 0.1 Declarations of dummy arguments :
89!
90TYPE(param_lima_cold_t),INTENT(IN)::LIMAC
91TYPE(param_lima_t),INTENT(IN)::LIMAP
92TYPE(dimphyex_t), INTENT(IN) :: D
93TYPE(cst_t), INTENT(IN) :: CST
94REAL, INTENT(IN) :: PTSTEP
95!
96REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODREF! Reference density
97REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PEXNREF ! Reference Exner function
98REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPABST ! abs. pressure at time t
99!
100REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PTHT ! Theta at time t
101REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRVT ! Water vapor m.r. at t
102REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRCT ! Cloud water m.r. at t
103REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRRT ! Rain water m.r. at t
104REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRIT ! Cloud ice m.r. at t
105REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRST ! Snow/aggregate m.r. at t
106REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRGT ! Graupel m.r. at t
107!
108REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PCCT ! Cloud water conc. at t
109REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PCIT ! Cloud water conc. at t
110REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NNB_CRYSTAL_SHAPE), INTENT(INOUT) :: PCIT_SHAPE ! Cloud water conc. at t
111REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NMOD_CCN), INTENT(INOUT) :: PNAT ! CCN conc. used for immersion nucl.
112REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NMOD_IFN), INTENT(INOUT) :: PIFT ! Free IFN conc.
113REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NMOD_IFN), INTENT(INOUT) :: PINT ! Nucleated IFN conc.
114REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NMOD_IMM), INTENT(INOUT) :: PNIT ! Nucleated (by immersion) CCN conc.
115!
116REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_TH_HIND
117REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_RI_HIND
118REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_CI_HIND
119REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NNB_CRYSTAL_SHAPE), INTENT(OUT) :: P_SHCI_HIND
120REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_TH_HINC
121REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_RC_HINC
122REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: P_CC_HINC
123REAL, DIMENSION(D%NIJT,D%NKT,LIMAP%NNB_CRYSTAL_SHAPE), INTENT(OUT) :: P_SHCI_HINC
124!
125REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PICEFR
126!
127!
128!* 0.2 Declarations of local variables :
129!
130!
131INTEGER :: IL, IMOD_CCN, IMOD_IFN, ISPECIE, IMOD_IMM ! Loop index
132INTEGER :: INEGT ! Case number of sedimentation, nucleation,
133!
134LOGICAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
135 :: GNEGT ! Test where to compute the nucleation
136!
137INTEGER, DIMENSION(SIZE(PRHODREF)) :: I1,I3 ! Indexes for PACK replacement
138!
139REAL, DIMENSION(:), ALLOCATABLE :: ZRVT ! Water vapor m.r. at t
140REAL, DIMENSION(:), ALLOCATABLE :: ZRCT ! Cloud water m.r. at t
141REAL, DIMENSION(:), ALLOCATABLE :: ZRRT ! Rain water m.r. at t
142REAL, DIMENSION(:), ALLOCATABLE :: ZRIT ! Pristine ice m.r. at t
143REAL, DIMENSION(:), ALLOCATABLE :: ZRST ! Snow/aggregate m.r. at t
144REAL, DIMENSION(:), ALLOCATABLE :: ZRGT ! Graupel/hail m.r. at t
145!
146REAL, DIMENSION(:), ALLOCATABLE :: ZCCT ! Cloud water conc. at t
147!
148REAL, DIMENSION(:,:), ALLOCATABLE :: ZNAT ! Cloud Cond. nuclei conc. source
149REAL, DIMENSION(:,:), ALLOCATABLE :: ZIFT ! Free Ice nuclei conc. source
150REAL, DIMENSION(:,:), ALLOCATABLE :: ZINT ! Nucleated Ice nuclei conc. source
151 !by Deposition/Contact
152REAL, DIMENSION(:,:), ALLOCATABLE :: ZNIT ! Nucleated Ice nuclei conc. source
153 !by Immersion
154!
155REAL, DIMENSION(:), ALLOCATABLE &
156 :: ZRHODREF, & ! RHO Dry REFerence
157 ZZT, & ! Temperature
158 ZPRES, & ! Pressure
159 ZEXNREF, & ! EXNer Pressure REFerence
160 ZZW, & ! Work array
161 ZZX, & ! Work array
162 ZZY, & ! Work array
163 ZLSFACT, & ! L_s/(Pi_ref*C_ph)
164 ZLVFACT, & ! L_v/(Pi_ref*C_ph)
165 ZLBDAC, & ! Slope parameter of the cloud droplet distr.
166 ZSI, &
167 ZSW, &
168 ZSI_W
169!
170REAL, DIMENSION(SIZE(PRHODREF,1),SIZE(PRHODREF,2)) &
171 :: ZW, ZT ! work arrays
172!
173REAL, DIMENSION(:,:), ALLOCATABLE :: ZSI0, & ! Si threshold in H_X for X={DM,BC,O}
174 Z_FRAC_ACT ! Activable frac. of each AP species
175REAL, DIMENSION(:), ALLOCATABLE :: ZTCELSIUS, ZZT_SI0_BC
176REAL, DIMENSION(:,:), ALLOCATABLE :: ZTC3D, & ! arrays of temperature and Si
177 ZSI3D ! --> used if lcrystal_shape=t
178!
179REAL(KIND=jphook) :: zhook_handle
180!-------------------------------------------------------------------------------
181!
182!
183!* 1. PRELIMINARY COMPUTATIONS
184! ------------------------
185!
186IF (lhook) CALL dr_hook('LIMA_PHILLIPS_IFN_NUCLEATION', 0, zhook_handle)
187p_th_hind(:,:) = 0.
188p_ri_hind(:,:) = 0.
189p_ci_hind(:,:) = 0.
190p_th_hinc(:,:) = 0.
191p_rc_hinc(:,:) = 0.
192p_cc_hinc(:,:) = 0.
193!
194! Temperature
195!
196zt(d%NIJB:d%NIJE,:) = ptht(d%NIJB:d%NIJE,:) * ( ppabst(d%NIJB:d%NIJE,:)/cst%XP00 ) ** (cst%XRD/cst%XCPD)
197!
198! Saturation over ice
199!
200zw(d%NIJB:d%NIJE,:) = exp( cst%XALPI - cst%XBETAI/zt(d%NIJB:d%NIJE,:) - cst%XGAMI*log(zt(d%NIJB:d%NIJE,:) ) )
201zw(d%NIJB:d%NIJE,:) = prvt(d%NIJB:d%NIJE,:)*( ppabst(d%NIJB:d%NIJE,:)-zw(d%NIJB:d%NIJE,:) ) / &
202 & ( (cst%XMV/cst%XMD) * zw(d%NIJB:d%NIJE,:) )
203!
204!
205!-------------------------------------------------------------------------------
206!
207!
208!* 2. COMPUTATIONS ONLY WHERE NECESSARY : PACK
209! ----------------------------------------
210!
211!
212gnegt(:,:) = .false.
213gnegt(d%NIJB:d%NIJE,d%NKB:d%NKE) = zt(d%NIJB:d%NIJE,d%NKB:d%NKE)<cst%XTT-2.0 .AND. &
214 zw(d%NIJB:d%NIJE,d%NKB:d%NKE)>0.95
215!
216inegt = countjv( gnegt(:,:),i1(:),i3(:))
217!
218IF (inegt > 0) THEN
219!
220 ALLOCATE(zrvt(inegt))
221 ALLOCATE(zrct(inegt))
222 ALLOCATE(zrrt(inegt))
223 ALLOCATE(zrit(inegt))
224 ALLOCATE(zrst(inegt))
225 ALLOCATE(zrgt(inegt))
226!
227 ALLOCATE(zcct(inegt))
228!
229 ALLOCATE(znat(inegt,limap%NMOD_CCN))
230 ALLOCATE(zift(inegt,limap%NMOD_IFN))
231 ALLOCATE(zint(inegt,limap%NMOD_IFN))
232 ALLOCATE(znit(inegt,limap%NMOD_IMM))
233!
234 ALLOCATE(zrhodref(inegt))
235 ALLOCATE(zzt(inegt))
236 ALLOCATE(zpres(inegt))
237 ALLOCATE(zexnref(inegt))
238!
239 DO il=1,inegt
240 zrvt(il) = prvt(i1(il),i3(il))
241 zrct(il) = prct(i1(il),i3(il))
242 zrrt(il) = prrt(i1(il),i3(il))
243 zrit(il) = prit(i1(il),i3(il))
244 zrst(il) = prst(i1(il),i3(il))
245 zrgt(il) = prgt(i1(il),i3(il))
246!
247 zcct(il) = pcct(i1(il),i3(il))
248!
249 DO imod_ccn = 1, limap%NMOD_CCN
250 znat(il,imod_ccn) = pnat(i1(il),i3(il),imod_ccn)
251 ENDDO
252 DO imod_ifn = 1, limap%NMOD_IFN
253 zift(il,imod_ifn) = pift(i1(il),i3(il),imod_ifn)
254 zint(il,imod_ifn) = pint(i1(il),i3(il),imod_ifn)
255 ENDDO
256 DO imod_imm = 1, limap%NMOD_IMM
257 znit(il,imod_imm) = pnit(i1(il),i3(il),imod_imm)
258 ENDDO
259 zrhodref(il) = prhodref(i1(il),i3(il))
260 zzt(il) = zt(i1(il),i3(il))
261 zpres(il) = ppabst(i1(il),i3(il))
262 zexnref(il) = pexnref(i1(il),i3(il))
263 ENDDO
264!
265! PACK : done
266! Prepare computations
267!
268 ALLOCATE( zlsfact(inegt) )
269 ALLOCATE( zlvfact(inegt) )
270 ALLOCATE( zsi(inegt) )
271 ALLOCATE( ztcelsius(inegt) )
272 ALLOCATE( zzt_si0_bc(inegt) )
273 ALLOCATE( zlbdac(inegt) )
274 ALLOCATE( zsi0(inegt,limap%NSPECIE) )
275 ALLOCATE( z_frac_act(inegt,limap%NSPECIE) )
276 ALLOCATE( zsw(inegt) )
277 ALLOCATE( zsi_w(inegt) )
278!
279 ALLOCATE( zzw(inegt) ) ; zzw(:) = 0.0
280 ALLOCATE( zzx(inegt) ) ; zzx(:) = 0.0
281 ALLOCATE( zzy(inegt) )
282!
283!
284!-------------------------------------------------------------------------------
285!
286!
287!* 3. COMPUTE THE SATURATION OVER WATER AND ICE
288! -----------------------------------------
289!
290!
291 ztcelsius(:) = zzt(:)-cst%XTT ! T [°C]
292 zzw(:) = zexnref(:)*( cst%XCPD+cst%XCPV*zrvt(:)+cst%XCL*(zrct(:)+zrrt(:)) &
293 +cst%XCI*(zrit(:)+zrst(:)+zrgt(:)) )
294 zlsfact(:) = (cst%XLSTT+(cst%XCPV-cst%XCI)*ztcelsius(:))/zzw(:) ! L_s/(Pi_ref*C_ph)
295 zlvfact(:) = (cst%XLVTT+(cst%XCPV-cst%XCL)*ztcelsius(:))/zzw(:) ! L_v/(Pi_ref*C_ph)
296!
297 zzw(:) = exp( cst%XALPI - cst%XBETAI/zzt(:) - cst%XGAMI*log(zzt(:) ) ) ! es_i
298 zsi(:) = zrvt(:)*(zpres(:)-zzw(:))/((cst%XMV/cst%XMD)*zzw(:)) ! Saturation over ice
299!
300 zzy(:) = exp( cst%XALPW - cst%XBETAW/zzt(:) - cst%XGAMW*log(zzt(:) ) ) ! es_w
301 zsw(:) = zrvt(:)*(zpres(:)-zzy(:))/((cst%XMV/cst%XMD)*zzy(:)) ! Saturation over water
302!
303 zsi_w(:)= zzy(:)/zzw(:) ! Saturation over ice at water saturation: es_w/es_i
304!
305! Saturation parameters for H_X, with X={Dust/Metallic (2 modes), Black Carbon, Organic}
306!
307 zsi0(:,1) = 1.0 + 10.0**( -1.0261 + 3.1656e-3* ztcelsius(:) &
308 + 5.3938e-4*(ztcelsius(:)**2) &
309 + 8.2584e-6*(ztcelsius(:)**3) ) ! with T [°C]
310 zsi0(:,2) = zsi0(:,1) ! DM2 = DM1
311 zsi0(:,3) = 0.0 ! BC
312 zzt_si0_bc(:) = max( 198.0, min( 239.0,zzt(:) ) )
313 zsi0(:,3) = (-3.118e-5*zzt_si0_bc(:)+1.085e-2)*zzt_si0_bc(:)+0.5652 - limap%XDSI0(3)
314 IF (limap%NPHILLIPS == 8) THEN
315 zsi0(:,4) = zsi0(:,3) ! O = BC
316 ELSE IF (limap%NPHILLIPS == 13) THEN
317 zsi0(:,4) = 1.15 ! BIO
318 END IF
319!
320! if lcrystal_shape=t, 3D array of temperature and supersaturation are needed
321 IF (limap%LCRYSTAL_SHAPE) THEN
322 ALLOCATE(ztc3d(SIZE(prhodref,1),SIZE(prhodref,2)))
323 ALLOCATE(zsi3d(SIZE(prhodref,1),SIZE(prhodref,2)))
324 ztc3d(d%NIJB:d%NIJE,:) = zt(d%NIJB:d%NIJE,:) - cst%XTT
325 zsi3d(:,:) = unpack( zsi(:), mask=gnegt(:,:), field=0. )
326 END IF
327!
328!-------------------------------------------------------------------------------
329!
330!
331!* 4. COMPUTE THE ACTIVABLE FRACTION OF EACH IFN SPECIE
332! -------------------------------------------------
333!
334!
335! Computation of the reference activity spectrum ( ZZY = N_{IN,1,*} )
336!
337 CALL lima_phillips_ref_spectrum(limap, cst, inegt, zzt, zsi, zsi_w, zzy)
338!
339! For each aerosol species (DM1, DM2, BC, O), compute the fraction that may be activated
340! Z_FRAC_ACT(INEGT,LIMAP%NSPECIE) = fraction of each species that may be activated
341!
342 CALL lima_phillips_integ(limap, cst, inegt, zzt, zsi, zsi0, zsw, zzy, z_frac_act)
343!
344!
345!-------------------------------------------------------------------------------
346!
347!
348!* 5. COMPUTE THE HETEROGENEOUS NUCLEATION OF INSOLUBLE IFN
349! -----------------------------------------------------
350!
351!
352!
353 DO imod_ifn = 1,limap%NMOD_IFN ! IFN modes
354 zzx(:)=0.
355 DO ispecie = 1, limap%NSPECIE ! Each IFN mode is mixed with DM1, DM2, BC, O
356 zzx(:)=zzx(:)+limap%XFRAC(ispecie,imod_ifn)*(zift(:,imod_ifn)+zint(:,imod_ifn))* &
357 z_frac_act(:,ispecie)
358 END DO
359! Now : ZZX(:) = number conc. of activable AP.
360! Activated AP at this time step = activable AP - already activated AP
361 zzx(:) = min( zift(:,imod_ifn), max( (zzx(:)-zint(:,imod_ifn)),0.0 ))
362 zzw(:) = min( limac%XMNU0*zzx(:), zrvt(:) )
363! Now : ZZX(:) = number conc. of AP activated at this time step (#/kg) from IFN mode IMOD_IFN
364! Now : ZZW(:) = mmr of ice nucleated at this time step (kg/kg) from IFN mode IMOD_IFN
365!
366! Update the concentrations and MMR
367!
368 zw(:,:) = unpack( zzx(:), mask=gnegt(:,:), field=0. )
369 pift(d%NIJB:d%NIJE,:,imod_ifn) = pift(d%NIJB:d%NIJE,:,imod_ifn) - zw(:,:)
370 pint(d%NIJB:d%NIJE,:,imod_ifn) = pint(d%NIJB:d%NIJE,:,imod_ifn) + zw(:,:)
371!
372 p_ci_hind(d%NIJB:d%NIJE,:) = p_ci_hind(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
373 IF (.NOT. limap%LCRYSTAL_SHAPE) THEN
374 pcit(d%NIJB:d%NIJE,:) = pcit(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
375 ELSE
376!NOTE : p_shci_hinX est utile uniquement pour les bilans --> peut-etre mettre une condition pour leur calcul ?
377 ! different crystal habits are generated depending on the temperature
378!++cb++ 18/04/24 la formation des cristaux produit uniquement des formes primaires
379! on se base sur la figure 5 de Bailey et Hallett (2009)
380! Plates: -1<T<-3, -9<T<-20, -20<T<-40, -40<T si SSI < 0.05
381 WHERE (((ztc3d(d%NIJB:d%NIJE,:) .GT. -3.0) .AND. (ztc3d(d%NIJB:d%NIJE,:) .LT. 0.0)) .OR. &
382 ((ztc3d(d%NIJB:d%NIJE,:) .LE. -9.0) .AND. (ztc3d(d%NIJB:d%NIJE,:) .GT. -40.0)) .OR. &
383 ((ztc3d(d%NIJB:d%NIJE,:) .LE. -40.0) .AND. ((zsi3d(d%NIJB:d%NIJE,:)-1.) .LT. 0.05)) )
384 p_shci_hind(d%NIJB:d%NIJE,:,1) = p_shci_hind(d%NIJB:d%NIJE,:,1) + zw(d%NIJB:d%NIJE,:)
385 pcit_shape(d%NIJB:d%NIJE,:,1) = pcit_shape(d%NIJB:d%NIJE,:,1) + zw(d%NIJB:d%NIJE,:)
386 END WHERE
387!
388! Columns: -3<T<-9, -40<T<-70 si SSI > 0.05
389 WHERE (((ztc3d(d%NIJB:d%NIJE,:) .LE. -3.0) .AND. (ztc3d(d%NIJB:d%NIJE,:) .GT. -9.0)) .OR. &
390 ((ztc3d(d%NIJB:d%NIJE,:) .LE. -40.0) .AND. ((zsi3d(d%NIJB:d%NIJE,:)-1.) .GE. 0.05)))
391 p_shci_hind(d%NIJB:d%NIJE,:,2) = p_shci_hind(d%NIJB:d%NIJE,:,2) + zw(d%NIJB:d%NIJE,:)
392 pcit_shape(d%NIJB:d%NIJE,:,2) = pcit_shape(d%NIJB:d%NIJE,:,2) + zw(d%NIJB:d%NIJE,:)
393 END WHERE
394 !
395 pcit(d%NIJB:d%NIJE,:) = sum(pcit_shape(d%NIJB:d%NIJE,:,:), dim=3)
396 END IF
397!
398 zw(:,:) = unpack( zzw(:), mask=gnegt(:,:), field=0. )
399 p_ri_hind(d%NIJB:d%NIJE,:) = p_ri_hind(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
400 prvt(d%NIJB:d%NIJE,:) = prvt(d%NIJB:d%NIJE,:) - zw(d%NIJB:d%NIJE,:)
401 prit(d%NIJB:d%NIJE,:) = prit(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
402!
403 zw(:,:) = unpack( zzw(:)*zlsfact(:), mask=gnegt(:,:), field=0. )
404 p_th_hind(d%NIJB:d%NIJE,:) = p_th_hind(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
405 ptht(d%NIJB:d%NIJE,:) = ptht(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
406 END DO
407!
408!
409!-------------------------------------------------------------------------------
410!
411!
412!* 6. COMPUTE THE HETEROGENEOUS NUCLEATION OF COATED IFN
413! --------------------------------------------------
414!
415!
416! Heterogeneous nucleation by immersion of the activated CCN
417! Currently, we represent coated IFN as a pure aerosol type (LIMAP%NIND_SPECIE)
418!
419!
420 DO imod_imm = 1,limap%NMOD_IMM ! Coated IFN modes
421 imod_ccn = limap%NINDICE_CCN_IMM(imod_imm) ! Corresponding CCN mode
422 IF (imod_ccn .GT. 0) THEN
423!
424! OLD LIMA : Compute the appropriate mean diameter and sigma
425! XMDIAM_IMM = MIN( LIMAP%XMDIAM_IFN(LIMAP%NIND_SPECIE) , LIMAP%XR_MEAN_CCN(IMOD_CCN)*2. )
426! XSIGMA_IMM = MIN( LIMAP%XSIGMA_IFN(ISPECIE) , EXP(LIMAP%XLOGSIG_CCN(IMOD_CCN)) )
427!
428 zzw(:) = min( zcct(:) , znat(:,imod_ccn) )
429 zzx(:)= ( zzw(:)+znit(:,imod_imm) ) * z_frac_act(:,limap%NIND_SPECIE)
430! Now : ZZX(:) = number of activable AP.
431! Activated AP at this time step = activable AP - already activated AP
432 zzx(:) = min( zzw(:), max( (zzx(:)-znit(:,imod_imm)),0.0 ) )
433 zzy(:) = min( limac%XMNU0*zzx(:) , zrvt(:), zrct(:) )
434!
435! Update the concentrations and MMR
436!
437 zw(:,:) = unpack( zzx(:), mask=gnegt(:,:), field=0. )
438 pnit(d%NIJB:d%NIJE,:,imod_imm) = pnit(d%NIJB:d%NIJE,:,imod_imm) + zw(d%NIJB:d%NIJE,:)
439 pnat(d%NIJB:d%NIJE,:,imod_ccn) = pnat(d%NIJB:d%NIJE,:,imod_ccn) - zw(d%NIJB:d%NIJE,:)
440!
441 p_cc_hinc(d%NIJB:d%NIJE,:) = p_cc_hinc(d%NIJB:d%NIJE,:) - zw(d%NIJB:d%NIJE,:)
442 pcct(d%NIJB:d%NIJE,:) = pcct(d%NIJB:d%NIJE,:) - zw(d%NIJB:d%NIJE,:)
443 IF (.NOT. limap%LCRYSTAL_SHAPE) THEN
444 pcit(d%NIJB:d%NIJE,:) = pcit(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
445 ELSE
446 ! different crystal habits are generated depending on the temperature
447
448! Plates: -1<T<-3, -9<T<-20, -20<T<-40, -40<T si SSI < 0.05
449! WHERE (((ZTC3D(:,:) .GT. -3.0) .AND. (ZTC3D(:,:) .LT. 0.0)) .OR. &
450! ((ZTC3D(:,:) .LE. -9.0) .AND. (ZTC3D(:,:) .GT. -40.0)) .OR. &
451! ((ZTC3D(:,:) .LE. -40.0) .AND. ((ZSI3D(:,:)-1.) .LT. 0.05)) )
452! P_SHCI_HINC(:,:,1) = P_SHCI_HINC(:,:,1) + ZW(:,:)
453! PCIT_SHAPE(:,:,1) = PCIT_SHAPE(:,:,1) + ZW(:,:)
454! END WHERE
455!
456! Columns: -3<T<-9, -40<T<-70 si SSI > 0.05
457! WHERE (((ZTC3D(:,:) .LE. -3.0) .AND. (ZTC3D(:,:) .GT. -9.0)) .OR. &
458! ((ZTC3D(:,:) .LE. -40.0) .AND. ((ZSI3D(:,:)-1.) .GE. 0.05)))
459! P_SHCI_HINC(:,:,2) = P_SHCI_HINC(:,:,2) + ZW(:,:)
460! PCIT_SHAPE(:,:,2) = PCIT_SHAPE(:,:,2) + ZW(:,:)
461! END WHERE
462! Droxtals
463 p_shci_hinc(d%NIJB:d%NIJE,:,4) = p_shci_hinc(d%NIJB:d%NIJE,:,4) + zw(d%NIJB:d%NIJE,:)
464 pcit_shape(d%NIJB:d%NIJE,:,4) = pcit_shape(d%NIJB:d%NIJE,:,4) + zw(d%NIJB:d%NIJE,:)
465 !
466 pcit(d%NIJB:d%NIJE,:) = sum(pcit_shape(d%NIJB:d%NIJE,:,:), dim=3)
467 END IF
468!
469 zw(:,:) = unpack( zzy(:), mask=gnegt(:,:), field=0. )
470 p_rc_hinc(d%NIJB:d%NIJE,:) = p_rc_hinc(d%NIJB:d%NIJE,:) - zw(d%NIJB:d%NIJE,:)
471 prct(d%NIJB:d%NIJE,:) = prct(d%NIJB:d%NIJE,:) - zw(d%NIJB:d%NIJE,:)
472 prit(d%NIJB:d%NIJE,:) = prit(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
473!
474 zw(:,:) = unpack( zzy(:)*zlsfact(:), mask=gnegt(:,:), field=0. )
475 p_th_hinc(d%NIJB:d%NIJE,:) = p_th_hinc(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
476 ptht(d%NIJB:d%NIJE,:) = ptht(d%NIJB:d%NIJE,:) + zw(d%NIJB:d%NIJE,:)
477 END IF
478 END DO
479!
480!-------------------------------------------------------------------------------
481!
482!
483!* 7. CLEAN
484! -----
485!
486!
487 DEALLOCATE(zrvt)
488 DEALLOCATE(zrct)
489 DEALLOCATE(zrrt)
490 DEALLOCATE(zrit)
491 DEALLOCATE(zrst)
492 DEALLOCATE(zrgt)
493 DEALLOCATE(zcct)
494 DEALLOCATE(znat)
495 DEALLOCATE(zift)
496 DEALLOCATE(zint)
497 DEALLOCATE(znit)
498 DEALLOCATE(zrhodref)
499 DEALLOCATE(zzt)
500 DEALLOCATE(zpres)
501 DEALLOCATE(zexnref)
502 DEALLOCATE(zlsfact)
503 DEALLOCATE(zlvfact)
504 DEALLOCATE(zsi)
505 DEALLOCATE(ztcelsius)
506 DEALLOCATE(zzt_si0_bc)
507 DEALLOCATE(zlbdac)
508 DEALLOCATE(zsi0)
509 DEALLOCATE(z_frac_act)
510 DEALLOCATE(zsw)
511 DEALLOCATE(zzw)
512 DEALLOCATE(zzx)
513 DEALLOCATE(zzy)
514 DEALLOCATE(zsi_w)
515 IF (ALLOCATED(ztc3d)) DEALLOCATE(ztc3d)
516 IF (ALLOCATED(zsi3d)) DEALLOCATE(zsi3d)
517!
518END IF ! INEGT > 0
519!
520!-------------------------------------------------------------------------------
521!
522IF (lhook) CALL dr_hook('LIMA_PHILLIPS_IFN_NUCLEATION', 1, zhook_handle)
523END SUBROUTINE lima_phillips_ifn_nucleation
subroutine lima_phillips_ifn_nucleation(limap, limac, d, cst, ptstep, prhodref, pexnref, ppabst, ptht, prvt, prct, prrt, prit, prst, prgt, pcct, pcit, pcit_shape, pnat, pift, pint, pnit, p_th_hind, p_ri_hind, p_ci_hind, p_shci_hind, p_th_hinc, p_rc_hinc, p_cc_hinc, p_shci_hinc, picefr)
subroutine lima_phillips_integ(limap, cst, isize, pzt, psi, psi0, psw, pzy, p_frac_act)
subroutine lima_phillips_ref_spectrum(limap, cst, isize, pzt, psi, psi_w, pzy)