1 SUBROUTINE clmax(EL0,SQZ,SQ,RQ2L,RQ2H)
42 use vrbls3d,
only: zint, q2, pint
44 use masks,
only: lmh, sm
45 use params_mod,
only: epsq2
46 use ctlblk_mod,
only: jsta, jend, lm, im, spval, ista, iend
50 real,
PARAMETER :: ALPHAL=0.2, alphas=0.2
53 real,
PARAMETER :: EL0M=300.0, elmin=11.0
60 real,
dimension(ista:iend,jsta:jend),
intent(inout) :: SQZ,SQ,RQ2L,RQ2H,EL0
61 real,
dimension(ista:iend,jsta:jend) :: HGT
74 hgt(i,j) = zint(i,j,nint(lmh(i,j)))
81 IF(q2(i,j,l) <= epsq2)
THEN
84 rq2l(i,j) = sqrt(q2(i,j,l))
100 dp = pint(i,j,l+1) - pint(i,j,l)
104 rq2m = rq2h(i,j) + rq2l(i,j)
108 sqz(i,j) = ((zint(i,j,l)+zint(i,j,l+1))*0.5-hgt(i,j))*rq2m*dp &
113 sq(i,j) = rq2m*dp + sq(i,j)
114 rq2h(i,j) = rq2l(i,j)
126 IF(hgt(i,j)<spval)
THEN
128 & ((sm(i,j)*alphas+(1.0-sm(i,j))*alphal)*sqz(i,j) &
129 & /(sq(i,j)+epsq2)),el0m),elmin)