Commit dd4f73fb authored by Gregor Michalicek's avatar Gregor Michalicek

Introduce t_eigVecCoeffs type to cdn/cdnval.F90 - part 2

parent 78af809c
......@@ -637,28 +637,24 @@ CONTAINS
IF (input%l_f) THEN
CALL timestart("cdnval: force_a12/21")
IF (.not.input%l_useapw) THEN
CALL force_a12(atoms,noccbd,sym, dimension,cell,oneD,&
we,ispin,noccbd,usdus,eigVecCoeffs%acof(:,0:,:,ispin),&
eigVecCoeffs%bcof(:,0:,:,ispin),force,results)
CALL force_a12(atoms,noccbd,sym,dimension,cell,oneD,&
we,ispin,noccbd,usdus,eigVecCoeffs,force,results)
ENDIF
CALL force_a21(input,atoms,dimension,noccbd,sym,&
oneD,cell,we,ispin,enpara%el0(0:,:,ispin),noccbd,eig,usdus,eigVecCoeffs%acof(:,0:,:,ispin),&
eigVecCoeffs%bcof(:,0:,:,ispin),eigVecCoeffs%ccof(-atoms%llod:,:,:,:,ispin),force,results)
CALL force_a21(input,atoms,dimension,noccbd,sym,oneD,cell,we,ispin,&
enpara%el0(0:,:,ispin),noccbd,eig,usdus,eigVecCoeffs,force,results)
CALL timestop("cdnval: force_a12/21")
END IF
IF(l_cs) THEN
CALL corespec_dos(atoms,usdus,ispin,dimension%lmd,kpts%nkpt,ikpt,&
dimension%neigd,noccbd,results%ef,banddos%sig_dos,&
eig,we,eigVecCoeffs%acof(1,0,1,ispin),eigVecCoeffs%bcof(1,0,1,ispin),&
eigVecCoeffs%ccof(-atoms%llod,1,1,1,ispin))
CALL corespec_dos(atoms,usdus,ispin,dimension%lmd,kpts%nkpt,ikpt,dimension%neigd,&
noccbd,results%ef,banddos%sig_dos,eig,we,eigVecCoeffs)
END IF
END DO !---> end loop over ispin
IF (noco%l_mperp) THEN
CALL rhomt21(atoms,we,noccbd,eigVecCoeffs%acof,eigVecCoeffs%bcof,eigVecCoeffs%ccof,denCoeffsOffdiag)
CALL rhomt21(atoms,we,noccbd,eigVecCoeffs,denCoeffsOffdiag)
IF (l_fmpl) THEN
CALL rhonmt21(atoms,llpd,sphhar,we,noccbd,sym,eigVecCoeffs%acof,eigVecCoeffs%bcof,denCoeffsOffdiag)
CALL rhonmt21(atoms,sphhar,we,noccbd,sym,eigVecCoeffs,denCoeffsOffdiag)
END IF
END IF
......
......@@ -7,22 +7,20 @@ MODULE m_rhomt21
! FF
! ***************************************************************
CONTAINS
SUBROUTINE rhomt21(atoms, we,ne,acof,bcof, ccof,denCoeffsOffdiag)
SUBROUTINE rhomt21(atoms,we,ne,eigVecCoeffs,denCoeffsOffdiag)
USE m_types
IMPLICIT NONE
TYPE(t_atoms),INTENT(IN) :: atoms
! ..
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
TYPE(t_denCoeffsOffdiag),INTENT(INOUT) :: denCoeffsOffdiag
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: ne
! ..
! .. Array Arguments ..
COMPLEX, INTENT (IN) :: acof(:,0:,:,:)!(nobd,0:lmaxd* (lmaxd+2),natd,jspd)
COMPLEX, INTENT (IN) :: bcof(:,0:,:,:)
COMPLEX, INTENT (IN) :: ccof(-atoms%llod:,:,:,:,:) !(-llod:llod,nobd,nlod,natd,jspd)
REAL, INTENT (IN) :: we(:)!(nobd)
TYPE (t_denCoeffsOffdiag), INTENT (INOUT) :: denCoeffsOffdiag
! ..
! .. Local Scalars ..
INTEGER i,l,lm ,itype,na,natom,lo,lop,m
natom = 0
......@@ -37,10 +35,14 @@ CONTAINS
lm = l* (l+1) + m
!---> sum over occupied bands
DO i = 1,ne
denCoeffsOffdiag%uu21(l,itype) = denCoeffsOffdiag%uu21(l,itype) + we(i)* CONJG(acof(i,lm,natom,2))*acof(i,lm,natom,1)
denCoeffsOffdiag%ud21(l,itype) = denCoeffsOffdiag%ud21(l,itype) + we(i)* CONJG(acof(i,lm,natom,2))*bcof(i,lm,natom,1)
denCoeffsOffdiag%du21(l,itype) = denCoeffsOffdiag%du21(l,itype) + we(i)* CONJG(bcof(i,lm,natom,2))*acof(i,lm,natom,1)
denCoeffsOffdiag%dd21(l,itype) = denCoeffsOffdiag%dd21(l,itype) + we(i)* CONJG(bcof(i,lm,natom,2))*bcof(i,lm,natom,1)
denCoeffsOffdiag%uu21(l,itype) = denCoeffsOffdiag%uu21(l,itype) +&
we(i)* CONJG(eigVecCoeffs%acof(i,lm,natom,2))*eigVecCoeffs%acof(i,lm,natom,1)
denCoeffsOffdiag%ud21(l,itype) = denCoeffsOffdiag%ud21(l,itype) +&
we(i)* CONJG(eigVecCoeffs%acof(i,lm,natom,2))*eigVecCoeffs%bcof(i,lm,natom,1)
denCoeffsOffdiag%du21(l,itype) = denCoeffsOffdiag%du21(l,itype) +&
we(i)* CONJG(eigVecCoeffs%bcof(i,lm,natom,2))*eigVecCoeffs%acof(i,lm,natom,1)
denCoeffsOffdiag%dd21(l,itype) = denCoeffsOffdiag%dd21(l,itype) +&
we(i)* CONJG(eigVecCoeffs%bcof(i,lm,natom,2))*eigVecCoeffs%bcof(i,lm,natom,1)
ENDDO ! i = 1,ne
ENDDO ! m = -l,l
ENDDO ! l
......@@ -53,10 +55,14 @@ CONTAINS
DO m = -l,l
lm = l* (l+1) + m
DO i = 1,ne
denCoeffsOffdiag%uulo21(lo,itype) = denCoeffsOffdiag%uulo21(lo,itype) + we(i)* CONJG(acof(i,lm,natom,2))*ccof(m,i,lo,natom,1)
denCoeffsOffdiag%dulo21(lo,itype) = denCoeffsOffdiag%dulo21(lo,itype) + we(i)* CONJG(bcof(i,lm,natom,2))*ccof(m,i,lo,natom,1)
denCoeffsOffdiag%ulou21(lo,itype) = denCoeffsOffdiag%ulou21(lo,itype) + we(i)* CONJG(acof(i,lm,natom,1))*ccof(m,i,lo,natom,2)
denCoeffsOffdiag%ulod21(lo,itype) = denCoeffsOffdiag%ulod21(lo,itype) + we(i)* CONJG(bcof(i,lm,natom,1))*ccof(m,i,lo,natom,2)
denCoeffsOffdiag%uulo21(lo,itype) = denCoeffsOffdiag%uulo21(lo,itype) +&
we(i)* CONJG(eigVecCoeffs%acof(i,lm,natom,2))*eigVecCoeffs%ccof(m,i,lo,natom,1)
denCoeffsOffdiag%dulo21(lo,itype) = denCoeffsOffdiag%dulo21(lo,itype) +&
we(i)* CONJG(eigVecCoeffs%bcof(i,lm,natom,2))*eigVecCoeffs%ccof(m,i,lo,natom,1)
denCoeffsOffdiag%ulou21(lo,itype) = denCoeffsOffdiag%ulou21(lo,itype) +&
we(i)* CONJG(eigVecCoeffs%acof(i,lm,natom,1))*eigVecCoeffs%ccof(m,i,lo,natom,2)
denCoeffsOffdiag%ulod21(lo,itype) = denCoeffsOffdiag%ulod21(lo,itype) +&
we(i)* CONJG(eigVecCoeffs%bcof(i,lm,natom,1))*eigVecCoeffs%ccof(m,i,lo,natom,2)
ENDDO
ENDDO
!---> contribution of local orbital - local orbital terms
......@@ -66,7 +72,7 @@ CONTAINS
DO m = -l,l
DO i = 1,ne
denCoeffsOffdiag%uloulop21(lop,lo,itype) = denCoeffsOffdiag%uloulop21(lop,lo,itype)+&
we(i)*CONJG(ccof(m,i,lop,natom,2))*ccof(m,i,lo, natom,1)
we(i)*CONJG(eigVecCoeffs%ccof(m,i,lop,natom,2))*eigVecCoeffs%ccof(m,i,lo, natom,1)
ENDDO ! i = 1,ne
ENDDO ! m = -l,l
ENDIF
......
......@@ -11,25 +11,25 @@ MODULE m_rhonmt21
! pk`00 ff`01 gb`02
! *************************************************************
CONTAINS
SUBROUTINE rhonmt21(atoms,llpd,sphhar, we,ne,sym,&
acof,bcof,denCoeffsOffdiag)
SUBROUTINE rhonmt21(atoms,sphhar,we,ne,sym,eigVecCoeffs,denCoeffsOffdiag)
USE m_gaunt,ONLY:gaunt1
USE m_types
IMPLICIT NONE
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
TYPE(t_denCoeffsOffdiag),INTENT(INOUT) :: denCoeffsOffdiag
! ..
! .. Scalar Arguments ..
INTEGER,INTENT(IN) :: llpd
INTEGER,INTENT(IN) :: ne
! ..
! .. Array Arguments ..
COMPLEX, INTENT(IN) :: acof(:,0:,:,:)!(nobd,0:lmaxd* (lmaxd+2),natd,jspd)
COMPLEX, INTENT(IN) :: bcof(:,0:,:,:)
REAL, INTENT(IN) :: we(:)!(nobd)
! ..
! .. Local Scalars ..
COMPLEX coef, cconst, cil, coef1
COMPLEX, PARAMETER :: mi = (0.0,-1.0)
......@@ -66,13 +66,13 @@ CONTAINS
DO nb = 1,ne
cconst= we(nb) * coef
denCoeffsOffdiag%uunmt21(llp,lh,nn) = denCoeffsOffdiag%uunmt21(llp,lh,nn)+ &
cconst * acof(nb,lm,nt,1)*CONJG(acof(nb,lmp,nt,2))
cconst * eigVecCoeffs%acof(nb,lm,nt,1)*CONJG(eigVecCoeffs%acof(nb,lmp,nt,2))
denCoeffsOffdiag%udnmt21(llp,lh,nn) = denCoeffsOffdiag%udnmt21(llp,lh,nn)+&
cconst * bcof(nb,lm,nt,1)*CONJG(acof(nb,lmp,nt,2))
cconst * eigVecCoeffs%bcof(nb,lm,nt,1)*CONJG(eigVecCoeffs%acof(nb,lmp,nt,2))
denCoeffsOffdiag%dunmt21(llp,lh,nn) = denCoeffsOffdiag%dunmt21(llp,lh,nn)+&
cconst * acof(nb,lm,nt,1)*CONJG(bcof(nb,lmp,nt,2))
cconst * eigVecCoeffs%acof(nb,lm,nt,1)*CONJG(eigVecCoeffs%bcof(nb,lmp,nt,2))
denCoeffsOffdiag%ddnmt21(llp,lh,nn) = denCoeffsOffdiag%ddnmt21(llp,lh,nn)+&
cconst * bcof(nb,lm,nt,1)*CONJG(bcof(nb,lmp,nt,2))
cconst * eigVecCoeffs%bcof(nb,lm,nt,1)*CONJG(eigVecCoeffs%bcof(nb,lmp,nt,2))
ENDDO ! nb
ENDIF ! (coef >= 0)
......
......@@ -362,14 +362,13 @@ MODULE m_corespec_eval
!-------------------------------------------------------------------------------
!
subroutine corespec_dos(atoms,usdus,ispin,lmd,nkpt,ikpt,&
neigd,noccbd,efermi,sig_dos,&
eig,we,acof,bcof,&
ccof)
neigd,noccbd,efermi,sig_dos,eig,we,eigVecCoeffs)
IMPLICIT NONE
TYPE (t_atoms), INTENT(IN) :: atoms
TYPE (t_usdus), INTENT(IN) :: usdus
TYPE (t_atoms), INTENT(IN) :: atoms
TYPE (t_usdus), INTENT(IN) :: usdus
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
! .. Scalar Arguments ..
integer, intent(in) :: ispin,lmd,nkpt,ikpt
......@@ -377,9 +376,6 @@ MODULE m_corespec_eval
real, intent(in) :: efermi,sig_dos
! .. Array Arguments ..
real, intent (in) :: eig(neigd),we(noccbd)
complex, intent (in) :: acof(noccbd,0:lmd,atoms%nat)
complex, intent (in) :: bcof(noccbd,0:lmd,atoms%nat)
complex, intent (in) :: ccof(-atoms%llod:atoms%llod,noccbd,atoms%nlod,atoms%nat)
! local variables
integer :: lx,lmx,nen,nex
......@@ -417,14 +413,14 @@ MODULE m_corespec_eval
!!$ do l2 = 0,lx
!!$ do m2 = -l2,l2
!!$ lm2 = l2*(l2+1)+m2
csv%dosb(1,1,lm1,lm1,iband) = dble(acof(iband,lm1,iatom)*&
&conjg(acof(iband,lm1,iatom)))*we(1)
csv%dosb(1,2,lm1,lm1,iband) = dble(acof(iband,lm1,iatom)*&
&conjg(bcof(iband,lm1,iatom)))
csv%dosb(2,1,lm1,lm1,iband) = dble(bcof(iband,lm1,iatom)*&
&conjg(acof(iband,lm1,iatom)))
csv%dosb(2,2,lm1,lm1,iband) = dble(bcof(iband,lm1,iatom)*&
&conjg(bcof(iband,lm1,iatom)))*we(1)*usdus%ddn(l1,csi%atomType,ispin)
csv%dosb(1,1,lm1,lm1,iband) = dble(eigVecCoeffs%acof(iband,lm1,iatom,ispin)*&
&conjg(eigVecCoeffs%acof(iband,lm1,iatom,ispin)))*we(1)
csv%dosb(1,2,lm1,lm1,iband) = dble(eigVecCoeffs%acof(iband,lm1,iatom,ispin)*&
&conjg(eigVecCoeffs%bcof(iband,lm1,iatom,ispin)))
csv%dosb(2,1,lm1,lm1,iband) = dble(eigVecCoeffs%bcof(iband,lm1,iatom,ispin)*&
&conjg(eigVecCoeffs%acof(iband,lm1,iatom,ispin)))
csv%dosb(2,2,lm1,lm1,iband) = dble(eigVecCoeffs%bcof(iband,lm1,iatom,ispin)*&
&conjg(eigVecCoeffs%bcof(iband,lm1,iatom,ispin)))*we(1)*usdus%ddn(l1,csi%atomType,ispin)
!!!!! this has to be checked: is >> ddn << factor necessary !!!!!
!!$ enddo
!!$ enddo
......
......@@ -5,9 +5,8 @@ MODULE m_forcea12
! ************************************************************
!
CONTAINS
SUBROUTINE force_a12(&
atoms,nobd,sym, DIMENSION, cell,oneD,&
we,jsp,ne,usdus,acof,bcof,force,results)
SUBROUTINE force_a12(atoms,nobd,sym, DIMENSION, cell,oneD,&
we,jsp,ne,usdus,eigVecCoeffs,force,results)
USE m_types
USE m_constants
IMPLICIT NONE
......@@ -20,15 +19,14 @@ CONTAINS
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: nobd
INTEGER, INTENT (IN) :: ne ,jsp
! ..
! .. Array Arguments ..
REAL, INTENT (IN) :: we(nobd)
COMPLEX, INTENT (IN) :: acof(nobd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat )
COMPLEX, INTENT (IN) :: bcof(nobd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat )
REAL, INTENT (IN) :: we(nobd)
! ..
! .. Local Scalars ..
COMPLEX a12,cil1,cil2
......@@ -82,8 +80,8 @@ CONTAINS
DO m1 = -l1,l1
lm1 = l1* (l1+1) + m1
DO ie = 1,ne
acof_flapw(ie,lm1) = acof(ie,lm1,natrun)
bcof_flapw(ie,lm1) = bcof(ie,lm1,natrun)
acof_flapw(ie,lm1) = eigVecCoeffs%acof(ie,lm1,natrun,jsp)
bcof_flapw(ie,lm1) = eigVecCoeffs%bcof(ie,lm1,natrun,jsp)
ENDDO
ENDDO
ENDDO
......
MODULE m_forcea21
CONTAINS
SUBROUTINE force_a21(&
input,atoms,DIMENSION,nobd,sym,oneD,cell,&
we,jsp,epar,ne,eig,usdus,&
acof,bcof,ccof,force,results)
SUBROUTINE force_a21(input,atoms,DIMENSION,nobd,sym,oneD,cell,&
we,jsp,epar,ne,eig,usdus,eigVecCoeffs,force,results)
! ************************************************************
! Pulay 2nd and 3rd (A17+A20) term force contribution a la Rici
......@@ -29,15 +27,16 @@ CONTAINS
USE m_types
USE m_constants
IMPLICIT NONE
TYPE(t_input),INTENT(IN) :: input
TYPE(t_force),INTENT(INOUT) :: force
TYPE(t_results),INTENT(INOUT):: results
TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_input),INTENT(IN) :: input
TYPE(t_force),INTENT(INOUT) :: force
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: nobd
......@@ -46,9 +45,6 @@ CONTAINS
! .. Array Arguments ..
REAL, INTENT (IN) :: we(nobd),epar(0:atoms%lmaxd,atoms%ntype)
REAL, INTENT (IN) :: eig(DIMENSION%neigd)
COMPLEX, INTENT (IN) :: acof(nobd,0:atoms%lmaxd*(atoms%lmaxd+2) ,atoms%nat)
COMPLEX, INTENT (IN) :: bcof(nobd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat )
COMPLEX, INTENT (IN) :: ccof(-atoms%llod:atoms%llod,nobd,atoms%nlod,atoms%nat)
! ..
! .. Local Scalars ..
COMPLEX dtd,dtu,utd,utu
......@@ -147,10 +143,10 @@ CONTAINS
END IF
DO i = 1,3
a21(i,natrun) = a21(i,natrun) + 2.0*&
AIMAG( CONJG(acof(ie,lm1,natrun)) *utu*force%aveccof(i,ie,lm2,natrun)&
+CONJG(acof(ie,lm1,natrun)) *utd*force%bveccof(i,ie,lm2,natrun)&
+CONJG(bcof(ie,lm1,natrun)) *dtu*force%aveccof(i,ie,lm2,natrun)&
+CONJG(bcof(ie,lm1,natrun)) *dtd*force%bveccof(i,ie,lm2,natrun))*we(ie)/atoms%neq(n)
AIMAG( CONJG(eigVecCoeffs%acof(ie,lm1,natrun,jsp)) *utu*force%aveccof(i,ie,lm2,natrun)&
+CONJG(eigVecCoeffs%acof(ie,lm1,natrun,jsp)) *utd*force%bveccof(i,ie,lm2,natrun)&
+CONJG(eigVecCoeffs%bcof(ie,lm1,natrun,jsp)) *dtu*force%aveccof(i,ie,lm2,natrun)&
+CONJG(eigVecCoeffs%bcof(ie,lm1,natrun,jsp)) *dtd*force%bveccof(i,ie,lm2,natrun))*we(ie)/atoms%neq(n)
! END i loop
END DO
END IF
......@@ -177,10 +173,10 @@ CONTAINS
DO i = 1,3
DO natrun = natom,natom + atoms%neq(n) - 1
a21(i,natrun) = a21(i,natrun) + 2.0*&
AIMAG(CONJG(acof(ie,lm1,natrun)) *utu*force%aveccof(i,ie,lm1,natrun)&
+CONJG(acof(ie,lm1,natrun)) *utd*force%bveccof(i,ie,lm1,natrun)&
+CONJG(bcof(ie,lm1,natrun)) *dtu*force%aveccof(i,ie,lm1,natrun)&
+CONJG(bcof(ie,lm1,natrun)) *dtd*force%bveccof(i,ie,lm1,natrun)&
AIMAG(CONJG(eigVecCoeffs%acof(ie,lm1,natrun,jsp)) *utu*force%aveccof(i,ie,lm1,natrun)&
+CONJG(eigVecCoeffs%acof(ie,lm1,natrun,jsp)) *utd*force%bveccof(i,ie,lm1,natrun)&
+CONJG(eigVecCoeffs%bcof(ie,lm1,natrun,jsp)) *dtu*force%aveccof(i,ie,lm1,natrun)&
+CONJG(eigVecCoeffs%bcof(ie,lm1,natrun,jsp)) *dtd*force%bveccof(i,ie,lm1,natrun)&
)*we(ie) /atoms%neq(n)
END DO
!
......@@ -196,14 +192,10 @@ CONTAINS
!
!---> add the local orbital and U contribution to a21
!
CALL force_a21_lo(nobd,atoms,jsp,n,we,eig,ne,&
acof,bcof,ccof,force%aveccof,force%bveccof,&
force%cveccof, tlmplm,usdus, a21)
CALL force_a21_lo(nobd,atoms,jsp,n,we,eig,ne,eigVecCoeffs,force,tlmplm,usdus,a21)
IF ((atoms%n_u.GT.0).AND.(i_u.LE.atoms%n_u)) THEN
CALL force_a21_U(nobd,atoms,i_u,n,jsp,we,ne,&
usdus,v_mmp,acof,bcof,ccof,&
force%aveccof,force%bveccof,force%cveccof, a21)
CALL force_a21_U(nobd,atoms,i_u,n,jsp,we,ne,usdus,v_mmp,eigVecCoeffs,force,a21)
END IF
IF (input%l_useapw) THEN
! -> B4 force
......@@ -216,14 +208,14 @@ CONTAINS
DO natrun = natom,natom + atoms%neq(n) - 1
b4(i,natrun) = b4(i,natrun) + 0.5 *&
we(ie)/atoms%neq(n)*atoms%rmt(n)**2*AIMAG(&
CONJG(acof(ie,lm1,natrun)*usdus%us(l1,n,jsp)&
+bcof(ie,lm1,natrun)*usdus%uds(l1,n,jsp))*&
CONJG(eigVecCoeffs%acof(ie,lm1,natrun,jsp)*usdus%us(l1,n,jsp)&
+eigVecCoeffs%bcof(ie,lm1,natrun,jsp)*usdus%uds(l1,n,jsp))*&
(force%aveccof(i,ie,lm1,natrun)*usdus%dus(l1,n,jsp)&
+force%bveccof(i,ie,lm1,natrun)*usdus%duds(l1,n,jsp) )&
-CONJG(force%aveccof(i,ie,lm1,natrun)*usdus%us(l1,n,jsp)&
+force%bveccof(i,ie,lm1,natrun)*usdus%uds(l1,n,jsp) )*&
(acof(ie,lm1,natrun)*usdus%dus(l1,n,jsp)&
+bcof(ie,lm1,natrun)*usdus%duds(l1,n,jsp)) )
(eigVecCoeffs%acof(ie,lm1,natrun,jsp)*usdus%dus(l1,n,jsp)&
+eigVecCoeffs%bcof(ie,lm1,natrun,jsp)*usdus%duds(l1,n,jsp)) )
END DO
END DO
END DO
......@@ -236,20 +228,20 @@ CONTAINS
DO natrun = natom,natom + atoms%neq(n) - 1
b4(i,natrun) = b4(i,natrun) + 0.5 *&
we(ie)/atoms%neq(n)*atoms%rmt(n)**2*AIMAG(&
CONJG( acof(ie,lm1,natrun)* usdus%us(l1,n,jsp)&
+ bcof(ie,lm1,natrun)* usdus%uds(l1,n,jsp) ) *&
CONJG( eigVecCoeffs%acof(ie,lm1,natrun,jsp)* usdus%us(l1,n,jsp)&
+ eigVecCoeffs%bcof(ie,lm1,natrun,jsp)* usdus%uds(l1,n,jsp) ) *&
force%cveccof(i,m,ie,lo,natrun)*usdus%dulos(lo,n,jsp)&
+ CONJG(ccof(m,ie,lo,natrun)*usdus%ulos(lo,n,jsp)) *&
+ CONJG(eigVecCoeffs%ccof(m,ie,lo,natrun,jsp)*usdus%ulos(lo,n,jsp)) *&
( force%aveccof(i,ie,lm1,natrun)* usdus%dus(l1,n,jsp)&
+ force%bveccof(i,ie,lm1,natrun)* usdus%duds(l1,n,jsp)&
+ force%cveccof(i,m,ie,lo,natrun)*usdus%dulos(lo,n,jsp) ) &
- (CONJG( force%aveccof(i,ie,lm1,natrun) *usdus%us(l1,n,jsp)&
+ force%bveccof(i,ie,lm1,natrun) *usdus%uds(l1,n,jsp) ) *&
ccof(m,ie,lo,natrun) *usdus%dulos(lo,n,jsp)&
eigVecCoeffs%ccof(m,ie,lo,natrun,jsp) *usdus%dulos(lo,n,jsp)&
+ CONJG(force%cveccof(i,m,ie,lo,natrun)*usdus%ulos(lo,n,jsp)) *&
( acof(ie,lm1,natrun)*usdus%dus(l1,n,jsp)&
+ bcof(ie,lm1,natrun)*usdus%duds(l1,n,jsp)&
+ ccof(m,ie,lo,natrun)*usdus%dulos(lo,n,jsp) ) ) )
( eigVecCoeffs%acof(ie,lm1,natrun,jsp)*usdus%dus(l1,n,jsp)&
+ eigVecCoeffs%bcof(ie,lm1,natrun,jsp)*usdus%duds(l1,n,jsp)&
+ eigVecCoeffs%ccof(m,ie,lo,natrun,jsp)*usdus%dulos(lo,n,jsp) ) ) )
END DO
ENDDO
ENDDO
......
MODULE m_forcea21U
CONTAINS
SUBROUTINE force_a21_U(nobd,atoms,i_u,itype,isp,we,ne,&
usdus,v_mmp, acof,bcof,ccof,aveccof,bveccof,cveccof, a21)
SUBROUTINE force_a21_U(nobd,atoms,i_u,itype,isp,we,ne,usdus,v_mmp,eigVecCoeffs,force,a21)
!
!***********************************************************************
! This subroutine calculates the lda+U contribution to the HF forces,
......@@ -13,8 +12,10 @@ CONTAINS
USE m_types
IMPLICIT NONE
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
TYPE(t_force),INTENT(IN) :: force
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: nobd
......@@ -25,12 +26,6 @@ CONTAINS
! .. Array Arguments ..
REAL, INTENT (IN) :: we(nobd)
COMPLEX, INTENT (IN) :: v_mmp(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,atoms%n_u)
COMPLEX, INTENT (IN) :: acof(:,0:,:)!(nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: bcof(:,0:,:)!(nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: ccof(-atoms%llod:atoms%llod,nobd,atoms%nlod,atoms%nat)
COMPLEX, INTENT (IN) :: aveccof(:,:,0:,:)!(3,nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: bveccof(:,:,0:,:)!(3,nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: cveccof(3,-atoms%llod:atoms%llod,nobd,atoms%nlod,atoms%nat)
REAL, INTENT (INOUT) :: a21(3,atoms%nat)
! ..
! .. Local Scalars ..
......@@ -64,8 +59,8 @@ CONTAINS
DO iatom = sum(atoms%neq(:itype-1))+1,sum(atoms%neq(:itype))
DO ie = 1,ne
DO i = 1,3
p1 = (CONJG(acof(ie,lm,iatom)) * v_a) * aveccof(i,ie,lmp,iatom)
p2 = (CONJG(bcof(ie,lm,iatom)) * v_b) * bveccof(i,ie,lmp,iatom)
p1 = (CONJG(eigVecCoeffs%acof(ie,lm,iatom,isp)) * v_a) * force%aveccof(i,ie,lmp,iatom)
p2 = (CONJG(eigVecCoeffs%bcof(ie,lm,iatom,isp)) * v_b) * force%bveccof(i,ie,lmp,iatom)
a21(i,iatom) = a21(i,iatom) + 2.0*AIMAG(p1 + p2) * we(ie)/atoms%neq(itype)
END DO
END DO
......@@ -89,11 +84,11 @@ CONTAINS
DO iatom = sum(atoms%neq(:itype-1))+1,sum(atoms%neq(:itype))
DO ie = 1,ne
DO i = 1,3
p1 = v_a * (CONJG(ccof(m,ie,lo,iatom)) * cveccof(i,mp,ie,lo,iatom))
p2 = v_b * (CONJG(acof(ie,lm,iatom)) * cveccof(i,mp,ie,lo,iatom) + &
CONJG(ccof(m,ie,lo,iatom)) * aveccof(i,ie,lmp,iatom))
p3 = v_c * (CONJG(bcof(ie,lm,iatom)) * cveccof(i,mp,ie,lo,iatom) + &
CONJG(ccof(m,ie,lo,iatom)) * bveccof(i,ie,lmp,iatom))
p1 = v_a * (CONJG(eigVecCoeffs%ccof(m,ie,lo,iatom,isp)) * force%cveccof(i,mp,ie,lo,iatom))
p2 = v_b * (CONJG(eigVecCoeffs%acof(ie,lm,iatom,isp)) * force%cveccof(i,mp,ie,lo,iatom) + &
CONJG(eigVecCoeffs%ccof(m,ie,lo,iatom,isp)) * force%aveccof(i,ie,lmp,iatom))
p3 = v_c * (CONJG(eigVecCoeffs%bcof(ie,lm,iatom,isp)) * force%cveccof(i,mp,ie,lo,iatom) + &
CONJG(eigVecCoeffs%ccof(m,ie,lo,iatom,isp)) * force%bveccof(i,ie,lmp,iatom))
a21(i,iatom) = a21(i,iatom) + 2.0*AIMAG(p1 + p2 + p3)*we(ie)/atoms%neq(itype)
END DO
END DO
......
......@@ -6,9 +6,7 @@
MODULE m_forcea21lo
CONTAINS
SUBROUTINE force_a21_lo(nobd,atoms,isp,itype,we,eig,ne,&
acof,bcof,ccof,aveccof,bveccof,&
cveccof,tlmplm,usdus, a21)
SUBROUTINE force_a21_lo(nobd,atoms,isp,itype,we,eig,ne,eigVecCoeffs,force,tlmplm,usdus,a21)
!
!***********************************************************************
! This subroutine calculates the local orbital contribution to A21,
......@@ -19,9 +17,11 @@ CONTAINS
!
USE m_types
IMPLICIT NONE
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_tlmplm),INTENT(IN) :: tlmplm
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_usdus),INTENT(IN) :: usdus
TYPE(t_tlmplm),INTENT(IN) :: tlmplm
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_eigVecCoeffs),INTENT(IN) :: eigVecCoeffs
TYPE(t_force),INTENT(IN) :: force
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: nobd
......@@ -29,12 +29,6 @@ CONTAINS
! ..
! .. Array Arguments ..
REAL, INTENT (IN) :: we(nobd),eig(:)!(dimension%neigd)
COMPLEX, INTENT (IN) :: acof(:,0:,:) !(nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: bcof(:,0:,:) !(nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: ccof(-atoms%llod:atoms%llod,nobd,atoms%nlod,atoms%nat)
COMPLEX, INTENT (IN) :: aveccof(:,:,0:,:)!(3,nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: bveccof(:,:,0:,:)!(3,nobd,0:dimension%lmd,atoms%nat)
COMPLEX, INTENT (IN) :: cveccof(3,-atoms%llod:atoms%llod,nobd,atoms%nlod,atoms%nat)
REAL, INTENT (INOUT) :: a21(3,atoms%nat)
! ..
! .. Local Scalars ..
......@@ -73,14 +67,14 @@ CONTAINS
DO ie = 1,ne
DO i = 1,3
a21(i,iatom)=a21(i,iatom)+2.0*aimag(&
conjg(acof(ie,lmp,iatom))*utulo&
*cveccof(i,m,ie,lo,iatom)&
+ conjg(bcof(ie,lmp,iatom))*dtulo&
*cveccof(i,m,ie,lo,iatom)&
+ conjg(ccof(m,ie,lo,iatom))&
*cutulo*aveccof(i,ie,lmp,iatom)&
+ conjg(ccof(m,ie,lo,iatom))&
*cdtulo*bveccof(i,ie,lmp,iatom)&
conjg(eigVecCoeffs%acof(ie,lmp,iatom,isp))*utulo&
*force%cveccof(i,m,ie,lo,iatom)&
+ conjg(eigVecCoeffs%bcof(ie,lmp,iatom,isp))*dtulo&
*force%cveccof(i,m,ie,lo,iatom)&
+ conjg(eigVecCoeffs%ccof(m,ie,lo,iatom,isp))&
*cutulo*force%aveccof(i,ie,lmp,iatom)&
+ conjg(eigVecCoeffs%ccof(m,ie,lo,iatom,isp))&
*cdtulo*force%bveccof(i,ie,lmp,iatom)&
)*we(ie)/atoms%neq(itype)
ENDDO
ENDDO
......@@ -107,8 +101,8 @@ CONTAINS
DO ie = 1,ne
DO i = 1,3
a21(i,iatom)=a21(i,iatom)+2.0*aimag(&
+ conjg(ccof(m,ie,lo,iatom))&
*ulotulo*cveccof(i,mp,ie,lop,iatom)&
+ conjg(eigVecCoeffs%ccof(m,ie,lo,iatom,isp))&
*ulotulo*force%cveccof(i,mp,ie,lop,iatom)&
)*we(ie)/atoms%neq(itype)
ENDDO
ENDDO
......@@ -121,10 +115,10 @@ CONTAINS
DO i = 1,3
a21(i,iatom)=a21(i,iatom)&
-2.0*aimag(&
(conjg(acof(ie,lm,iatom))*cveccof(i,m,ie,lo,iatom)+&
conjg(ccof(m,ie,lo,iatom))*aveccof(i,ie,lm,iatom))*usdus%uulon(lo,itype,isp)+&
(conjg(bcof(ie,lm,iatom))*cveccof(i,m,ie,lo,iatom)+&
conjg(ccof(m,ie,lo,iatom))*bveccof(i,ie,lm,iatom))*&
(conjg(eigVecCoeffs%acof(ie,lm,iatom,isp))*force%cveccof(i,m,ie,lo,iatom)+&
conjg(eigVecCoeffs%ccof(m,ie,lo,iatom,isp))*force%aveccof(i,ie,lm,iatom))*usdus%uulon(lo,itype,isp)+&
(conjg(eigVecCoeffs%bcof(ie,lm,iatom,isp))*force%cveccof(i,m,ie,lo,iatom)+&
conjg(eigVecCoeffs%ccof(m,ie,lo,iatom,isp))*force%bveccof(i,ie,lm,iatom))*&
usdus%dulon(lo,itype,isp))*eig(ie)*we(ie)/atoms%neq(itype)
ENDDO
ENDDO
......@@ -135,8 +129,8 @@ CONTAINS
DO ie = 1,ne
DO i = 1,3
a21(i,iatom)=a21(i,iatom)-2.0*aimag(&
conjg(ccof(m,ie,lo,iatom))*&
cveccof(i,m,ie,lop,iatom)*&
conjg(eigVecCoeffs%ccof(m,ie,lo,iatom,isp))*&
force%cveccof(i,m,ie,lop,iatom)*&
usdus%uloulopn(lo,lop,itype,isp))*&
eig(ie)*we(ie)/atoms%neq(itype)
......
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