Newer
Older
!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
!MNH_LIC for details. version 1.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
! ####################################
MODULE MODI_CH_AQUEOUS_TMICKESS
! ####################################
!
INTERFACE
SUBROUTINE CH_AQUEOUS_TMICKESS( PTSTEP, PRHODREF, PRHODJ, PRTMIN_AQ, &
PRCT, PRRT, PRCS, PRRS, &
PCSVT, PCRSVS, PRSVT, PRRSVS )
!
REAL, INTENT(IN) :: PTSTEP ! Time step
REAL, INTENT(IN) :: PRTMIN_AQ ! LWC threshold liq. chem.
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCT ! cloud water m.r. at t
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rainwater m.r. at t
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCS ! cloud water m.r. source
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rainwater m.r. source
REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCSVT ! cloud water aq. species at t
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PCRSVS ! cloud water aq. species source
REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRSVT ! Rainwater aq. species at t
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRSVS ! Rainwater aq. species source
!
END SUBROUTINE CH_AQUEOUS_TMICKESS
END INTERFACE
END MODULE MODI_CH_AQUEOUS_TMICKESS
!
! ######################################################################
SUBROUTINE CH_AQUEOUS_TMICKESS( PTSTEP, PRHODREF, PRHODJ, PRTMIN_AQ, &
PRCT, PRRT, PRCS, PRRS, &
PCSVT, PCRSVS, PRSVT, PRRSVS )
! ######################################################################
!
!!**** * - compute the explicit microphysical sources
!!
!! PURPOSE
!! -------
!! The purpose of this routine is to compute the microphysical sources
!! corresponding to collision/coalescence processes (autoconversion + accretion)
!! for the Kessler cloud microphysics parameterization (see slow_terms)
!!
!!
!!** METHOD
!! ------
!!
!! EXTERNAL
!! --------
!! None
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! Module MODD_PARAMETERS
!! JPHEXT : Horizontal external points number
!! JPVEXT : Vertical external points number
!!
!! REFERENCE
!! ---------
!! Book1 of the documentation ( routine CH_AQUEOUS_TMICKESS )
!!
!! AUTHOR
!! ------
!! C. Mari J.P. Pinty M. Leriche * Laboratoire d'Aerologie*
!!
!! MODIFICATIONS
!! -------------
!! Original 26/03/08
!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
!!
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_PARAMETERS, ONLY : JPHEXT, &! number of horizontal External points
JPVEXT ! number of vertical External points
USE MODD_CLOUDPAR, ONLY : XC1RC, XC2RC, &! autoconversion param.
XCEXRA, XCRA, &! accrection param.
XCEXVT ! constant in the rain drop fall velocity
!
IMPLICIT NONE
!
!* 0.1 Declarations of dummy arguments :
!
!
REAL, INTENT(IN) :: PTSTEP ! Time step
REAL, INTENT(IN) :: PRTMIN_AQ ! LWC threshold liq. chem.
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCT ! cloud water m.r. at t
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rainwater m.r. at t
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCS ! cloud water m.r. source
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rainwater m.r. source
REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCSVT ! cloud water aq. species at t
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PCRSVS ! cloud water aq. species source
REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRSVT ! Rainwater aq. species at t
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRSVS ! Rainwater aq. species source
!ch_monitorn.f90
!* 0.2 Declarations of local variables :
!
INTEGER :: JLC, JLR ! Loop index for cloud water and rainwater aq. species
INTEGER :: IIB ! Define the domain where is
INTEGER :: IIE ! the microphysical sources have to be computed
INTEGER :: IJB !
INTEGER :: IJE !
INTEGER :: IKB !
INTEGER :: IKE !
!
INTEGER :: IMICRO ! case number of r_x>0 locations
LOGICAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) &
:: GMICRO ! where to compute mic. processes
REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) &
:: ZRCS ! Cloud water m.r. source phys.tendency
!REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) &
! :: ZRRS ! Rain water m.r. source phys. tendency
REAL, DIMENSION(SIZE(PCRSVS,1),SIZE(PCRSVS,2),SIZE(PCRSVS,3),SIZE(PCRSVS,4)) &
:: ZZCRSVS ! Cloud water aq. species source
REAL, DIMENSION(SIZE(PRRSVS,1),SIZE(PRRSVS,2),SIZE(PRRSVS,3),SIZE(PRRSVS,4)) &
:: ZZRRSVS ! Rain water aq. species source
REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) &
:: ZW ! work array
REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) &
:: ZCW ! work array
REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) &
:: ZRW ! work array
REAL, DIMENSION(:), ALLOCATABLE :: ZRCT ! Cloud water m.r. at t
REAL, DIMENSION(:), ALLOCATABLE :: ZRRT ! Rain water m.r. at t
REAL, DIMENSION(:), ALLOCATABLE :: ZZRCS ! Cloud water m.r. source
!REAL, DIMENSION(:), ALLOCATABLE :: ZZRRS ! Rain water m.r. source
REAL, DIMENSION(:,:), ALLOCATABLE :: ZCSVT ! Cloud water aq. species at t
!REAL, DIMENSION(:,:), ALLOCATABLE :: ZRSVT ! Rain water aq. species at t
REAL, DIMENSION(:,:), ALLOCATABLE :: ZCRSVS ! Cloud water aq. species source
REAL, DIMENSION(:,:), ALLOCATABLE :: ZRRSVS ! Rain water aq. species source
REAL, DIMENSION(:,:), ALLOCATABLE :: ZZW1 ! Work array
!
REAL, DIMENSION(:), ALLOCATABLE :: ZRHODREF, & ! RHO Dry REFerence
ZZW ! Work array
!
INTEGER , DIMENSION(SIZE(GMICRO)) :: I1,I2,I3 ! Used to replace the COUNT
INTEGER :: JL ! and PACK intrinsics
!
!
!-------------------------------------------------------------------------------
!
!* 1. COMPUTE THE LOOP BOUNDS
! -----------------------
!
CALL GET_INDICE_ll (IIB,IJB,IIE,IJE)
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
IKB=1+JPVEXT
IKE=SIZE(PRCT,3) - JPVEXT
!
!-------------------------------------------------------------------------------
!
!!* 2. TRANSFORMATION INTO PHYSICAL TENDENCIES
! ---------------------------------------
!
ZRCS(:,:,:) = PRCS(:,:,:) / PRHODJ(:,:,:)
!ZRRS(:,:,:) = PRRS(:,:,:) / PRHODJ(:,:,:)
!
DO JLC= 1, SIZE(PCRSVS,4)
ZZCRSVS(:,:,:,JLC) = PCRSVS(:,:,:,JLC) / PRHODJ(:,:,:)
ENDDO
DO JLR= 1, SIZE(PRRSVS,4)
ZZRRSVS(:,:,:,JLR) = PRRSVS(:,:,:,JLR) / PRHODJ(:,:,:)
ENDDO
!
!-------------------------------------------------------------------------------
!
!* 3. OPTIMIZATION: looking for locations where lwc lwr > min value
! -------------------------------------------------------------
!
GMICRO(:,:,:) = .FALSE.
GMICRO(IIB:IIE,IJB:IJE,IKB:IKE) = &
(PRCT(IIB:IIE,IJB:IJE,IKB:IKE)>PRTMIN_AQ*1.e3/PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE)) .OR. &
(PRRT(IIB:IIE,IJB:IJE,IKB:IKE)>PRTMIN_AQ*1.e3/PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE))
!
IMICRO = COUNTJV( GMICRO(:,:,:),I1(:),I2(:),I3(:))
IF( IMICRO >= 1 ) THEN
ALLOCATE(ZRCT(IMICRO))
ALLOCATE(ZRRT(IMICRO))
ALLOCATE(ZCSVT(IMICRO,SIZE(PCSVT,4)))
! ALLOCATE(ZRSVT(IMICRO,SIZE(PRSVT,4)))
ALLOCATE(ZZRCS(IMICRO))
! ALLOCATE(ZZRRS(IMICRO))
ALLOCATE(ZCRSVS(IMICRO,SIZE(PCRSVS,4)))
ALLOCATE(ZRRSVS(IMICRO,SIZE(PRRSVS,4)))
ALLOCATE(ZRHODREF(IMICRO))
ALLOCATE(ZZW(IMICRO))
ALLOCATE(ZZW1(IMICRO,SIZE(PCSVT,4)))
DO JL=1,IMICRO
ZCSVT(JL,:) = PCSVT(I1(JL),I2(JL),I3(JL),:)
ZCRSVS(JL,:) = ZZCRSVS(I1(JL),I2(JL),I3(JL),:)
! ZRSVT(JL,:) = PRSVT(I1(JL),I2(JL),I3(JL),:)
ZRRSVS(JL,:) = ZZRRSVS(I1(JL),I2(JL),I3(JL),:)
!
ZRCT(JL) = PRCT(I1(JL),I2(JL),I3(JL))
ZRRT(JL) = PRRT(I1(JL),I2(JL),I3(JL))
!
ZZRCS(JL) = ZRCS(I1(JL),I2(JL),I3(JL))
! ZZRRS(JL) = ZRRS(I1(JL),I2(JL),I3(JL))
!
ZRHODREF(JL) = PRHODREF(I1(JL),I2(JL),I3(JL))
ENDDO
!
!
!-------------------------------------------------------------------------------
!
!* 4. COMPUTES THE SLOW WARM PROCESS SOURCES
! --------------------------------------
!
!* 4.1 compute the autoconversion of r_c for r_r production: RCAUTR
!
ZZW(:) = 0.0
ZZW1(:,:) = 0.0
!
DO JL=1,IMICRO
IF ( (ZRCT(JL)>0.0) .AND. (ZZRCS(JL)>0.0) ) THEN
ZZW(JL) = MIN( ZZRCS(JL),XC1RC*MAX( ZRCT(JL)-XC2RC/ZRHODREF(JL),0.0))
!
ZZW1(JL,:) = ZZW(JL) * ZCSVT(JL,:)/ZRCT(JL)
ZZW1(JL,:) = MAX(MIN(ZZW1(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0)
ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW1(JL,:)
ZRRSVS(JL,:) = ZRRSVS(JL,:) + ZZW1(JL,:)
END IF
END DO
!
!* 4.2 compute the accretion of r_c for r_r production: RCACCR
!
ZZW(:) = 0.0
ZZW1(:,:) = 0.0
!
DO JL = 1,IMICRO
IF( (ZRCT(JL)>0.0) .AND. (ZRRT(JL)>0.0) .AND. (ZZRCS(JL)>0.0) ) THEN
ZZW(JL) = MIN( ZZRCS(JL),XCRA * ZRCT(JL) * ZRRT(JL)**XCEXRA &
* ZRHODREF(JL)**( XCEXRA - XCEXVT ) )
!
ZZW1(JL,:) = ZZW(JL) * ZCSVT(JL,:)/ZRCT(JL)
ZZW1(JL,:) = MAX(MIN(ZZW1(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0)
ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW1(JL,:)
ZRRSVS(JL,:) = ZRRSVS(JL,:) + ZZW1(JL,:)
END IF
END DO
!
!
!* 4.3 compute the evaporation of r_r: RREVAV
!
! calculated by the kinetic mass transfer equation (BASIC.f90)
!
!
!-------------------------------------------------------------------------------
!
!* 5. UNPACK RESULTS AND DEALLOCATE ARRAYS
! ------------------------------------
!
DO JLC= 1, SIZE(PCRSVS,4)
ZCW(:,:,:) = ZZCRSVS(:,:,:,JLC)
ZZCRSVS(:,:,:,JLC) = UNPACK(ZCRSVS(:,JLC), MASK=GMICRO(:,:,:), FIELD=ZCW(:,:,:))
PCRSVS(:,:,:,JLC) = ZZCRSVS(:,:,:,JLC) * PRHODJ(:,:,:)
END DO
DO JLR= 1, SIZE(PRRSVS,4)
ZRW(:,:,:) = ZZRRSVS(:,:,:,JLR)
ZZRRSVS(:,:,:,JLR) = UNPACK(ZRRSVS(:,JLR), MASK=GMICRO(:,:,:), FIELD=ZRW(:,:,:))
PRRSVS(:,:,:,JLR) = ZZRRSVS(:,:,:,JLR) * PRHODJ(:,:,:)
END DO
!
DEALLOCATE(ZRHODREF)
DEALLOCATE(ZZW)
DEALLOCATE(ZZW1)
! DEALLOCATE(ZZRRS)
DEALLOCATE(ZZRCS)
DEALLOCATE(ZCRSVS)
DEALLOCATE(ZRRSVS)
DEALLOCATE(ZRRT)
DEALLOCATE(ZRCT)
DEALLOCATE(ZCSVT)
! DEALLOCATE(ZRSVT)
!
END IF
!
!
!-------------------------------------------------------------------------------
!
!
CONTAINS
!
!
FUNCTION COUNTJV(LTAB,I1,I2,I3) RESULT(IC)
!
!* 0. DECLARATIONS
! ------------
!
IMPLICIT NONE
!
!* 0.2 declaration of local variables
!
!
LOGICAL, DIMENSION(:,:,:) :: LTAB ! Mask
INTEGER, DIMENSION(:) :: I1,I2,I3 ! Used to replace the COUNT and PACK
INTEGER :: JI,JJ,JK,IC
!
!-------------------------------------------------------------------------------
!
IC = 0
DO JK = 1,SIZE(LTAB,3)
DO JJ = 1,SIZE(LTAB,2)
DO JI = 1,SIZE(LTAB,1)
IF( LTAB(JI,JJ,JK) ) THEN
IC = IC +1
I1(IC) = JI
I2(IC) = JJ
I3(IC) = JK
END IF
END DO
END DO
END DO
!
END FUNCTION COUNTJV
!
END SUBROUTINE CH_AQUEOUS_TMICKESS