The Elk Code
 
Loading...
Searching...
No Matches
readvclr.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
6subroutine readvclr
7use modmain
8use modulr
9implicit none
10! local variables
11integer i1,i2,i3,ir
12integer ngridq_(3),i1_,i2_,i3_
13! automatic arrays
14real(8) vclr(nqpt)
15! read the real-space external Coulomb potential from file
16open(50,file='VCLR.OUT',form='FORMATTED')
17read(50,*) ngridq_(1:3)
18if (any(ngridq(1:3) /= ngridq_(1:3))) then
19 write(*,*)
20 write(*,'("Error(readvclr): differing ngridq")')
21 write(*,'(" current : ",3I6)') ngridq
22 write(*,'(" VCLR.OUT : ",3I6)') ngridq_
23 write(*,*)
24 stop
25end if
26ir=0
27do i3=1,ngridq(3)
28 do i2=1,ngridq(2)
29 do i1=1,ngridq(1)
30 ir=ir+1
31 read(50,*) i1_,i2_,i3_,vclr(ir)
32 if ((i1 /= i1_).or.(i2 /= i2_).or.(i3 /= i3_)) then
33 write(*,*)
34 write(*,'("Error(readvclr): differing i1, i2 or i3")')
35 write(*,'(" current : ",3I6)') i1,i2,i3
36 write(*,'(" VCLR.OUT : ",3I6)') i1_,i2_,i3_
37 write(*,*)
38 stop
39 end if
40 end do
41 end do
42end do
43close(50)
44! Fourier transform external Coulomb potential from real-space to Q-space
45call rzfftifc(3,ngridq,-1,vclr,vclq)
46end subroutine
47
integer, dimension(3) ngridq
Definition modmain.f90:515
complex(8), dimension(:), allocatable vclq
Definition modulr.f90:65
subroutine readvclr
Definition readvclr.f90:7
subroutine rzfftifc(nd, n, sgn, r, z)