1
* ***************************
3
* * nwpw_factorial_init *
5
* ***************************
7
subroutine nwpw_factorial_init()
11
* **** Factorial common block ****
14
real*8 factorial(0:FMAX)
15
common / FACTORIAL_Block / factorial
17
* **** local variables ****
25
factorial(n) = x*factorial(n-1)
31
* ***************************
35
* ***************************
37
* Computes the Clebsch-Gordon coefficients using Racah's formula.
40
real*8 function nwpw_clebsch(l1,l2,l,m1,m2,m)
46
* **** Factorial common block ****
49
real*8 factorial(0:FMAX)
50
common / FACTORIAL_Block / factorial
52
* **** local variables ****
56
* **************************************
57
* **** check the triangle condition ****
58
* **************************************
60
* *** a zero Clebsch-Gordon coefficient ***
61
if ( ((m1+m2).ne.m) .OR.
62
> (abs(m1).gt.abs(l1)).OR.
63
> (abs(m2).gt.abs(l2)).OR.
64
> (abs(m) .gt.abs(l) ).OR.
66
> (l.lt.abs(l1-l2)) .OR.
67
> (mod((l1+l2+l),2).ne. 0) ) then
70
* *** a non-zero Clebsch-Gordon coeffient ****
73
if ((l-l2+m1) .lt.0) zmin = -l + l2 - m1
74
if ((l-l1-m2+zmin).lt.0) zmin = -l + l1 + m2
76
if ((l2+m2-zmax).lt.0) zmax = l2 + m2
77
if ((l1-m1-zmax).lt.0) zmax = l1 - m1
82
if (mod(z,2).ne.0) sign = -1.0d0
85
> / ( factorial( (z) )
86
> * factorial( (l1+l2-l-z) )
87
> * factorial( (l1-m1-z) )
88
> * factorial( (l2+m2-z) )
89
> * factorial( (l-l2+m1+z) )
90
> * factorial( (l-l1-m2+z) ))
92
tmp2 = dsqrt( dble(2*l+1) * factorial( (l1+l2-l) )
93
> * factorial( (l1-l2+l) )
94
> * factorial( (-l1+l2+l) )
95
> * factorial( (l1+m1) )
96
> * factorial( (l1-m1) )
97
> * factorial( (l2+m2) )
98
> * factorial( (l2-m2) )
99
> * factorial( (l+m) )
100
> * factorial( (l-m) )
101
> / factorial( (l1+l2+l+1) )
111
* ***************************
115
* ***************************
117
* Computes the Gaunt coefficient
119
* Gaunt(l,m,l1,m1,l2,m2) =
123
* = | | dconjg(Y_lm(theta,phi)) * Y_l1m1(theta,phi) * dconjg(Y_l2m2(theta,phi)) sin(theta) dtheta dphi
129
* = | | Y_lm(theta,phi) * dconjg(Y_l1m1(theta,phi)) * Y_l2m2(theta,phi) sin(theta) dtheta dphi
134
* = sqrt( (2*l+1)*(2*l2+1)/(4*pi*(2*l1+1)) ) * Clebsch(l l2 l1; m m2 m1) * Clebsch(l l2 l1; 0 0 0)
138
real*8 function nwpw_Gaunt(l,m,l1,m1,l2,m2)
144
* **** local variables ****
148
* **** external functions ***
153
* *** a zero Gaunt coefficient ***
154
if ( ((m+m2).ne.m1) .OR.
155
> (abs(m1).gt.abs(l1)).OR.
156
> (abs(m2).gt.abs(l2)).OR.
157
> (abs(m) .gt.abs(l) ).OR.
158
> (l1.gt.(l+l2)) .OR.
159
> (l1.lt.abs(l-l2)) .OR.
160
> (mod((l1+l2+l),2).ne. 0 )) then
163
* *** a non-zero Gaunt Coefficient ***
166
fourpi = 16.0d0*datan(1.0d0)
167
coeff = dsqrt( dble((2*l+1)*(2*l2+1))/(fourpi*dble(2*l1+1)))
168
tmp = coeff*Clebsch(l,l2,l1, m,m2,m1)
169
> *Clebsch(l,l2,l1, 0,0, 0)
177
* ***************************
181
* ***************************
183
* Computes the Taunt coefficient
185
* Taunt(l,m,l1,m1,l2,m2) =
189
* = | | T_lm(theta,phi)) * T_l1m1(theta,phi) * T_l2m2(theta,phi)) sin(theta) dtheta dphi
194
* = sqrt( (2*l+1)*(2*l2+1)/(2*pi*(2*l1+1)) ) * Clebsch(l l2 l1; m m2 m1) * Clebsch(l l2 l1; 0 0 0)
198
real*8 function nwpw_Taunt(l,m,l1,m1,l2,m2)
204
* **** local variables ****
208
* **** external functions ***
213
* *** a zero Taunt coefficient ***
214
if ( ((m+m2).ne.m1) .OR.
215
> (abs(m1).gt.abs(l1)).OR.
216
> (abs(m2).gt.abs(l2)).OR.
217
> (abs(m) .gt.abs(l) ).OR.
218
> (l1.gt.(l+l2)) .OR.
219
> (l1.lt.abs(l-l2)) .OR.
220
> (mod((l1+l2+l),2).ne. 0 )) then
223
* *** a non-zero Taunt Coefficient ***
226
twopi = 8.0d0*datan(1.0d0)
227
coeff = dsqrt( dble((2*l+1)*(2*l2+1))/(twopi*dble(2*l1+1)))
228
tmp = coeff*Clebsch(l,l2,l1, m,m2,m1)
229
> *Clebsch(l,l2,l1, 0,0, 0)