(git:0de0cc2)
fft_plan.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief Type to store data about a (1D or 3D) FFT, including FFTW plan
10 !> \par History
11 !> IAB 09-Jan-2009 : initial version
12 !> (c) The Numerical Algorithms Group (NAG) Ltd, 2009 on behalf of the HECToR project
13 !> IAB 09-Oct-2009 : Added additional fields needed when using OpenMP
14 !> (c) The Numerical Algorithms Group (NAG) Ltd, 2009 on behalf of the HECToR project
15 !> \author JGH
16 ! **************************************************************************************************
17 
18 MODULE fft_plan
19  USE iso_c_binding, ONLY: c_null_ptr,&
20  c_ptr
21 
22  IMPLICIT NONE
23  PRIVATE
24 
25  PUBLIC :: fft_plan_type
26 
27  TYPE fft_plan_type
28 
29  INTEGER :: fft_type = -1
30  INTEGER :: fsign = 0
31  LOGICAL :: trans = .false., fft_in_place = .false., valid = .false., separated_plans = .false.
32  INTEGER :: n = -1, m = -1
33  INTEGER, DIMENSION(3) :: n_3d = -1
34 
35 ! Handle for the FFTW plan
36  TYPE(C_PTR) :: fftw_plan = c_null_ptr
37 
38 ! Plan for the remaining rows for 1D FFT when number of threads does not divide the number of rows exactly
39 !$ TYPE(C_PTR) :: alt_fftw_plan = C_NULL_PTR
40 !$ LOGICAL :: need_alt_plan = .FALSE.
41 !$ INTEGER :: num_threads_needed = -1, num_rows = -1, alt_num_rows = -1
42 
43 ! Individual plans (used by hand-optimised 3D FFT)
44  TYPE(C_PTR) :: fftw_plan_nx = c_null_ptr, fftw_plan_ny = c_null_ptr, fftw_plan_nz = c_null_ptr
45 ! Plans for the remaining rows (when the number of threads does not divide the number of rows exactly)
46  TYPE(C_PTR) :: fftw_plan_nx_r = c_null_ptr, fftw_plan_ny_r = c_null_ptr, fftw_plan_nz_r = c_null_ptr
47 
48  END TYPE fft_plan_type
49 
50 END MODULE fft_plan
Type to store data about a (1D or 3D) FFT, including FFTW plan.
Definition: fft_plan.F:18