fft_3d Subroutine

public subroutine fft_3d(self, grid, isign)

Transform along all three directions, isign selects forward (-1) or backward (+1)

Arguments

Type IntentOptional Attributes Name
type(fft_mesh), intent(in) :: self

Instance of the transform

complex(kind=wp), intent(inout) :: grid(:,:,:)

Mesh to transform in place

integer, intent(in) :: isign

Sign of the exponent


Source Code

subroutine fft_3d(self, grid, isign)

   !> Instance of the transform
   type(fft_mesh), intent(in) :: self

   !> Mesh to transform in place
   complex(wp), intent(inout) :: grid(:, :, :)

   !> Sign of the exponent
   integer, intent(in) :: isign

   integer :: i1, i2, i3

   !$omp parallel default(none) shared(self, grid, isign) private(i1, i2, i3)

   !$omp do schedule(runtime) collapse(2)
   do i3 = 1, self%mesh(3)
      do i2 = 1, self%mesh(2)
         call fft_1d(grid(:, i2, i3), self%tw, self%nmax, isign)
      end do
   end do
   !$omp end do

   !$omp do schedule(runtime) collapse(2)
   do i3 = 1, self%mesh(3)
      do i1 = 1, self%mesh(1)
         call fft_1d(grid(i1, :, i3), self%tw, self%nmax, isign)
      end do
   end do
   !$omp end do

   !$omp do schedule(runtime) collapse(2)
   do i2 = 1, self%mesh(2)
      do i1 = 1, self%mesh(1)
         call fft_1d(grid(i1, i2, :), self%tw, self%nmax, isign)
      end do
   end do
   !$omp end do

   !$omp end parallel

end subroutine fft_3d