Commit 5ac1a0cc authored by Henning Janssen's avatar Henning Janssen

Made spin averaging of Hubbard 1 orbitals switchable

parent 2b987e9d
......@@ -174,7 +174,7 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
DO iType = 1, atoms%ntype
DO ispin = jsp_start, jsp_end
CALL genMTBasis(atoms,enpara,vTot,mpi,iType,ispin,usdus,f(:,:,0:,ispin),g(:,:,0:,ispin),flo(:,:,:,ispin))
CALL genMTBasis(atoms,enpara,vTot,mpi,iType,ispin,usdus,f(:,:,0:,ispin),g(:,:,0:,ispin),flo(:,:,:,ispin),input%l_dftspinpol)
END DO
IF (noco%l_mperp.OR.input%l_gfmperp) CALL denCoeffsOffdiag%addRadFunScalarProducts(atoms,f,g,flo,iType)
IF (banddos%l_mcd) CALL mcd_init(atoms,input,dimension,vTot%mt(:,0,:,:),g,f,mcd,iType,jspin)
......@@ -290,7 +290,7 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
#endif
CALL cdnmt(mpi,input%jspins,atoms,sphhar,noco,jsp_start,jsp_end,&
enpara,vTot%mt(:,0,:,:),denCoeffs,usdus,orb,denCoeffsOffdiag,moments,den%mt,hub1)
enpara,vTot%mt(:,0,:,:),denCoeffs,usdus,orb,denCoeffsOffdiag,moments,den%mt,hub1,input%l_dftspinpol)
IF (mpi%irank==0) THEN
IF (l_coreSpec) CALL corespec_ddscs(jspin,input%jspins)
......
......@@ -11,7 +11,7 @@ MODULE m_cdnmt
!***********************************************************************
CONTAINS
SUBROUTINE cdnmt(mpi,jspd,atoms,sphhar,noco,jsp_start,jsp_end,enpara,&
vr,denCoeffs,usdus,orb,denCoeffsOffdiag,moments,rho,hub1)
vr,denCoeffs,usdus,orb,denCoeffsOffdiag,moments,rho,hub1,l_dftspinpol)
use m_constants,only: sfp_const
USE m_rhosphnlo
USE m_radfun
......@@ -27,6 +27,7 @@ CONTAINS
TYPE(t_enpara), INTENT(IN) :: enpara
TYPE(t_moments), INTENT(INOUT) :: moments
TYPE(t_hub1ham), OPTIONAL, INTENT(INOUT) :: hub1
LOGICAL, INTENT(IN) :: l_dftspinpol
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: jsp_start,jsp_end,jspd
......@@ -67,7 +68,7 @@ CONTAINS
!$OMP PARALLEL DEFAULT(none) &
!$OMP SHARED(usdus,rho,moments,qmtl,hub1) &
!$OMP SHARED(atoms,jsp_start,jsp_end,enpara,vr,denCoeffs,sphhar)&
!$OMP SHARED(atoms,jsp_start,jsp_end,enpara,vr,denCoeffs,sphhar,l_dftspinpol)&
!$OMP SHARED(orb,noco,denCoeffsOffdiag,jspd)&
!$OMP PRIVATE(itype,na,ispin,l,rho21,f,g,nodeu,noded,wronk,i,j,s,qmtllo,qmtt,nd,lh,lp,llp,cs,l_hia,vrTmp,i_hia)
IF (noco%l_mperp) THEN
......@@ -99,7 +100,7 @@ CONTAINS
!In the case of a spin-polarized calculation with Hubbard 1 we want to treat
!the correlated orbitals with a non-spin-polarized basis
IF(l_hia.AND.jspd.EQ.2) THEN
IF(l_hia.AND.jspd.EQ.2.AND..NOT.l_dftspinpol) THEN
vrTmp = (vr(:,itype,1) + vr(:,itype,2))/2.0
ELSE
vrTmp = vr(:,itype,ispin)
......
......@@ -52,7 +52,7 @@ MODULE m_radovlp
!In the case of a spin-polarized calculation with Hubbard 1 we want to treat
!the correlated orbitals with a non-spin-polarized basis
IF(l_hia.AND.input%jspins.EQ.2) THEN
IF(l_hia.AND.input%jspins.EQ.2.AND..NOT.input%l_dftspinpol) THEN
vrTmp = (vr(:,0,iType,1) + vr(:,0,iType,2))/2.0
ELSE
vrTmp = vr(:,0,iType,ispin)
......
......@@ -54,7 +54,7 @@ CONTAINS
IF (jsp<3) vr0(:,0)=0.0
DO i=MERGE(1,jspin,jspin>2),MERGE(2,jspin,jspin>2)
CALL genMTBasis(atoms,enpara,v,mpi,n,i,ud,f(:,:,:,i),g(:,:,:,i),flo)
CALL genMTBasis(atoms,enpara,v,mpi,n,i,ud,f(:,:,:,i),g(:,:,:,i),flo,input%l_dftspinpol)
ENDDO
IF (jspin>2) THEN
jspin1=1
......
......@@ -60,7 +60,7 @@ CONTAINS
ENDIF
ENDDO
DO jspin = 1,input%jspins
IF(l_hia.AND.input%jspins.EQ.2) THEN
IF(l_hia.AND.input%jspins.EQ.2.AND..NOT.input%l_dftspinpol) THEN
vrTmp = (vr(:,1)+vr(:,2))/2.0
ELSE
vrTmp = vr(:,jspin)
......
......@@ -7,7 +7,7 @@ MODULE m_genMTBasis
CONTAINS
SUBROUTINE genMTBasis(atoms,enpara,vTot,mpi,iType,jspin,usdus,f,g,flo)
SUBROUTINE genMTBasis(atoms,enpara,vTot,mpi,iType,jspin,usdus,f,g,flo,l_dftspinpol)
USE m_types
USE m_radfun
USE m_radflo
......@@ -24,6 +24,8 @@ CONTAINS
INTEGER, INTENT(IN) :: iType
INTEGER, INTENT(IN) :: jspin
LOGICAL, INTENT(IN) :: l_dftspinpol
REAL, INTENT(INOUT) :: f(atoms%jmtd,2,0:atoms%lmaxd)
REAL, INTENT(INOUT) :: g(atoms%jmtd,2,0:atoms%lmaxd)
REAL, INTENT(INOUT) :: flo(atoms%jmtd,2,atoms%nlod)
......@@ -53,7 +55,7 @@ CONTAINS
!In the case of a spin-polarized calculation with Hubbard 1 we want to treat
!the correlated orbitals with a non-spin-polarized basis
IF(l_hia.AND.SIZE(vTot%mt,4).GT.1) THEN
IF(l_hia.AND.SIZE(vTot%mt,4).GT.1.AND..NOT.l_dftspinpol) THEN
vrTmp = (vTot%mt(:,0,iType,1) + vTot%mt(:,0,iType,2))/2.0
ELSE
vrTmp = vTot%mt(:,0,iType,jspin)
......
......@@ -719,6 +719,8 @@ CONTAINS
input%minoccDistance = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@minoccDistance'))
input%minmatDistance = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@minmatDistance'))
hub1%beta = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@beta'))
!Switch determines wether the Hubbard 1 orbitals are kept non-polarized in the DFT part
input%l_dftspinpol = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@spinpoldft'))
END IF
xPathA = '/fleurInput/calculationSetup/greensFunction'
......
......@@ -349,7 +349,7 @@ SUBROUTINE writeBasis(input,noco,kpts,atoms,sym,cell,enpara,vTot,vCoul,vx,mpi,DI
write(itype_name , '(2a,i0)') TRIM(ADJUSTL(jsp_name)),'/itype_',itype
CALL h5gcreate_f(fileID, TRIM(ADJUSTL(itype_name)), itypeGroupID, hdfError)
CALL genMTBasis(atoms,enpara,vTot,mpi,itype,jsp,usdus,f(:,:,0:,jsp),g(:,:,0:,jsp),flo)
CALL genMTBasis(atoms,enpara,vTot,mpi,itype,jsp,usdus,f(:,:,0:,jsp),g(:,:,0:,jsp),flo,input%l_dftspinpol)
dims(:3)=(/atoms%jmtd,2,atoms%lmaxd+1/)
dimsInt = dims
CALL h5screate_simple_f(3,dims(:3),itypeSpaceID,hdfError)
......
......@@ -665,6 +665,7 @@
<xsd:attribute default="100.0" name="beta" type="xsd:double" use="optional"/>
<xsd:attribute default="0.01" name="minoccDistance" type="xsd:double" use="optional"/>
<xsd:attribute default="0.001" name="minmatDistance" type="xsd:double" use="optional"/>
<xsd:attribute default="F" name="dftspinpol" type="FleurBool" use="optional"/>
</xsd:complexType>
<xsd:complexType name="GFGeneralType">
......
......@@ -158,6 +158,7 @@
input%l_gfsphavg = .TRUE.
input%l_gfmperp = .FALSE.
input%l_gf = .FALSE.
input%l_dftspinpol = .FALSE.
input%gf_ne = 1300
input%gf_ellow = 0.0
input%gf_elup = 0.0
......
......@@ -239,6 +239,7 @@ CONTAINS
CALL MPI_BCAST(input%gf_ne,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%gf_sigma,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%l_gf,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%l_dftspinpol,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%gfTet,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%gf_anacont,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%gf_dosfermi,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
......
......@@ -268,7 +268,7 @@ CONTAINS
END IF
END DO
IF(atoms%n_hia.GT.0.AND.input%jspins.EQ.2) THEN
IF(atoms%n_hia.GT.0.AND.input%jspins.EQ.2.AND..NOT.input%l_dftspinpol) THEN
!Set the energy parameters to the same value
!We want the shell where Hubbard 1 is applied to
!be non spin-polarized
......
......@@ -441,6 +441,7 @@ MODULE m_types_setup
REAL :: ldauMixParam
REAL :: ldauSpinf
LOGICAL :: ldauAdjEnpara
LOGICAL :: l_dftspinpol
LOGICAL :: l_gfsphavg
LOGICAL :: l_gfmperp
LOGICAL :: l_resolvent
......
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