44 SUBROUTINE calhel3(LLOW,LUPP,UST,VST,HELI)
47 use vrbls3d, only: zmid, uh, vh, u, v, zint
48 use vrbls2d, only: fis, u10, v10
52 use ctlblk_mod
, only: jsta, jend, jsta_m, jend_m, jsta_2l, jend_2u, &
54 use gridspec_mod
, only: gridtype
58 real,
PARAMETER :: p150=15000.0,p300=30000.0,s15=15.0
59 real,
PARAMETER :: d3000=3000.0,pi6=0.5235987756,pi9=0.34906585
60 real,
PARAMETER :: d5500=5500.0,d6000=6000.0,d7000=7000.0
61 real,
PARAMETER :: d500=500.0
63 real,
PARAMETER :: d1000=1000.0
64 real,
PARAMETER :: d1500=1500.0
66 REAL,
PARAMETER :: pi = 3.1415927
71 integer,
dimension(IM,jsta_2l:jend_2u),
intent(in) :: llow, lupp
72 REAL,
dimension(IM,jsta_2l:jend_2u),
intent(out) :: ust,vst
73 REAL,
dimension(IM,jsta_2l:jend_2u),
intent(out) :: heli
75 real,
dimension(im,jsta_2l:jend_2u) :: htsfc, ust6, vst6, ust5, vst5, &
76 ust1, vst1, ushr1, vshr1, &
77 ushr6, vshr6, u1, v1, u2, v2, &
78 hgt1, hgt2, umean, vmean
79 real,
dimension(im,jsta_2l:jend_2u) :: ushr05,vshr05,elt,elb
92 integer,
dimension(im,jsta_2l:jend_2u) :: count6, count5, count1, l1, l2
98 INTEGER ive(jm),ivw(jm)
99 integer i,j,iw,ie,js,jn,jvn,jvs,l,n,lv
100 integer istart,istop,jstart,jstop
101 real z2,dzabv,umean5,vmean5,umean1,vmean1,umean6,vmean6, &
102 denom,z1,z3,dz,dz1,dz2,du1,du2,dv1,dv2
145 IF(gridtype ==
'E')
THEN
156 ELSE IF(gridtype ==
'B')
THEN
190 IF(gridtype /=
'A') CALL exch(fis(1:im,jsta_2l:jend_2u))
192 IF(gridtype /=
'A') CALL exch(zmid(1:im,jsta_2l:jend_2u,l))
202 IF (gridtype==
'B')
THEN
203 htsfc(i,j) = (0.25/g)*(fis(iw,j)+fis(ie,j)+fis(i,jn)+fis(ie,jn))
208 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(ie,jn,l))
210 htsfc(i,j) = (0.25/g)*(fis(iw,j)+fis(ie,j)+fis(i,jn)+fis(i,js))
215 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(i,js,l))
217 dzabv = z2-htsfc(i,j)
220 IF (dzabv <= d6000 .AND. l <= lv)
THEN
221 ust6(i,j) = ust6(i,j) + uh(i,j,l)
222 vst6(i,j) = vst6(i,j) + vh(i,j,l)
223 count6(i,j) = count6(i,j) + 1
226 IF (dzabv < d6000 .AND. dzabv >= d5500 .AND. l <= lv)
THEN
227 ust5(i,j) = ust5(i,j) + uh(i,j,l)
228 vst5(i,j) = vst5(i,j) + vh(i,j,l)
229 count5(i,j) = count5(i,j) + 1
232 IF (dzabv < d500 .AND. l <= lv)
THEN
233 ust1(i,j) = ust1(i,j) + uh(i,j,l)
234 vst1(i,j) = vst1(i,j) + vh(i,j,l)
235 count1(i,j) = count1(i,j) + 1
238 IF (dzabv >= d1000 .AND. dzabv <= d1500 .AND. l <= lv)
THEN
245 IF (dzabv >= d500 .AND. dzabv < d1000 .AND. &
246 l <= lv .AND. l1(i,j) <= l2(i,j))
THEN
262 IF (count5(i,j) == 0)
THEN
268 IF (gridtype==
'B')
THEN
269 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(ie,jn,l))
271 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(i,js,l))
276 IF (dzabv < d7000 .AND. dzabv >= d6000)
THEN
277 ust5(i,j) = ust5(i,j) + uh(i,j,l)
278 vst5(i,j) = vst5(i,j) + vh(i,j,l)
293 IF (count6(i,j) > 0 .AND. count1(i,j) > 0 .AND. count5(i,j) > 0)
THEN
294 umean5 = ust5(i,j) / count5(i,j)
295 vmean5 = vst5(i,j) / count5(i,j)
296 umean1 = ust1(i,j) / count1(i,j)
297 vmean1 = vst1(i,j) / count1(i,j)
298 umean6 = ust6(i,j) / count6(i,j)
299 vmean6 = vst6(i,j) / count6(i,j)
312 ushr6(i,j) = umean5 - umean1
313 vshr6(i,j) = vmean5 - vmean1
315 denom = ushr6(i,j)*ushr6(i,j)+vshr6(i,j)*vshr6(i,j)
316 IF (denom /= 0.0)
THEN
317 ust(i,j) = umean6 + (7.5*vshr6(i,j)/sqrt(denom))
318 vst(i,j) = vmean6 - (7.5*ushr6(i,j)/sqrt(denom))
330 IF(l1(i,j) > 0 .AND. l2(i,j) > 0)
THEN
331 umean(i,j) = u1(i,j) + (d1000 - hgt1(i,j))*(u2(i,j) - &
332 u1(i,j))/(hgt2(i,j) - hgt1(i,j))
333 vmean(i,j) = v1(i,j) + (d1000 - hgt1(i,j))*(v2(i,j) - &
334 v1(i,j))/(hgt2(i,j) - hgt1(i,j))
335 ELSE IF(l1(i,j) > 0 .AND. l2(i,j) == 0)
THEN
338 ELSE IF(l1(i,j) == 0 .AND. l2(i,j) > 0)
THEN
346 IF(l1(i,j) > 0 .OR. l2(i,j) > 0)
THEN
347 ushr05(i,j) = umean1 - u10(i,j)
348 vshr05(i,j) = vmean1 - v10(i,j)
349 ushr1(i,j) = umean(i,j) - u10(i,j)
350 vshr1(i,j) = vmean(i,j) - v10(i,j)
376 if(gridtype /=
'A')
then
377 call exch(zint(1,jsta_2l,l))
378 call exch(zint(1,jsta_2l,l+1))
386 IF (gridtype==
'B')
THEN
387 z2=0.25*(zmid(iw,j,l)+zmid(ie,j,l)+ &
388 zmid(i,jn,l)+zmid(ie,jn,l))
390 z2=0.25*(zmid(iw,j,l)+zmid(ie,j,l)+ &
391 zmid(i,jn,l)+zmid(i,js,l))
394 elt(i,j) = zint(i,j,lupp(i,j))-htsfc(i,j)
395 elb(i,j) = zint(i,j,llow(i,j))-htsfc(i,j)
398 IF(dzabv <= elt(i,j) .AND. dzabv >= elb(i,j) .AND. l <= nint(lmv(i,j)))
THEN
399 IF (gridtype==
'B')
THEN
400 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
401 zmid(i,jn,l+1)+zmid(ie,jn,l+1))
402 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
403 zmid(i,jn,l-1)+zmid(ie,jn,l-1))
404 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
405 zint(i,jn,l)+zint(ie,jn,l))- &
406 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
407 zint(i,jn,l+1)+zint(ie,jn,l+1)))
409 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
410 zmid(i,jn,l+1)+zmid(i,js,l+1))
411 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
412 zmid(i,jn,l-1)+zmid(i,js,l-1))
413 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
414 zint(i,js,l)+zint(i,jn,l))- &
415 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
416 zint(i,js,l+1)+zint(i,jn,l+1)))
420 du1 = uh(i,j,l+1)-uh(i,j,l)
421 du2 = uh(i,j,l)-uh(i,j,l-1)
422 dv1 = vh(i,j,l+1)-vh(i,j,l)
423 dv2 = vh(i,j,l)-vh(i,j,l-1)
424 IF( l >= lupp(i,j) .AND. l <= llow(i,j) )
THEN
425 IF( vh(i,j,l) <spval.and.uh(i,j,l) <spval.and. &
426 vh(i,j,l+1)<spval.and.uh(i,j,l+1)<spval.and. &
427 vh(i,j,l-1)<spval.and.uh(i,j,l-1)<spval.and. &
428 vst(i,j) <spval.and.ust(i,j) <spval) &
429 heli(i,j) = ((vh(i,j,l)-vst(i,j))* &
430 (dz2*(du1/dz1)+dz1*(du2/dz2)) &
431 - (uh(i,j,l)-ust(i,j))* &
432 (dz2*(dv1/dz1)+dz1*(dv2/dz2))) &
433 *dz/(dz1+dz2)+heli(i,j)
435 IF(lupp(i,j) == llow(i,j)) heli(i,j) = 0.