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(lmax
,nr
,r
,ld
,zfmt1
,zfmt2
)
10 ! !INPUT/OUTPUT PARAMETERS:
11 ! lmax : maximum angular momentum
12 ! nr : number of radial mesh points (in,integer)
13 ! r : radial mesh (in,real(nr))
14 ! ld : leading dimension (in,integer)
15 ! zfmt1 : first complex function inside muffin-tin (in,complex(ld,nr))
16 ! zfmt2 : second complex function inside muffin-tin (in,complex(ld,nr))
18 ! Calculates the inner product of two complex fuctions in the muffin-tin. In
19 ! other words, given two complex functions of the form
20 ! $$ f({\bf r})=\sum_{l=0}^{l_{\rm max}}\sum_{m=-l}^{l}f_{lm}(r)Y_{lm}
22 ! the function returns
23 ! $$ I=\sum_{l=0}^{l_{\rm max}}\sum_{m=-l}^{l}\int f_{lm}^{1*}(r)
24 ! f_{lm}^2(r)r^2\,dr\;. $$
27 ! Created November 2003 (Sharma)
32 integer, intent(in
) :: lmax
33 integer, intent(in
) :: nr
34 real(8), intent(in
) :: r(nr
)
35 integer, intent(in
) :: ld
36 complex(8), intent(in
) :: zfmt1(ld
,nr
)
37 complex(8), intent(in
) :: zfmt2(ld
,nr
)
43 real(8) fr1(nr
),fr2(nr
),gr(nr
),cf(3,nr
)
49 write(*,'("Error(zfmtinp): lmax < 0 : ",I8)') lmax
56 zt1
=zdotc(lmmax
,zfmt1(1,ir
),1,zfmt2(1,ir
),1)
60 call fderiv(-1,nr
,r
,fr1
,gr
,cf
)
62 call fderiv(-1,nr
,r
,fr2
,gr
,cf
)
64 zfmtinp
=cmplx(t1
,t2
,8)