File: gauntyry.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (56 lines) | stat: -rw-r--r-- 1,493 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
! This file is distributed under the terms of the GNU Lesser General Public
! License. See the file COPYING for license details.

!BOP
! !ROUTINE: gauntyry
! !INTERFACE:
complex(8) function gauntyry(l1,l2,l3,m1,m2,m3)
! !INPUT/OUTPUT PARAMETERS:
!   l1, l2, l3 : angular momentum quantum numbers (in,integer)
!   m1, m2, m3 : magnetic quantum numbers (in,integer)
! !DESCRIPTION:
!   Returns the complex Gaunt-like coefficient given by
!   $\langle Y^{l_1}_{m_1}|R^{l_2}_{m_2}|Y^{l_3}_{m_3}\rangle$, where $Y_{lm}$
!   and $R_{lm}$ are the complex and real spherical harmonics, respectively.
!   Suitable for $l_i$ less than 50. See routine {\tt genrlm}.
!
! !REVISION HISTORY:
!   Created November 2002 (JKD)
!EOP
!BOC
implicit none
! arguments
integer, intent(in) :: l1,l2,l3
integer, intent(in) :: m1,m2,m3
! local variables
! real constant sqrt(2)/2
real(8), parameter :: c1=0.7071067811865475244d0
real(8) t1,t2
! external functions
real(8) gaunt
external gaunt
if (m2.gt.0) then
  if (mod(m2,2).eq.0) then
    t1=1.d0
  else
    t1=-1.d0
  end if
  t2=c1*(gaunt(l1,l2,l3,m1,m2,m3)+t1*gaunt(l1,l2,l3,m1,-m2,m3))
  gauntyry=cmplx(t2,0.d0,8)
else if (m2.lt.0) then
  if (mod(m2,2).eq.0) then
    t1=1.d0
  else
    t1=-1.d0
  end if
  t2=c1*(gaunt(l1,l2,l3,m1,m2,m3)-t1*gaunt(l1,l2,l3,m1,-m2,m3))
  gauntyry=cmplx(0.d0,-t2,8)
else
  gauntyry=cmplx(gaunt(l1,l2,l3,m1,m2,m3),0.d0,8)
end if
return
end function
!EOC