diff --git a/src/grid/FFTW.f90 b/src/grid/FFTW.f90 new file mode 100644 index 000000000..e552e78e0 --- /dev/null +++ b/src/grid/FFTW.f90 @@ -0,0 +1,13 @@ +!-------------------------------------------------------------------------------------------------- +!> @author Martin Diehl, KU Leuven +!> @brief Wrap FFTW3 into a module. +!-------------------------------------------------------------------------------------------------- +module FFTW3 + use, intrinsic :: ISO_C_binding + + implicit none + public + + include 'fftw3-mpi.f03' + +end module FFTW3 diff --git a/src/grid/discretization_grid.f90 b/src/grid/discretization_grid.f90 index 901d35a9a..916cf6e69 100644 --- a/src/grid/discretization_grid.f90 +++ b/src/grid/discretization_grid.f90 @@ -10,6 +10,7 @@ module discretization_grid #if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) use MPI_f08 #endif + use FFTW3 use prec use parallelization @@ -50,7 +51,6 @@ subroutine discretization_grid_init(restart) logical, intent(in) :: restart - include 'fftw3-mpi.f03' real(pReal), dimension(3) :: & mySize, & !< domain size of this process origin !< (global) distance to origin diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index 4e7bc2583..c047d8669 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -4,13 +4,12 @@ !> @brief Utilities used by the different spectral solver variants !-------------------------------------------------------------------------------------------------- module spectral_utilities - use, intrinsic :: iso_c_binding - #include use PETScSys #if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) use MPI_f08 #endif + use FFTW3 use prec use CLI @@ -26,8 +25,6 @@ module spectral_utilities implicit none private - include 'fftw3-mpi.f03' - !-------------------------------------------------------------------------------------------------- ! grid related information real(pReal), protected, public :: wgt !< weighting factor 1/Nelems