61 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(OUT), &
63 INTEGER,
INTENT(IN) :: maxl1, maxl2, llmax
64 INTEGER,
DIMENSION(:, :, :),
INTENT(OUT), &
65 OPTIONAL,
POINTER :: cg_none0_list
66 INTEGER,
DIMENSION(:, :),
INTENT(OUT),
OPTIONAL, &
69 CHARACTER(len=*),
PARAMETER :: routinen =
'real_gaunt_coefficients'
71 INTEGER :: handle, ilist, im, iso, iso1, iso2, l1, &
72 l2, lp, m1, m2, mp(4), nlist, &
73 nlist_max, nsfunc, nsfunc1, nsfunc2
76 CALL timeset(routinen, handle)
86 ALLOCATE (my_cg(nsfunc1, nsfunc2, nsfunc))
105 DO lp = mod(l1 + l2, 2), min(l1 + l2, llmax), 2
107 IF (abs(mp(im)) > lp) cycle
108 iso =
nsoset(lp - 1) + lp + 1 + mp(im)
109 my_cg(iso1, iso2, iso) =
real_gaunt(l1, m1, l2, m2, lp, mp(im))
115 do_list =
PRESENT(cg_none0_list) .OR.
PRESENT(ncg_none0)
117 cpassert(
PRESENT(cg_none0_list))
118 cpassert(
PRESENT(ncg_none0))
120 ALLOCATE (ncg_none0(nsfunc1, nsfunc2))
121 ALLOCATE (cg_none0_list(nsfunc1, nsfunc2, nlist_max))
128 IF (abs(my_cg(iso1, iso2, ilist)) > cg_eps)
THEN
130 IF (nlist > nlist_max)
THEN
131 CALL reallocate(cg_none0_list, 1, nsfunc1, 1, nsfunc2, 1, nlist)
134 cg_none0_list(iso1, iso2, nlist) = ilist
137 ncg_none0(iso1, iso2) = nlist
142 CALL timestop(handle)
subroutine, public real_gaunt_coefficients(my_cg, maxl1, maxl2, llmax, cg_none0_list, ncg_none0)
Calculate the expansion of the product of two real spherical harmonics in real spherical harmonics,...
real(kind=dp) function, public real_gaunt(l1, m1, l2, m2, l3, m3)
Gaunt coefficient of three real spherical harmonics, int S(l1,m1) S(l2,m2) S(l3,m3) dOmega.