Previous: , Up: Overview of Fortran interface   [Contents][Index]


7.1.1 Extended and quadruple precision in Fortran

If FFTW is compiled in long double (extended) precision (see Installation and Customization), you may be able to call the resulting fftwl_ routines (see Precision) from Fortran if your compiler supports the C_LONG_DOUBLE_COMPLEX type code.

Because some Fortran compilers do not support C_LONG_DOUBLE_COMPLEX, the fftwl_ declarations are segregated into a separate interface file fftw3l.f03, which you should include in addition to fftw3.f03 (which declares precision-independent ‘FFTW_’ constants):

  use, intrinsic :: iso_c_binding 
  include 'fftw3.f03'
  include 'fftw3l.f03'

We also support using the nonstandard __float128 quadruple-precision type provided by recent versions of gcc on 32- and 64-bit x86 hardware (see Installation and Customization), using the corresponding real(16) and complex(16) types supported by gfortran. The quadruple-precision ‘fftwq_’ functions (see Precision) are declared in a fftw3q.f03 interface file, which should be included in addition to fftw3l.f03, as above. You should also link with -lfftw3q -lquadmath -lm as in C.