41 SUBROUTINE calhel(DEPTH,UST,VST,HELI,USHR1,VSHR1,USHR6,VSHR6)
44 use vrbls3d, only: zmid, uh, vh, u, v, zint
45 use vrbls2d, only: fis, u10, v10
49 use ctlblk_mod
, only: jsta, jend, jsta_m, jend_m, jsta_2l, jend_2u, &
51 use gridspec_mod
, only: gridtype
55 real,
PARAMETER :: p150=15000.0,p300=30000.0,s15=15.0
56 real,
PARAMETER :: d3000=3000.0,pi6=0.5235987756,pi9=0.34906585
57 real,
PARAMETER :: d5500=5500.0,d6000=6000.0,d7000=7000.0
58 real,
PARAMETER :: d500=500.0
60 real,
PARAMETER :: d1000=1000.0
61 real,
PARAMETER :: d1500=1500.0
67 real,
intent(in) :: depth(2)
68 REAL,
dimension(IM,jsta_2l:jend_2u),
intent(out) :: ust,vst
69 REAL,
dimension(IM,jsta_2l:jend_2u,2),
intent(out) :: heli
71 real,
dimension(im,jsta_2l:jend_2u) :: htsfc, ust6, vst6, ust5, vst5, &
72 ust1, vst1, ushr1, vshr1, &
73 ushr6, vshr6, u1, v1, u2, v2, &
74 hgt1, hgt2, umean, vmean
86 integer,
dimension(im,jsta_2l:jend_2u) :: count6, count5, count1, l1, l2
92 INTEGER ive(jm),ivw(jm)
93 integer i,j,iw,ie,js,jn,jvn,jvs,l,n,lv
94 integer istart,istop,jstart,jstop
95 real z2,dzabv,umean5,vmean5,umean1,vmean1,umean6,vmean6, &
96 denom,z1,z3,dz,dz1,dz2,du1,du2,dv1,dv2
139 IF(gridtype ==
'E')
THEN
150 ELSE IF(gridtype ==
'B')
THEN
184 IF(gridtype /=
'A') CALL exch(fis(1:im,jsta_2l:jend_2u))
186 IF(gridtype /=
'A') CALL exch(zmid(1:im,jsta_2l:jend_2u,l))
196 IF (gridtype==
'B')
THEN
197 htsfc(i,j) = (0.25/g)*(fis(iw,j)+fis(ie,j)+fis(i,jn)+fis(ie,jn))
202 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(ie,jn,l))
204 htsfc(i,j) = (0.25/g)*(fis(iw,j)+fis(ie,j)+fis(i,jn)+fis(i,js))
209 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(i,js,l))
211 dzabv = z2-htsfc(i,j)
214 IF (dzabv <= d6000 .AND. l <= lv)
THEN
215 ust6(i,j) = ust6(i,j) + uh(i,j,l)
216 vst6(i,j) = vst6(i,j) + vh(i,j,l)
217 count6(i,j) = count6(i,j) + 1
220 IF (dzabv < d6000 .AND. dzabv >= d5500 .AND. l <= lv)
THEN
221 ust5(i,j) = ust5(i,j) + uh(i,j,l)
222 vst5(i,j) = vst5(i,j) + vh(i,j,l)
223 count5(i,j) = count5(i,j) + 1
226 IF (dzabv < d500 .AND. l <= lv)
THEN
227 ust1(i,j) = ust1(i,j) + uh(i,j,l)
228 vst1(i,j) = vst1(i,j) + vh(i,j,l)
229 count1(i,j) = count1(i,j) + 1
232 IF (dzabv >= d1000 .AND. dzabv <= d1500 .AND. l <= lv)
THEN
239 IF (dzabv >= d500 .AND. dzabv < d1000 .AND. &
240 l <= lv .AND. l1(i,j) <= l2(i,j))
THEN
256 IF (count5(i,j) == 0)
THEN
262 IF (gridtype==
'B')
THEN
263 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(ie,jn,l))
265 z2 = 0.25*(zmid(iw,j,l)+zmid(ie,j,l)+zmid(i,jn,l)+zmid(i,js,l))
269 IF (dzabv < d7000 .AND. dzabv >= d6000)
THEN
270 ust5(i,j) = ust5(i,j) + uh(i,j,l)
271 vst5(i,j) = vst5(i,j) + vh(i,j,l)
285 IF (count6(i,j) > 0 .AND. count1(i,j) > 0 .AND. count5(i,j) > 0)
THEN
286 umean5 = ust5(i,j) / count5(i,j)
287 vmean5 = vst5(i,j) / count5(i,j)
288 umean1 = ust1(i,j) / count1(i,j)
289 vmean1 = vst1(i,j) / count1(i,j)
290 umean6 = ust6(i,j) / count6(i,j)
291 vmean6 = vst6(i,j) / count6(i,j)
304 ushr6(i,j) = umean5 - umean1
305 vshr6(i,j) = vmean5 - vmean1
307 denom = ushr6(i,j)*ushr6(i,j)+vshr6(i,j)*vshr6(i,j)
308 IF (denom /= 0.0)
THEN
309 ust(i,j) = umean6 + (7.5*vshr6(i,j)/sqrt(denom))
310 vst(i,j) = vmean6 - (7.5*ushr6(i,j)/sqrt(denom))
322 IF(l1(i,j) > 0 .AND. l2(i,j) > 0)
THEN
323 umean(i,j) = u1(i,j) + (d1000 - hgt1(i,j))*(u2(i,j) - &
324 u1(i,j))/(hgt2(i,j) - hgt1(i,j))
325 vmean(i,j) = v1(i,j) + (d1000 - hgt1(i,j))*(v2(i,j) - &
326 v1(i,j))/(hgt2(i,j) - hgt1(i,j))
327 ELSE IF(l1(i,j) > 0 .AND. l2(i,j) == 0)
THEN
330 ELSE IF(l1(i,j) == 0 .AND. l2(i,j) > 0)
THEN
338 IF(l1(i,j) > 0 .OR. l2(i,j) > 0)
THEN
339 ushr1(i,j) = umean(i,j) - u10(i,j)
340 vshr1(i,j) = vmean(i,j) - v10(i,j)
365 if(gridtype /=
'A')
then
366 call exch(zint(1,jsta_2l,l))
367 call exch(zint(1,jsta_2l,l+1))
375 IF (gridtype==
'B')
THEN
376 z2=0.25*(zmid(iw,j,l)+zmid(ie,j,l)+ &
377 zmid(i,jn,l)+zmid(ie,jn,l))
379 z2=0.25*(zmid(iw,j,l)+zmid(ie,j,l)+ &
380 zmid(i,jn,l)+zmid(i,js,l))
384 IF(dzabv < depth(n) .AND. l <= nint(lmv(i,j)))
THEN
385 IF (gridtype==
'B')
THEN
386 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
387 zmid(i,jn,l+1)+zmid(ie,jn,l+1))
388 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
389 zmid(i,jn,l-1)+zmid(ie,jn,l-1))
390 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
391 zint(i,jn,l)+zint(ie,jn,l))- &
392 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
393 zint(i,jn,l+1)+zint(ie,jn,l+1)))
395 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
396 zmid(i,jn,l+1)+zmid(i,js,l+1))
397 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
398 zmid(i,jn,l-1)+zmid(i,js,l-1))
399 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
400 zint(i,js,l)+zint(i,jn,l))- &
401 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
402 zint(i,js,l+1)+zint(i,jn,l+1)))
406 du1 = uh(i,j,l+1)-uh(i,j,l)
407 du2 = uh(i,j,l)-uh(i,j,l-1)
408 dv1 = vh(i,j,l+1)-vh(i,j,l)
409 dv2 = vh(i,j,l)-vh(i,j,l-1)
410 IF( vh(i,j,l) <spval.and.uh(i,j,l) <spval.and. &
411 vh(i,j,l+1)<spval.and.uh(i,j,l+1)<spval.and. &
412 vh(i,j,l-1)<spval.and.uh(i,j,l-1)<spval.and. &
413 vst(i,j) <spval.and.ust(i,j) <spval) &
414 heli(i,j,n) = ((vh(i,j,l)-vst(i,j))* &
415 (dz2*(du1/dz1)+dz1*(du2/dz2)) &
416 - (uh(i,j,l)-ust(i,j))* &
417 (dz2*(dv1/dz1)+dz1*(dv2/dz2))) &
418 *dz/(dz1+dz2)+heli(i,j,n)