UPP (develop)
Loading...
Searching...
No Matches
NGMFLD.f
Go to the documentation of this file.
1
46
47!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
58
59 SUBROUTINE ngmfld(RH4710,RH4796,RH1847,RH8498,QM8510)
60
61!
62!
63! INCLUDE PARAMETERS
64 use vrbls3d, only: q, uh, vh, pint, alpint, zint, t
65 use masks, only: lmh
66 use params_mod, only: d00, d50, h1m12, pq0, a2, a3, a4, h1, d01, small
67 use ctlblk_mod, only: jsta, jend, lm, jsta_2l, jend_2u, jsta_m2, jend_m2,&
68 spval, im, &
69 ista, iend, ista_2l, iend_2u, ista_m2, iend_m2, ista_m, iend_m
70!
71!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
72 implicit none
73!
74 real,PARAMETER :: SIG100=1.00000, sig98=0.98230, sig96=0.96470
75 real,PARAMETER :: SIG89 =0.89671, sig85=0.85000, sig84=0.84368
76 real,PARAMETER :: SIG78 =0.78483, sig47=0.47191, sig18=0.18018
77!
78! DECLARE VARIABLES.
79 LOGICAL GOT8510,GOT4710,GOT4796,GOT1847,GOT8498
80 REAL,dimension(ista_2l:iend_2u,jsta_2l:jend_2u),intent(out) :: QM8510,RH4710,RH8498, &
81 rh4796,rh1847
82 REAL,dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: Z8510,Z4710,Z8498,Z4796,Z1847
83 real,dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: Q1D, U1D, V1D, QCNVG
84!
85 integer I,J,L
86 real P100,P85,P98,P96,P84,P47,P18,ALPM,DE,PM,TM,QM, &
87 qmcvg,qs,rh,dz
88!********************************************************************
89! START NGMFLD HERE.
90!
91! INITIALIZE ARRAYS.
92!$omp parallel do private(i,j)
93 DO j=jsta,jend
94 DO i=ista,iend
95 qm8510(i,j) = d00
96 rh4710(i,j) = d00
97 rh8498(i,j) = d00
98 rh4796(i,j) = d00
99 rh1847(i,j) = d00
100 z8510(i,j) = d00
101 z8498(i,j) = d00
102 z4710(i,j) = d00
103 z4796(i,j) = d00
104 z1847(i,j) = d00
105 ENDDO
106 ENDDO
107!
108! LOOP OVER HORIZONTAL GRID.
109!
110!!$omp parallel do &
111! & private(dz,p100,p18,p47,p84,p85, &
112! & p96,p98,pm,qdiv,qk,qkhn,qkhs,qkm1,qm,qm8510, &
113! & qmcvg,qs,qudx,qvdy,r2dx,r2dy,rh,rh1847,rh4710, &
114! & rh4796,rh8498,tm,tmt0,tmt15,z1847,z4710,z4796, &
115! & z8498,z8510,q1d,u1d,v1d,qcnvg)
116
117 DO l=1,lm
118! COMPUTE MOISTURE CONVERGENCE
119!$omp parallel do private(i,j)
120 DO j=jsta_2l,jend_2u
121 DO i=ista_2l,iend_2u
122 q1d(i,j) = q(i,j,l)
123 u1d(i,j) = uh(i,j,l)
124 v1d(i,j) = vh(i,j,l)
125 ENDDO
126 ENDDO
127 CALL calmcvg(q1d,u1d,v1d,qcnvg)
128! COMPUTE MOISTURE CONVERGENCE
129 DO j=jsta_m2,jend_m2
130 DO i=ista_m,iend_m
131!
132! SET TARGET PRESSURES.
133
134 p100 = pint(i,j,nint(lmh(i,j)))
135 p98 = sig98*p100
136 p96 = sig96*p100
137 p85 = sig85*p100
138 p84 = sig84*p100
139 p47 = sig47*p100
140 p18 = sig18*p100
141!
142!
143! COMPUTE LAYER MEAN FIELDS AT THE GIVEN K.
144!
145! COMPUTE P, Z, T, AND Q AT THE MIDPOINT OF THE CURRENT ETA LAYER.
146 alpm = d50*(alpint(i,j,l)+alpint(i,j,l+1))
147 dz = zint(i,j,l)-zint(i,j,l+1)
148 pm = exp(alpm)
149 tm = t(i,j,l)
150 qm = q(i,j,l)
151 qm = amax1(qm,h1m12)
152 qmcvg= qcnvg(i,j)
153!
154!
155! COMPUTE RELATIVE HUMIDITY.
156!
157 qs=pq0/pm*exp(a2*(tm-a3)/(tm-a4))
158!
159 rh = qm/qs
160 IF (rh>h1) THEN
161 rh = h1
162 qm = rh*qs
163 ENDIF
164 IF (rh<d01) THEN
165 rh = d01
166 qm = rh*qs
167 ENDIF
168!
169! SIGMA 0.85-1.00 MOISTURE CONVERGENCE.
170 IF ((pm<=p100).AND.(pm>=p85)) THEN
171 z8510(i,j) = z8510(i,j) + dz
172 qm8510(i,j) = qm8510(i,j) + qmcvg*dz
173 ENDIF
174!
175! SIGMA 0.47-1.00 RELATIVE HUMIDITY.
176 IF ((pm<=p100).AND.(pm>=p47)) THEN
177 z4710(i,j) = z4710(i,j) + dz
178 rh4710(i,j) = rh4710(i,j) + rh*dz
179 ENDIF
180!
181! SIGMA 0.84-0.98 RELATIVE HUMIDITY.
182 IF ((pm<=p98).AND.(pm>=p84)) THEN
183 z8498(i,j) = z8498(i,j) + dz
184 rh8498(i,j) = rh8498(i,j) + rh*dz
185 ENDIF
186!
187! SIGMA 0.47-0.96 RELATIVE HUMIDITY.
188 IF ((pm<=p96).AND.(pm>=p47)) THEN
189 z4796(i,j) = z4796(i,j) + dz
190 rh4796(i,j) = rh4796(i,j) + rh*dz
191 ENDIF
192!
193! SIGMA 0.18-0.47 RELATIVE HUMIDITY.
194 IF ((pm<=p47).AND.(pm>=p18)) THEN
195 z1847(i,j) = z1847(i,j) + dz
196 rh1847(i,j) = rh1847(i,j) + rh*dz
197 ENDIF
198!
199 ENDDO
200 ENDDO
201 ENDDO
202!
203 DO j=jsta_m2,jend_m2
204 DO i=ista_m,iend_m
205! NORMALIZE TO GET LAYER MEAN VALUES.
206 IF (z8510(i,j)>0) THEN
207 qm8510(i,j) = qm8510(i,j)/z8510(i,j)
208 ELSE
209 qm8510(i,j) = spval
210 ENDIF
211 IF (abs(qm8510(i,j)-spval)<small)qm8510(i,j)=h1m12
212!
213 IF (z4710(i,j)>0) THEN
214 rh4710(i,j) = rh4710(i,j)/z4710(i,j)
215 ELSE
216 rh4710(i,j) = spval
217 ENDIF
218!
219 IF (z8498(i,j)>0) THEN
220 rh8498(i,j) = rh8498(i,j)/z8498(i,j)
221 ELSE
222 rh8498(i,j) = spval
223 ENDIF
224!
225 IF (z4796(i,j)>0) THEN
226 rh4796(i,j) = rh4796(i,j)/z4796(i,j)
227 ELSE
228 rh4796(i,j) = spval
229 ENDIF
230!
231 IF (z1847(i,j)>0) THEN
232 rh1847(i,j) = rh1847(i,j)/z1847(i,j)
233 ELSE
234 rh1847(i,j) = spval
235 ENDIF
236 ENDDO
237 ENDDO
238!
239!
240! END OF ROUTINE.
241!
242 RETURN
243 END
244
subroutine calmcvg(q1d, u1d, v1d, qcnvg)
Subroutine that computes moisture convergence.
Definition CALMCVG.f:44
subroutine ngmfld(rh4710, rh4796, rh1847, rh8498, qm8510)
ngmfld() computes layer mean NGM fields
Definition NGMFLD.f:60