1 SUBROUTINE mixlen(EL0,EL)
41 use vrbls3d, only: zint, pmid, t, q2
42 use masks, only: lmh, htm
44 use ctlblk_mod
, only: jsta, jend, jsta_m, jend_m, im, jm, jsta_2l, jend_2u,&
50 real,
PARAMETER :: vkrm=0.4
52 real,
PARAMETER :: frg=4.*9.8,drdrff=0.54,cpblt=10., &
53 csh=0.23*0.5, epsn2=1.e-7
57 real,
intent(in) :: el0(im,jsta_2l:jend_2u)
58 real,
intent(out) :: el(im,jsta_2l:jend_2u,lm)
59 real hgt(im,jsta:jend),ape(im,jsta_m:jend_m,2)
62 real zl,vkrmz,ensq,q2kl,elst,ziag,elvgd
76 hgt(i,j)=zint(i,j,nint(lmh(i,j))+1)
87 IF(hgt(i,j)<spval)
THEN
88 zl = 0.5*(zint(i,j,l)+zint(i,j,l+1))
89 vkrmz = (zl-hgt(i,j))*vkrm
90 el(i,j,l) = el0(i,j)*vkrmz/(el0(i,j)+vkrmz)
104 IF(hgt(i,j)<spval)
THEN
105 el(i,j,l) = 0.5*(el(i,j,l)+el(i,j,l+1))*htm(i,j,l+1)
116 IF(hgt(i,j)<spval)
THEN
131 ape(i,j,1) = (1.e5/pmid(i,j,1))**capa
139 IF(t(i,j,l)<spval)
THEN
140 ape(i,j,2) = (1.e5/pmid(i,j,l+1))**capa
141 ensq = htm(i,j,l+1)* &
142 frg*(t(i,j,l)*ape(i,j,1)-t(i,j,l+1)*ape(i,j,2))/ &
143 ((t(i,j,l)*ape(i,j,1)+t(i,j,l+1)*ape(i,j,2))* &
144 (zint(i,j,l)-zint(i,j,l+2))+epsn2)
145 ensq = amax1(ensq,epsn2)
146 q2kl = amax1(epsq2,q2(i,j,l))
147 elst = drdrff*sqrt(q2kl/ensq)
149 ziag = zint(i,j,l+1)-hgt(i,j)
151 IF(ziag < cpblt*el0(i,j))
THEN
152 el(i,j,l) = amin1(el(i,j,l),elst)
154 elvgd = csh*(zint(i,j,l)-zint(i,j,l+2))
155 el(i,j,l) = amin1(elst,elvgd,vkrm*ziag)
157 ape(i,j,1) = ape(i,j,2)