15 SUBROUTINE calpbl(PBLRI)
18 use vrbls3d, only: pmid, q, t, uh, vh, zmid
21 use params_mod, only: h10e5, capa, d608, h1, g, gi
22 use ctlblk_mod
, only: lm, im, jsta, jend, spval, jsta_m, jsta_2l, jend_2u, jend_m
23 use gridspec_mod
, only: gridtype
29 real,
dimension(IM,jsta_2l:jend_2u),
intent(inout) :: pblri
31 REAL,
ALLOCATABLE :: thv(:,:,:)
32 INTEGER ifrstlev(im,jsta_2l:jend_2u),icalpbl(im,jsta_2l:jend_2u) &
33 ,lvlp(im,jsta_2l:jend_2u)
34 REAL rif(im,jsta_2l:jend_2u) &
35 ,ribp(im,jsta_2l:jend_2u),ubot1(im,jsta_2l:jend_2u) &
36 ,vbot1(im,jsta_2l:jend_2u),zbot1(im,jsta_2l:jend_2u) &
37 ,thvbot1(im,jsta_2l:jend_2u)
39 real ape,betta,ricr,ustarr,wmin,uhkl,ulkl,vhkl,vlkl,wndsl,wndslp, &
40 ubot,vbot,vtop,utop,thvtop,ztop,wdl2,rib
45 ALLOCATE ( thv(im,jsta_2l:jend_2u,lm) )
62 if( pmid(i,j,l)<spval)
then
63 ape = (h10e5/pmid(i,j,l))**capa
64 thv(i,j,l) = (q(i,j,l)*d608+h1)*t(i,j,l)*ape
103 if(gridtype /=
'A')
THEN
104 call exch(vtm(1,jsta_2l,l))
105 call exch(uh(1,jsta_2l,l))
106 call exch(vh(1,jsta_2l,l))
107 call exch(vtm(1,jsta_2l,l-1))
108 call exch(uh(1,jsta_2l,l-1))
109 call exch(vh(1,jsta_2l,l-1))
115 if( pmid(i,j,l)<spval)
then
118 IF(ifrstlev(i,j) == 0)
THEN
122 IF(gridtype ==
'A')
THEN
127 ELSE IF(gridtype ==
'E')
THEN
137 wndsl = vtm(i,j-1,l)+vtm(iw,j,l)+vtm(ie,j,l)+vtm(i,j+1,l)
138 wndslp = vtm(i,j-1,l-1)+vtm(iw,j,l-1)+ &
139 vtm(ie,j,l-1)+vtm(i,j+1,l-1)
140 IF(wndsl == 0. .OR. wndslp == 0.) cycle
141 ubot = (uh(i,j-1,l)+uh(iw,j,l)+uh(ie,j,l)+uh(i,j+1,l))/wndsl
142 utop = (uh(i,j-1,l-1)+uh(iw,j,l-1)+uh(ie,j,l-1)+ &
143 uh(i,j+1,l-1))/wndslp
144 vbot = (vh(i,j-1,l)+vh(iw,j,l)+vh(ie,j,l)+vh(i,j+1,l))/wndsl
145 vtop = (vh(i,j-1,l-1)+vh(iw,j,l-1)+vh(ie,j,l-1)+ &
146 vh(i,j+1,l-1))/wndslp
147 ELSE IF(gridtype ==
'B')
THEN
150 ubot = (uh(iw,j-1,l)+uh(iw,j,l)+uh(ie,j-1,l)+uh(i,j,l))*0.25
151 utop = (uh(iw,j-1,l-1)+uh(iw,j,l-1)+uh(ie,j-1,l-1)+ &
153 vbot = (vh(iw,j-1,l)+vh(iw,j,l)+vh(ie,j-1,l)+vh(i,j,l))*0.25
154 vtop = (vh(iw,j-1,l-1)+vh(iw,j,l-1)+vh(ie,j-1,l-1)+ &
158 IF(ifrstlev(i,j) == 0)
THEN
161 zbot1(i,j) = zmid(i,j,l)
162 thvbot1(i,j) = thv(i,j,l)
166 thvtop = thv(i,j,l-1)
174 wdl2 = (utop-ubot1(i,j))**2 + (vtop-vbot1(i,j))**2 + wmin**2
175 rib = (g/thvbot1(i,j))*(thvtop-thvbot1(i,j))* &
176 (ztop-zbot1(i,j))/(wdl2+betta*(ustarr**2))
186 IF (rib>=ricr.AND.icalpbl(i,j)==0)
THEN
187 pblri(i,j) = zmid(i,j,l)+(zmid(i,j,l-1)-zmid(i,j,l))* &
188 (ricr-ribp(i,j))/(rib-ribp(i,j))
193 pblri(i,j) = pblri(i,j)-fis(i,j)*gi