UPP (develop)
Loading...
Searching...
No Matches
LFMFLD.f
Go to the documentation of this file.
1
44!--------------------------------------------------------------------------------------
52 SUBROUTINE lfmfld(RH3310,RH6610,RH3366,PW3310)
53
54!
55!
56 use vrbls3d, only: pint, alpint, zint, t, q, cwm
57 use masks, only: lmh
58 use params_mod, only: d00, d50, pq0, a2, a3, a4, h1, d01, gi
59 use ctlblk_mod, only: jsta, jend, modelname, spval, im, ista, iend
60 use physcons_post, only: con_rd, con_rv, con_eps, con_epsm1
61 use upp_physics, only: fpvsnew
62
63 implicit none
64
65!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
66!
67 real,PARAMETER :: RHOWAT=1.e3
68!
69! DECLARE VARIABLES.
70!
71 REAL ALPM, DZ, ES, PM, PWSUM, QM, QS, TM, DP, RH
72 REAL,dimension(ista:iend,jsta:jend),intent(inout) :: RH3310, RH6610, RH3366
73 REAL,dimension(ista:iend,jsta:jend),intent(inout) :: PW3310
74 real Z3310,Z6610,Z3366,P10,P33,P66
75 integer I,J,L,LLMH
76!
77!***********************************************************************
78! START LFMFLD HERE
79!
80!
81! LOOP OVER HORIZONTAL GRID.
82!
83 DO 30 j=jsta,jend
84 DO 30 i=ista,iend
85!
86! ZERO VARIABLES.
87 rh3310(i,j) = d00
88 pw3310(i,j) = d00
89 rh6610(i,j) = d00
90 rh3366(i,j) = d00
91 z3310 = d00
92 z6610 = d00
93 z3366 = d00
94!
95! SET BOUNDS FOR PRESSURES AND SURFACE L.
96 p10 = pint(i,j,nint(lmh(i,j)))
97 p66 = 0.75*p10
98 p33 = 0.50*p10
99 llmh = nint(lmh(i,j))
100!
101! ACCULMULATE RELATIVE HUMIDITIES AND PRECIPITABLE WATER.
102!
103 DO 10 l = llmh,1,-1
104!
105! GET P, Z, T, AND Q AT MIDPOINT OF ETA LAYER.
106 alpm = d50*(alpint(i,j,l)+alpint(i,j,l+1))
107 dz = zint(i,j,l)-zint(i,j,l+1)
108 dp = pint(i,j,l+1)-pint(i,j,l)
109 pm = exp(alpm)
110 tm = t(i,j,l)
111 qm = q(i,j,l)
112 qm = amax1(qm,d00)
113!
114! QS=PQ0/PM*EXP(A2*(TM-A3)/(TM-A4))
115 IF(modelname == 'GFS')THEN
116 es = min(fpvsnew(tm),pm)
117 qs = con_eps*es/(pm+con_epsm1*es)
118 ELSE
119 qs=pq0/pm*exp(a2*(tm-a3)/(tm-a4))
120 END IF
121 rh = qm/qs
122 IF (rh>h1) THEN
123 rh = h1
124 qm = rh*qs
125 ENDIF
126 IF (rh<d01) THEN
127 rh = d01
128 qm = rh*qs
129 ENDIF
130!
131! JUMP OUT OF THIS LOOP IF WE ARE ABOVE THE HIGHEST TARGET PRESSURE.
132 IF (pm<=p33) exit
133!
134! 0.66-1.00 RELATIVE HUMIDITY.
135 IF ((pm<=p10).AND.(pm>=p66)) THEN
136 z6610 = z6610 + dz
137 rh6610(i,j) = rh6610(i,j) + rh*dz
138 ENDIF
139!
140! 0.33-1.00 RELATIVE HUMIDITY AND PRECIPITABLE WATER.
141 IF ((pm<=p10).AND.(pm>=p33)) THEN
142 z3310 = z3310 + dz
143 rh3310(i,j)= rh3310(i,j)+rh*dz
144 pw3310(i,j)= pw3310(i,j)+(q(i,j,l)+cwm(i,j,l))*dp*gi
145 ENDIF
146!
147! 0.33-0.66 RELATIVE HUMIDITY.
148 IF ((pm<=p66).AND.(pm>=p33)) THEN
149 z3366 = z3366 + dz
150 rh3366(i,j) = rh3366(i,j) + rh*dz
151 ENDIF
152!
153 10 CONTINUE
154!
155! NORMALIZE TO GET MEAN RELATIVE HUMIDITIES. AT
156! ONE TIME WE DIVIDED PRECIPITABLE WATER BY DENSITY
157! TO GET THE EQUIVALENT WATER DEPTH IN METERS. NO MORE.
158 IF (z6610>d00) THEN
159 rh6610(i,j) = rh6610(i,j)/z6610
160 ELSE
161 rh6610(i,j) = spval
162 ENDIF
163!
164 IF (z3310>d00) THEN
165 rh3310(i,j) = rh3310(i,j)/z3310
166 ELSE
167 rh3310(i,j) = spval
168 ENDIF
169!
170 IF (z3366>d00) THEN
171 rh3366(i,j) = rh3366(i,j)/z3366
172 ELSE
173 rh3366(i,j) = spval
174 ENDIF
175 30 CONTINUE
176!
177!
178! END OF ROUTINE.
179!
180 RETURN
181 END
subroutine lfmfld(rh3310, rh6610, rh3366, pw3310)
LFMFLD() computes layer mean LFM fields.
Definition LFMFLD.f:53