Commit 6a72f3f7 authored by Daniel Wortmann's avatar Daniel Wortmann

Bugfixes in lda+u and noco calculations

parent 3c21dbd7
......@@ -698,7 +698,7 @@ CONTAINS
ENDIF
IF ( atoms%n_u.GT.0 ) THEN
CALL n_mat(atoms,sym,noccbd,usdus,ispin,we, acof(:,0:,:,ispin),bcof(:,0:,:,isp),&
CALL n_mat(atoms,sym,noccbd,usdus,ispin,we, acof(:,0:,:,ispin),bcof(:,0:,:,ispin),&
ccof(-atoms%llod:,:,:,:,ispin), n_mmp)
ENDIF
!
......
......@@ -77,7 +77,7 @@ CONTAINS
!+odim
! ..
! .. Local Scalars ..
INTEGER jsp,nk,nred,ne_all
INTEGER jsp,nk,nred,ne_all,n_u_in
INTEGER iter,ne,matsize ,nrec,lh0
INTEGER nspins,isp,l,i,j,err,gwc
INTEGER mlotot,mlolotot,mlot_d,mlolot_d,nlot_d
......@@ -360,6 +360,7 @@ CONTAINS
! ..
! LDA+U
IF ((atoms%n_u.GT.0)) THEN
n_u_in=atoms%n_u
ALLOCATE( vs_mmp(-lmaxb:lmaxb,-lmaxb:lmaxb,atoms%n_u,input%jspins) )
CALL u_setup(atoms,lmaxb,sphhar,input, enpara%el0(0:,:,:),vr,mpi, vs_mmp,results)
ELSE
......@@ -669,7 +670,7 @@ CONTAINS
CALL MPI_BARRIER(MPI_COMM,ierr)
#endif
if (l_hybrid.or.hybrid%l_calhf) CALL close_eig(eig_id_hf)
atoms%n_u=n_u_in
IF( input%jspins .EQ. 1 .AND. l_hybrid ) THEN
......
......@@ -268,7 +268,7 @@ CONTAINS
ENDIF
END IF
IF (atoms%lda_u(n)%l.GE.0.AND.gwc.EQ.1) THEN
IF (atoms%n_u>0.and.atoms%lda_u(n)%l.GE.0.AND.gwc.EQ.1) THEN
IF ( noco%l_noco .AND. (.NOT.noco%l_ss) ) THEN
#ifndef CPP_INVERSION
CALL u_ham(&
......
......@@ -76,7 +76,7 @@ CONTAINS
REAL,PARAMETER:: del=1.e-6
REAL :: efermi,emax,emin,entropy,fermikn,gap,&
wfermi,wvals,w_below_emin,w_near_ef,tkb
INTEGER ink,inkem,j,js,k,kpt,nocc,nocst,i
INTEGER ink,inkem,j,js,k,kpt,nocc,nocst,i,nspins
! .. Local Arrays ..
REAL :: qc(3)
......@@ -108,6 +108,8 @@ CONTAINS
! and n-th state
!**********************************************************************
! ..
nspins=input%jspins
if (noco%l_noco) nspins=1
tkb=input%tkb !might be modified if we have an insulator
IF ( mpi%irank == 0 ) THEN
WRITE (6,FMT='(/)')
......@@ -225,7 +227,7 @@ CONTAINS
!
wvals = 0.0
DO js = 1,input%jspins
DO js = 1,nspins
DO k = 1,kpts%nkpt
wvals = wvals + SUM(results%w_iks(:ne(k,js),k,js))
ENDDO
......@@ -248,7 +250,7 @@ CONTAINS
! here we have w(n,kpt,js)= spindg*wghtkp(kpt)*f(e(kpt,n))
!
entropy = 0.0
DO js = 1,input%jspins
DO js = 1,nspins
DO kpt = 1 , kpts%nkpt
DO nocc=1,ne(kpt,js)
fermikn = results%w_iks(nocc,kpt,js)/kpts%wtkpt(kpt)
......
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