2020-03-26 16:57:46 +01:00
|
|
|
subroutine form_v(nC,nO,nV,nR,X1,X2,X3,X4,t2,v)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Form quadratic array in CCD
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2020-03-26 16:57:46 +01:00
|
|
|
integer,intent(in) :: nC,nO,nV,nR
|
2020-10-19 14:20:35 +02:00
|
|
|
double precision,intent(in) :: t2(nO-nC,nO-nC,nV-nR,nV-nR)
|
|
|
|
double precision,intent(in) :: X1(nO-nC,nO-nC,nO-nC,nO-nC)
|
|
|
|
double precision,intent(in) :: X2(nV-nR,nV-nR)
|
|
|
|
double precision,intent(in) :: X3(nO-nC,nO-nC)
|
|
|
|
double precision,intent(in) :: X4(nO-nC,nO-nC,nV-nR,nV-nR)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: i,j,k,l
|
|
|
|
integer :: a,b,c,d
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
2020-10-19 14:20:35 +02:00
|
|
|
double precision,intent(out) :: v(nO-nC,nO-nC,nV-nR,nV-nR)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
v(:,:,:,:) = 0d0
|
|
|
|
|
2020-10-19 14:20:35 +02:00
|
|
|
do i=1,nO-nC
|
|
|
|
do j=1,nO-nC
|
2020-03-26 16:57:46 +01:00
|
|
|
do a=1,nV-nR
|
|
|
|
do b=1,nV-nR
|
2020-10-19 14:20:35 +02:00
|
|
|
do k=1,nO-nC
|
|
|
|
do l=1,nO-nC
|
2019-03-19 10:13:33 +01:00
|
|
|
v(i,j,a,b) = v(i,j,a,b) + 0.25d0*X1(k,l,i,j)*t2(k,l,a,b)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2020-10-19 14:20:35 +02:00
|
|
|
do i=1,nO-nC
|
|
|
|
do j=1,nO-nC
|
2020-03-26 16:57:46 +01:00
|
|
|
do a=1,nV-nR
|
|
|
|
do b=1,nV-nR
|
|
|
|
do c=1,nV-nR
|
2019-03-19 10:13:33 +01:00
|
|
|
v(i,j,a,b) = v(i,j,a,b) - 0.5d0*(X2(b,c)*t2(i,j,a,c) + X2(a,c)*t2(i,j,c,b))
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2020-10-19 14:20:35 +02:00
|
|
|
do i=1,nO-nC
|
|
|
|
do j=1,nO-nC
|
2020-03-26 16:57:46 +01:00
|
|
|
do a=1,nV-nR
|
|
|
|
do b=1,nV-nR
|
2020-10-19 14:20:35 +02:00
|
|
|
do k=1,nO-nC
|
2019-03-19 10:13:33 +01:00
|
|
|
v(i,j,a,b) = v(i,j,a,b) - 0.5d0*(X3(k,j)*t2(i,k,a,b) + X3(k,i)*t2(k,j,a,b))
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2020-10-19 14:20:35 +02:00
|
|
|
do i=1,nO-nC
|
|
|
|
do j=1,nO-nC
|
2020-03-26 16:57:46 +01:00
|
|
|
do a=1,nV-nR
|
|
|
|
do b=1,nV-nR
|
2020-10-19 14:20:35 +02:00
|
|
|
do k=1,nO-nC
|
2020-03-26 16:57:46 +01:00
|
|
|
do c=1,nV-nR
|
2019-03-19 10:13:33 +01:00
|
|
|
v(i,j,a,b) = v(i,j,a,b) + (X4(i,k,a,c)*t2(j,k,b,c) + X4(i,k,b,c)*t2(k,j,a,c))
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
end subroutine form_v
|