14 REAL(rprec),
PARAMETER :: p25 =
p5*
p5
15 REAL(rprec),
PARAMETER :: bigno = 1.e50_dp
16 REAL(rprec),
PARAMETER :: epstan = epsilon(one)
18 INTEGER :: kp, ku, kuminus, kv, kvminus, i, m, n, mn, &
19 imn, jmn, kmn, l, istat1, smn
20 REAL(rprec),
DIMENSION(0:mf + nf,0:mf,0:nf) :: cmn
21 REAL(rprec) :: argu, argv, argp, dn1, f1, f2, f3, alp_per
38 cosper(kp) = cos(alp_per*(kp - 1))
39 sinper(kp) = sin(alp_per*(kp - 1))
46 kuminus = mod(nu - (ku-1), nu) + 1
48 kvminus = mod(nv - (kv-1), nv) + 1
51 imirr(i) = kvminus + nv*(kuminus - 1)
53 cosuv(i) = cos(
alvp*(kv - 1))
54 sinuv(i) = sin(
alvp*(kv - 1))
67 argp =
p5*alp_per*(kp-1)
68 IF (abs(argp - p25*
pi2) < epstan)
THEN
71 tanv_1d(kp) = 2*tan(argp)
77 argv =
p5*
alv*(kv - 1)
78 IF (abs(argv - p25*
pi2) < epstan)
THEN
81 tanv_1d(kv) = 2*tan(argv)
87 argu =
p5*
alu*(ku - 1)
88 IF (abs(argu - p25*
pi2)<epstan .or. abs(argu - 0.75_dp*
pi2) < epstan)
THEN
91 tanu_1d(ku) = 2*tan(argu)
97 IF (kp.gt.1 .and. nv.ne.1)
EXIT
98 argp =
p5*alp_per*(kp-1)
100 argu =
p5*
alu*(ku - 1)
103 argv =
p5*
alv*(kv - 1) + argp
105 IF (abs(argu - p25*
pi2)<epstan .or. abs(argu - 0.75_dp*
pi2) < epstan)
THEN
108 tanu(i) = 2*tan(argu)
111 IF (abs(argv - p25*
pi2) < epstan)
THEN
114 tanv(i) = 2*tan(argv)
125 cosu(m,ku) = cos(
alu*(m*(ku - 1)))
126 sinu(m,ku) = sin(
alu*(m*(ku - 1)))
135 cosu1(i,m) = cosu(m,ku)
136 sinu1(i,m) = sinu(m,ku)
140 cosui(m,ku) = cosu(m,ku)*
alu*
alv*2
141 sinui(m,ku) = sinu(m,ku)*
alu*
alv*2
142 IF (ku.eq.1 .or. ku.eq.nu2)
then
145 cosui(m,ku) =
p5*cosui(m,ku)
157 csign(n) = sign(one,dn1)
161 cosv(n,kv) = cos(dn1*(kv - 1))
162 sinv(n,kv) = sin(dn1*(kv - 1))
163 IF (i.gt.nuv2 .or. n.lt.0)
then
169 cosv1(i,n) = cosv(n,kv)
170 sinv1(i,n) = sinv(n,kv)
209 f1 = f1*(smn + 1 - i)
214 cmn(l,m,n) = f1/(f2*f3)*((-1)**((l - imn)/2))
215 f1 = f1*p25*((jmn + l + 2)*(jmn - l))
216 f2 = f2*
p5*(l + 2 + kmn)
217 f3 = f3*
p5*(l + 2 - kmn)
227 cmns(0:mf+nf,m,n) =
p5*
alp*( cmn(0:mf+nf,m,n ) + cmn(0:mf+nf,m-1,n ) &
228 + cmn(0:mf+nf,m,n-1) + cmn(0:mf+nf,m-1,n-1))
231 cmns(0:mf+nf,1:mf,0) = (
p5*
alp)*(cmn(0:mf+nf,1:mf,0) + cmn(0:mf+nf,:mf-1,0))
232 cmns(0:mf+nf,0,1:nf) = (
p5*
alp)*(cmn(0:mf+nf,0,1:nf) + cmn(0:mf+nf,0,:nf-1))
233 cmns(0:mf+nf,0,0) = (
p5*
alp)*(cmn(0:mf+nf,0,0) + cmn(0:mf+nf,0,0))
239 call add_int(
"nvper", nvper)
240 call add_int(
"nuv_tan", nuv_tan)
242 call add_real_1d(
"cosper", nvper, cosper)
243 call add_real_1d(
"sinper", nvper, sinper)
245 call add_real_1d(
"tanu_1d", 2*nu, tanu_1d)
246 call add_real_1d(
"tanv_1d", nuv_tan/(2*nu), tanv_1d)
248 call add_real_2d(
"tanu", 2*nu, nuv_tan/(2*nu), tanu)
249 call add_real_2d(
"tanv", 2*nu, nuv_tan/(2*nu), tanv)
251 call add_real_3d(
"cmns", mf+nf+1, mf+1, nf+1, cmns)
integer num_eqsolve_retries