20 subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,&
21 flag_mid,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, &
22 delt,qadv,kbcon1,ktcon,cnvflg,betascu,betamcu,betadcu, &
23 sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab)
26 use machine,
only : kind_phys
27 use funcphys,
only : fpvs
32 integer,
intent(in) :: im,km,kbcon1(im),ktcon(im)
33 real(kind=kind_phys),
intent(in) :: hvap,delt,betascu,betamcu,betadcu, &
34 sigmind,sigminm,sigmins
35 real(kind=kind_phys),
intent(in) :: qadv(im,km),del(im,km), &
36 qmicro(im,km),tmf(im,km),dbyo1(im,km),zdqca(im,km), &
37 omega_u(im,km),zeta(im,km)
38 logical,
intent(in) :: flag_init,flag_restart,cnvflg(im),flag_shallow,flag_mid
39 real(kind=kind_phys),
intent(in) :: sigmain(im,km)
42 real(kind=kind_phys),
intent(out) :: sigmaout(im,km)
43 real(kind=kind_phys),
intent(out) :: sigmab(im)
48 real(kind=kind_phys) :: terma(im),termb(im),termc(im),termd(im)
49 real(kind=kind_phys) :: mcons(im),fdqa(im),form(im,km), &
53 real(kind=kind_phys) :: gcvalmx,epsilon,zz,cvg,mcon,buy2, &
54 fdqb,dtdyn,dxlim,rmulacvg,tem, &
87 dp(i,k) = 1000. * del(i,k)
96 if(sigmain(i,k)>sigmab(i))
then
97 sigmab(i)=sigmain(i,k)
105 if(sigmab(i) < 1.e-5)
then
115 dp1 = 1000. * del(i,1)
116 mcons(i)=(hvap*(qadv(i,1)+tmf(i,1)+qmicro(i,1))*dp1)
122 mcon = (hvap*(qadv(i,k)+tmf(i,k)+qmicro(i,k))*dp(i,k))
123 buy2 = termd(i)+mcon+mcons(i)
125 if(dbyo1(i,k)>0 .and. buy2 > 0.)
then
128 inbu(i,k-1)=max(inbu(i,k-1),inbu(i,k))
129 termd(i) = termd(i) + inbu(i,k-1)*mcons(i)
139 tem=sigmab(i)*zeta(i,k)*inbu(i,k)*dbyo1(i,k)*dp(i,k)
140 terma(i)=terma(i)+tem
149 tem=zeta(i,k)*dbyo1(i,k)*inbu(i,k)*dp(i,k)
150 termb(i)=termb(i)+tem
159 form(i,k)=-1.0*inbu(i,k)*(omega_u(i,k)*delt)
160 fdqb=0.5*((form(i,k)*zdqca(i,k)))
161 termc(i)=termc(i)+inbu(i,k)* &
162 (fdqb+fdqa(i))*hvap*zeta(i,k)
169 if(flag_init .and. .not. flag_restart)
then
178 den=min(termc(i)+termb(i),1.e8)
180 zz=max(0.0,sign(1.0,terma(i))) &
181 *max(0.0,sign(1.0,termb(i))) &
182 *max(0.0,sign(1.0,termc(i)-epsilon))
184 sigmab(i)=(zz*(terma(i)+cvg))/(den+(1.0-zz))
186 sigmab(i)=min(sigmab(i),0.95)
187 sigmab(i)=max(sigmab(i),0.01)
196 sigmaout(i,k)=sigmab(i)
205 sigmab(i)=sigmab(i)/betascu
206 sigmab(i)=max(sigmins,sigmab(i))
212 sigmab(i)=sigmab(i)/betamcu
213 sigmab(i)=max(sigminm,sigmab(i))
219 sigmab(i)=sigmab(i)/betadcu
220 sigmab(i)=max(sigmind,sigmab(i))
225 sigmab(i) = min(0.95,sigmab(i))