mirror of
https://github.com/pfloos/quack
synced 2024-12-22 20:35:36 +01:00
opt memory access in Aph & Bph
This commit is contained in:
parent
6cfe4a5dec
commit
20900979c4
@ -7,31 +7,31 @@ subroutine phLR_A(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,e,ERI,Aph)
|
|||||||
|
|
||||||
! Input variables
|
! Input variables
|
||||||
|
|
||||||
logical,intent(in) :: dRPA
|
logical,intent(in) :: dRPA
|
||||||
integer,intent(in) :: ispin
|
integer,intent(in) :: ispin
|
||||||
integer,intent(in) :: nBas
|
integer,intent(in) :: nBas
|
||||||
integer,intent(in) :: nC
|
integer,intent(in) :: nC
|
||||||
integer,intent(in) :: nO
|
integer,intent(in) :: nO
|
||||||
integer,intent(in) :: nV
|
integer,intent(in) :: nV
|
||||||
integer,intent(in) :: nR
|
integer,intent(in) :: nR
|
||||||
integer,intent(in) :: nS
|
integer,intent(in) :: nS
|
||||||
double precision,intent(in) :: lambda
|
double precision,intent(in) :: lambda
|
||||||
double precision,intent(in) :: e(nBas)
|
double precision,intent(in) :: e(nBas)
|
||||||
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
||||||
|
|
||||||
! Local variables
|
! Local variables
|
||||||
|
|
||||||
double precision :: delta_dRPA
|
double precision :: delta_dRPA
|
||||||
double precision,external :: Kronecker_delta
|
double precision,external :: Kronecker_delta
|
||||||
|
|
||||||
integer :: i,j,a,b,ia,jb
|
integer :: i,j,a,b,ia,jb
|
||||||
integer :: nn,jb0
|
integer :: nn,jb0
|
||||||
logical :: i_eq_j
|
logical :: i_eq_j
|
||||||
double precision :: ct1,ct2
|
double precision :: ct1,ct2
|
||||||
|
|
||||||
! Output variables
|
! Output variables
|
||||||
|
|
||||||
double precision,intent(out) :: Aph(nS,nS)
|
double precision,intent(out) :: Aph(nS,nS)
|
||||||
|
|
||||||
! Direct RPA
|
! Direct RPA
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ subroutine phLR_A(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,e,ERI,Aph)
|
|||||||
do b = nO+1, nBas-nR
|
do b = nO+1, nBas-nR
|
||||||
jb = b + jb0
|
jb = b + jb0
|
||||||
|
|
||||||
Aph(ia,jb) = ct1 * ERI(i,b,a,j) + ct2 * ERI(i,b,j,a)
|
Aph(ia,jb) = ct1 * ERI(b,i,j,a) + ct2 * ERI(b,j,a,i)
|
||||||
if(i_eq_j) then
|
if(i_eq_j) then
|
||||||
if(a == b) Aph(ia,jb) = Aph(ia,jb) + e(a) - e(i)
|
if(a == b) Aph(ia,jb) = Aph(ia,jb) + e(a) - e(i)
|
||||||
endif
|
endif
|
||||||
@ -109,7 +109,7 @@ subroutine phLR_A(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,e,ERI,Aph)
|
|||||||
do b = nO+1, nBas-nR
|
do b = nO+1, nBas-nR
|
||||||
jb = b + jb0
|
jb = b + jb0
|
||||||
|
|
||||||
Aph(ia,jb) = ct2 * ERI(i,b,j,a)
|
Aph(ia,jb) = ct2 * ERI(b,j,a,i)
|
||||||
if(i_eq_j) then
|
if(i_eq_j) then
|
||||||
if(a == b) Aph(ia,jb) = Aph(ia,jb) + e(a) - e(i)
|
if(a == b) Aph(ia,jb) = Aph(ia,jb) + e(a) - e(i)
|
||||||
endif
|
endif
|
||||||
|
@ -7,22 +7,22 @@ subroutine phLR_B(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,ERI,Bph)
|
|||||||
|
|
||||||
! Input variables
|
! Input variables
|
||||||
|
|
||||||
logical,intent(in) :: dRPA
|
logical,intent(in) :: dRPA
|
||||||
integer,intent(in) :: ispin,nBas,nC,nO,nV,nR,nS
|
integer,intent(in) :: ispin,nBas,nC,nO,nV,nR,nS
|
||||||
double precision,intent(in) :: lambda
|
double precision,intent(in) :: lambda
|
||||||
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
||||||
|
|
||||||
! Local variables
|
! Local variables
|
||||||
|
|
||||||
double precision :: delta_dRPA
|
double precision :: delta_dRPA
|
||||||
|
|
||||||
integer :: i,j,a,b,ia,jb
|
integer :: i,j,a,b,ia,jb
|
||||||
integer :: nn,jb0
|
integer :: nn,jb0
|
||||||
double precision :: ct1,ct2
|
double precision :: ct1,ct2
|
||||||
|
|
||||||
! Output variables
|
! Output variables
|
||||||
|
|
||||||
double precision,intent(out) :: Bph(nS,nS)
|
double precision,intent(out) :: Bph(nS,nS)
|
||||||
|
|
||||||
! Direct RPA
|
! Direct RPA
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ subroutine phLR_B(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,ERI,Bph)
|
|||||||
do b = nO+1, nBas-nR
|
do b = nO+1, nBas-nR
|
||||||
jb = b + jb0
|
jb = b + jb0
|
||||||
|
|
||||||
Bph(ia,jb) = ct1 * ERI(i,j,a,b) + ct2 * ERI(i,j,b,a)
|
Bph(ia,jb) = ct1 * ERI(b,i,j,a) + ct2 * ERI(b,j,i,a)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@ -94,7 +94,7 @@ subroutine phLR_B(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,ERI,Bph)
|
|||||||
do b = nO+1, nBas-nR
|
do b = nO+1, nBas-nR
|
||||||
jb = b + jb0
|
jb = b + jb0
|
||||||
|
|
||||||
Bph(ia,jb) = ct2 * ERI(i,j,b,a)
|
Bph(ia,jb) = ct2 * ERI(b,j,i,a)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
Loading…
Reference in New Issue
Block a user