41 use vrbls3d,
only: pmid, t, q
42 use vrbls2d,
only: t500
44 use lookup_mod,
only: thl, rdth, jtb, qs0, sqs, rdq,itb, ptbl, pl, &
45 rdp, the0, sthe, rdthe, ttbl
46 use ctlblk_mod,
only: jsta, jend, im, spval, ista, iend
47 use params_mod,
only: d00,h10e5, capa, elocp, eps, oneps
48 use upp_physics,
only: fpvsnew
55 real,
PARAMETER :: D8202=.820231e0 , h5e4=5.e4 , p500=50000.
59 real,
intent(out) :: SLINDX(ista:iend,jsta:jend)
60 REAL :: TVP, ESATP, QSATP
61 REAL :: TTH, TP, APESP, PARTMP, THESP, TPSP
62 REAL :: BQS00, SQS00, BQS10, SQS10, BQ, SQ, TQ
63 REAL :: P00, P10, P01, P11, T00, T10, T01, T11
64 REAL :: BTHE00, STHE00, BTHE10, STHE10, BTH, STH
65 REAL :: TQQ, QQ, QBT, TTHBT, TBT, APEBT, PPQ, PP
67 INTEGER :: I, J, LBTM, ITTBK, IQ, IT, IPTBK, ITH, IP, IQTB
68 INTEGER :: ITTB, IPTB, ITHTB
84 IF(t(i,j,lbtm)<spval .AND. q(i,j,lbtm)<spval)
THEN
87 apebt = (h10e5/pmid(i,j,lbtm))**capa
90 tth = (tthbt-thl)*rdth
109 bq=(bqs10-bqs00)*tqq+bqs00
110 sq=(sqs10-sqs00)*tqq+sqs00
131 tpsp = p00+(p10-p00)*ppq+(p01-p00)*tqq &
132 +(p00-p10-p01+p11)*ppq*tqq
133 IF(tpsp <= d00) tpsp = h10e5
134 apesp = (h10e5/tpsp)**capa
135 thesp = tthbt*exp(elocp*qbt*apesp/tthbt)
156 bth=(bthe10-bthe00)*qq+bthe00
157 sth=(sthe10-sthe00)*qq+sthe00
158 tth=(thesp-bth)/sth*rdthe
179 partmp=(t00+(t10-t00)*pp+(t01-t00)*qq &
180 +(t00-t10-t01+t11)*pp*qq)
182 partmp=tbt*apebt*d8202
192 esatp=fpvsnew(partmp)
193 qsatp=eps*esatp/(p500-esatp*oneps)
194 tvp=partmp*(1+0.608*qsatp)
195 slindx(i,j)=t500(i,j)-tvp