2 SUBROUTINE table(PTBL,TTBL,PT &
3 &, rdq,rdth,rdp,rdthe,pl,thl,qs0,sqs,sthe,the0)
12 integer,
parameter :: itb=076, jtb=134
13 real,
parameter :: thh=365.,ph=105000. &
14 &, PQ0=379.90516,A1=610.78,A2=17.2693882,A3=273.16, &
15 a4=35.86, r=287.04,cp=1004.6,eliwv=2.683e6,eps=1.e-9
17 real,
dimension(ITB,JTB),
intent(out) :: ptbl
18 real,
dimension(JTB,ITB),
intent(out) :: ttbl
19 real,
dimension(JTB),
intent(out) :: qs0,sqs
20 real,
dimension(ITB),
intent(out) :: sthe,the0
21 real,
intent(in) :: pt,thl
22 real,
intent(out) :: rdq,rdth,rdp,rdthe,pl
24 & QSOLD(JTB), POLD (JTB), QSNEW(JTB) &
25 &, Y2P (JTB), APP (JTB), AQP (JTB), PNEW(JTB) &
26 &, TOLD (JTB), THEOLD(JTB) &
27 &, Y2T (JTB), THENEW(JTB), APT (JTB), AQT (JTB), TNEW(JTB)
29 real dth,dp,th,p,ape,denom,qs0k,sqsk,dqs,qs,theok,sthek &
31 integer lthm,kpm,kthm1,kpm1,kp,kmm,kthm,kth
41 dth = (thh-thl) /
REAL(kthm-1)
42 dp = (ph -pl ) /
REAL(kpm -1)
59 ape = (100000./p)**(r/cp)
62 qsold(kp) = pq0 / p*exp(a2*(th-a3*ape)/denom)
72 sqsk = qsold(kpm) - qsold(1)
77 qsold(kp) = (qsold(kp)-qs0k)/sqsk
78 IF((qsold(kp)-qsold(kp-1)) < eps) qsold(kp) = qsold(kp-1)+eps
89 qsnew(kp) = qsnew(kp-1) + dqs
95 CALL spline(jtb,kpm,qsold,pold,y2p,kpm,qsnew,pnew,app,aqp)
98 ptbl(kp,kth) = pnew(kp)
114 ape = (100000./p)**(r/cp)
116 IF (denom > eps)
THEN
117 qs = pq0/p*exp(a2*(th-a3*ape)/denom)
124 theold(kth) = th*exp(eliwv*qs/(cp*told(kth)))
130 sthek = theold(kthm) - theold(1)
135 theold(kth)=(theold(kth)-the0k)/sthek
136 IF((theold(kth)-theold(kth-1))<eps) &
137 theold(kth) = theold(kth-1) + eps
145 dthe = 1./
REAL(kthm-1)
149 thenew(kth) = thenew(kth-1) + dthe
155 CALL spline(jtb,kthm,theold,told,y2t,kthm,thenew,tnew,apt,aqt)
158 ttbl(kth,kp) = tnew(kth)