9subroutine dos(fext,tocc,occsvp)
44character(*),
intent(in) :: fext
45logical,
intent(in) :: tocc
46real(8),
intent(in) :: occsvp(nstsv,nkpt)
49integer nsk(3),ik,jk,ist,iw,ld
50integer nsd,ispn,jspn,is,ia,ias
51integer lmmax,l0,l1,l,m,lm,nthd
52real(8) dw,th,sps(2),vl(3),vc(3)
53real(8) v1(3),v2(3),v3(3),t1
54complex(8) su2(2,2),b(2,2),c(2,2)
58real(4),
allocatable :: bc(:,:,:,:,:),sc(:,:,:)
59real(8),
allocatable :: w(:),e(:,:,:),f(:,:),g(:)
60real(8),
allocatable :: dt(:,:),dp(:,:,:),elm(:,:)
61complex(8),
allocatable :: ulm(:,:,:),a(:,:)
62complex(8),
allocatable :: dmat(:,:,:,:,:),sdmat(:,:,:)
63complex(8),
allocatable :: apwalm(:,:,:,:,:)
64complex(8),
allocatable :: evecfv(:,:,:),evecsv(:,:)
83 allocate(ulm(lmmax,lmmax,
natmtot))
89t1=sqrt(v1(1)**2+v1(2)**2+v1(3)**2)
92 write(*,
'("Error(dos): spin-quantisation axis (sqados) has zero length")')
97if (v1(3) >= 1.d0-
epslat)
then
131 vl(:)=vl(:)+0.5d0*
vqlss(:)
132 vc(:)=vc(:)+0.5d0*
vqcss(:)
134 vl(:)=vl(:)-0.5d0*
vqlss(:)
135 vc(:)=vc(:)-0.5d0*
vqcss(:)
140 sfacgk(:,:,ispn,ik),apwalm(:,:,:,:,ispn))
149 call gendmatk(.false.,.false.,0,
lmaxdos,ias,nstsv,[0],
ngk(:,ik),apwalm, &
150 evecfv,evecsv,lmmax,dmat)
156 call zgemm(
'N',
'N',lmmax,lmmax,lmmax,
zone,ulm(:,:,ias),lmmax, &
157 dmat(:,ispn,1,jspn,ist),ld,
zzero,a,lmmax)
158 call zgemm(
'N',
'C',lmmax,lmmax,lmmax,
zone,a,lmmax,ulm(:,:,ias), &
159 lmmax,
zzero,dmat(:,ispn,1,jspn,ist),ld)
165 if (
spinpol.and.(.not.tsqaz))
then
168 b(:,:)=dmat(lm,:,lm,:,ist)
171 dmat(lm,:,lm,:,ist)=b(:,:)
179 t1=dble(dmat(lm,ispn,lm,ispn,ist))
180 bc(lm,ispn,ias,ist,ik)=real(t1)
189 if (
spinpol.and.(.not.tsqaz))
then
191 call z2mm(su2,sdmat(:,:,ist),b)
192 call z2mmct(b,su2,sdmat(:,:,ist))
197 t1=dble(sdmat(ispn,ispn,ist))
198 sc(ispn,ist,ik)=real(t1)
203deallocate(apwalm,evecfv,evecsv,dmat,sdmat,a)
211 w(iw)=dw*dble(iw-1)+
wplot(1)
230 f(ist,ik)=sc(ispn,ist,ik)
232 f(ist,ik)=f(ist,ik)*occsvp(ist,jk)
234 f(ist,ik)=f(ist,ik)*
occmax
239 call brzint(
nswplot,
ngridk,nsk,
ivkiknr,
nwplot,
wplot,nstsv,nstsv,e(:,:,ispn), &
249open(50,file=
'TDOS'//trim(fext),form=
'FORMATTED',action=
'WRITE')
252 write(50,
'(2G18.10)') w(iw),dt(iw,ispn)*sps(ispn)
258if (.not.
tpdos)
goto 10
274 do lm=l**2+1,(l+1)**2
278 f(ist,ik)=bc(lm,ispn,ias,ist,ik)
280 f(ist,ik)=f(ist,ik)*occsvp(ist,jk)
282 f(ist,ik)=f(ist,ik)*
occmax
290 dp(:,l,1)=dp(:,l,1)+g(:)
292 dp(:,l,ispn)=dp(:,l,ispn)+g(:)
296 dp(:,lm,1)=dp(:,lm,1)+g(:)
306 dt(:,ispn)=dt(:,ispn)-g(:)
317 write(fname,
'("PDOS_S",I2.2,"_A",I4.4)') is,ia
318 open(50,file=trim(fname)//trim(fext),form=
'FORMATTED',action=
'WRITE')
322 write(50,
'(2G18.10)') w(iw),dp(iw,l,ispn)*sps(ispn)
334 open(50,file=
'ELMIREP'//trim(fext),form=
'FORMATTED',action=
'WRITE')
339 write(50,
'("Species : ",I4," (",A,"), atom : ",I4)') is, &
344 write(50,
'(" l = ",I2,", m = ",I2,", lm= ",I3," : ",G18.10)') l,m, &
355open(50,file=
'IDOS'//trim(fext),form=
'FORMATTED',action=
'WRITE')
358 write(50,
'(2G18.10)') w(iw),dt(iw,ispn)*sps(ispn)
366deallocate(bc,sc,w,e,dt,dp)
367if (
lmirep)
deallocate(elm,ulm)
real(8), dimension(:,:,:,:), allocatable vgkc
real(8), dimension(3) sqados
complex(8), parameter zzero
real(8), dimension(:,:,:), allocatable gkc
integer, dimension(maxspecies) natoms
integer, dimension(maxatoms, maxspecies) idxas
integer, dimension(:,:), allocatable ngk
integer, dimension(:,:), allocatable ivk
complex(8), parameter zone
real(8), dimension(3) vqcss
real(8), dimension(2) wplot
real(8), dimension(:,:,:,:), allocatable vgkl
integer, dimension(3) ngridk
character(64), dimension(maxspecies) spsymb
real(8), dimension(:,:), allocatable vkl
integer, dimension(:,:,:), allocatable ivkiknr
real(8), dimension(3) vqlss
integer, dimension(:,:,:), allocatable ivkik
real(8), dimension(:,:), allocatable vkc
complex(8), dimension(:,:,:,:), allocatable sfacgk
real(8), dimension(:,:), allocatable evalsv