Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: FFTW 3.3.5: Calling FFTW from Modern Fortran Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42:
Chris@42:

Chris@42: Next: , Previous: , Up: Top   [Contents][Index]

Chris@42:
Chris@42:
Chris@42: Chris@42:

7 Calling FFTW from Modern Fortran

Chris@42: Chris@42: Chris@42:

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

Chris@42:

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

Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: Chris@42: