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)