4
1
mirror of https://github.com/pfloos/quack synced 2024-11-13 01:23:59 +01:00
quack/src/CC/form_u.f90

72 lines
1.6 KiB
Fortran
Raw Normal View History

2020-03-26 16:57:46 +01:00
subroutine form_u(nC,nO,nV,nR,OOOO,VVVV,OVOV,t2,u)
2019-03-19 10:13:33 +01:00
! Form linear 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) :: OOOO(nO-nC,nO-nC,nO-nC,nO-nC)
double precision,intent(in) :: VVVV(nV-nR,nV-nR,nV-nR,nV-nR)
double precision,intent(in) :: OVOV(nO-nC,nV-nR,nO-nC,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) :: u(nO-nC,nO-nC,nV-nR,nV-nR)
2019-03-19 10:13:33 +01:00
u(:,:,:,:) = 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
do c=1,nV-nR
do d=1,nV-nR
2019-03-19 10:13:33 +01:00
u(i,j,a,b) = u(i,j,a,b) + 0.5d0*VVVV(a,b,c,d)*t2(i,j,c,d)
enddo
enddo
enddo
enddo
enddo
enddo
2020-10-19 14:20:35 +02:00
do i=1,nO-nC
do j=1,nO-nC
do k=1,nO-nC
do l=1,nO-nC
2020-03-26 16:57:46 +01:00
do a=1,nV-nR
do b=1,nV-nR
2019-03-19 10:13:33 +01:00
u(i,j,a,b) = u(i,j,a,b) + 0.5d0*OOOO(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
do k=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
u(i,j,a,b) = u(i,j,a,b) - OVOV(k,b,j,c)*t2(i,k,a,c) &
+ OVOV(k,a,j,c)*t2(i,k,b,c) &
- OVOV(k,a,i,c)*t2(j,k,b,c) &
+ OVOV(k,b,i,c)*t2(j,k,a,c)
enddo
enddo
enddo
enddo
enddo
enddo
end subroutine form_u