cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: FFTW 3.3.5: Calling FFTW from Modern Fortran cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127:
cannam@127:

cannam@127: Next: , Previous: , Up: Top   [Contents][Index]

cannam@127:
cannam@127:
cannam@127: cannam@127:

7 Calling FFTW from Modern Fortran

cannam@127: cannam@127: cannam@127:

Fortran 2003 standardized ways for Fortran code to call C libraries, cannam@127: and this allows us to support a direct translation of the FFTW C API cannam@127: into Fortran. Compared to the legacy Fortran 77 interface cannam@127: (see Calling FFTW from Legacy Fortran), this direct interface cannam@127: offers many advantages, especially compile-time type-checking and cannam@127: aligned memory allocation. As of this writing, support for these C cannam@127: interoperability features seems widespread, having been implemented in cannam@127: nearly all major Fortran compilers (e.g. GNU, Intel, IBM, cannam@127: Oracle/Solaris, Portland Group, NAG). cannam@127: cannam@127:

cannam@127:

This chapter documents that interface. For the most part, since this cannam@127: interface allows Fortran to call the C interface directly, the usage cannam@127: is identical to C translated to Fortran syntax. However, there are a cannam@127: few subtle points such as memory allocation, wisdom, and data types cannam@127: that deserve closer attention. cannam@127:

cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: