23 SUBROUTINE calthte(P1D,T1D,Q1D,THTE)
27 use params_mod, only: d00, eps, oneps, d01, h1m12, p1000, h1
28 use ctlblk_mod
, only: jsta, jend, im, spval
32 real,
PARAMETER :: kg2g=1.e3
33 real,
PARAMETER :: d35=3.5,d4805=4.805,h2840=2840.,h55=55.
34 real,
PARAMETER :: d2845=0.2845,d00028=0.00028,d3376=3.376
35 real,
PARAMETER :: d00254=0.00254,d00081=0.00081,d81=0.81
36 real,
PARAMETER :: d28=0.28,h2675=2675.
40 REAL,
dimension(IM,jsta:jend),
intent(in) :: p1d,t1d,q1d
41 REAL,
dimension(IM,jsta:jend),
intent(inout) :: thte
44 real p,t,q,evp,rmx,ckapa,rkapa,arg,denom,tlcl,plcl,fac, &
65 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q1d(i,j)<spval)
THEN
69 evp = p*q/(eps+oneps*q)
71 ckapa = d2845*(1.-d28*rmx)
73 arg = max(h1m12, evp*d01)
74 denom = d35*log(t) - log(evp*d01) - d4805
75 tlcl = h2840/denom + h55
76 plcl = p*(tlcl/t)**rkapa
77 fac = (p1000/p)**ckapa
78 eterm = (d3376/tlcl-d00254)*(rmx*kg2g*(h1+d81*rmx))
79 thetae = t*fac*exp(eterm)