36 use vrbls3d,
only: uh, vh, pmid, t, q, pint, zmid, zint
37 use vrbls2d,
only: ths, qs, smstav, twbs, qwbs, pblh
39 use params_mod,
only: p1000, capa, d608, h1, g, rd, cp
40 use ctlblk_mod,
only: jsta, jend, spval, lm, jsta_m, jend_m, im, &
41 jsta_2l, jend_2u, ista, iend, ista_m, iend_m,ista_2l,iend_2u
42 use gridspec_mod,
only: gridtype
48 REAL ,
PARAMETER :: VCONVC=1.
52 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(inout) :: PBLREGIME
54 integer I,J,IE,IW,ii,jj
55 real APE,THV,THVX,GOVRTH,UMASS,VMASS,WSPD,TSKV,DTHV,RHOX,fluxc,tsfc, &
67 pblregime(i,j) = spval
87 IF(gridtype /=
'A')
THEN
88 call exch(uh(1,jsta_2l,lm))
89 call exch(vh(1,jsta_2l,lm))
95 IF(pmid(i,j,lm)<spval .AND. qs(i,j)<spval .AND. &
96 smstav(i,j)<spval)
THEN
97 ape = (p1000/pmid(i,j,lm))**capa
99 thvx = (q(i,j,lm)*d608+h1)*thx
101 IF(gridtype ==
'E')
THEN
104 umass = (uh(i,j-1,lm)+uh(iw,j,lm)+uh(ie,j,lm) &
106 vmass = (vh(i,j-1,lm)+vh(iw,j,lm)+vh(ie,j,lm) &
108 wspd= sqrt(umass*umass+vmass*vmass)
109 ELSE IF(gridtype ==
'B')
THEN
112 umass = (uh(iw,j-1,lm)+uh(iw,j,lm)+uh(ie,j-1,lm) &
114 vmass = (vh(iw,j-1,lm)+vh(iw,j,lm)+vh(ie,j-1,lm) &
116 wspd= sqrt(umass*umass+vmass*vmass)
118 wspd = sqrt(uh(i,j,lm)*uh(i,j,lm)+vh(i,j,lm)*vh(i,j,lm))
121 tskv = ths(i,j)*(1.+d608*qs(i,j)*smstav(i,j))
127 rhox = pint(i,j,lm+1)/rd/(t(i,j,lm)*(q(i,j,lm)*d608+h1))
128 fluxc = max(-twbs(i,j)/rhox/cp - d608*tskv*qwbs(i,j)/rhox,0.)
129 tsfc = ths(i,j)*(pint(i,j,lm+1)/p1000)**capa
130 vconv = vconvc*(g/tsfc*pblh(i,j)*fluxc)**.33
132 vsgd = 0.32 * (max(dx(i,j)/5000.-1.,0.))**.33
133 wspd = sqrt(wspd*wspd+vconv*vconv+vsgd*vsgd)
135 br = govrth*(zmid(i,j,lm)-zint(i,j,lm+1))*dthv/(wspd*wspd)
139 ELSE IF(br == 0.0)
THEN
141 ELSE IF(br < 0.2)
THEN