31 use phys_const_gbl,
only: pi, imu
32 use precisn_gbl,
only: wp
69 integer,
intent(in) :: n, m(0:n-1), s(0:2*n-1)
70 real(wp),
intent(in) :: a, c
71 complex(wp),
intent(in) :: k(0:2*n-1)
75 complex(wp) :: i(0:n*(npp+1)), f(0:n*(npp+1)-1), fg(0:n*(npp+1)-1), g(0:(n+1)*(npp+1)-1), j(0:n*(npp+1)-1)
76 complex(wp) :: t(0:npp, 0:n*(npp + 1)-1)
78 real(wp) :: b(0:n*(npp+1)-1, 0:n*(npp+1))
81 integer :: o, p, q, lvl
104 do p = lbound(b, 1), ubound(b, 1)
107 b(p, q) = b(p - 1, q - 1) + b(p - 1, q)
131 do p = 1, (n - lvl)*(npp + 1) - 1
132 f(p) = (m(lvl) + 1 - p) * f(p - 1) / a
138 do p = 0, (n - lvl)*(npp + 1) - 1
141 fg(p) = fg(p) + b(p,q) * f(p - q) * i(q)
151 u = u + s(2*lvl+1)*k(2*lvl+1) + s(2*lvl+0)*k(2*lvl+0) + imu*c
152 v = v + s(2*lvl+1)/abs(k(2*lvl+1)) + s(2*lvl+0)/abs(k(2*lvl+0))
154 g(0) = imu*a / (u*a + v)
155 g(1) = imu*v / ((u*a + v)*(u*a + v))
157 do p = 2, (n - lvl + 1)*(npp + 1) - 1
158 g(p) = g(p - 1) * (-p) * u / (u*a + v)
164 do p = 0, (n - lvl)*(npp + 1) - 1
169 do p = 0, (n - lvl)*(npp + 1) - o - 1
172 t(o, p) = t(o, p) + b(p + 1, q) * g(p + 1 - q) * t(o - 1, q)
179 do p = 0, (n - lvl - 1)*(npp + 1)
182 j(p) = j(p) + t(o, p)
188 do p = 0, (n - lvl - 1)*(npp + 1)
191 i(p) = i(p) + b(p, q) * g(p - q) * j(q)
228 integer,
intent(in) :: n, m(1:n), s(1:2*n), l(1:2*n)
229 real(wp),
intent(in) :: a, c
230 complex(wp),
intent(in) :: k(1:2*n)
232 integer :: nn(2*n), ms(n), p
233 complex(wp) :: an(2*n), bn(2*n), factor(2*n)
236 real(wp) :: total_phase, total_exponent, kr, ki
237 complex(wp) :: integ, err
247 an(p) = 1 + l(p) - s(p)*imu/k(p)
248 bn(p) = -l(p) - s(p)*imu/k(p)
252 do while (.not. at_end)
256 ms(p) = m(p) - nn(2*p-1) - nn(2*p-0)
264 integ = integ * factor(p)
278 factor(p) = factor(p) * (an(p) + nn(p) - 1) * (bn(p) + nn(p) - 1) / (2 * imu * s(p) * nn(p) * k(p))
294 total_phase = total_phase + s(p)*(kr*a + log(2*kr*a)/kr - pi*l(p)/2 +
cphase(l(p), kr))
297 total_exponent = total_exponent + s(p)*(-ki*a + log(2*ki*a)/ki)
302 val = val * cmplx(cos(total_phase), sin(total_phase), wp) * exp(total_exponent - n*c*a)
334 integer,
intent(in) :: n, sa, sb, m(:), l(:)
335 real(wp),
intent(in) :: a, c
336 complex(wp),
intent(in) :: k(:)
339 integer :: order(n), mp(n), lp(2*n), sp(2*n), p, signs
340 complex(wp) :: kp(2*n), err, integ
357 do signs = 0, 2**(n - 1) - 1
384 if (order(p) > 1) sp(2*p - 1) = merge(merge(-1, +1, btest(signs, order(p) - 2)), +1, acc(order(p) - 1))
385 if (order(p) < n) sp(2*p - 0) = merge(merge(-1, +1, btest(signs, order(p) - 1)), +1, acc(order(p) + 1))
387 acc(order(p)) = .true.
389 kp(2*p - 1) = k(order(p) - 0)
390 kp(2*p - 0) = k(order(p) + 1)
392 lp(2*p - 1) = l(order(p) - 0)
393 lp(2*p - 0) = l(order(p) + 1)
409 val = val * imu / k(p)
complex(wp) function nested_exp_integ(a, c, N, m, s, k)
Multi-dimensional triangular integral of exponentials and powers.
complex(wp) function nested_coul_integ(a, c, N, m, s, l, k)
Multi-dimensional triangular integral of Coulomb-Hankel functions and powers.
integer, parameter ntermsppt
Number of terms in expansion of the exponential integral.
subroutine kahan_add(X, dX, err)
Compensated summation.
logical function next_permutation(p)
Construct or advance permutation.
real(wp) function cphase(l, k)
Coulomb phase.
Hard-coded parameters of MULTIDIP.
Special integrals needed by MULTIDIP.
Special functions and objects used by MULTIDIP.
complex(wp) function nested_cgreen_integ(a, c, N, sa, sb, m, l, k)
Multi-dimensional integral of Coulomb-Hankel and Coulomb-Green functions and powers.
integer, parameter ntermsasy
Number of terms in expansion of the Coulomb-Hankel functions.