The Elk Code
getevalsv.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2007 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
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 getevalsv(fext,ikp,vpl,evalsv_)
7 use modmain
8 implicit none
9 ! arguments
10 character(*), intent(in) :: fext
11 integer, intent(in) :: ikp
12 real(8), intent(in) :: vpl(3)
13 real(8), intent(out) :: evalsv_(nstsv)
14 ! local variables
15 integer isym,ik,recl,nstsv_
16 real(8) vkl_(3),t1
17 if (ikp > 0) then
18  ik=ikp
19 else
20 ! find the k-point number
21  call findkpt(vpl,isym,ik)
22 end if
23 ! find the record length
24 inquire(iolength=recl) vkl_,nstsv_,evalsv_
25 !$OMP CRITICAL(u204)
26 open(204,file='EVALSV'//trim(fext),form='UNFORMATTED',access='DIRECT',recl=recl)
27 read(204,rec=ik) vkl_,nstsv_,evalsv_
28 close(204)
29 !$OMP END CRITICAL(u204)
30 t1=abs(vkl(1,ik)-vkl_(1))+abs(vkl(2,ik)-vkl_(2))+abs(vkl(3,ik)-vkl_(3))
31 if (t1 > epslat) then
32  write(*,*)
33  write(*,'("Error(getevalsv): differing vectors for k-point ",I0)') ik
34  write(*,'(" current : ",3G18.10)') vkl(:,ik)
35  write(*,'(" EVALSV.OUT : ",3G18.10)') vkl_
36  write(*,*)
37  stop
38 end if
39 if (nstsv /= nstsv_) then
40  write(*,*)
41  write(*,'("Error(getevalsv): differing nstsv for k-point ",I0)') ik
42  write(*,'(" current : ",I0)') nstsv
43  write(*,'(" EVALSV.OUT : ",I0)') nstsv_
44  write(*,*)
45  stop
46 end if
47 ! apply scissor correction if required
48 if (tscissor) then
49  where (evalsv_(:) > efermi) evalsv_(:)=evalsv_(:)+scissor
50 end if
51 end subroutine
52 
real(8) efermi
Definition: modmain.f90:903
real(8) scissor
Definition: modmain.f90:907
logical tscissor
Definition: modmain.f90:905
subroutine getevalsv(fext, ikp, vpl, evalsv_)
Definition: getevalsv.f90:7
real(8), dimension(:,:), allocatable vkl
Definition: modmain.f90:474
real(8) epslat
Definition: modmain.f90:24
subroutine findkpt(vpl, isym, ik)
Definition: findkpt.f90:7