49 SUBROUTINE splat(IDRT,JMAX,SLAT,WLAT)
50 REAL SLAT(JMAX),WLAT(JMAX)
51 INTEGER,
PARAMETER:: KD=selected_real_kind(15,45)
52 REAL(KIND=kd):: pk(jmax/2),pkm1(jmax/2),pkm2(jmax/2)
53 REAL(KIND=kd):: slatd(jmax/2),sp,spmax,eps=10.*epsilon(sp)
56 DATA bz / 2.4048255577, 5.5200781103,
57 $ 8.6537279129, 11.7915344391, 14.9309177086, 18.0710639679,
58 $ 21.2116366299, 24.3524715308, 27.4934791320, 30.6346064684,
59 $ 33.7758202136, 36.9170983537, 40.0584257646, 43.1997917132,
60 $ 46.3411883717, 49.4826098974, 52.6240518411, 55.7655107550,
61 $ 58.9069839261, 62.0484691902, 65.1899648002, 68.3314693299,
62 $ 71.4729816036, 74.6145006437, 77.7560256304, 80.8975558711,
63 $ 84.0390907769, 87.1806298436, 90.3221726372, 93.4637187819,
64 $ 96.6052679510, 99.7468198587, 102.888374254, 106.029930916,
65 $ 109.171489649, 112.313050280, 115.454612653, 118.596176630,
66 $ 121.737742088, 124.879308913, 128.020877005, 131.162446275,
67 $ 134.304016638, 137.445588020, 140.587160352, 143.728733573,
68 $ 146.870307625, 150.011882457, 153.153458019, 156.295034268 /
70 REAL AWORK((JMAX+1)/2,((JMAX+1)/2)),BWORK(((JMAX+1)/2))
71 INTEGER:: JHE,JHO,J0=0
72 INTEGER IPVT((JMAX+1)/2)
73 parameter(pi=3.14159265358979,c=(1.-(2./pi)**2)*0.25)
79 r=1./sqrt((jmax+0.5)**2+c)
84 slatd(j)=cos((bz(jz)+(j-jz)*pi)*r)
87 DO WHILE(spmax.GT.eps)
97 pk(j)=((2*n-1)*slatd(j)*pkm1(j)-(n-1)*pkm2(j))/n
101 sp=pk(j)*(1.-slatd(j)**2)/(jmax*(pkm1(j)-slatd(j)*pk(j)))
103 spmax=max(spmax,abs(sp))
109 wlat(j)=(2.*(1.-slatd(j)**2))/(jmax*pkm1(j))**2
110 slat(jmax+1-j)=-slat(j)
111 wlat(jmax+1-j)=wlat(j)
117 wlat(jhe)=wlat(jhe)*n**2/(n-1)**2
122 ELSEIF(idrt.EQ.0)
THEN
129 slat(j)=cos((j-1)*dlt)
133 awork(js,j)=cos(2*(js-1)*j*dlt)
137 bwork(js)=-d1/(4*(js-1)**2-1)
140 CALL dgef(awork,jhe,jho,ipvt)
141 CALL dges(awork,jhe,jho,ipvt,bwork,j0)
143 #if defined LINUX || defined APPLE
144 call ludcmp(awork,jho,jhe,ipvt)
145 call lubksb(awork,jho,jhe,ipvt,bwork)
153 slat(jmax+1-j)=-slat(j)
154 wlat(jmax+1-j)=wlat(j)
158 wlat(jhe)=2.*wlat(jhe)
162 ELSEIF(idrt.EQ.256)
THEN
169 slat(j)=cos((j-0.5)*dlt)
173 awork(js,j)=cos(2*(js-1)*(j-0.5)*dlt)
177 bwork(js)=-d1/(4*(js-1)**2-1)
180 CALL dgef(awork,jhe,jho,ipvt)
181 CALL dges(awork,jhe,jho,ipvt,bwork,j0)
183 #if defined LINUX || defined APPLE
184 call ludcmp(awork,jho,jhe,ipvt,d)
185 call lubksb(awork,jho,jhe,ipvt,bwork)
193 slat(jmax+1-j)=-slat(j)
194 wlat(jmax+1-j)=wlat(j)
198 wlat(jhe)=2.*wlat(jhe)