1 !WRF:MODEL_LAYER:PHYSICS
3 MODULE module_sf_sfcdiags_ruclsm
7 SUBROUTINE SFCDIAGS_RUCLSM(HFX,QFX,TSK,QSFC,CQS,CQS2,CHS,CHS2,T2,TH2,Q2, &
8 T3D,QV3D,RHO3D,P3D,PSFC2D,SNOW, &
10 ids,ide, jds,jde, kds,kde, &
11 ims,ime, jms,jme, kms,kme, &
12 its,ite, jts,jte, kts,kte )
13 !-------------------------------------------------------------------
15 !-------------------------------------------------------------------
16 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
17 ims,ime, jms,jme, kms,kme, &
18 its,ite, jts,jte, kts,kte
19 REAL, DIMENSION( ims:ime, jms:jme ) , &
25 REAL, DIMENSION( ims:ime, jms:jme ) , &
26 INTENT(INOUT) :: Q2, &
29 REAL, DIMENSION( ims:ime, jms:jme ) , &
36 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , &
37 INTENT(IN ) :: QV3D, &
42 REAL, INTENT(IN ) :: CP,R_d,ROVCP
45 REAL :: RHO, x2m, qlev1, tempc, qsat, p2m, qsfcprox, qsfcmr, &
46 psfc, dT, dQ, fh, fac, dz1
57 ! Assume that 2-m pressure also equal to PSFC
59 ! P2m = PSFC2D(I,J)*EXP(-0.068283/t3d(i,1,j))
62 !!! 2-m Temperature - T2
63 if(CHS2(I,J).lt.1.E-5) then
64 ! may be to small treshold?
65 ! if(CHS2(I,J).lt.3.E-3 .AND. HFX(I,J).lt.0.) then
66 ! when stable - let 2-m temperature be equal the first atm. level temp.
67 ! TH2(I,J) = TSK(I,J)*(1.E5/PSFC(I,J))**ROVCP
68 TH2(I,J) = t3d(i,1,j)*(1.E5/PSFC)**ROVCP
70 TH2(I,J) = TSK(I,J)*(1.E5/PSFC)**ROVCP - HFX(I,J)/(RHO*CP*CHS2(I,J))
71 ! T2(I,J) = TSK(I,J) - HFX(I,J)/(RHO*CP*CHS2(I,J))
73 ! TH2(I,J) = T2(I,J)*(1.E5/PSFC(I,J))**ROVCP
74 T2(I,J) = TH2(I,J)*(1.E-5*PSFC)**ROVCP
75 ! check that T2 values lie in the range between TSK and T at the 1st level
76 x2m = MAX(MIN(tsk(i,j),t3d(i,1,j)) , t2(i,j))
77 t2(i,j) = MIN(MAX(tsk(i,j),t3d(i,1,j)) , x2m)
78 TH2(I,J) = T2(I,J)*(1.E5/PSFC)**ROVCP
80 fac=(1.E5/PSFC)**ROVCP
81 TH2(I,J) = tsk(i,j)*fac - CHS(I,J)/CHS2(I,J)*(tsk(i,j) - t3d(i,1,j))*fac
82 T2(I,J) = TH2(I,J)*(1.E-5*PSFC)**ROVCP
86 !!! 2-m Water vapor mixing ratio - Q2
89 tempc=t3d(i,1,j)-273.15
90 if (tempc .le. 0.0) then
92 qsat = rsif(p3d(i,1,j), t3d(i,1,j))
94 qsat = rslf(p3d(i,1,j), t3d(i,1,j))
96 !remove oversaturation at level 1
97 qlev1 = min(qsat, qlev1)
99 ! Compute QSFC proxy from QFX, qlev1 and CQS
100 ! Use of QSFCprox is more accurate diagnostics for densely vegetated areas,
101 ! like cropland in summer
102 qsfcprox=qlev1+QFX(I,J)/(RHO*CQS(I,J))
103 qsfcmr = qsfc(i,j)/(1.-qsfc(i,j))
105 ! if(i.eq.426.and.j.eq.250) then
106 !! RAP cropland point
107 ! print *,'qsfc,qsfcmr,qsfcprox,qlev1',qsfc(i,j),qsfcmr,qsfcprox,qlev1
108 ! print *,'(qsfcprox-qsfcmr)/qsfcmr =', (qsfcprox-qsfcmr)/qsfcmr
112 if(CQS2(I,J).lt.1.E-5) then
113 ! - under very stable conditions use first level for 2-m mixing ratio
116 ! x2m = QSFCmr - QFX(I,J)/(RHO*CQS2(I,J))
117 x2m = QSFCprox - QFX(I,J)/(RHO*CQS2(I,J))
122 Q2(I,J) = qsfcmr - CQS(I,J)/CQS2(I,J)*(qsfcmr - qlev1)
125 ! Check that Q2 values lie between QSFCmr and qlev1
126 x2m = MAX(MIN(qsfcmr,qlev1) , q2(i,j))
127 q2(i,j) = MIN(MAX(qsfcmr,qlev1) , x2m)
131 if (tempc .le. 0.0) then
132 ! ice and supercooled water
133 qsat = rsif(psfc, t2(i,j))
136 qsat = rslf(psfc, t2(i,j))
139 q2(i,j) = min(qsat, q2(i,j))
140 ! if(i.eq.426.and.j.eq.250) then
142 ! print *,'FINAL - qsfc,qsfcmr,qsfcprox,q2(i,j),qlev1', &
143 ! qsfc(i,j),qsfcmr,qsfcprox,q2(i,j),qlev1
144 ! print *,'(q2-qlev1)/qlev1 =', (q2(i,j)-qlev1)/qlev1
150 END SUBROUTINE SFCDIAGS_RUCLSM
152 !tgs - saturation functions are from Thompson microphysics scheme
153 REAL FUNCTION RSLF(P,T)
156 REAL, INTENT(IN):: P, T
158 REAL, PARAMETER:: C0= .611583699E03
159 REAL, PARAMETER:: C1= .444606896E02
160 REAL, PARAMETER:: C2= .143177157E01
161 REAL, PARAMETER:: C3= .264224321E-1
162 REAL, PARAMETER:: C4= .299291081E-3
163 REAL, PARAMETER:: C5= .203154182E-5
164 REAL, PARAMETER:: C6= .702620698E-8
165 REAL, PARAMETER:: C7= .379534310E-11
166 REAL, PARAMETER:: C8=-.321582393E-13
170 ! ESL=612.2*EXP(17.67*X/(T-29.65))
171 ESL=C0+X*(C1+X*(C2+X*(C3+X*(C4+X*(C5+X*(C6+X*(C7+X*C8)))))))
172 RSLF=.622*ESL/(P-ESL)
177 ! ; Source: Murphy and Koop, Review of the vapour pressure of ice and
178 ! supercooled water for atmospheric applications, Q. J. R.
179 ! Meteorol. Soc (2005), 131, pp. 1539-1565.
180 ! Psat = EXP(54.842763 - 6763.22 / T - 4.210 * ALOG(T) + 0.000367 * T
181 ! + TANH(0.0415 * (T - 218.8)) * (53.878 - 1331.22
182 ! / T - 9.44523 * ALOG(T) + 0.014025 * T))
184 !+---+-----------------------------------------------------------------+
185 ! THIS FUNCTION CALCULATES THE ICE SATURATION VAPOR MIXING RATIO AS A
186 ! FUNCTION OF TEMPERATURE AND PRESSURE
188 REAL FUNCTION RSIF(P,T)
191 REAL, INTENT(IN):: P, T
193 REAL, PARAMETER:: C0= .609868993E03
194 REAL, PARAMETER:: C1= .499320233E02
195 REAL, PARAMETER:: C2= .184672631E01
196 REAL, PARAMETER:: C3= .402737184E-1
197 REAL, PARAMETER:: C4= .565392987E-3
198 REAL, PARAMETER:: C5= .521693933E-5
199 REAL, PARAMETER:: C6= .307839583E-7
200 REAL, PARAMETER:: C7= .105785160E-9
201 REAL, PARAMETER:: C8= .161444444E-12
204 ESI=C0+X*(C1+X*(C2+X*(C3+X*(C4+X*(C5+X*(C6+X*(C7+X*C8)))))))
205 RSIF=.622*ESI/(P-ESI)
209 END MODULE module_sf_sfcdiags_ruclsm