28 #include "../base/base_uses.f90"
33 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cg_test'
43 INTEGER,
PARAMETER :: l = 7
45 COMPLEX(KIND=dp),
ALLOCATABLE,
DIMENSION(:) :: a1, a2, a3
46 INTEGER :: il, iw, l1, l2, ll, lp, m1, m2, mm, mp, &
48 REAL(kind=
dp) :: ca, cga(10), cn, rga(10, 21), tend, &
50 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: b1, b2, b3, wa
56 WRITE (iw,
'(/,A,/)')
" Test of Clebsch-Gordon Coefficients"
57 WRITE (iw,
'(T40,A,T77,I4)')
" Maximum l value tested:", l
64 ALLOCATE (a1(na), a2(na), a3(na))
65 ALLOCATE (b1(na), b2(na), b3(na))
73 WRITE (iw,
'(T30,A,T71,F10.3)')
" Time for Clebsch-Gordon Table [s] ", tend
74 lp = (l**4 + 6*l**3 + 15*l**2 + 18*l + 8)/8
76 WRITE (iw,
'(T30,A,T71,I10)')
" Size of Clebsch-Gordon Table ", lp
77 WRITE (iw,
'(/,A)')
" Start Test for Complex Spherical Harmonics "
85 CALL clebsch_gordon(l1, m1, l2, m2, cga)
86 DO lp = mod(l1 + l2, 2), l1 + l2, 2
88 IF (lp < abs(mp)) cycle
90 cn = real(sum(a1*a2*conjg(a3)*wa), kind=
dp)
93 IF (abs(ca - cn) > 1.e-10_dp)
THEN
94 WRITE (*,
'(A,3I5,A,F20.12)')
" l ", l1, l2, lp,
" A ", ca
95 WRITE (*,
'(A,3I5,A,F20.12)')
" m ", m1, m2, mp,
" N ", cn
102 WRITE (iw,
'(A,i2,A)')
" Test for l = ", l1,
" done"
105 WRITE (iw,
'(/,A)')
" Start Test for Real Spherical Harmonics "
112 CALL clebsch_gordon(l1, m1, l2, m2, rga)
115 IF (m1*m2 < 0 .OR. (m1*m2 == 0 .AND. (m1 < 0 .OR. m2 < 0)))
THEN
122 DO lp = mod(l1 + l2, 2), l1 + l2, 2
123 IF (abs(mp) <= lp)
THEN
125 cn = sum(b1*b2*b3*wa)
128 IF (abs(ca - cn) > 1.e-10_dp)
THEN
129 WRITE (*,
'(A,3I5,A,F20.12)')
" l ", l1, l2, lp,
" A ", ca
130 WRITE (*,
'(A,3I5,A,F20.12)')
" m ", m1, m2, mp,
" N ", cn
134 IF (mp /= mm .AND. abs(mm) <= lp)
THEN
136 cn = sum(b1*b2*b3*wa)
139 IF (abs(ca - cn) > 1.e-10_dp)
THEN
140 WRITE (*,
'(A,3I5,A,F20.12)')
" l ", l1, l2, lp,
" A ", ca
141 WRITE (*,
'(A,3I5,A,F20.12)')
" m ", m1, m2, mm,
" N ", cn
149 WRITE (iw,
'(A,i2,A)')
" Test for l = ", l1,
" done"
153 DEALLOCATE (a1, a2, a3)
154 DEALLOCATE (b1, b2, b3)
Test of Clebsch-Gordon Coefficients.
subroutine, public clebsch_gordon_test()
...
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
Defines the basic variable types.
integer, parameter, public dp
Generation of the spherical Lebedev grids. All Lebedev grids were generated with a precision of at le...
subroutine, public deallocate_lebedev_grids()
...
type(oh_grid), dimension(nlg), target, public lebedev_grid
integer function, public get_number_of_lebedev_grid(l, n)
Get the number of the Lebedev grid, which has the requested angular momentum quantnum number l or siz...
subroutine, public init_lebedev_grids()
Load the coordinates and weights of the nonredundant Lebedev grid points.
Machine interface based on Fortran 2003 and POSIX.
real(kind=dp) function, public m_walltime()
returns time from a real-time clock, protected against rolling early/easily
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Calculate spherical harmonics.
subroutine, public clebsch_gordon_init(l)
...
subroutine, public clebsch_gordon_deallocate()
...