Commit 77d0ceee authored by Henning Janssen's avatar Henning Janssen

Bugfix to v_mmp_21

parent 71932854
......@@ -59,7 +59,7 @@ CONTAINS
ALLOCATE (u(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,&
-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,MAX(1,atoms%n_u),input%jspins))
ALLOCATE (n_mmp(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,MAX(1,atoms%n_u),input%jspins))
n_mmp(:,:,1:atoms%n_u,:) = inDen%mmpMat(:,:,1:atoms%n_u,:)
n_mmp(:,:,1:atoms%n_u,:) = inDen%mmpMat(:,:,1:atoms%n_u,1:input%jspins)
DO ispin = 1, 1 ! input%jspins
f0(:,1) = (f0(:,1) + f0(:,input%jspins) ) / 2
f2(:,1) = (f2(:,1) + f2(:,input%jspins) ) / 2
......@@ -74,7 +74,7 @@ CONTAINS
CALL nmat_rot(atoms%lda_u(1:atoms%n_u)%phi,atoms%lda_u(1:atoms%n_u)%theta,zero,3,atoms%n_u,input%jspins,atoms%lda_u(1:atoms%n_u)%l,n_mmp)
! calculate potential matrix and total energy correction
CALL v_mmp(sym,atoms,atoms%lda_u(:atoms%n_u),atoms%n_u,input%jspins,.TRUE.,n_mmp,u,f0,f2,pot%mmpMat,results%e_ldau)
CALL v_mmp(sym,atoms,atoms%lda_u(:atoms%n_u),atoms%n_u,input%jspins,.TRUE.,n_mmp,u,f0,f2,pot%mmpMat(:,:,1:atoms%n_u,1:input%jspins),results%e_ldau)
!spin off-diagonal elements (no rotation yet)
IF(noco%l_mperp) THEN
......
MODULE m_vmmp21
! ************************************************************
! This subroutine calculates the potential matrix v^{s}_{m,m'}
! for a given atom 'n' and l-quantum number 'l'. The l,u,j's for
! for a given atom 'iType' and l-quantum number 'l'. The l,u,j's for
! all atoms are stored in lda_u, the density matrix is ns_mmp,
! and the e-e- interaction potential is u(m1,m2,m3,m4,n).
! and the e-e- interaction potential is u(m1,m2,m3,m4,iType).
! For details see Eq.(16) of Shick et al. PRB 60, 10765 (1999)
!
! Additionally, the total energy contribution of LDA+U (Eq.24)
......@@ -27,10 +27,10 @@ MODULE m_vmmp21
TYPE (t_utype), INTENT (IN) :: u_in(n_u)
COMPLEX, INTENT(IN):: n_mmp21(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,n_u)
COMPLEX,INTENT(OUT)::v_mmp21(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,n_u)
COMPLEX,INTENT(INOUT)::v_mmp21(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,n_u)
!
! .. Local Variables ..
INTEGER n,ispin,jspin,l,m,mp,p,q,iType,i_u
INTEGER ispin,jspin,l,m,mp,p,q,iType,i_u
REAL rho_tot,u_htr,j_htr,e_ee,ns_sum,spin_deg,e_dc,e_dcc
REAL a1,a2,alpha
LOGICAL l_mix
......@@ -45,7 +45,7 @@ MODULE m_vmmp21
iType = u_in(i_u)%atomType
l = u_in(i_u)%l
l_mix = .false. ! lda_u(itype)%l_amf ! switched off
u_htr = f0(n)/hartree_to_ev_const
u_htr = f0(i_u)/hartree_to_ev_const
IF (l.EQ.1) THEN
j_htr = f2(i_u)/(5*hartree_to_ev_const)
ELSEIF (l.EQ.2) THEN
......@@ -62,7 +62,7 @@ MODULE m_vmmp21
!------------------------------------------------------------------------+
! initialise v_mmp
!
v_mmp21(:,:,n) = cmplx(0.0,0.0)
v_mmp21(:,:,i_u) = cmplx(0.0,0.0)
!
! outer spin loop - set up v_mmp
!
......
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