The Elk Code
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 
6 subroutine readvclr
7 use modmain
8 use modulr
9 implicit none
10 ! local variables
11 integer i1,i2,i3,ir
12 integer ngridq_(3),i1_,i2_,i3_
13 ! automatic arrays
14 real(8) vclr(nqpt)
15 ! read the real-space external Coulomb potential from file
16 open(50,file='VCLR.OUT',form='FORMATTED')
17 read(50,*) ngridq_(1:3)
18 if (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
25 end if
26 ir=0
27 do 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
42 end do
43 close(50)
44 ! Fourier transform external Coulomb potential from real-space to Q-space
45 call rzfftifc(3,ngridq,-1,vclr,vclq)
46 end subroutine
47 
complex(8), dimension(:), allocatable vclq
Definition: modulr.f90:66
subroutine readvclr
Definition: readvclr.f90:7
integer, dimension(3) ngridq
Definition: modmain.f90:515
subroutine rzfftifc(nd, n, sgn, r, z)
Definition: modulr.f90:6