44 SUBROUTINE splat(IDRT,JMAX,SLAT,WLAT)
45 REAL SLAT(JMAX),WLAT(JMAX)
46 INTEGER,
PARAMETER:: KD=selected_real_kind(15,45)
47 REAL(KIND=kd):: pk(jmax/2),pkm1(jmax/2),pkm2(jmax/2)
48 REAL(KIND=kd):: slatd(jmax/2),sp,spmax,eps=10.*epsilon(sp)
51 DATA bz / 2.4048255577, 5.5200781103,
52 $ 8.6537279129, 11.7915344391, 14.9309177086, 18.0710639679,
53 $ 21.2116366299, 24.3524715308, 27.4934791320, 30.6346064684,
54 $ 33.7758202136, 36.9170983537, 40.0584257646, 43.1997917132,
55 $ 46.3411883717, 49.4826098974, 52.6240518411, 55.7655107550,
56 $ 58.9069839261, 62.0484691902, 65.1899648002, 68.3314693299,
57 $ 71.4729816036, 74.6145006437, 77.7560256304, 80.8975558711,
58 $ 84.0390907769, 87.1806298436, 90.3221726372, 93.4637187819,
59 $ 96.6052679510, 99.7468198587, 102.888374254, 106.029930916,
60 $ 109.171489649, 112.313050280, 115.454612653, 118.596176630,
61 $ 121.737742088, 124.879308913, 128.020877005, 131.162446275,
62 $ 134.304016638, 137.445588020, 140.587160352, 143.728733573,
63 $ 146.870307625, 150.011882457, 153.153458019, 156.295034268 /
65 REAL AWORK((JMAX+1)/2,((JMAX+1)/2)),BWORK(((JMAX+1)/2))
66 INTEGER:: JHE,JHO,J0=0
67 INTEGER IPVT((JMAX+1)/2)
68 parameter(pi=3.14159265358979,c=(1.-(2./pi)**2)*0.25)
74 r=1./sqrt((jmax+0.5)**2+c)
79 slatd(j)=cos((bz(jz)+(j-jz)*pi)*r)
82 DO WHILE(spmax.GT.eps)
92 pk(j)=((2*n-1)*slatd(j)*pkm1(j)-(n-1)*pkm2(j))/n
96 sp=pk(j)*(1.-slatd(j)**2)/(jmax*(pkm1(j)-slatd(j)*pk(j)))
98 spmax=max(spmax,abs(sp))
104 wlat(j)=(2.*(1.-slatd(j)**2))/(jmax*pkm1(j))**2
105 slat(jmax+1-j)=-slat(j)
106 wlat(jmax+1-j)=wlat(j)
112 wlat(jhe)=wlat(jhe)*n**2/(n-1)**2
117 ELSEIF(idrt.EQ.0)
THEN
124 slat(j)=cos((j-1)*dlt)
128 awork(js,j)=cos(2*(js-1)*j*dlt)
132 bwork(js)=-d1/(4*(js-1)**2-1)
135 call ludcmp(awork,jho,jhe,ipvt)
136 call lubksb(awork,jho,jhe,ipvt,bwork)
144 slat(jmax+1-j)=-slat(j)
145 wlat(jmax+1-j)=wlat(j)
149 wlat(jhe)=2.*wlat(jhe)
153 ELSEIF(idrt.EQ.256)
THEN
160 slat(j)=cos((j-0.5)*dlt)
164 awork(js,j)=cos(2*(js-1)*(j-0.5)*dlt)
168 bwork(js)=-d1/(4*(js-1)**2-1)
171 call ludcmp(awork,jho,jhe,ipvt,d)
172 call lubksb(awork,jho,jhe,ipvt,bwork)
180 slat(jmax+1-j)=-slat(j)
181 wlat(jmax+1-j)=wlat(j)
185 wlat(jhe)=2.*wlat(jhe)
subroutine ludcmp(A, N, NP, INDX)
Replaces an NxN matrix a with the LU decomposition.
subroutine lubksb(A, N, NP, INDX, B)
Solves a system of linear equations, follows call to ludcmp().
subroutine splat(IDRT, JMAX, SLAT, WLAT)
Computes cosines of colatitude and Gaussian weights for one of the following specific global sets of ...