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),rfmt(*)
12 complex(4), intent(in) :: cfmt(*)
13 ! local variables
14 integer ir,i
15 complex(8) z1,z2
16 ! compute the dot-products for each radial point and integrate over r
17 z1=0.d0
18 i=1
19 if (lmaxi == 1) then
20  do ir=1,nri
21  z1=z1+wr(ir) &
22  *(rfmt(i)*cfmt(i) &
23  +rfmt(i+1)*cfmt(i+1) &
24  +rfmt(i+2)*cfmt(i+2) &
25  +rfmt(i+3)*cfmt(i+3))
26  i=i+4
27  end do
28  z1=pi*z1
29 else
30  do ir=1,nri
31  z1=z1+wr(ir)*dot_product(rfmt(i:i+lmmaxi-1),cfmt(i:i+lmmaxi-1))
32  i=i+lmmaxi
33  end do
34  z1=(fourpi/dble(lmmaxi))*z1
35 end if
36 z2=0.d0
37 do ir=nri+1,nr
38  z2=z2+wr(ir)*dot_product(rfmt(i:i+lmmaxo-1),cfmt(i:i+lmmaxo-1))
39  i=i+lmmaxo
40 end do
41 rcfmtinp=z1+(fourpi/dble(lmmaxo))*z2
42 end function
43 
integer lmmaxo
Definition: modmain.f90:205
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:209
real(8), parameter fourpi
Definition: modmain.f90:1234
integer lmaxi
Definition: modmain.f90:207