UPP (develop)
Loading...
Searching...
No Matches
CALTHTE.f
Go to the documentation of this file.
1
23!--------------------------------------------------------------------------------------
30!--------------------------------------------------------------------------------------
31 SUBROUTINE calthte(P1D,T1D,Q1D,THTE)
32
33!
34!
35 use params_mod, only: d00, eps, oneps, d01, h1m12, p1000, h1
36 use ctlblk_mod, only: jsta, jend, im, spval, ista, iend
37!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
38 implicit none
39!
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.
45!
46! DECLARE VARIABLES.
47!
48 REAL,dimension(ista:iend,jsta:jend),intent(in) :: P1D,T1D,Q1D
49 REAL,dimension(ista:iend,jsta:jend),intent(inout) :: THTE
50
51 integer I,J
52 real P,T,Q,EVP,RMX,CKAPA,RKAPA,ARG,DENOM,TLCL,PLCL,FAC, &
53 eterm,thetae
54!
55!***************************************************************
56! START CALTHTE.
57!
58! ZERO THETA-E ARRAY
59!$omp parallel do private(i,j)
60 DO j=jsta,jend
61 DO i=ista,iend
62 thte(i,j) = d00
63 ENDDO
64 ENDDO
65!
66! COMPUTE THETA-E.
67!
68! DO J=JSTA_M,JEND_M
69! DO I=ISTA_M,IEND_M
70!$omp parallel do private(i,j,p,t,q,evp,rmx,ckapa,rkapa,arg,denom,tlcl,plcl,fac,eterm,thetae)
71 DO j=jsta,jend
72 DO i=ista,iend
73 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q1d(i,j)<spval)THEN
74 p = p1d(i,j)
75 t = t1d(i,j)
76 q = q1d(i,j)
77 evp = p*q/(eps+oneps*q)
78 rmx = eps*evp/(p-evp)
79 ckapa = d2845*(1.-d28*rmx)
80 rkapa = 1./ckapa
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)
88 thte(i,j)= thetae
89 ENDIF
90 ENDDO
91 ENDDO
92!
93! END OF ROUTINE.
94!
95 RETURN
96 END
subroutine calthte(p1d, t1d, q1d, thte)
Subroutine that computes Theta-E.
Definition CALTHTE.f:32