The Elk Code
 
Loading...
Searching...
No Matches
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
6pure complex(8) function rcfmtinp(nr,nri,wr,rfmt,cfmt)
7use modmain
8implicit none
9! arguments
10integer, intent(in) :: nr,nri
11real(8), intent(in) :: wr(nr)
12real(8), intent(in) :: rfmt(*)
13complex(4), intent(in) :: cfmt(*)
14! local variables
15integer n,ir,i
16complex(8) z1,z2
17! compute the dot-products for each radial point and integrate over r
18z1=0.d0
19i=1
20if (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
30else
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
37end if
38z2=0.d0
39n=lmmaxo-1
40do ir=nri+1,nr
41 z2=z2+wr(ir)*dot_product(rfmt(i:i+n),cfmt(i:i+n))
42 i=i+lmmaxo
43end do
44rcfmtinp=z1+(fourpi/dble(lmmaxo))*z2
45end function
46
real(8), parameter pi
Definition modmain.f90:1229
integer lmmaxi
Definition modmain.f90:207
real(8), parameter fourpi
Definition modmain.f90:1231
integer lmaxi
Definition modmain.f90:205
integer lmmaxo
Definition modmain.f90:203
pure complex(8) function rcfmtinp(nr, nri, wr, rfmt, cfmt)
Definition rcfmtinp.f90:7