1 SUBROUTINE calwxt_revised_post(T,Q,PMID,PINT,HTM,LMH,PREC,ZINT,IWX)
29 use params_mod,
only: h1m12, d00, d608, h1, rog
30 use ctlblk_mod,
only: jsta, jend, modelname, pthresh, im, jsta_2l, jend_2u, lm,&
31 lp1, spval, ista, iend, ista_2l, iend_2u
42 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u,LM),
intent(in) :: T,Q,PMID,HTM
43 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u,LP1),
intent(in) :: PINT,ZINT
44 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(in) :: LMH
45 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(in) :: PREC
54 integer,
DIMENSION(ista:iend,jsta:jend),
intent(inout) :: IWX
57 REAL,
ALLOCATABLE :: TWET(:,:,:)
58 integer,
DIMENSION(ista:iend,jsta:jend) :: KARR,LICEE
59 real,
dimension(ista:iend,jsta:jend) :: TCOLD,TWARM
61 integer I,J,L,LMHK,LICE,IFREL,IWRML,IFRZL
62 real PSFCK,TDCHK,A,TDKL,TDPRE,TLMHK,TWRMK,AREAS8,AREAP4,AREA1, &
63 surfw,surfc,dzkl,pintk1,pintk2,pm150,qkl,tkl,pkl,area0, &
66 logical :: jcontinue=.true.
79 ALLOCATE ( twet(ista_2l:iend_2u,jsta_2l:jend_2u,lm) )
97 IF (prec(i,j)<=pthresh) cycle
104 psfck=pint(i,j,lmhk+1)
111 760 tcold(i,j)=t(i,j,lmhk)
112 twarm(i,j)=t(i,j,lmhk)
124 IF (pkl<50000.0.OR.pkl>psfck-7000.0) cycle
126 a=alog(qkl*pkl/(610.78*(0.378*qkl+0.622)))
127 tdkl=(237.3*a)/(17.269-a)+273.15
129 IF (tdpre<tdchk.AND.tkl<tcold(i,j)) tcold(i,j)=tkl
130 IF (tdpre<tdchk.AND.tkl>twarm(i,j)) twarm(i,j)=tkl
131 IF (tdpre<tdchk.AND.l<licee(i,j)) licee(i,j)=l
138 IF (tcold(i,j)==t(i,j,lmhk).AND.tdchk<6.0)
THEN
151 IF (prec(i,j)<=pthresh) cycle
157 IF (tcold(i,j)>269.15)
THEN
158 IF (tlmhk<=273.15)
THEN
181 CALL wetbulb(t,q,pmid,htm,karr,twet)
193 psfck=pint(i,j,lmhk+1)
217 DO 1945 l=lmhk,lice,-1
218 dzkl=zint(i,j,l)-zint(i,j,l+1)
219 area1=(twet(i,j,l)-269.15)*dzkl
220 area0=(twet(i,j,l)-273.15)*dzkl
221 IF (twet(i,j,l)>=269.15) areap4=areap4+area1
222 IF (twet(i,j,l)>=273.15) areap0=areap0+area0
234 IF (areap0<350.0)
THEN
248 IF(pintk1<pm150)
THEN
251 dzkl=zint(i,j,l)-zint(i,j,l+1)
256 dzkl=t(i,j,l)*(q(i,j,l)*d608+h1)*rog* &
258 area1=(twet(i,j,l)-273.15)*dzkl
273 IF (ifrzl==0.AND.t(i,j,l)<273.15) ifrzl=1
274 IF (iwrml==0.AND.t(i,j,l)>=twrmk) iwrml=1
276 IF (iwrml==0.OR.ifrzl==0)
THEN
277 dzkl=zint(i,j,l)-zint(i,j,l+1)
278 area1=(twet(i,j,l)-273.15)*dzkl
279 IF(ifrzl==0.AND.twet(i,j,l)>=273.15)surfw=surfw+area1
280 IF(iwrml==0.AND.twet(i,j,l)<=273.15)surfc=surfc+area1
283 IF(surfc<-3000.0.OR. &
284 & (areas8<-3000.0.AND.surfw<50.0))
THEN
294 IF(tlmhk<273.15)
THEN