cannam@95: cannam@95: cannam@95: Fortran-interface routines - FFTW 3.3.3 cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95:
cannam@95: cannam@95: cannam@95:

cannam@95: Next: , cannam@95: Previous: Calling FFTW from Legacy Fortran, cannam@95: Up: Calling FFTW from Legacy Fortran cannam@95:


cannam@95:
cannam@95: cannam@95:

8.1 Fortran-interface routines

cannam@95: cannam@95:

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

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

cannam@95: cannam@95:

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

cannam@95:
cannam@95:

Footnotes

[1] Technically, Fortran 77 identifiers are not cannam@95: allowed to have more than 6 characters, nor may they contain cannam@95: underscores. Any compiler that enforces this limitation doesn't cannam@95: deserve to link to FFTW.

cannam@95: cannam@95:

[2] The cannam@95: reason for this is that some Fortran implementations seem to have cannam@95: trouble with C function return values, and vice versa.

cannam@95: cannam@95:
cannam@95: cannam@95: cannam@95: