The Elk Code
 
Loading...
Searching...
No Matches
lopzflm.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU Lesser General Public
4! License. See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: lopzflm
8! !INTERFACE:
9pure subroutine lopzflm(lmax,zflm,ld,zlflm)
10! !INPUT/OUTPUT PARAMETERS:
11! lmax : maximum angular momentum (in,integer)
12! zflm : coefficients of input spherical harmonic expansion
13! (in,complex((lmax+1)**2))
14! ld : leading dimension (in,integer)
15! zlflm : coefficients of output spherical harmonic expansion
16! (out,complex(ld,3))
17! !DESCRIPTION:
18! Applies the angular momentum operator $\hat{\bf L}$ to a function expanded
19! in terms of complex spherical harmonics. This makes use of the identities
20! \begin{align*}
21! (L_x+iL_y)Y_{lm}(\theta,\phi)&=\sqrt{(l-m)(l+m+1)}Y_{lm+1}(\theta,\phi)\\
22! (L_x-iL_y)Y_{lm}(\theta,\phi)&=\sqrt{(l+m)(l-m+1)}Y_{lm-1}(\theta,\phi)\\
23! L_zY_{lm}(\theta,\phi)&=mY_{lm}(\theta,\phi).
24! \end{align*}
25!
26! !REVISION HISTORY:
27! Created March 2004 (JKD)
28!EOP
29!BOC
30implicit none
31! arguments
32integer, intent(in) :: lmax
33complex(8), intent(in) :: zflm(*)
34integer, intent(in) :: ld
35complex(8), intent(out) :: zlflm(ld,3)
36! local variables
37integer l,m,lm
38real(8) t1
39complex(8), parameter :: zi=(0.d0,1.d0),zmi=(0.d0,-1.d0)
40complex(8) z1
41lm=0
42do l=0,lmax
43 do m=-l,l
44 lm=lm+1
45 if (m == -l) then
46 zlflm(lm,1)=0.d0
47 zlflm(lm,2)=0.d0
48 end if
49 if (m < l) then
50 t1=0.5d0*sqrt(dble((l-m)*(l+m+1)))
51 z1=t1*zflm(lm)
52 zlflm(lm+1,1)=z1
53 zlflm(lm+1,2)=zmi*z1
54 end if
55 if (m > -l) then
56 t1=0.5d0*sqrt(dble((l+m)*(l-m+1)))
57 z1=t1*zflm(lm)
58 zlflm(lm-1,1)=zlflm(lm-1,1)+z1
59 zlflm(lm-1,2)=zlflm(lm-1,2)+zi*z1
60 end if
61 if (m /= 0) then
62 zlflm(lm,3)=dble(m)*zflm(lm)
63 else
64 zlflm(lm,3)=0.d0
65 end if
66 end do
67end do
68end subroutine
69!EOC
70
pure subroutine lopzflm(lmax, zflm, ld, zlflm)
Definition lopzflm.f90:10