Commit 2e7cbaa0 authored by Daniel Wortmann's avatar Daniel Wortmann

Bugfix for fermie.F90

parent 0720c364
......@@ -55,7 +55,7 @@ CONTAINS
!REAL, INTENT (OUT):: w(:,:,:) !(dimension%neigd,kpts%nkpt,dimension%jspd)
! ..
! .. Local Scalars ..
REAL del ,spindg,ssc ,ws,zc,weight,efermi
REAL del ,spindg,ssc ,ws,zc,weight,efermi,seigv
INTEGER i,idummy,j,jsp,k,l,n,nbands,nstef,nv,nmat,nspins
INTEGER n_help,m_spins,mspin,sslice(2)
! ..
......@@ -143,14 +143,15 @@ CONTAINS
!finished reading of eigenvalues
IF (mpi%irank == 0) CALL closeXMLElement('eigenvalues')
if (abs(input%fixed_moment)<1E-6) THEN
IF (ABS(input%fixed_moment)<1E-6) THEN
!this is a standard calculation
m_spins=1
else
!total moment is fixed
m_spins=2
end if
END IF
results%seigv = 0.0e0
do mspin=1,m_spins
IF (m_spins == 1) THEN
sslice = (/1,nspins/)
......@@ -194,7 +195,7 @@ CONTAINS
!---> DETERMINE EF BY SUMMING WEIGHTS
!
weight = input%zelec/spindg
results%seigv = 0.0e0
seigv=0.0
IF(m_spins /= 1) weight = weight/2.0 -(mspin-1.5)*input%fixed_moment
ws = 0.0e0
l = 0
......@@ -208,7 +209,7 @@ CONTAINS
8010 FORMAT (/,10x,'error: not enough wavefunctions.',i10,2d20.10)
END IF
ws = ws + we(INDEX(l))
results%seigv = results%seigv + e(INDEX(l))*we(INDEX(l))*spindg
seigv =seigv + e(INDEX(l))*we(INDEX(l))*spindg
! WRITE (6,FMT='(2f10.7)') e(index(l)),we(index(l))
END DO
results%ef = e(INDEX(l))
......@@ -226,7 +227,7 @@ CONTAINS
ENDIF
ENDIF
IF ( mpi%irank == 0 ) WRITE (6,FMT=8020) results%ef,nstef,results%seigv,ws,results%seigsc,ssc
IF ( mpi%irank == 0 ) WRITE (6,FMT=8020) results%ef,nstef,seigv,ws,results%seigsc,ssc
!+po
results%ts = 0.0
......@@ -276,4 +277,4 @@ CONTAINS
& 10x,'sum of semicore eigenvalues :',f10.6,' htr',/,&
& 10x,'sum of semicore charge :',f10.6,' e',/)
END SUBROUTINE fermie
END MODULE m_fermie
END MODULE m_fermie
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment