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