PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_icecloud.F90
Go to the documentation of this file.
2IMPLICIT NONE
3CONTAINS
4SUBROUTINE icecloud &
5! Input :
6 & ( d,cst,icep,pp,pz,pdz,pt,pr,ptstep,ppblh,pwcld,xw2d, &
7! Output :
8 & sifrc,ssio,ssiu,w2d,rsi)
9
10 USE yomhook , ONLY : lhook, dr_hook, jphook
11 USE modd_dimphyex, ONLY: dimphyex_t
12 USE modd_cst,ONLY : cst_t
14 IMPLICIT NONE
15!-----------------------------------------------------------------------
16!
17! Purpose:
18! calculate subgridscale fraction of supersaturation with respect to ice.
19! Method:
20! Assume a linear distubution of relative humidity and let the variability
21! of humidity be a function of model level thickness.
22! (Also a function of of humidity itself in the boundary layer)
23! Interface: subroutine ICECLOUD is called
24! ------------ from subroutine 'rain_ice'
25!
26! variable type content
27! ======== ==== =======
28!
29! INPUT arguments (arguments d'entree)
30!----------------------------------------------
31! PP : pressure at model level (Pa)
32! PZ : model level height (m)
33! PDZ : model level thickness (m)
34! PT : temperature (K)
35! PR : model level humidity mixing ratio (kg/kg)
36! PTSTEP : timestep
37! PPBLH : plantetary layer height (m) (negative value means unknown)
38! PWCLD : water and / mixed phase cloud cover (negative means unknown)
39! XW2D : quota between ice crystal concentration between dry and wet
40! part of a gridbox
41
42! OUTPUT arguments (arguments d'sortie)
43!---------------------------------------------
44! SIFRC : subgridscale fraction with supersaturation with respect to ice.
45! SSIO : Super-saturation with respect to ice in the
46! supersaturated fraction
47! SSIU : Sub-saturation with respect to ice in the sub-saturated
48! fraction
49! W2D : Factor used to get consistncy between the mean value of
50! the gridbox and parts of the gridbox
51! RSI : Saturation mixing ratio over ice
52
53TYPE(dimphyex_t), INTENT(IN) :: D
54TYPE(cst_t), INTENT(IN) :: CST
55TYPE(rain_ice_param_t), INTENT(IN) :: ICEP
56REAL, INTENT(IN) :: PP(D%NIJT,D%NKT)
57REAL, INTENT(IN) :: PZ(D%NIJT,D%NKT)
58REAL, INTENT(IN) :: PDZ(D%NIJT,D%NKT)
59REAL, INTENT(IN) :: PT(D%NIJT,D%NKT)
60REAL, INTENT(IN) :: PR(D%NIJT,D%NKT)
61REAL, INTENT(IN) :: PTSTEP
62REAL, INTENT(IN) :: PPBLH
63REAL, INTENT(IN) :: PWCLD(D%NIJT,D%NKT)
64REAL, INTENT(IN) :: XW2D
65
66! OUTPUT arguments (arguments d'sortie)
67!---------------------------------------------
68REAL, INTENT(OUT) :: SIFRC(D%NIJT,D%NKT)
69REAL, INTENT(OUT) :: SSIO(D%NIJT,D%NKT)
70REAL, INTENT(OUT) :: SSIU(D%NIJT,D%NKT)
71REAL, INTENT(OUT) :: W2D(D%NIJT,D%NKT)
72REAL, INTENT(OUT) :: RSI(D%NIJT,D%NKT)
73
74! Working variables:
75REAL :: ZSIGMAX,ZSIGMAY,ZSIGMAZ,ZXDIST,ZYDIST,&
76 & ZRHW,ZRHIN,ZDRHDZ,ZZ,ZRHDIST,ZRHLIM, &
77 & ZRHDIF,ZWCLD,ZI2W,ZRHLIMICE,ZRHLIMINV,ZA,ZRHI,ZR
78INTEGER :: JIJ, JK, IIJB, IIJE, IKTB, IKTE
79
80REAL(KIND=jphook) :: zhook_handle
81IF (lhook) CALL dr_hook('ICECLOUD',0,zhook_handle)
82!
83iijb=d%NIJB
84iije=d%NIJE
85iktb=d%NKTB
86ikte=d%NKTE
87!
88zsigmax=3.e-4 ! assumed rh variation in x axis direction
89zsigmay=zsigmax ! assumed rh variation in y axis direction
90zsigmaz=1.e-2
91
92!ZXDIST=DTHETA*110000.
93zxdist=2500.
94 ! gridsize in x axis (m) Avoid too low
95 ! since the model has a tendency to become
96 ! drier at high horizontal resolution
97 ! due to stronger vertical velocities.
98zydist=zxdist ! gridsize in y axis (m)
99DO jk = iktb, ikte
100 DO jij = iijb, iije
101 zr = max(0.,pr(jij,jk)*ptstep)
102 sifrc(jij,jk) = 0.
103 za = zr*pp(jij,jk)/(cst%XEPSILO + zr)
104 zrhw = za/esatw(icep%TIWMX, pt(jij,jk))
105 rsi(jij,jk) = qsatmx_tab(cst,icep%TIWMX,pp(jij,jk),pt(jij,jk),1.)
106 zrhi = za/esati(icep%TIWMX, pt(jij,jk))
107 zi2w = esatw(icep%TIWMX, pt(jij,jk))/esati(icep%TIWMX, pt(jij,jk))
108
109 ssiu(jij,jk) = min(zi2w,zrhi)
110 ssio(jij,jk) = ssiu(jij,jk)
111 w2d(jij,jk) = 1.
112 IF (pt(jij,jk)>273.1 .OR. zr<=0. .OR. esati(icep%TIWMX, pt(jij,jk)) >= pp(jij,jk)*0.5) THEN
113 ssiu(jij,jk) = ssiu(jij,jk) - 1.
114 ssio(jij,jk) = ssiu(jij,jk)
115 IF(pwcld(jij,jk)>=0.) sifrc(jij,jk) = pwcld(jij,jk)
116 ELSE
117
118 zrhin = max(0.05, min(1.,zrhw))
119
120 zdrhdz=zrhin*cst%XG /(pt(jij,jk)*cst%XRD)* &
121 & ( cst%XEPSILO*cst%XLVTT/(cst%XCPD*pt(jij,jk)) - 1.) ! correct
122! & ( ZEPSILO*XLSTT/(CST%XCPD*PT) -1.) ! incorrect
123! more exact
124! assumed rh variation in the z axis (rh/m) in the pbl .
125! Also possible to just use
126! zdrhdz=4.2e-4_jprb ! rh/m !
127
128 zz=0.
129 IF(ppblh < 0. )THEN ! Assume boundary layer height is not available
130 zz = min(1.,max(0.,pz(jij,jk)*0.001))
131 ELSE
132 IF(pz(jij,jk) > 35. .AND. pz(jij,jk) > ppblh) zz = 1.
133 ENDIF
134
135! 1.6e-2 rh/m means variations is of order 0.5 for a 1km dept.
136! sigmaz=4e-2 ! EO 140 lev.
137
138
139! Compute rh-variation is x,y,z direction as approxmately
140! independent, exept for the z variation in the pbl, where rh is
141! assumed to be fairly constantly increasing with height
142
143 zrhdist = sqrt( zxdist*zsigmax**2 + zydist*zsigmay**2 + &
144 & (1.-zz)* (pdz(jij,jk)*zdrhdz)**2 + zz*pdz(jij,jk)*zsigmaz**2)
145! z-variation of rh in the pbl z-variation of rh outside the pbl
146! Safety for very coarse vertical resolution:
147 IF(zz > 0.1) zrhdist = zrhdist/(1.+zrhdist)
148
149!!!! Note ZRHDIST is with respect to water ! !!!!!!!!!!!!
150
151 zrhlim = max(0.5,min(0.99,1.-0.5*zrhdist))
152
153 IF(pwcld(jij,jk) < 0.)THEN
154 ! Assume water/mixed-phase cloud cover from e.g.
155 ! statistical cloud scheme is not available
156 zrhdif = (1. - zrhw)/(1.0-zrhlim)
157 zrhdif = 1. - sqrt(max(0.,zrhdif))
158 zwcld = min(1.,max(zrhdif,0.0))
159 ELSE
160 zwcld = pwcld(jij,jk)
161! possible to backwards compute a critical relative humity consitent with
162! input cloudcover:
163! IF(PWCLD < 0.99 .AND. PWCLD > 0.01) ZRHLIM= 1. - (1.-ZRHW)/(1.-PWCLD)**2
164 ENDIF
165
166 sifrc(jij,jk) = zwcld
167
168! relation rhlim with respect to water to that of ice:
169!ZRHLIMICE = MAX(ZRHDMIN*ZI2W,1.+ ZI2W*( ZRHLIM - 1.))
170 zrhlimice = 1.+ zi2w*( zrhlim - 1.)
171
172 IF(zrhlim <= 0.999)THEN
173
174 ! compute a 1/(1-rhlim) constistant with lstmp(i,k):
175 zrhliminv = 1./(1. - zrhlimice)
176 zrhdif = (zrhi - zrhlimice)*zrhliminv
177
178 IF(zwcld==0.)THEN
179 sifrc(jij,jk) = min(1.,0.5*max(0.,zrhdif))
180 ELSE
181 za = 1. - 1./zi2w
182 sifrc(jij,jk) = min(1.,za*0.5/ (1. - zrhlim))
183 sifrc(jij,jk) = min(1.,zwcld + sifrc(jij,jk))
184 ENDIF
185 ENDIF
186
187 IF(sifrc(jij,jk) > 0.01) THEN
188 ssiu(jij,jk) = sifrc(jij,jk) + zrhlimice*(1.-sifrc(jij,jk))
189 ssio(jij,jk) = (zrhi - (1.- sifrc(jij,jk))*ssiu(jij,jk))/sifrc(jij,jk)
190 ELSE
191 sifrc(jij,jk) = 0.! to aviod mismatch with output variables
192 za = min(0.,zrhi-zrhlimice)
193 ssiu(jij,jk) = max(0.,sifrc(jij,jk) + zrhlimice*(1.-sifrc(jij,jk)) + 2.*za )
194 ENDIF
195 ssio(jij,jk) = min(zi2w,ssio(jij,jk))
196 ssiu(jij,jk) = max(0.,ssiu(jij,jk))
197
198! Transform from relative humidity to degree of saturation:
199 ssiu(jij,jk) = ssiu(jij,jk) - 1.
200 ssio(jij,jk) = ssio(jij,jk) - 1.
201
202 IF (xw2d > 1.) w2d(jij,jk) = 1./(1. - sifrc(jij,jk) + xw2d*sifrc(jij,jk))
203 END IF
204 ENDDO
205ENDDO
206
207IF (lhook) CALL dr_hook('ICECLOUD',1,zhook_handle)
208CONTAINS
209include "tiwmx.func.h"
210!
211! Saturation mixing ratio for an ice fraction FICE (formerly in mode_qsatmx_tab.F90)
212ELEMENTAL FUNCTION qsatmx_tab(CST, TIWMX, P,T,FICE)
213
214 USE modd_cst ,ONLY : cst_t
215 USE modd_tiwmx, ONLY: tiwmx_t
216
217 IMPLICIT NONE
218
219!$acc routine seq
220
221 REAL :: qsatmx_tab
222 TYPE(cst_t), INTENT(IN) :: cst
223 TYPE(tiwmx_t), INTENT(IN) :: tiwmx
224 REAL, INTENT(IN) :: p,t,fice
225
226 REAL :: zes
227
228 zes = esati(tiwmx, t)*fice + esatw(tiwmx, t)*(1.-fice)
229 IF(zes >= p)THEN ! temp > boiling point, condensation not possible.
230 ! Then this function lacks physical meaning,
231 ! here set to one
232 qsatmx_tab = 1.
233 ELSE
234 qsatmx_tab = cst%XEPSILO*zes/(p-zes) !r
235 ENDIF
236
237END FUNCTION qsatmx_tab
238!
239END SUBROUTINE icecloud
240END MODULE mode_icecloud
elemental real function esatw(tt)
elemental real function qsatmx_tab(cst, tiwmx, p, t, fice)
type(tiwmx_t), target, save tiwmx
subroutine icecloud(d, cst, icep, pp, pz, pdz, pt, pr, ptstep, ppblh, pwcld, xw2d, sifrc, ssio, ssiu, w2d, rsi)