The Elk Code
ephdos.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2020 Chung-Yu Wang, 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 ephdos
7 use modmain
8 use modphonon
9 use modbog
10 implicit none
11 ! local variables
12 integer nsk(3),ik,ist,iw
13 real(8) v(3),dw,vn,t1
14 ! allocatable arrays
15 integer, allocatable :: idx(:)
16 real(8), allocatable :: w(:),f(:,:),g(:)
17 ! initialise universal variables
18 call init0
19 call init1
20 call init2
21 call initeph
22 allocate(idx(nstsv),w(nstsv))
23 do ik=1,nkpt
24 ! get the eigenvalues from file
25  call getevaluv(ik,evaluv(:,ik))
26 ! negate eigenvalues corresponding to V-norm > 1/2
27  do ist=1,nstsv
28  if (vnorm(ist,ik) > 0.5d0) evaluv(ist,ik)=-evaluv(ist,ik)
29  end do
30 ! arrange in ascending order
31  w(:)=evaluv(:,ik)
32  call sortidx(nstsv,w,idx)
33  evaluv(:,ik)=w(idx(:))
34 ! put the V-norm into the same order as the eigenvalues
35  w(:)=vnorm(:,ik)
36  vnorm(:,ik)=w(idx(:))
37 end do
38 deallocate(idx,w)
39 ! generate the partial and total DOS and write to file
40 allocate(w(nwplot),f(nstsv,nkptnr),g(nwplot))
41 ! generate frequency grid
42 dw=(wplot(2)-wplot(1))/dble(nwplot)
43 do iw=1,nwplot
44  w(iw)=dw*dble(iw-1)+wplot(1)
45 end do
46 ! number of subdivisions used for interpolation in the Brillouin zone
47 nsk(:)=max(ngrkf/ngridk(:),1)
48 ! set the weight array
49 f(:,:)=occmax
50 ! integrate over the Brillouin zone
52 ! output the total electronic DOS to file
53 open(50,file='TDOS_EPH.OUT.OUT',form='FORMATTED',action='WRITE')
54 do iw=1,nwplot
55  write(50,'(2G18.10)') w(iw),g(iw)
56 end do
57 close(50)
58 ! output the FACE vs energy histogram to file
59 open(50,file='FACEEH.OUT',form='FORMATTED',action='WRITE')
60 do ik=1,nkpt
61 ! map k-vector to first Brillouin zone
62  v(:)=vkc(:,ik)
63  call vecfbz(epslat,bvec,v)
64  do ist=1,nstsv
65  vn=vnorm(ist,ik)
66  if ((vn > 0.d0).and.(vn < 1.d0)) then
67  t1=-(vn*log(vn)+(1.d0-vn)*log(1.d0-vn))
68  else
69  t1=0.d0
70  end if
71  if (t1 < 1.d-4) cycle
72  write(50,'(5G18.10)') evaluv(ist,ik),t1,v
73  end do
74 end do
75 close(50)
76 write(*,*)
77 write(*,'("Info(ephdos):")')
78 write(*,'(" Total electronic density of states for the electron-phonon")')
79 write(*,'(" system written to TDOS_EPH.OUT.OUT")')
80 write(*,*)
81 write(*,'(" Fermionic anomalous correlation entropy vs energy histogram")')
82 write(*,'(" written to FACEEH.OUT")')
83 write(*,*)
84 write(*,'(" Fermi energy is at zero in plots")')
85 write(*,*)
86 write(*,'(" DOS units are states/Hartree/unit cell")')
87 deallocate(w,f,g)
88 end subroutine
89 
integer ngrkf
Definition: modmain.f90:1075
subroutine vecfbz(eps, bvec, vpl)
Definition: vecfbz.f90:10
integer nkpt
Definition: modmain.f90:461
real(8), dimension(:,:), allocatable evaluv
Definition: modbog.f90:15
subroutine ephdos
Definition: ephdos.f90:7
integer, dimension(:,:,:), allocatable ivkik
Definition: modmain.f90:467
subroutine brzint(nsm, ngridk, nsk, ivkik, nw, wint, n, ld, e, f, g)
Definition: brzint.f90:10
integer nkptnr
Definition: modmain.f90:463
real(8), dimension(:,:), allocatable vkc
Definition: modmain.f90:473
integer nstsv
Definition: modmain.f90:889
real(8), dimension(2) wplot
Definition: modmain.f90:1079
subroutine getevaluv(ik, evaluvp)
Definition: getevaluv.f90:7
real(8) occmax
Definition: modmain.f90:901
Definition: modbog.f90:6
subroutine init2
Definition: init2.f90:7
integer, dimension(3) ngridk
Definition: modmain.f90:448
pure subroutine sortidx(n, x, idx)
Definition: sortidx.f90:10
real(8), dimension(3, 3) bvec
Definition: modmain.f90:16
subroutine init1
Definition: init1.f90:10
real(8) epslat
Definition: modmain.f90:24
integer nswplot
Definition: modmain.f90:1077
real(8), dimension(:,:), allocatable vnorm
Definition: modbog.f90:17
subroutine initeph
Definition: initeph.f90:7
subroutine init0
Definition: init0.f90:10
integer nwplot
Definition: modmain.f90:1073