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,J0=0
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))
105 wlat(j)=(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)
136 call ludcmp(awork,jho,jhe,ipvt)
137 call lubksb(awork,jho,jhe,ipvt,bwork)
145 print *, j, jmax, jmax+1-j
146 slat(jmax+1-j)=-slat(j)
147 wlat(jmax+1-j)=wlat(j)
151 wlat(jhe)=2.*wlat(jhe)
155 ELSEIF(idrt.EQ.256)
THEN
162 slat(j)=cos((j-0.5)*dlt)
166 awork(js,j)=cos(2*(js-1)*(j-0.5)*dlt)
170 bwork(js)=-d1/(4*(js-1)**2-1)
173 call ludcmp(awork,jho,jhe,ipvt,d)
174 call lubksb(awork,jho,jhe,ipvt,bwork)
182 slat(jmax+1-j)=-slat(j)
183 wlat(jmax+1-j)=wlat(j)
187 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 ...