52 subroutine calca(A,Auv,m02,rmax,Aerr)
54 integer,
intent(in) :: rmax
55 double complex,
intent(in) :: m02
56 double complex,
intent(out) :: A(0:rmax/2), Auv(0:rmax/2)
57 double precision,
optional,
intent(out) :: Aerr(0:rmax)
58 double complex :: A0_coli, mm02, elimminf2_coli
59 double complex :: fac, ccc
62 if(
present(aerr))
then
69 mm02 = elimminf2_coli(m02)
73 auv(n0) = fac*auv(n0-1)
74 a(n0) = fac*(a(n0-1)+ccc)
76 if(
present(aerr))
then
91 subroutine calcb(B,Buv,p10,m02,m12,rmax,id,Berr)
93 integer,
intent(in) :: rmax, id
94 double complex,
intent(in) :: p10,m02,m12
95 double complex,
intent(inout) :: B(0:rmax,0:rmax), Buv(0:rmax,0:rmax)
96 double precision,
optional,
intent(out) :: Berr(0:rmax)
97 double complex,
allocatable :: Baux(:,:), Buvaux(:,:),fct(:)
98 double precision,
allocatable :: Berraux(:)
99 double complex :: x(3)
100 integer :: rank,switch,cnt,n0,n1,r
101 logical :: nocalc,wrica
103 if (use_cache_system)
then
104 if ((ncache.gt.0).and.(ncache.le.ncache_max))
then
112 allocate(fct(2*ncoefsg(rmax,2)+rmax+1))
113 call readcache(fct,2*ncoefsg(rmax,2)+rmax+1,x,3,1,id,2,rank,nocalc,wrica)
124 buv(n0,n1) = fct(cnt)
128 if(
present(berr))
then
129 berr(r) = real(fct(cnt))
136 if(rank.eq.rmax)
then
138 allocate(berraux(0:rank))
139 call calcbred(b,buv,p10,m02,m12,rank,id,berraux)
140 if(
present(berr)) berr=berraux
151 fct(cnt) = buv(n0,n1)
155 fct(cnt) = berraux(r)
158 call writecache(fct,2*ncoefsg(rank,2)+rank+1,id,2,rank)
166 allocate(baux(0:rank,0:rank))
167 allocate(buvaux(0:rank,0:rank))
168 allocate(berraux(0:rank))
170 call calcbred(baux,buvaux,p10,m02,m12,rank,id,berraux)
175 allocate(fct(2*ncoefsg(rank,2)+rank+1))
181 fct(cnt) = baux(n0,n1)
183 fct(cnt) = buvaux(n0,n1)
187 fct(cnt) = berraux(r)
190 call writecache(fct,2*ncoefsg(rank,2)+rank+1,id,2,rank)
194 b(0:rmax,0:rmax) = baux(0:rmax,0:rmax)
195 buv(0:rmax,0:rmax) = buvaux(0:rmax,0:rmax)
196 if(
present(berr))
then
197 berr = berraux(0:rmax)
207 if(
present(berr))
then
208 call calcbred(b,buv,p10,m02,m12,rmax,id,berr)
210 allocate(berraux(0:rmax))
211 call calcbred(b,buv,p10,m02,m12,rmax,id,berraux)
226 subroutine calcbred(B,Buv,p10,m02,m12,rmax,id,Berr)
228 integer,
intent(in) :: rmax, id
229 double complex,
intent(in) :: p10,m02,m12
230 double complex,
intent(inout) :: B(0:rmax,0:rmax), Buv(0:rmax,0:rmax)
231 double precision,
intent(out) :: Berr(0:rmax)
233 double complex :: A(0:rmax-1), Auv(0:rmax-1)
234 double complex :: q2, mm02, mm12, f1
235 double complex :: Bn_coli,elimminf2_coli
236 integer :: rmaxA,n0,n1,r,sgn,k,rid,r0
238 double complex,
parameter :: cd0 = dcmplx(0d0,0d0)
245 b(0,0) = bn_coli(0,p10,m02,m12)
252 buv(0,n1) = sgn/(n1+1d0)
253 b(0,n1) = bn_coli(n1,p10,m02,m12)
260 call elminf2iv_coli(p10,m02,m12,q2,mm02,mm12,finarg)
271 rmaxa = max(rmax-1,0)
274 call calca(a,auv,mm12,2*rmaxa)
277 if (abs(q2)/(abs(q2)+abs(mm02+mm12)).gt.
dprec_coli)
then
284 do n0=max(1,r-rmax),r/2
286 do n1=max(r0-2*n0,0),k
287 buv(n0,n1) = ((-1)**n1*auv(n0-1) + 2*mm02*buv(n0-1,n1) &
288 + f1*buv(n0-1,n1+1))/(2*n0+n1+1)/2
289 b(n0,n1) = ((-1)**n1*a(n0-1) + 2*mm02*b(n0-1,n1) &
290 + f1*b(n0-1,n1+1) + 4*buv(n0,n1))/(2*n0+n1+1)/2
302 do n0=max(1,r-rmax),r/2
304 do n1=max(r0-2*n0,0),k
306 buv(n0,n1) = ((-1)**n1*auv(n0-1) + mm02*buv(n0-1,n1))/(n0+n1+1)/2
307 b(n0,n1) = ((-1)**n1*a(n0-1) + mm02*b(n0-1,n1) &
308 + 2*buv(n0,n1))/(n0+n1+1)/2
324 berr(0) = abs(b(0,0))
326 berr(r) = max(berr(r-1),abs(b(0,r)))
340 subroutine calcdb(DB,DBuv,p10,m02,m12,rmax,id,DBerr)
342 integer,
intent(in) :: rmax, id
343 double complex,
intent(in) :: p10,m02,m12
344 double complex,
intent(inout) :: DB(0:rmax/2,0:rmax), DBuv(0:rmax/2,0:rmax)
345 double precision,
optional,
intent(out) :: DBerr(0:rmax)
346 double precision :: Berr(0:rmax)
347 double complex :: B(0:rmax,0:rmax), Buv(0:rmax,0:rmax)
349 double complex :: A(0:rmax-1), Auv(0:rmax-1)
350 double complex :: q2, mm02, mm12, f1
351 double complex :: DBn_coli,elimminf2_coli
352 integer :: rmaxA,n0,n1,r,sgn,k,rid
354 double complex,
parameter :: cd0 = dcmplx(0d0,0d0)
360 db(0,0) = dbn_coli(0,p10,m02,m12)
362 call calcbred(b,buv,p10,m02,m12,rmax,id,berr)
368 db(0,n1) = dbn_coli(n1,p10,m02,m12)
375 call elminf2iv_coli(p10,m02,m12,q2,mm02,mm12,finarg)
383 if (q2.ne.0d0.or.mm02.ne.0d0.or.mm12.ne.0d0)
then
386 rmaxa = max(rmax-1,0)
389 call calca(a,auv,mm12,2*rmaxa)
394 do n0=max(1,r-rmax),r/2
397 dbuv(n0,n1) = (buv(n0-1,n1+1) + 2*mm02*dbuv(n0-1,n1) &
398 + f1*dbuv(n0-1,n1+1))/(2*n0+n1+1)/2
400 db(n0,n1) = b(n0-1,n1+1) + 4*dbuv(n0,n1)
402 db(n0,n1) = db(n0,n1) + 2*mm02*db(n0-1,n1)
405 db(n0,n1) = db(n0,n1) + f1*db(n0-1,n1+1)
408 db(n0,n1) = db(n0,n1) /(2*(2*n0+n1+1))
420 do n0=max(1,r-rmax),r/2
424 dbuv(n0,n1) = buv(n0-1,n1+1)/(2*n0+n1+1)/2
426 db(n0,n1) = (b(n0-1,n1+1) + 4*dbuv(n0,n1))/(2*n0+n1+1)/2
434 dberr(0) = abs(db(0,0))
436 dberr(r) = max(dberr(r-1),abs(db(0,r)))