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.
9 complex(8) function zfmtinp(tsh
,lmax
,nr
,r
,ld
,zfmt1
,zfmt2
)
10 ! !INPUT/OUTPUT PARAMETERS:
11 ! tsh : .true. if the functions are in spherical harmonics (in,logical)
12 ! lmax : maximum angular momentum
13 ! nr : number of radial mesh points (in,integer)
14 ! r : radial mesh (in,real(nr))
15 ! ld : leading dimension (in,integer)
16 ! zfmt1 : first complex muffin-tin function in spherical harmonics/
17 ! coordinates (in,complex(ld,nr))
18 ! zfmt2 : second complex muffin-tin function in spherical harmonics/
19 ! coordinates (in,complex(ld,nr))
21 ! Calculates the inner product of two complex fuctions in the muffin-tin. In
22 ! other words, given two complex functions of the form
23 ! $$ f({\bf r})=\sum_{l=0}^{l_{\rm max}}\sum_{m=-l}^{l}f_{lm}(r)Y_{lm}
25 ! the function returns
26 ! $$ I=\sum_{l=0}^{l_{\rm max}}\sum_{m=-l}^{l}\int f_{lm}^{1*}(r)
27 ! f_{lm}^2(r)r^2\,dr\;. $$
28 ! Note that if {\tt tsh} is {\tt .false.} the functions are in spherical
29 ! coordinates rather than spherical harmonics. In this case $I$ is multiplied
30 ! by $4\pi/(l_{\rm max}+1)^2$.
33 ! Created November 2003 (Sharma)
38 logical, intent(in
) :: tsh
39 integer, intent(in
) :: lmax
40 integer, intent(in
) :: nr
41 real(8), intent(in
) :: r(nr
)
42 integer, intent(in
) :: ld
43 complex(8), intent(in
) :: zfmt1(ld
,nr
)
44 complex(8), intent(in
) :: zfmt2(ld
,nr
)
47 real(8), parameter :: fourpi
=12.566370614359172954d0
51 real(8) fr1(nr
),fr2(nr
),gr(nr
),cf(3,nr
)
58 zt1
=zdotc(lmmax
,zfmt1(:,ir
),1,zfmt2(:,ir
),1)
62 call fderiv(-1,nr
,r
,fr1
,gr
,cf
)
64 call fderiv(-1,nr
,r
,fr2
,gr
,cf
)
66 zfmtinp
=cmplx(t1
,t2
,8)
67 if (.not
.tsh
) zfmtinp
=zfmtinp
*fourpi
/dble(lmmax
)