The Elk Code
writegwsf.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2016 A. Davydov, A. Sanna, J. K. Dewhurst, S. Sharma and
3 ! E. K. U. Gross. This file is distributed under the terms of the GNU General
4 ! Public License. See the file COPYING for license details.
5 
6 subroutine writegwsf(ik,wr,sf)
7 use modmain
8 use modgw
9 implicit none
10 ! arguments
11 integer, intent(in) :: ik
12 real(8), intent(in) :: wr(nwplot),sf(nwplot)
13 ! local variables
14 integer iw,ist
15 real(8) e
16 character(256) fname
17 write(fname,'("GWSF_K",I6.6,".OUT")') ik
18 open(50,file=trim(fname),form='FORMATTED')
19 ! write the GW spectral function
20 do iw=1,nwplot
21  write(50,'(2G18.10)') wr(iw),sf(iw)
22 end do
23 write(50,*)
24 ! write the Kohn-Sham eigenvalues for reference
25 do ist=1,nstsv
26  e=evalsv(ist,ik)-efermi
27  write(50,'(2G18.10)') e,0.d0
28  write(50,'(2G18.10)') e,1.d0/swidth
29  write(50,*)
30 end do
31 close(50)
32 end subroutine
33 
real(8) efermi
Definition: modmain.f90:907
real(8), dimension(:,:), allocatable evalsv
Definition: modmain.f90:921
real(8) swidth
Definition: modmain.f90:895
integer nstsv
Definition: modmain.f90:889
subroutine writegwsf(ik, wr, sf)
Definition: writegwsf.f90:7
Definition: modgw.f90:6