28 use blas_lapack_gbl,
only: blasint
29 use phys_const_gbl,
only: pi, imu
30 use precisn_gbl,
only: wp
58 character(len=*),
intent(in) :: filename
60 integer,
intent(in) :: irr
61 real(wp),
intent(in) :: ck(:, :), ap(:, :), Etot
63 real(wp),
allocatable :: f(:, :), Ek(:), S(:), C(:), dSdr(:), dCdr(:)
65 integer :: u, j, nfdm, nchan
68 nfdm =
size(moldat % r_points) - 1
69 nchan = moldat % nchan(irr)
72 allocate (f(nchan, 2), ek(nchan), s(nchan), c(nchan), dsdr(nchan), dcdr(nchan))
74 open (newunit = u, file = filename, action =
'write', form =
'formatted')
77 if (.not.
associated(moldat % wmat2(j, irr) % mat))
then
78 print
'(a)',
'Error: wmat2 has not been read from molecular_data'
80 else if (moldat % wmat2(j, irr) % distributed)
then
81 print
'(a)',
'Error: test_outer_expansion not implemented in MPI-IO mode'
84 f = matmul(moldat % wmat2(j, irr) % mat, ck)
85 write (u,
'(*(e25.15))') moldat % r_points(j), transpose(f)
88 ek = etot - moldat % etarg(moldat % ichl(:, irr))
90 do j = 0, nint(moldat % rmatr / dr)
91 r = moldat % rmatr + j*dr
93 write (u,
'(*(e25.15))') r, cmplx(ap(:, 1), ap(:, 2), wp) * (c + imu*s)
130 real(wp),
intent(in) :: r, Ek(:)
131 integer,
intent(in) :: irr, nopen
132 real(wp),
intent(inout) :: S(:), C(:), Sp(:), Cp(:)
133 logical,
optional,
intent(in) :: sqrtknorm
135 real(wp) :: k, kfactor, Z, F, Fp, G, Gp
136 integer :: ichan, nchan, l
138 z = moldat % nz - moldat % nelc
139 nchan = moldat % nchan(irr)
143 do ichan = 1, min(nchan, nopen)
145 k = sqrt(2*abs(ek(ichan)))
146 l = moldat % l2p(ichan, irr)
150 if (
present(sqrtknorm))
then
151 if (.not. sqrtknorm)
then
156 call coul(z, l, ek(ichan), r, f, fp, g, gp)
158 s(ichan) = f * kfactor
159 c(ichan) = g * kfactor
160 sp(ichan) = fp * kfactor
161 cp(ichan) = gp * kfactor
207 integer,
intent(in) :: nopen, irr
208 real(wp),
intent(in) :: Etot
209 real(wp),
intent(in) :: S(:), C(:), Sp(:), Cp(:)
210 real(wp),
intent(inout) :: Kmat(:, :)
212 real(wp),
allocatable :: Amat(:, :)
213 real(wp),
allocatable :: Rmat(:, :)
214 integer(blasint),
allocatable :: ipiv(:)
216 integer(blasint) :: ldk, info, n, nrhs
217 integer :: nstat, nchan, ichan, jchan
219 nchan = moldat % nchan(irr)
220 nstat = moldat % mnp1(irr)
224 allocate (rmat(nchan, nchan))
226 call calculate_r_matrix(nchan, nstat, moldat % wamp(irr) % mat, moldat % eig(1:nstat, irr), etot, rmat)
230 allocate (amat(nchan, nchan), ipiv(nchan))
235 amat(ichan, jchan) = merge(c(jchan),
rzero, ichan == jchan) - rmat(ichan, jchan)*cp(jchan)
241 kmat(ichan, jchan) = rmat(ichan, jchan)*sp(jchan) - merge(s(jchan),
rzero, ichan == jchan)
245 do jchan = nopen + 1, nchan
247 kmat(ichan, jchan) =
rzero
251 n = int(nchan, blasint)
252 nrhs = int(nopen, blasint)
253 ldk = int(
size(kmat, 1), blasint)
255 call blas_dgetrf(n, n, amat, n, ipiv, info)
256 call blas_dgetrs(
'N', n, nrhs, amat, n, ipiv, kmat, ldk, info)
I/O routines used by MULTIDIP.
Routines related to outer region asymptotic channels.
subroutine test_outer_expansion(filename, moldat, irr, ck, ap, Etot)
Evaluate wfn in channels for inside and outside of the R-matrix sphere.
subroutine evaluate_fundamental_solutions(moldat, r, irr, nopen, Ek, S, C, Sp, Cp, sqrtknorm)
Evaluate asymptotic solutions at boundary.
subroutine calculate_k_matrix(moldat, nopen, irr, Etot, S, C, Sp, Cp, Kmat)
Calculate (generalized) K-matrix.
Hard-coded parameters of MULTIDIP.
real(wp), parameter rzero
Special functions and objects used by MULTIDIP.
subroutine coul(Z, l, Ek, r, F, Fp, G, Gp)
Coulomb functions.
subroutine calculate_r_matrix(nchan, nstat, wmat, eig, Etot, Rmat)
Calculate scattering R-matrix.