26 use,
intrinsic :: iso_c_binding
50 integer,
public,
parameter :: &
55 integer,
public,
parameter :: &
56 NFFT_PRE_PHI_HUT = 0, &
76 real(real64),
public :: norm
79 logical,
public :: set_defaults = .false.
80 logical,
public :: guru
81 integer,
public :: precompute
83 real(real64),
public :: sigma
97 type(nfft_t),
intent(inout) :: nfft
98 type(namespace_t),
intent(in) :: namespace
109 call parse_variable(namespace,
'NFFTGuruInterface', .false., nfft%guru)
163 subroutine nfft_init(nfft, nfft_options, N, dim, M, optimize)
164 type(nfft_t),
intent(inout) :: nfft
166 integer,
intent(inout) :: n(3)
167 integer,
intent(inout) :: m(3)
168 integer,
intent(in) :: dim
171 integer :: ii, my_n(3)
173 integer :: nfft_flags
184 if (.not. nfft%set_defaults)
then
185 nfft%guru = nfft_options%guru
186 nfft%mm = nfft_options%mm
187 nfft%sigma = nfft_options%sigma
188 nfft%precompute = nfft_options%precompute
196 my_n(ii) = n(ii)*int(nfft%sigma)
200 nfft%fftN(1:dim) = my_n(1:dim)
206 nfft_flags = nfft_flags + nfft%precompute
208 call oct_nfft_init_guru(nfft%plan, dim, n, m(1)*m(2)*m(3), my_n, nfft%mm, &
209 nfft_flags, fftw_measure + fftw_destroy_input)
215 call oct_nfft_init_3d(nfft%plan, n(1), n(2),n(3), m(1)*m(2)*m(3))
217 call oct_nfft_init_2d(nfft%plan, n(1), n(2), m(1)*m(2))
219 call oct_nfft_init_1d(nfft%plan,n(1),m(1))
230 type(
nfft_t),
intent(inout) :: nfft
240 do idir = 1, nfft%dim
252 do idir = 1, nfft%dim
264 do idir = 1, nfft%dim
275 select case (nfft%precompute)
293 type(
nfft_t),
intent(inout) :: nfft
297 call oct_nfft_finalize(nfft%plan)
307 type(
nfft_t),
intent(in) :: in
308 type(
nfft_t),
intent(out) :: out
320 out%precompute = in%precompute
336 type(
nfft_t),
intent(inout) :: nfft
337 real(real64),
intent(in) :: x1(:)
338 real(real64),
optional,
intent(in) :: x2(:)
339 real(real64),
optional,
intent(in) :: x3(:)
343 real(real64) :: x1_(1:nfft%m(1)), x2_(1:nfft%m(2)), x3_(1:nfft%m(3))
344 real(real64) :: length, cc, eps, dx1(1:nfft%m(1)-1), dx2(1:nfft%m(2)-1), dx3(1:nfft%m(3)-1)
353 select case (nfft%dim)
355 length = (maxval(x1)-minval(x1))*eps
356 cc = (minval(x1)+maxval(x1))/
m_two
358 length = (maxval(x2)-minval(x2))*eps
359 cc = (minval(x2)+maxval(x2))/
m_two
361 length = (maxval(x3)-minval(x3))*eps
362 cc = (minval(x3)+maxval(x3))/
m_two
364 call oct_nfft_precompute_one_psi_3d(nfft%plan, nfft%M, x1_, x2_, x3_)
367 do ii = 1, nfft%M(1)-1
368 dx1(ii)= abs(x1_(ii+1)-x1_(ii))
370 do ii = 1, nfft%M(2)-1
371 dx2(ii)= abs(x2_(ii+1)-x2_(ii))
373 do ii = 1, nfft%M(3)-1
374 dx3(ii)= abs(x3_(ii+1)-x3_(ii))
376 nfft%norm =
m_one/(minval(dx1(:)) * minval(dx2(:)) * minval(dx3(:)))
379 length = (maxval(x1)-minval(x1))*eps
380 cc = (minval(x1)+maxval(x1))/
m_two
382 length = (maxval(x2)-minval(x2))*eps
383 cc = (minval(x2)+maxval(x2))/
m_two
385 call oct_nfft_precompute_one_psi_2d(nfft%plan, nfft%M, x1_, x2_)
388 do ii = 1, nfft%M(1)-1
389 dx1(ii)= abs(x1_(ii+1)-x1_(ii))
391 do ii = 1, nfft%M(2)-1
392 dx2(ii)= abs(x2_(ii+1)-x2_(ii))
394 nfft%norm =
m_one/(minval(dx1(:)) * minval(dx2(:)))
398 length = (maxval(x1)-minval(x1))*eps
401 call oct_nfft_precompute_one_psi_1d(nfft%plan,nfft%M(1),x1_)
404 do ii = 1, nfft%M(1)-1
405 dx1(ii)= abs(x1_(ii+1)-x1_(ii))
407 nfft%norm =
m_one/(minval(dx1(:)))
412 call oct_nfft_check(nfft%plan)
415 write(
message(1),
'(a)')
"Info: NFFT plan precomputed."
424#include "nfft_inc.F90"
427#include "complex.F90"
428#include "nfft_inc.F90"
real(real64), parameter, public m_two
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_one
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
subroutine, public messages_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_input_error(namespace, var, details, row, column)
integer, parameter, public nfft_pre_lin_psi
integer, parameter, public nfft_complex
subroutine, public nfft_write_info(nfft)
subroutine, public znfft_forward(nfft, in, out)
integer, parameter, public nfft_fftw_init
subroutine, public nfft_end(nfft)
integer, parameter, public nfft_pre_fg_psi
integer, parameter, public nfft_fg_psi
subroutine, public nfft_init(nfft, nfft_options, N, dim, M, optimize)
subroutine, public nfft_copy_info(in, out)
integer, parameter, public nfft_malloc_x
integer, parameter, public nfft_malloc_f_hat
subroutine, public dnfft_forward(nfft, in, out)
integer, parameter, public nfft_malloc_f
subroutine, public dnfft_backward(nfft, in, out)
integer, parameter, public nfft_pre_full_psi
integer, parameter, public nfft_fft_out_of_place
subroutine, public znfft_backward(nfft, in, out)
subroutine, public nfft_precompute(nfft, X1, X2, X3)
integer, parameter, public nfft_pre_psi
subroutine, public nfft_guru_options(nfft, namespace)