1 SUBROUTINE mixlen(EL0,EL)
42 use vrbls3d,
only: zint, pmid, t, q2
43 use masks,
only: lmh, htm
44 use params_mod,
only: epsq2, capa
45 use ctlblk_mod,
only: jsta, jend, jsta_m, jend_m, im, jm, jsta_2l, jend_2u,&
47 ista, iend, ista_m, iend_m, ista_2l, iend_2u
52 real,
PARAMETER :: VKRM=0.4
54 real,
PARAMETER :: FRG=4.*9.8,drdrff=0.54,cpblt=10., &
55 csh=0.23*0.5, epsn2=1.e-7
59 real,
intent(in) :: el0(ista_2l:iend_2u,jsta_2l:jend_2u)
60 real,
intent(out) :: EL(ista_2l:iend_2u,jsta_2l:jend_2u,LM)
61 real HGT(ISTA:IEND,JSTA:JEND),APE(ISTA_M:IEND_M,JSTA_M:JEND_M,2)
64 real ZL,VKRMZ,ENSQ,Q2KL,ELST,ZIAG,ELVGD
78 hgt(i,j)=zint(i,j,nint(lmh(i,j))+1)
89 IF(hgt(i,j)<spval)
THEN
90 zl = 0.5*(zint(i,j,l)+zint(i,j,l+1))
91 vkrmz = (zl-hgt(i,j))*vkrm
92 el(i,j,l) = el0(i,j)*vkrmz/(el0(i,j)+vkrmz)
106 IF(hgt(i,j)<spval)
THEN
107 el(i,j,l) = 0.5*(el(i,j,l)+el(i,j,l+1))*htm(i,j,l+1)
118 IF(hgt(i,j)<spval)
THEN
133 ape(i,j,1) = (1.e5/pmid(i,j,1))**capa
141 IF(t(i,j,l)<spval)
THEN
142 ape(i,j,2) = (1.e5/pmid(i,j,l+1))**capa
143 ensq = htm(i,j,l+1)* &
144 frg*(t(i,j,l)*ape(i,j,1)-t(i,j,l+1)*ape(i,j,2))/ &
145 ((t(i,j,l)*ape(i,j,1)+t(i,j,l+1)*ape(i,j,2))* &
146 (zint(i,j,l)-zint(i,j,l+2))+epsn2)
147 ensq = amax1(ensq,epsn2)
148 q2kl = amax1(epsq2,q2(i,j,l))
149 elst = drdrff*sqrt(q2kl/ensq)
151 ziag = zint(i,j,l+1)-hgt(i,j)
153 IF(ziag < cpblt*el0(i,j))
THEN
154 el(i,j,l) = amin1(el(i,j,l),elst)
156 elvgd = csh*(zint(i,j,l)-zint(i,j,l+2))
157 el(i,j,l) = amin1(elst,elvgd,vkrm*ziag)
159 ape(i,j,1) = ape(i,j,2)