The Elk Code
 
Loading...
Searching...
No Matches
getkmat.f90
Go to the documentation of this file.
1
2! Copyright (C) 2007-2010 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 getkmat(ik,kmat)
7use modmain
9implicit none
10! arguments
11integer, intent(in) :: ik
12complex(8), intent(out) :: kmat(nstsv,nstsv)
13! local variables
14logical tgs
15integer nstsv_,recl
16real(8) vkl_(3),t1
17!$OMP CRITICAL(u220)
18! read from RAM disk if required
19if (ramdisk) then
20 call getrd('KMAT.OUT',ik,tgs,v1=vkl_,n1=nstsv_,nzv=nstsv*nstsv,zva=kmat)
21 if (tgs) goto 10
22end if
23! find the record length
24inquire(iolength=recl) vkl_,nstsv_,kmat
25open(220,file='KMAT.OUT',form='UNFORMATTED',access='DIRECT',recl=recl)
26read(220,rec=ik) vkl_,nstsv_,kmat
27close(220)
2810 continue
29!$OMP END CRITICAL(u220)
30t1=abs(vkl(1,ik)-vkl_(1))+abs(vkl(2,ik)-vkl_(2))+abs(vkl(3,ik)-vkl_(3))
31if (t1 > epslat) then
32 write(*,*)
33 write(*,'("Error(getkmat): differing vectors for k-point ",I8)') ik
34 write(*,'(" current : ",3G18.10)') vkl(:,ik)
35 write(*,'(" KMAT.OUT : ",3G18.10)') vkl_
36 write(*,*)
37 stop
38end if
39if (nstsv /= nstsv_) then
40 write(*,*)
41 write(*,'("Error(getkmat): differing nstsv for k-point ",I8)') ik
42 write(*,'(" current : ",I8)') nstsv
43 write(*,'(" KMAT.OUT : ",I8)') nstsv_
44 write(*,*)
45 stop
46end if
47end subroutine
48
subroutine getkmat(ik, kmat)
Definition getkmat.f90:7
real(8) epslat
Definition modmain.f90:24
real(8), dimension(:,:), allocatable vkl
Definition modmain.f90:471
type(file_t), dimension(:), allocatable, private file
subroutine getrd(fname, irec, tgs, n1, n2, n3, v1, v2, nrv, rva, nzv, zva)
logical ramdisk
Definition modramdisk.f90:9