1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 22:53:42 +01:00
qp_plugins_scemama/devel/cc/form_r1.irp.f

71 lines
1.7 KiB
FortranFixed
Raw Normal View History

2019-09-14 14:15:25 +02:00
subroutine form_r1(hvv,hoo,hvo,t1,t2,tau,r1)
2019-09-09 16:51:15 +02:00
! Form tau in CCSD
implicit none
! Input variables
2019-09-14 14:15:25 +02:00
double precision,intent(in) :: hvv(spin_vir_num,spin_vir_num)
double precision,intent(in) :: hoo(spin_occ_num,spin_occ_num)
double precision,intent(in) :: hvo(spin_vir_num,spin_occ_num)
2019-09-09 16:51:15 +02:00
2019-09-14 14:15:25 +02:00
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
double precision,intent(in) :: t2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
double precision,intent(in) :: tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
2019-09-09 16:51:15 +02:00
! Local variables
integer :: i,j,k,l
integer :: a,b,c,d
! Output variables
2019-09-14 14:15:25 +02:00
double precision,intent(out) :: r1(spin_occ_num,spin_vir_num)
2019-09-09 16:51:15 +02:00
r1(:,:) = 0d0
2019-09-14 14:15:25 +02:00
do a=1,spin_vir_num
do i=1,spin_occ_num
2019-09-09 16:51:15 +02:00
2019-09-14 14:15:25 +02:00
do b=1,spin_vir_num
2019-09-09 16:51:15 +02:00
r1(i,a) = r1(i,a) + hvv(b,a)*t1(i,b)
end do
2019-09-14 14:15:25 +02:00
do j=1,spin_occ_num
2019-09-09 16:51:15 +02:00
r1(i,a) = r1(i,a) - hoo(i,j)*t1(j,a)
end do
2019-09-14 14:15:25 +02:00
do j=1,spin_occ_num
do b=1,spin_vir_num
2019-09-09 16:51:15 +02: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
2019-09-14 14:15:25 +02:00
do b=1,spin_vir_num
do j=1,spin_occ_num
2019-09-09 16:51:15 +02:00
r1(i,a) = r1(i,a) + OVVO(i,b,a,j)*t1(j,b)
end do
end do
2019-09-14 14:15:25 +02:00
do c=1,spin_vir_num
do b=1,spin_vir_num
do j=1,spin_occ_num
2019-09-09 16:51:15 +02:00
r1(i,a) = r1(i,a) - OVVV(j,a,b,c)*tau(i,j,b,c)
end do
end do
end do
2019-09-14 14:15:25 +02:00
do b=1,spin_vir_num
do k=1,spin_occ_num
do j=1,spin_occ_num
2019-09-09 16:51:15 +02: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