4
1
mirror of https://github.com/pfloos/quack synced 2024-11-13 09:34:04 +01:00
quack/src/CC/form_r1.f90

78 lines
1.7 KiB
Fortran
Raw Normal View History

2020-03-26 16:57:46 +01:00
subroutine form_r1(nC,nO,nV,nR,OVVO,OVVV,OOOV,hvv,hoo,hvo,t1,t2,tau,r1)
2019-03-19 10:13:33 +01:00
! Form tau in CCSD
implicit none
! Input variables
2020-03-26 16:57:46 +01:00
integer,intent(in) :: nC,nO,nV,nR
2019-03-19 10:13:33 +01:00
double precision,intent(in) :: OVVO(nO,nV,nV,nO)
double precision,intent(in) :: OVVV(nO,nV,nV,nV)
double precision,intent(in) :: OOOV(nO,nO,nO,nV)
double precision,intent(in) :: hvv(nV,nV)
double precision,intent(in) :: hoo(nO,nO)
double precision,intent(in) :: hvo(nV,nO)
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
! Local variables
integer :: i,j,k,l
integer :: a,b,c,d
! Output variables
double precision,intent(out) :: r1(nO,nV)
r1(:,:) = 0d0
2020-03-26 16:57:46 +01:00
do i=nC+1,nO
do a=1,nV-nR
2019-03-19 10:13:33 +01:00
2020-03-26 16:57:46 +01:00
do b=1,nV-nR
2019-03-19 10:13:33 +01:00
r1(i,a) = r1(i,a) + hvv(b,a)*t1(i,b)
end do
2020-03-26 16:57:46 +01:00
do j=nC+1,nO
2019-03-19 10:13:33 +01:00
r1(i,a) = r1(i,a) - hoo(i,j)*t1(j,a)
end do
2020-03-26 16:57:46 +01:00
do j=nC+1,nO
do b=1,nV-nR
2019-03-19 10:13:33 +01:00
r1(i,a) = r1(i,a) + hvo(b,j)*(t2(i,j,a,b) + t1(i,b)*t1(j,a))
end do
end do
2020-03-26 16:57:46 +01:00
do j=nC+1,nO
do b=1,nV-nR
2019-03-19 10:13:33 +01:00
r1(i,a) = r1(i,a) + OVVO(i,b,a,j)*t1(j,b)
end do
end do
2020-03-26 16:57:46 +01:00
do j=nC+1,nO
do b=1,nV-nR
do c=1,nV-nR
2019-03-19 10:13:33 +01:00
r1(i,a) = r1(i,a) - OVVV(j,a,b,c)*tau(i,j,b,c)
end do
end do
end do
2020-03-26 16:57:46 +01:00
do j=nC+1,nO
do k=nC+1,nO
do b=1,nV-nR
2019-03-19 10:13:33 +01:00
r1(i,a) = r1(i,a) - OOOV(j,k,i,b)*tau(j,k,a,b)
end do
end do
end do
end do
end do
end subroutine form_r1