Commit dd3ce146 authored by Gregor Michalicek's avatar Gregor Michalicek
Browse files

Fix wrong output of sum of eigenvalues in SOC case

parent 48248650
......@@ -86,7 +86,7 @@ CONTAINS
! .. Local Scalars ..
REAL,PARAMETER:: del=1.e-6
REAL :: efermi,emax,emin,entropy,fermikn,gap,&
wfermi,wvals,w_below_emin,w_near_ef,tkb
wfermi,wvals,w_below_emin,w_near_ef,tkb, seigvTemp
INTEGER ink,inkem,j,js,k,kpt,nocc,nocst,i
! .. Local Arrays ..
......@@ -287,12 +287,16 @@ CONTAINS
!
seigv = seigv+spindg*DOT_PRODUCT(e(INDEX(:nocst)),we(INDEX(:nocst)))
seigvTemp = seigv
IF (noco%l_soc .AND. (.NOT. noco%l_noco)) THEN
seigvTemp = seigvTemp / 2.0
END IF
IF (fmpi%irank == 0) THEN
attributes = ''
WRITE(attributes(1),'(f20.10)') seigv
WRITE(attributes(1),'(f20.10)') seigvTemp
WRITE(attributes(2),'(a)') 'Htr'
CALL writeXMLElement('sumValenceSingleParticleEnergies',(/'value','units'/),attributes)
WRITE (oUnit,FMT=8040) seigv
WRITE (oUnit,FMT=8040) seigvTemp
END IF
8000 FORMAT (/,10x,'==>efrmhi: not enough wavefunctions.',i10,2e20.10)
......
......@@ -240,7 +240,7 @@ CONTAINS
ELSE IF (input%bz_integration==BZINT_METHOD_GAUSS) THEN
CALL fergwt(kpts,input,fmpi,results%neig(:,sslice(1):sslice(2)), results%eig(:,:,sslice(1):sslice(2)),results%ef,results%w_iks(:,:,sslice(1):sslice(2)),results%seigv)
ELSE IF (input%bz_integration==BZINT_METHOD_TRIA) THEN
CALL fertri(input,kpts,fmpi%irank, results%neig(:,sslice(1):sslice(2)),nspins,zc,results%eig(:,:,sslice(1):sslice(2)),spindg,&
CALL fertri(input,noco,kpts,fmpi%irank, results%neig(:,sslice(1):sslice(2)),nspins,zc,results%eig(:,:,sslice(1):sslice(2)),spindg,&
results%ef,results%seigv,results%w_iks(:,:,sslice(1):sslice(2)))
ELSE IF (input%bz_integration==BZINT_METHOD_TETRA) THEN
CALL fertetra(input,noco,kpts,fmpi,results%neig(:,sslice(1):sslice(2)), results%eig(:,:,sslice(1):sslice(2)),&
......
......@@ -22,7 +22,7 @@ MODULE m_fertetra
REAL, INTENT(INOUT) :: w(:,:,:)
INTEGER :: jspin,jspins,ikpt,it,iBand
REAL :: dlow,dup,dfermi,s1,s,chmom
REAL :: dlow,dup,dfermi,s1,s,chmom,seigvTemp
REAL :: lowBound,upperBound,weightSum
......@@ -136,10 +136,16 @@ MODULE m_fertetra
ENDDO
seigv = 2.0/input%jspins*seigv
chmom = s1 - jspins*s
seigvTemp = seigv
IF (noco%l_soc .AND. (.NOT. noco%l_noco)) THEN
seigvTemp = seigvTemp / 2.0
END IF
IF ( mpi%irank == 0 ) THEN
WRITE (oUnit,FMT=9300) seigv,s1,chmom
WRITE (oUnit,FMT=9300) seigvTemp,s1,chmom
END IF
9300 FORMAT (/,10x,'sum of valence eigenvalues=',f20.6,5x,&
9300 FORMAT (/,10x,'sum of valence eigenvalues=',f20.10,5x,&
'sum of weights=',f10.6,/,10x,'moment=',f12.6)
END SUBROUTINE fertetra
......
......@@ -19,10 +19,11 @@ MODULE m_fertri
CONTAINS
SUBROUTINE fertri(input,kpts,irank,ne,jspins,zc,eig,sfac,&
SUBROUTINE fertri(input,noco,kpts,irank,ne,jspins,zc,eig,sfac,&
ef,seigv,w)
TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_kpts), INTENT(IN) :: kpts
INTEGER, INTENT(IN) :: jspins,irank
REAL, INTENT(IN) :: zc,sfac
......@@ -33,7 +34,7 @@ MODULE m_fertri
REAL, INTENT(INOUT) :: eig(:,:,:)!(neig,nkpt,jspins)
REAL :: chmom,ct,del,dez,ei,emax,emin,s,s1,workf
REAL :: lb,ub,e_set
REAL :: lb,ub,e_set,seigvTemp
INTEGER :: i,ic,j,jsp,k,neig
INTEGER :: nemax(2)
REAL, PARAMETER :: de = 5.0e-3 !Step for initial search
......@@ -173,9 +174,14 @@ MODULE m_fertri
seigv = sfac*seigv
chmom = s1 - jspins*s
seigvTemp = seigv
IF (noco%l_soc .AND. (.NOT. noco%l_noco)) THEN
seigvTemp = seigvTemp / 2.0
END IF
IF (irank == 0) THEN
WRITE (oUnit,FMT=8040) seigv,s1,chmom
8040 FORMAT (/,10x,'sum of valence eigenvalues=',f20.6,5x,&
WRITE (oUnit,FMT=8040) seigvTemp,s1,chmom
8040 FORMAT (/,10x,'sum of valence eigenvalues=',f20.10,5x,&
'sum of weights=',f10.6,/,10x,'moment=',f12.6)
END IF
......
Supports Markdown
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