49 SUBROUTINE calhel3(LLOW,LUPP,UST,VST,HELI)
52 use vrbls3d,
only: zmid, uh, vh, u, v, zint
53 use vrbls2d,
only: fis, u10, v10
55 use params_mod,
only: g
56 use lookup_mod,
only: itb,jtb,itbq,jtbq
57 use ctlblk_mod,
only: jsta, jend, jsta_m, jend_m, jsta_2l, jend_2u, &
58 lm, im, jm, me, spval, &
59 ista, iend, ista_m, iend_m, ista_2l, iend_2u
60 use gridspec_mod,
only: gridtype
64 real,
PARAMETER :: P150=15000.0,p300=30000.0,s15=15.0
65 real,
PARAMETER :: D3000=3000.0,pi6=0.5235987756,pi9=0.34906585
66 real,
PARAMETER :: D5500=5500.0,d6000=6000.0,d7000=7000.0
67 real,
PARAMETER :: D500=500.0
69 real,
PARAMETER :: D1000=1000.0
70 real,
PARAMETER :: D1500=1500.0
72 REAL,
PARAMETER :: pi = 3.1415927
77 integer,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(in) :: LLOW, LUPP
78 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(out) :: UST,VST
79 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(out) :: HELI
81 real,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: HTSFC, UST6, VST6, UST5, VST5, &
82 ust1, vst1, ushr1, vshr1, &
83 ushr6, vshr6, u1, v1, u2, v2, &
84 hgt1, hgt2, umean, vmean
85 real,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: USHR05,VSHR05,ELT,ELB
98 integer,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: COUNT6, COUNT5, COUNT1, L1, L2
104 INTEGER IVE(JM),IVW(JM)
105 integer I,J,IW,IE,JS,JN,JVN,JVS,L,N,lv
106 integer ISTART,ISTOP,JSTART,JSTOP
107 real Z2,DZABV,UMEAN5,VMEAN5,UMEAN1,VMEAN1,UMEAN6,VMEAN6, &
108 denom,z1,z3,dz,dz1,dz2,du1,du2,dv1,dv2
151 IF(gridtype ==
'E')
THEN
162 ELSE IF(gridtype ==
'B')
THEN
196 IF(gridtype /=
'A')
CALL exch(fis(ista_2l:iend_2u,jsta_2l:jend_2u))
198 IF(gridtype /=
'A')
CALL exch(zmid(ista_2l:iend_2u,jsta_2l:jend_2u,l))
208 IF (gridtype==
'B')
THEN
209 htsfc(i,j) = (0.25/g)*(fis(iw,j)+fis(ie,j)+fis(i,jn)+fis(ie,jn))
214 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(ie,jn,l))
216 htsfc(i,j) = (0.25/g)*(fis(iw,j)+fis(ie,j)+fis(i,jn)+fis(i,js))
221 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(i,js,l))
223 dzabv = z2-htsfc(i,j)
226 IF (dzabv <= d6000 .AND. l <= lv)
THEN
227 ust6(i,j) = ust6(i,j) + uh(i,j,l)
228 vst6(i,j) = vst6(i,j) + vh(i,j,l)
229 count6(i,j) = count6(i,j) + 1
232 IF (dzabv < d6000 .AND. dzabv >= d5500 .AND. l <= lv)
THEN
233 ust5(i,j) = ust5(i,j) + uh(i,j,l)
234 vst5(i,j) = vst5(i,j) + vh(i,j,l)
235 count5(i,j) = count5(i,j) + 1
238 IF (dzabv < d500 .AND. l <= lv)
THEN
239 ust1(i,j) = ust1(i,j) + uh(i,j,l)
240 vst1(i,j) = vst1(i,j) + vh(i,j,l)
241 count1(i,j) = count1(i,j) + 1
244 IF (dzabv >= d1000 .AND. dzabv <= d1500 .AND. l <= lv)
THEN
251 IF (dzabv >= d500 .AND. dzabv < d1000 .AND. &
252 l <= lv .AND. l1(i,j) <= l2(i,j))
THEN
268 IF (count5(i,j) == 0)
THEN
274 IF (gridtype==
'B')
THEN
275 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(ie,jn,l))
277 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(i,js,l))
282 IF (dzabv < d7000 .AND. dzabv >= d6000)
THEN
283 ust5(i,j) = ust5(i,j) + uh(i,j,l)
284 vst5(i,j) = vst5(i,j) + vh(i,j,l)
299 IF (count6(i,j) > 0 .AND. count1(i,j) > 0 .AND. count5(i,j) > 0)
THEN
300 umean5 = ust5(i,j) / count5(i,j)
301 vmean5 = vst5(i,j) / count5(i,j)
302 umean1 = ust1(i,j) / count1(i,j)
303 vmean1 = vst1(i,j) / count1(i,j)
304 umean6 = ust6(i,j) / count6(i,j)
305 vmean6 = vst6(i,j) / count6(i,j)
318 ushr6(i,j) = umean5 - umean1
319 vshr6(i,j) = vmean5 - vmean1
321 denom = ushr6(i,j)*ushr6(i,j)+vshr6(i,j)*vshr6(i,j)
322 IF (denom /= 0.0)
THEN
323 ust(i,j) = umean6 + (7.5*vshr6(i,j)/sqrt(denom))
324 vst(i,j) = vmean6 - (7.5*ushr6(i,j)/sqrt(denom))
336 IF(l1(i,j) > 0 .AND. l2(i,j) > 0)
THEN
337 umean(i,j) = u1(i,j) + (d1000 - hgt1(i,j))*(u2(i,j) - &
338 u1(i,j))/(hgt2(i,j) - hgt1(i,j))
339 vmean(i,j) = v1(i,j) + (d1000 - hgt1(i,j))*(v2(i,j) - &
340 v1(i,j))/(hgt2(i,j) - hgt1(i,j))
341 ELSE IF(l1(i,j) > 0 .AND. l2(i,j) == 0)
THEN
344 ELSE IF(l1(i,j) == 0 .AND. l2(i,j) > 0)
THEN
352 IF(l1(i,j) > 0 .OR. l2(i,j) > 0)
THEN
353 ushr05(i,j) = umean1 - u10(i,j)
354 vshr05(i,j) = vmean1 - v10(i,j)
355 ushr1(i,j) = umean(i,j) - u10(i,j)
356 vshr1(i,j) = vmean(i,j) - v10(i,j)
381 if(gridtype /=
'A')
then
382 call exch(zint(1,jsta_2l,l))
383 call exch(zint(1,jsta_2l,l+1))
391 IF (gridtype==
'B')
THEN
392 z2=0.25*(zmid(iw,j,l)+zmid(ie,j,l)+ &
393 zmid(i,jn,l)+zmid(ie,jn,l))
395 z2=0.25*(zmid(iw,j,l)+zmid(ie,j,l)+ &
396 zmid(i,jn,l)+zmid(i,js,l))
399 elt(i,j) = zint(i,j,lupp(i,j))-htsfc(i,j)
400 elb(i,j) = zint(i,j,llow(i,j))-htsfc(i,j)
403 IF(dzabv <= elt(i,j) .AND. dzabv >= elb(i,j) .AND. l <= nint(lmv(i,j)))
THEN
404 IF (gridtype==
'B')
THEN
405 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
406 zmid(i,jn,l+1)+zmid(ie,jn,l+1))
407 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
408 zmid(i,jn,l-1)+zmid(ie,jn,l-1))
409 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
410 zint(i,jn,l)+zint(ie,jn,l))- &
411 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
412 zint(i,jn,l+1)+zint(ie,jn,l+1)))
414 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
415 zmid(i,jn,l+1)+zmid(i,js,l+1))
416 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
417 zmid(i,jn,l-1)+zmid(i,js,l-1))
418 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
419 zint(i,js,l)+zint(i,jn,l))- &
420 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
421 zint(i,js,l+1)+zint(i,jn,l+1)))
425 du1 = uh(i,j,l+1)-uh(i,j,l)
426 du2 = uh(i,j,l)-uh(i,j,l-1)
427 dv1 = vh(i,j,l+1)-vh(i,j,l)
428 dv2 = vh(i,j,l)-vh(i,j,l-1)
429 IF( l >= lupp(i,j) .AND. l <= llow(i,j) )
THEN
430 IF( vh(i,j,l) <spval.and.uh(i,j,l) <spval.and. &
431 vh(i,j,l+1)<spval.and.uh(i,j,l+1)<spval.and. &
432 vh(i,j,l-1)<spval.and.uh(i,j,l-1)<spval.and. &
433 vst(i,j) <spval.and.ust(i,j) <spval) &
434 heli(i,j) = ((vh(i,j,l)-vst(i,j))* &
435 (dz2*(du1/dz1)+dz1*(du2/dz2)) &
436 - (uh(i,j,l)-ust(i,j))* &
437 (dz2*(dv1/dz1)+dz1*(dv2/dz2))) &
438 *dz/(dz1+dz2)+heli(i,j)
440 IF(lupp(i,j) == llow(i,j)) heli(i,j) = 0.