1 SUBROUTINE clmax(EL0,SQZ,SQ,RQ2L,RQ2H)
41 use vrbls3d, only: zint, q2, pint
43 use masks, only: lmh, sm
45 use ctlblk_mod
, only: jsta, jend, lm, im, spval
49 real,
PARAMETER :: alphal=0.2, alphas=0.2
52 real,
PARAMETER :: el0m=300.0, elmin=11.0
59 real,
dimension(IM,jsta:jend),
intent(inout) :: sqz,sq,rq2l,rq2h,el0
60 real,
dimension(IM,jsta:jend) :: hgt
73 hgt(i,j) = zint(i,j,nint(lmh(i,j)))
80 IF(q2(i,j,l) <= epsq2)
THEN
83 rq2l(i,j) = sqrt(q2(i,j,l))
99 dp = pint(i,j,l+1) - pint(i,j,l)
103 rq2m = rq2h(i,j) + rq2l(i,j)
107 sqz(i,j) = ((zint(i,j,l)+zint(i,j,l+1))*0.5-hgt(i,j))*rq2m*dp &
112 sq(i,j) = rq2m*dp + sq(i,j)
113 rq2h(i,j) = rq2l(i,j)
125 IF(hgt(i,j)<spval)
THEN
127 & ((sm(i,j)*alphas+(1.0-sm(i,j))*alphal)*sqz(i,j) &
128 & /(sq(i,j)+epsq2)),el0m),elmin)