45 SUBROUTINE splat(IDRT,JMAX,SLAT,WLAT)
46 REAL SLAT(JMAX),WLAT(JMAX)
47 INTEGER,
PARAMETER:: KD=selected_real_kind(15,45)
48 REAL(KIND=kd):: pk(jmax/2),pkm1(jmax/2),pkm2(jmax/2)
49 REAL(KIND=kd):: slatd(jmax/2),sp,spmax,eps=10.*epsilon(sp)
52 DATA bz / 2.4048255577, 5.5200781103,
53 $ 8.6537279129, 11.7915344391, 14.9309177086, 18.0710639679,
54 $ 21.2116366299, 24.3524715308, 27.4934791320, 30.6346064684,
55 $ 33.7758202136, 36.9170983537, 40.0584257646, 43.1997917132,
56 $ 46.3411883717, 49.4826098974, 52.6240518411, 55.7655107550,
57 $ 58.9069839261, 62.0484691902, 65.1899648002, 68.3314693299,
58 $ 71.4729816036, 74.6145006437, 77.7560256304, 80.8975558711,
59 $ 84.0390907769, 87.1806298436, 90.3221726372, 93.4637187819,
60 $ 96.6052679510, 99.7468198587, 102.888374254, 106.029930916,
61 $ 109.171489649, 112.313050280, 115.454612653, 118.596176630,
62 $ 121.737742088, 124.879308913, 128.020877005, 131.162446275,
63 $ 134.304016638, 137.445588020, 140.587160352, 143.728733573,
64 $ 146.870307625, 150.011882457, 153.153458019, 156.295034268 /
66 REAL AWORK((JMAX+1)/2,((JMAX+1)/2)),BWORK(((JMAX+1)/2))
67 INTEGER:: JHE,JHO,INFO
68 INTEGER IPVT((JMAX+1)/2)
69 parameter(pi=3.14159265358979,c=(1.-(2./pi)**2)*0.25)
75 r=1./sqrt((jmax+0.5)**2+c)
80 slatd(j)=cos((bz(jz)+(j-jz)*pi)*r)
83 DO WHILE(spmax.GT.eps)
93 pk(j)=((2*n-1)*slatd(j)*pkm1(j)-(n-1)*pkm2(j))/n
97 sp=pk(j)*(1.-slatd(j)**2)/(jmax*(pkm1(j)-slatd(j)*pk(j)))
99 spmax=max(spmax,abs(sp))
104 slat(j)=real(slatd(j))
105 wlat(j)=real((2.*(1.-slatd(j)**2))/(jmax*pkm1(j))**2)
106 slat(jmax+1-j)=-slat(j)
107 wlat(jmax+1-j)=wlat(j)
113 wlat(jhe)=wlat(jhe)*n**2/(n-1)**2
118 ELSEIF(idrt.EQ.0)
THEN
125 slat(j)=cos((j-1)*dlt)
129 awork(js,j)=cos(2*(js-1)*j*dlt)
133 bwork(js)=-d1/(4*(js-1)**2-1)
138 CALL sgetrf(jho, jho, awork, jhe, ipvt, info)
139 CALL sgetrs(
'N', jho, 1, awork, jhe, ipvt, bwork, jho, info)
141 CALL dgetrf(jho, jho, awork, jhe, ipvt, info)
142 CALL dgetrs(
'N', jho, 1, awork, jhe, ipvt, bwork, jho, info)
151 print *, j, jmax, jmax+1-j
152 slat(jmax+1-j)=-slat(j)
153 wlat(jmax+1-j)=wlat(j)
157 wlat(jhe)=2.*wlat(jhe)
161 ELSEIF(idrt.EQ.256)
THEN
168 slat(j)=cos((j-0.5)*dlt)
172 awork(js,j)=cos(2*(js-1)*(j-0.5)*dlt)
176 bwork(js)=-d1/(4*(js-1)**2-1)
181 CALL sgetrf(jho, jho, awork, jhe, ipvt, info)
182 CALL sgetrs(
'N', jho, 1, awork, jhe, ipvt, bwork, jho, info)
184 CALL dgetrf(jho, jho, awork, jhe, ipvt, info)
185 CALL dgetrs(
'N', jho, 1, awork, jhe, ipvt, bwork, jho, info)
194 slat(jmax+1-j)=-slat(j)
195 wlat(jmax+1-j)=wlat(j)
199 wlat(jhe)=2.*wlat(jhe)
subroutine splat(IDRT, JMAX, SLAT, WLAT)
Computes cosines of colatitude and Gaussian weights for one of the following specific global sets of ...