The Elk Code
Loading...
Searching...
No Matches
potefieldu.f90
Go to the documentation of this file.
1
2
! Copyright (C) 2019 T. Mueller, 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
subroutine
potefieldu
7
use
modmain
8
use
modulr
9
implicit none
10
! local variables
11
integer
ir
12
real
(8) v0,v(3)
13
! allocatable arrays
14
real
(8),
allocatable
:: rfft(:)
15
if
(sum(abs(
efieldcu
(:))) <
epslat
)
return
16
allocate
(rfft(
nqpt
))
17
! constant added to potential so that it is zero at the ultracell center
18
v(:)=0.5d0*(
avecu
(:,1)+
avecu
(:,2)+
avecu
(:,3))
19
v0=dot_product(
efieldcu
(:),v(:))
20
! calculate the potential in real-space
21
do
ir=1,
nqpt
22
rfft(ir)=v0-dot_product(
efieldcu
(:),
vrcu
(:,ir))
23
end do
24
! Fourier transform to Q-space
25
call
rzfftifc
(3,
ngridq
,-1,rfft,
vclq
)
26
deallocate
(rfft)
27
end subroutine
28
modmain
Definition
modmain.f90:6
modmain::nqpt
integer nqpt
Definition
modmain.f90:525
modmain::epslat
real(8) epslat
Definition
modmain.f90:24
modmain::ngridq
integer, dimension(3) ngridq
Definition
modmain.f90:515
modulr
Definition
modulr.f90:6
modulr::vclq
complex(8), dimension(:), allocatable vclq
Definition
modulr.f90:65
modulr::vrcu
real(8), dimension(:,:), allocatable vrcu
Definition
modulr.f90:26
modulr::avecu
real(8), dimension(3, 3) avecu
Definition
modulr.f90:12
modulr::efieldcu
real(8), dimension(3) efieldcu
Definition
modulr.f90:76
potefieldu
subroutine potefieldu
Definition
potefieldu.f90:7
rzfftifc
subroutine rzfftifc(nd, n, sgn, r, z)
Definition
zfftifc_fftw.f90:32
potefieldu.f90
Generated by
1.9.8