35 use params_mod,
only: d00, eps, oneps, d01, h1m12, p1000, h1
36 use ctlblk_mod,
only: jsta, jend, im, spval, ista, iend
40 real,
PARAMETER :: KG2G=1.e3
41 real,
PARAMETER :: D35=3.5,d4805=4.805,h2840=2840.,h55=55.
42 real,
PARAMETER :: D2845=0.2845,d00028=0.00028,d3376=3.376
43 real,
PARAMETER :: D00254=0.00254,d00081=0.00081,d81=0.81
44 real,
PARAMETER :: D28=0.28,h2675=2675.
48 REAL,
dimension(ista:iend,jsta:jend),
intent(in) :: P1D,T1D,Q1D
49 REAL,
dimension(ista:iend,jsta:jend),
intent(inout) :: THTE
52 real P,T,Q,EVP,RMX,CKAPA,RKAPA,ARG,DENOM,TLCL,PLCL,FAC, &
73 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q1d(i,j)<spval)
THEN
77 evp = p*q/(eps+oneps*q)
79 ckapa = d2845*(1.-d28*rmx)
81 arg = max(h1m12, evp*d01)
82 denom = d35*log(t) - log(evp*d01) - d4805
83 tlcl = h2840/denom + h55
84 plcl = p*(tlcl/t)**rkapa
85 fac = (p1000/p)**ckapa
86 eterm = (d3376/tlcl-d00254)*(rmx*kg2g*(h1+d81*rmx))
87 thetae = t*fac*exp(eterm)
subroutine calthte(p1d, t1d, q1d, thte)
Subroutine that computes Theta-E.