Commit 8f21ea0d authored by Ralf Müller's avatar Ralf Müller
Browse files

6*8=42

parent 076a9ef5
......@@ -311,6 +311,21 @@ AC_ARG_ENABLE([ieg],
enable_ieg=yes])
AC_MSG_RESULT([$enable_ieg])
AC_SUBST([ENABLE_IEG],[$enable_ieg])
# ----------------------------------------------------------------------
# Compile with fftw support
AC_MSG_CHECKING([for FFTW3 support])
AC_ARG_WITH([fftw3],
[AS_HELP_STRING([--without-fftw3],
[disable support for fftw3])],
[],
[with_fftw3=yes])
AS_IF([test "x$with_fftw3" != xno],
[AC_CHECK_HEADERS([fftw3.h])
AC_SEARCH_LIBS([fftw_cleanup],[fftw3],
[AC_DEFINE([HAVE_LIBFFTW3],[1],[FFTW3 library is present if defined to 1])],
[AC_MSG_RESULT([Could not link to fftw3 library])])])
# ----------------------------------------------------------------------
# Checks for PROJ.4 library
AC_ARG_WITH([proj],
......
......@@ -23,7 +23,11 @@
Filter bandpass
*/
#if defined ( _USE_FFTW3 )
#if defined (HAVE_CONFIG_H)
# include "config.h"
#endif
#if defined ( HAVE_LIBFFTW3 )
#include <fftw3.h>
#endif
......@@ -133,10 +137,10 @@ void create_fmasc(int nts, double fdata, double fmin, double fmax, int *fmasc)
}
#if defined ( _USE_FFTW3 )
#if defined ( HAVE_LIBFFTW3 )
static
void filter_fftw(int nts, const int *fmasc,
fftw_complex *fft_in, fftw_complex *fft_out, fftw_plan *p_T2S, fftw_plan *p_S2T)
fftw_complex *fft_in, fftw_complex *fft_out, fftw_plan *p_T2S, fftw_plan *p_S2T)
{
// fprintf(stderr,"using fftw filter\n");
......@@ -200,7 +204,7 @@ void *Filter(void *argument)
field_t ***vars = NULL;
double fmin = 0, fmax = 0;
int *fmasc;
#if defined ( _USE_FFTW3 )
#if defined ( HAVE_LIBFFTW3 )
fftw_plan p_T2S, p_S2T;
fftw_complex *out_fft;
fftw_complex *in_fft;
......@@ -322,7 +326,7 @@ void *Filter(void *argument)
nts = tsID;
/* round up nts to next power of two for (better) performance
** of fast fourier transformation */
#if defined ( _USE_FFTW3 )
#if defined ( HAVE_LIBFFTW3 )
nts2 = nts;
out_fft = (fftw_complex *) malloc ( nts * sizeof(fftw_complex) );
......@@ -383,13 +387,13 @@ void *Filter(void *argument)
gridsize = gridInqSize(gridID);
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
#if defined ( _USE_FFTW3 )
#if defined ( HAVE_LIBFFTW3 )
fprintf(stderr," using fftw lib\n");
#endif
for ( levelID = 0; levelID < nlevel; levelID++ )
{
#if defined ( _USE_FFTW3 )
#if defined ( HAVE_LIBFFTW3 )
for ( i = 0; i < gridsize-1; i++ )
{
for ( tsID = 0; tsID < nts; tsID++ )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment