UPP (develop)
Loading...
Searching...
No Matches
LFMFLD_GFS.f
Go to the documentation of this file.
1
45!---------------------------------------------------------------------------
53!---------------------------------------------------------------------------
54 SUBROUTINE lfmfld_gfs(RH4410,RH7294,RH4472,RH3310)
55
56!
57!
58 use vrbls3d, only: pint, q, t, pmid
59 use masks, only: lmh
60 use params_mod, only: d00
61 use ctlblk_mod, only: jsta, jend, spval, im, ista, iend
62 use upp_physics, only: fpvsnew
63!
64 implicit none
65!
66 real,PARAMETER :: RHOWAT=1.e3
67 real,parameter:: con_rd =2.8705e+2 ! gas constant air (J/kg/K)
68 real,parameter:: con_rv =4.6150e+2 ! gas constant H2O
69 real,parameter:: con_eps =con_rd/con_rv
70 real,parameter:: con_epsm1 =con_rd/con_rv-1
71 real,parameter:: strh1=0.44,strh2=0.72,strh3=0.44,strh4=0.33 &
72 ,sbrh1=1.00,sbrh2=0.94,sbrh3=0.72,sbrh4=1.00
73!
74! DECLARE VARIABLES.
75!
76 REAL ALPM, DZ, ES, PM, PWSUM, QM, QS
77 REAL,dimension(ista:iend,jsta:jend),intent(out) :: RH4410, RH7294, RH4472 &
78 ,rh3310
79!
80 integer I,J,L,LLMH
81 real P4410, P7294,P4472,P3310,Q4410,Q7294,Q4472,Q3310,QS4410, &
82 qs7294,qs4472,qs3310,ps,p33,dp1,dp2,dp3,dp4
83
84!***********************************************************************
85! START LFMFLD HERE
86!
87!
88! LOOP OVER HORIZONTAL GRID.
89!
90 DO 30 j=jsta,jend
91 DO 30 i=ista,iend
92!
93! ZERO VARIABLES.
94 rh4410(i,j) = d00
95 rh4472(i,j) = d00
96 rh7294(i,j) = d00
97 rh3310(i,j) = d00
98 p4410 = d00
99 p7294 = d00
100 p4472 = d00
101 p3310 = d00
102 q4410 = d00
103 q7294 = d00
104 q4472 = d00
105 q3310 = d00
106 qs4410 = d00
107 qs7294 = d00
108 qs4472 = d00
109 qs3310 = d00
110!
111! SET BOUNDS FOR PRESSURES AND SURFACE L.
112
113 llmh = nint(lmh(i,j))
114 ps=pint(i,j,llmh+1)
115 p33 = 0.33*ps
116!
117! ACCULMULATE RELATIVE HUMIDITIES AND PRECIPITABLE WATER.
118!
119 DO 10 l = llmh,1,-1
120!
121! GET P, Z, T, AND Q AT MIDPOINT OF ETA LAYER.
122
123 dp1 = max(min(pint(i,j,l+1),sbrh1*ps) &
124 -max(pint(i,j,l),strh1*ps),0.)
125 dp2 = max(min(pint(i,j,l+1),sbrh2*ps) &
126 -max(pint(i,j,l),strh2*ps),0.)
127 dp3 = max(min(pint(i,j,l+1),sbrh3*ps) &
128 -max(pint(i,j,l),strh3*ps),0.)
129 dp4 = max(min(pint(i,j,l+1),sbrh4*ps) &
130 -max(pint(i,j,l),strh4*ps),0.)
131
132 pm = pint(i,j,l)
133 qm = q(i,j,l)
134 qm = max(qm,d00)
135 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
136 qs=con_eps*es/(pmid(i,j,l)+con_epsm1*es)
137!
138!
139! JUMP OUT OF THIS LOOP IF WE ARE ABOVE THE HIGHEST TARGET PRESSURE.
140 IF (pm<=p33) exit
141!
142! 0.44-1.00 RELATIVE HUMIDITY.
143! IF ((PM<=P10).AND.(PM>=P44)) THEN
144 p4410 = p4410 + dp1
145 q4410 = q4410 + qm*dp1
146 qs4410 = qs4410+ qs*dp1
147! ENDIF
148!
149! 0.33-1.00 RELATIVE HUMIDITY
150! IF ((PM<=P10).AND.(PM>=P33)) THEN
151 p3310 = p3310 + dp4
152 q3310 = q3310 + qm*dp4
153 qs3310 = qs3310+ qs*dp4
154! ENDIF
155!
156! 0.44-0.72 RELATIVE HUMIDITY.
157! IF ((PM<=P66).AND.(PM>=P33)) THEN
158 p4472 = p4472 + dp3
159 q4472 = q4472 + qm*dp3
160 qs4472 = qs4472+ qs*dp3
161! ENDIF
162! 0.72-0.94 RELATIVE HUMIDITY.
163! IF ((PM<=P66).AND.(PM>=P33)) THEN
164 p7294 = p7294 + dp2
165 q7294 = q7294 + qm*dp2
166 qs7294 = qs7294+ qs*dp2
167! ENDIF
168!
169 10 CONTINUE
170!
171! NORMALIZE TO GET MEAN RELATIVE HUMIDITIES. AT
172! ONE TIME WE DIVIDED PRECIPITABLE WATER BY DENSITY
173! TO GET THE EQUIVALENT WATER DEPTH IN METERS. NO MORE.
174 IF (p4410>d00) THEN
175 rh4410(i,j) = q4410/qs4410
176 ELSE
177 rh4410(i,j) = spval
178 ENDIF
179!
180 IF (p3310>d00) THEN
181 rh3310(i,j) = q3310/qs3310
182 ELSE
183 rh3310(i,j) = spval
184 ENDIF
185!
186 IF (p4472>d00) THEN
187 rh4472(i,j) = q4472/qs4472
188 ELSE
189 rh4472(i,j) = spval
190 ENDIF
191
192 IF (p7294>d00) THEN
193 rh7294(i,j) = q7294/qs7294
194 ELSE
195 rh7294(i,j) = spval
196 ENDIF
197 30 CONTINUE
198!
199! END OF ROUTINE.
200!
201 RETURN
202 END
subroutine lfmfld_gfs(rh4410, rh7294, rh4472, rh3310)
LFMFLD_GFS() computes layer mean LFM fields.
Definition LFMFLD_GFS.f:55