Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: FFTW 3.3.8: Fortran-interface routines Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82:
Chris@82:

Chris@82: Next: , Previous: , Up: Calling FFTW from Legacy Fortran   [Contents][Index]

Chris@82:
Chris@82:
Chris@82: Chris@82:

8.1 Fortran-interface routines

Chris@82: Chris@82:

Nearly all of the FFTW functions have Fortran-callable equivalents. Chris@82: The name of the legacy Fortran routine is the same as that of the Chris@82: corresponding C routine, but with the ‘fftw_’ prefix replaced by Chris@82: ‘dfftw_’.9 The single and long-double precision Chris@82: versions use ‘sfftw_’ and ‘lfftw_’, respectively, instead of Chris@82: ‘fftwf_’ and ‘fftwl_’; quadruple precision (real*16) Chris@82: is available on some systems as ‘fftwq_’ (see Precision). Chris@82: (Note that long double on x86 hardware is usually at most Chris@82: 80-bit extended precision, not quadruple precision.) Chris@82:

Chris@82:

For the most part, all of the arguments to the functions are the same, Chris@82: with the following exceptions: Chris@82:

Chris@82: Chris@82: Chris@82:

In general, you should take care to use Fortran data types that Chris@82: correspond to (i.e. are the same size as) the C types used by FFTW. Chris@82: In practice, this correspondence is usually straightforward Chris@82: (i.e. integer corresponds to int, real Chris@82: corresponds to float, etcetera). The native Fortran Chris@82: double/single-precision complex type should be compatible with Chris@82: fftw_complex/fftwf_complex. Such simple correspondences Chris@82: are assumed in the examples below. Chris@82: Chris@82:

Chris@82:
Chris@82:
Chris@82:

Footnotes

Chris@82: Chris@82:

(9)

Chris@82:

Technically, Fortran 77 identifiers are not Chris@82: allowed to have more than 6 characters, nor may they contain Chris@82: underscores. Any compiler that enforces this limitation doesn’t Chris@82: deserve to link to FFTW.

Chris@82:

(10)

Chris@82:

The Chris@82: reason for this is that some Fortran implementations seem to have Chris@82: trouble with C function return values, and vice versa.

Chris@82:
Chris@82:
Chris@82:
Chris@82:

Chris@82: Next: , Previous: , Up: Calling FFTW from Legacy Fortran   [Contents][Index]

Chris@82:
Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: