Commit f5f52a63 authored by Henning Janssen's avatar Henning Janssen

Added offdiagonal DFT+U contributions in tlmplm_cholesky

parent 8d204263
......@@ -196,7 +196,7 @@ CONTAINS
!
!---> set up the t-matrices for the local orbitals,
!---> if there are any
IF (atoms%nlo(n).GE.1) THEN
IF (atoms%nlo(n).GE.1.AND.jspin<3) THEN
CALL tlo(atoms,sphhar,jspin,jsp,n,enpara,1,input,v%mt(1,0,n,jsp),&
na,flo,f(:,:,:,jspin),g(:,:,:,jspin),ud, ud%uuilon(:,:,jspin),ud%duilon(:,:,jspin),ud%ulouilopn(:,:,:,jspin), td)
......
......@@ -12,6 +12,7 @@ CONTAINS
jspin,jsp,mpi,v,input,td,ud)
USE m_tlmplm
USE m_types
USE m_radovlp
USE m_gaunt, ONLY: gaunt2
USE m_constants, ONLY: lmaxU_const
IMPLICIT NONE
......@@ -37,7 +38,7 @@ CONTAINS
LOGICAL OK
! ..
! .. Local Arrays ..
REAL, ALLOCATABLE :: uun21(:,:),udn21(:,:),dun21(:,:),ddn21(:,:)
REAL,PARAMETER:: e_shift_min=0.5
REAL,PARAMETER:: e_shift_max=65.0
......@@ -47,6 +48,13 @@ CONTAINS
td%e_shift(:,jsp)=0.0
IF (jsp<3) td%e_shift(:,jsp)=e_shift_min
!Calculate overlap integrals
!For the off-diagonal LDA+U contributions
IF(jsp>=3) THEN
ALLOCATE(uun21(0:atoms%lmaxd,atoms%ntype),udn21(0:atoms%lmaxd,atoms%ntype),&
dun21(0:atoms%lmaxd,atoms%ntype),ddn21(0:atoms%lmaxd,atoms%ntype) )
CALL rad_ovlp(atoms,ud,input,v%mt,enpara%el0, uun21,udn21,dun21,ddn21)
ENDIF
td%tdulo(:,:,:,jsp) = CMPLX(0.0,0.0)
td%tuulo(:,:,:,jsp) = CMPLX(0.0,0.0)
......@@ -59,7 +67,7 @@ CONTAINS
!$OMP PRIVATE(temp,i,l,lm,lmin,lmin0,lmp)&
!$OMP PRIVATE(lmplm,lp,m,mp,n)&
!$OMP PRIVATE(OK,s,in,info)&
!$OMP SHARED(atoms,jspin,jsp,sphhar,enpara,td,ud,v,mpi,input)
!$OMP SHARED(atoms,jspin,jsp,sphhar,enpara,td,ud,v,mpi,input,uun21,udn21,dun21,ddn21)
DO n = 1,atoms%ntype
CALL tlmplm(n,sphhar,atoms,enpara,jspin,jsp,mpi,v,input,td,ud)
OK=.FALSE.
......@@ -97,7 +105,6 @@ CONTAINS
END DO
ENDDO
!Include contribution from LDA+U and LDA+HIA (latter are behind LDA+U contributions)
IF(jsp<3) THEN !offdiagonal contributions are added currently in hsmt_u_offdiag
DO i_u=1,atoms%n_u+atoms%n_hia
IF (n.NE.atoms%lda_u(i_u)%atomType) CYCLE
!Found a "U" for this atom type
......@@ -107,12 +114,23 @@ CONTAINS
lm = l* (l+1) + m
DO mp = -lp,lp
lmp = lp* (lp+1) + mp
td%h_loc(lm,lmp,n,jsp) =td%h_loc(lm,lmp,n,jsp) + v%mmpMat(m,mp,i_u,jsp)
td%h_loc(lm+s,lmp+s,n,jsp) =td%h_loc(lm+s,lmp+s,n,jsp)+ v%mmpMat(m,mp,i_u,jsp)*ud%ddn(lp,n,jsp)
IF (jsp < 3) THEN
td%h_loc(lm,lmp,n,jsp) =td%h_loc(lm,lmp,n,jsp) + v%mmpMat(m,mp,i_u,jsp)
td%h_loc(lm+s,lmp+s,n,jsp) =td%h_loc(lm+s,lmp+s,n,jsp) + v%mmpMat(m,mp,i_u,jsp) * ud%ddn(lp,n,jsp)
ELSE IF(jsp.EQ.3) THEN
td%h_loc(lm,lmp,n,jsp) =td%h_loc(lm,lmp,n,jsp) + v%mmpMat(m,mp,i_u,jsp) * uun21(l,n)
td%h_loc(lm+s,lmp,n,jsp) =td%h_loc(lm+s,lmp,n,jsp) + v%mmpMat(m,mp,i_u,jsp) * dun21(l,n)
td%h_loc(lm,lmp+s,n,jsp) =td%h_loc(lm,lmp+s,n,jsp) + v%mmpMat(m,mp,i_u,jsp) * udn21(l,n)
td%h_loc(lm+s,lmp+s,n,jsp) =td%h_loc(lm+s,lmp+s,n,jsp) + v%mmpMat(m,mp,i_u,jsp) * ddn21(l,n)
ELSE
td%h_loc(lm,lmp,n,jsp) =td%h_loc(lm,lmp,n,jsp) + v%mmpMat(mp,m,i_u,3) * uun21(l,n)
td%h_loc(lm+s,lmp,n,jsp) =td%h_loc(lm+s,lmp,n,jsp) + v%mmpMat(mp,m,i_u,3) * dun21(l,n)
td%h_loc(lm,lmp+s,n,jsp) =td%h_loc(lm,lmp+s,n,jsp) + v%mmpMat(mp,m,i_u,3) * udn21(l,n)
td%h_loc(lm+s,lmp+s,n,jsp) =td%h_loc(lm+s,lmp+s,n,jsp) + v%mmpMat(mp,m,i_u,3) * ddn21(l,n)
ENDIF
ENDDO
ENDDO
END DO
ENDIF
!Now add diagonal contribution to matrices
IF (jsp<3) THEN
......@@ -202,9 +220,9 @@ CONTAINS
DO l=0,atoms%lnonsph(n)
c=(-0.5)*CMPLX(noco%b_con(1,n),noco%b_con(2,n))
td%h_off(l ,l ,n,1) =td%h_off(l ,l ,n,1) + uun21(l,n)*c
td%h_loc(l ,l+s,n,1) =td%h_off(l ,l+s,n,1) + udn21(l,n)*c
td%h_loc(l+s,l ,n,1) =td%h_off(l+s,l ,n,1) + dun21(l,n)*c
td%h_loc(l+s,l+s,n,1) =td%h_off(l+s,l+s,n,1) + ddn21(l,n)*c
td%h_off(l ,l+s,n,1) =td%h_off(l ,l+s,n,1) + udn21(l,n)*c
td%h_off(l+s,l ,n,1) =td%h_off(l+s,l ,n,1) + dun21(l,n)*c
td%h_off(l+s,l+s,n,1) =td%h_off(l+s,l+s,n,1) + ddn21(l,n)*c
ENDDO
......@@ -212,9 +230,9 @@ CONTAINS
DO l=0,atoms%lnonsph(n)
c=(-0.5)*CMPLX(noco%b_con(1,n),-noco%b_con(2,n))
td%h_off(l ,l ,n,2) =td%h_off(l ,l ,n,2) + uun21(l,n)*c
td%h_loc(l ,l+s,n,2) =td%h_off(l ,l+s,n,2) + udn21(l,n)*c
td%h_loc(l+s,l ,n,2) =td%h_off(l+s,l ,n,2) + dun21(l,n)*c
td%h_loc(l+s,l+s,n,2) =td%h_off(l+s,l+s,n,2) + ddn21(l,n)*c
td%h_off(l ,l+s,n,2) =td%h_off(l ,l+s,n,2) + udn21(l,n)*c
td%h_off(l+s,l ,n,2) =td%h_off(l+s,l ,n,2) + dun21(l,n)*c
td%h_off(l+s,l+s,n,2) =td%h_off(l+s,l+s,n,2) + ddn21(l,n)*c
ENDDO
END DO
END SUBROUTINE tlmplm_constrained
......
......@@ -4,8 +4,6 @@ set(fleur_F77 ${fleur_F77}
set(fleur_F90 ${fleur_F90}
greensf/greensfImag.f90
greensf/greensfImag21.f90
greensf/greensfRes.f90
greensf/greensfRes21.f90
greensf/angles.f90
greensf/onsite.f90
greensf/kkintgr.f90
......
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