46 SUBROUTINE calhel(DEPTH,UST,VST,HELI,USHR1,VSHR1,USHR6,VSHR6)
49 use vrbls3d,
only: zmid, uh, vh, u, v, zint
50 use vrbls2d,
only: fis, u10, v10
51 use masks,
only: lmv, gdlat
52 use params_mod,
only: g
53 use lookup_mod,
only: itb,jtb,itbq,jtbq
54 use ctlblk_mod,
only: jsta, jend, jsta_m, jend_m, jsta_2l, jend_2u, &
55 lm, im, jm, me, spval, &
56 ista, iend, ista_m, iend_m, ista_2l, iend_2u
57 use gridspec_mod,
only: gridtype
61 real,
PARAMETER :: P150=15000.0,p300=30000.0,s15=15.0
62 real,
PARAMETER :: D3000=3000.0,pi6=0.5235987756,pi9=0.34906585
63 real,
PARAMETER :: D5500=5500.0,d6000=6000.0,d7000=7000.0
64 real,
PARAMETER :: D500=500.0
66 real,
PARAMETER :: D1000=1000.0
67 real,
PARAMETER :: D1500=1500.0
73 real,
intent(in) :: DEPTH(2)
74 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(out) :: UST,VST
75 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u,2),
intent(out) :: HELI
77 real,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: HTSFC, UST6, VST6, UST5, VST5, &
78 ust1, vst1, ushr1, vshr1, &
79 ushr6, vshr6, u1, v1, u2, v2, &
80 hgt1, hgt2, umean, vmean
92 integer,
dimension(ista_2l:iend_2u,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(ista_2l:iend_2u,jsta_2l:jend_2u))
192 IF(gridtype /=
'A')
CALL exch(zmid(ista_2l:iend_2u,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))
275 IF (dzabv < d7000 .AND. dzabv >= d6000)
THEN
276 ust5(i,j) = ust5(i,j) + uh(i,j,l)
277 vst5(i,j) = vst5(i,j) + vh(i,j,l)
291 IF (count6(i,j) > 0 .AND. count1(i,j) > 0 .AND. count5(i,j) > 0)
THEN
292 umean5 = ust5(i,j) / count5(i,j)
293 vmean5 = vst5(i,j) / count5(i,j)
294 umean1 = ust1(i,j) / count1(i,j)
295 vmean1 = vst1(i,j) / count1(i,j)
296 umean6 = ust6(i,j) / count6(i,j)
297 vmean6 = vst6(i,j) / count6(i,j)
310 ushr6(i,j) = umean5 - umean1
311 vshr6(i,j) = vmean5 - vmean1
313 denom = ushr6(i,j)*ushr6(i,j)+vshr6(i,j)*vshr6(i,j)
314 IF (denom /= 0.0)
THEN
315 IF (gdlat(i,j) >= 0)
THEN
316 ust(i,j) = umean6 + (7.5*vshr6(i,j)/sqrt(denom))
317 vst(i,j) = vmean6 - (7.5*ushr6(i,j)/sqrt(denom))
318 ELSE IF (gdlat(i,j) < 0)
THEN
319 ust(i,j) = umean6 - (7.5*vshr6(i,j)/sqrt(denom))
320 vst(i,j) = vmean6 + (7.5*ushr6(i,j)/sqrt(denom))
333 IF(l1(i,j) > 0 .AND. l2(i,j) > 0)
THEN
334 umean(i,j) = u1(i,j) + (d1000 - hgt1(i,j))*(u2(i,j) - &
335 u1(i,j))/(hgt2(i,j) - hgt1(i,j))
336 vmean(i,j) = v1(i,j) + (d1000 - hgt1(i,j))*(v2(i,j) - &
337 v1(i,j))/(hgt2(i,j) - hgt1(i,j))
338 ELSE IF(l1(i,j) > 0 .AND. l2(i,j) == 0)
THEN
341 ELSE IF(l1(i,j) == 0 .AND. l2(i,j) > 0)
THEN
349 IF(l1(i,j) > 0 .OR. l2(i,j) > 0)
THEN
350 ushr1(i,j) = umean(i,j) - u10(i,j)
351 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))
395 IF(dzabv < depth(n) .AND. l <= nint(lmv(i,j)))
THEN
396 IF (gridtype==
'B')
THEN
397 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
398 zmid(i,jn,l+1)+zmid(ie,jn,l+1))
399 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
400 zmid(i,jn,l-1)+zmid(ie,jn,l-1))
401 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
402 zint(i,jn,l)+zint(ie,jn,l))- &
403 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
404 zint(i,jn,l+1)+zint(ie,jn,l+1)))
406 z1 = 0.25*(zmid(iw,j,l+1)+zmid(ie,j,l+1)+ &
407 zmid(i,jn,l+1)+zmid(i,js,l+1))
408 z3 = 0.25*(zmid(iw,j,l-1)+zmid(ie,j,l-1)+ &
409 zmid(i,jn,l-1)+zmid(i,js,l-1))
410 dz = 0.25*((zint(iw,j,l)+zint(ie,j,l)+ &
411 zint(i,js,l)+zint(i,jn,l))- &
412 (zint(iw,j,l+1)+zint(ie,j,l+1)+ &
413 zint(i,js,l+1)+zint(i,jn,l+1)))
417 du1 = uh(i,j,l+1)-uh(i,j,l)
418 du2 = uh(i,j,l)-uh(i,j,l-1)
419 dv1 = vh(i,j,l+1)-vh(i,j,l)
420 dv2 = vh(i,j,l)-vh(i,j,l-1)
421 IF( vh(i,j,l) <spval.and.uh(i,j,l) <spval.and. &
422 vh(i,j,l+1)<spval.and.uh(i,j,l+1)<spval.and. &
423 vh(i,j,l-1)<spval.and.uh(i,j,l-1)<spval.and. &
424 vst(i,j) <spval.and.ust(i,j) <spval) &
425 heli(i,j,n) = ((vh(i,j,l)-vst(i,j))* &
426 (dz2*(du1/dz1)+dz1*(du2/dz2)) &
427 - (uh(i,j,l)-ust(i,j))* &
428 (dz2*(dv1/dz1)+dz1*(dv2/dz2))) &
429 *dz/(dz1+dz2)+heli(i,j,n)