A utility to perform Fast Fourier Transforms
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | Ng(3) |
Global number of grid points in each direction |
|||
| type(block_obj), | public, | pointer | :: | block | => | null() |
Associated block structure |
| type(fftbuf_obj), | public | :: | buffers(3) |
Input/Output buffers passed to FFTW |
|||
| integer, | public | :: | contig_dir | = | 0 |
Continguous direction |
|
| logical, | public | :: | fft_dir(3) | = | .false. |
Flags for FFT in each direction |
|
| integer, | public | :: | l_dims(3) |
Size of original array in each direction |
|||
| integer, | public | :: | l_offsets(3) |
Offsets of the local original array in global array |
|||
| type(C_PTR), | public | :: | p_in(3) | = | C_NULL_PTR |
Pointer to input array |
|
| type(C_PTR), | public | :: | p_out(3) | = | C_NULL_PTR |
Pointer to output array |
|
| type(parallel_obj), | public, | pointer | :: | parallel | => | null() |
Associated parallel structure |
| type(C_PTR), | public | :: | plan_b(3) | = | C_NULL_PTR |
Pointer to FFTW plan for inverse transform |
|
| type(C_PTR), | public | :: | plan_f(3) | = | C_NULL_PTR |
Pointer to FFTW plan for forward transform |
|
| integer, | private, | allocatable | :: | r_counts(:) |
Element count to be received by this MPI rank |
||
| integer, | private, | allocatable | :: | r_displs(:) |
Element displacements received by this MPI rank |
||
| integer, | private, | allocatable | :: | r_ptr(:) |
Pointers in received buffers |
||
| integer, | private, | allocatable | :: | s_counts(:) |
Element count to be sent by this MPI rank |
||
| integer, | private, | allocatable | :: | s_displs(:) |
Element displacements sent by this MPI rank |
||
| integer, | private, | allocatable | :: | s_ptr(:) |
Pointers in sent buffers |
Finalizes object and frees memory.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
Determines data layout of original array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
Returns the rank owning a given grid index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| integer, | intent(in) | :: | idx(3) |
Grid index |
||
| integer, | intent(in) | :: | Ng(3) |
Global grid points in each direction |
Rank owning this index
Returns the new layout and decomposition resulting from swapping two directions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| integer, | intent(in) | :: | swap_1 |
Direction to swap |
||
| integer, | intent(in) | :: | swap_2 |
Direction to swap |
||
| integer, | intent(in) | :: | Ng(3) |
Global number of grid points in each direction in the original layout |
||
| integer, | intent(out) | :: | Ng_T(3) |
Global number of grid points in each direction in the transposed layout |
||
| integer, | intent(out) | :: | l_dims_T(3) |
Size of each subblock in the transposed layout |
||
| integer, | intent(out) | :: | l_offsets_T(3) |
Offsets of each subblock in the transposed layout |
Initializes the FFT object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| type(block_obj), | intent(in), | target | :: | block |
A block object |
|
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
Computes the Inverse of a Fourier Transform and stores it back in the input field. The FFT must be given in the halfcomplex format.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| type(eulerian_obj_r), | intent(inout) | :: | field |
Field containing FFT coefficient in halfcomplex format |
Ensures that there is at least one contiguous direction and selects the one with largest number of grid points since that direction will be decomposed by the transpose.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
Sets the FFT directions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| logical, | intent(in) | :: | dir_flag(3) |
FFT directions |
Computes the Fourier Transform of field and stores it back in the input field in the "halfcomplex" (r2r) format. E.g. if the FFT is to be carried out in the 1-dir, then field%cell(:,j,k) contains the fourier transform in the 1-dir stored as follows r_0, r_1, ..., r_(Ng(1)1/2), i_(Ng(1)+1/2-1),..., i_1 r_m is the real part of mode m2pi/L(1) and i_m is the imaginary part of mode m2pi/L(1) for points at location y(j) (or ym(j), depending on the field staggering), z(k) (or zm(k)).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| type(eulerian_obj_r), | intent(inout) | :: | field |
Input field |
Builds the transposed array A_T by swapping directions (swap_1) and (swap_2) of input array A. Note that the MPI decomposition remains unchanged. E.g.: 1) dir1=1 and dir2=2: field_T%cell(i,j,k) = field%cell(j,i,k) 2) dir1=3 and dir2=2: field_T%cell(i,j,k) = field%cell(i,k,j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fft_obj), | intent(inout) | :: | this |
A FFT object |
||
| integer, | intent(in) | :: | swap_1 |
Direction to swap |
||
| integer, | intent(in) | :: | swap_2 |
Direction to swap |
||
| real(kind=wp), | intent(in) | :: | A(:,:,:) |
Input array to transpose |
||
| integer, | intent(in) | :: | Ng(3) |
Global nbr of grid points in the original layout |
||
| integer, | intent(in) | :: | l_dims(3) |
Size of each subblock in the original layout |
||
| integer, | intent(in) | :: | l_offsets(3) |
Offsets of each subblock in the original layout |
||
| real(kind=wp), | intent(out), | allocatable | :: | A_T(:,:,:) |
Transposed array |
|
| integer, | intent(out) | :: | Ng_T(3) |
Global nbr of grid points in the transposed layout |
||
| integer, | intent(out) | :: | l_dims_T(3) |
Size of each subblock in the transposed layout |
||
| integer, | intent(out) | :: | l_offsets_T(3) |
Offsets of each subblock in the transposed layout |