2 SUBROUTINE tableq(TTBLQ,RDP,RDTHE,PL,THL,STHE,THE0)
13 integer,
parameter :: ITB=152,jtb=440
14 real,
parameter :: THH=325.,ph=105000. &
15 &, pq0=379.90516,a1=610.78,a2=17.2693882,a3=273.16,a4=35.86 &
16 &, r=287.04,cp=1004.6,eliwv=2.683e6,eps=1.e-9
18 real,
dimension(JTB,ITB),
intent(out) :: TTBLQ
19 real,
dimension(ITB),
intent(out) :: THE0,STHE
20 real,
intent(in) :: PL,THL
21 real,
intent(out) :: RDP,RDTHE
23 real TOLD (JTB),THEOLD(JTB) &
24 &, Y2T (JTB),THENEW(JTB),APT (JTB),AQT (JTB),TNEW (JTB)
26 real PT,RDQ,DTH,DP,RDTH,TH,P,APE,DENOM,the0k, dthe, &
27 qs0k,sqsk,dqs,qs,theok,sthek
28 integer KTHM,KPM,KTHM1,KPM1,KP,KMM,KTH
36 dth=(thh-thl)/real(kthm-1)
37 dp =(ph -pl )/real(kpm -1)
48 ape=(100000./p)**(r/cp)
49 qs=pq0/p*exp(a2*(th-a3*ape)/(th-a4*ape))
51 theold(kth)=th*exp(eliwv*qs/(cp*told(kth)))
55 sthek=theold(kthm)-theold(1)
60 theold(kth)=(theold(kth)-the0k)/sthek
62 IF((theold(kth)-theold(kth-1))<eps) &
63 theold(kth)=theold(kth-1) + eps
76 thenew(kth)=thenew(kth-1)+dthe
82 CALL spline(jtb,kthm,theold,told,y2t,kthm,thenew,tnew,apt,aqt)
85 ttblq(kth,kp)=tnew(kth)