The Elk Code
rcfmtinp.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2014 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 pure complex(8) function rcfmtinp(nr,nri,wr,rfmt,cfmt)
7 use modmain
8 implicit none
9 ! arguments
10 integer, intent(in) :: nr,nri
11 real(8), intent(in) :: wr(nr)
12 real(8), intent(in) :: rfmt(*)
13 complex(4), intent(in) :: cfmt(*)
14 ! local variables
15 integer n,ir,i
16 complex(8) z1,z2
17 ! compute the dot-products for each radial point and integrate over r
18 z1=0.d0
19 i=1
20 if (lmaxi == 1) then
21  do ir=1,nri
22  z1=z1+wr(ir) &
23  *(rfmt(i)*cfmt(i) &
24  +rfmt(i+1)*cfmt(i+1) &
25  +rfmt(i+2)*cfmt(i+2) &
26  +rfmt(i+3)*cfmt(i+3))
27  i=i+4
28  end do
29  z1=pi*z1
30 else
31  n=lmmaxi-1
32  do ir=1,nri
33  z1=z1+wr(ir)*dot_product(rfmt(i:i+n),cfmt(i:i+n))
34  i=i+lmmaxi
35  end do
36  z1=(fourpi/dble(lmmaxi))*z1
37 end if
38 z2=0.d0
39 n=lmmaxo-1
40 do ir=nri+1,nr
41  z2=z2+wr(ir)*dot_product(rfmt(i:i+n),cfmt(i:i+n))
42  i=i+lmmaxo
43 end do
44 rcfmtinp=z1+(fourpi/dble(lmmaxo))*z2
45 end function
46 
integer lmmaxo
Definition: modmain.f90:203
pure complex(8) function rcfmtinp(nr, nri, wr, rfmt, cfmt)
Definition: rcfmtinp.f90:7
real(8), parameter pi
Definition: modmain.f90:1232
integer lmmaxi
Definition: modmain.f90:207
real(8), parameter fourpi
Definition: modmain.f90:1234
integer lmaxi
Definition: modmain.f90:205