comparison src/fftw-3.3.3/doc/html/Defining-an-FFTW-module.html @ 95:89f5e221ed7b

Add FFTW3
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 15:35:50 +0000
parents
children
comparison
equal deleted inserted replaced
94:d278df1123f9 95:89f5e221ed7b
1 <html lang="en">
2 <head>
3 <title>Defining an FFTW module - FFTW 3.3.3</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="FFTW 3.3.3">
6 <meta name="generator" content="makeinfo 4.13">
7 <link title="Top" rel="start" href="index.html#Top">
8 <link rel="up" href="Calling-FFTW-from-Modern-Fortran.html#Calling-FFTW-from-Modern-Fortran" title="Calling FFTW from Modern Fortran">
9 <link rel="prev" href="Accessing-the-wisdom-API-from-Fortran.html#Accessing-the-wisdom-API-from-Fortran" title="Accessing the wisdom API from Fortran">
10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
11 <!--
12 This manual is for FFTW
13 (version 3.3.3, 25 November 2012).
14
15 Copyright (C) 2003 Matteo Frigo.
16
17 Copyright (C) 2003 Massachusetts Institute of Technology.
18
19 Permission is granted to make and distribute verbatim copies of
20 this manual provided the copyright notice and this permission
21 notice are preserved on all copies.
22
23 Permission is granted to copy and distribute modified versions of
24 this manual under the conditions for verbatim copying, provided
25 that the entire resulting derived work is distributed under the
26 terms of a permission notice identical to this one.
27
28 Permission is granted to copy and distribute translations of this
29 manual into another language, under the above conditions for
30 modified versions, except that this permission notice may be
31 stated in a translation approved by the Free Software Foundation.
32 -->
33 <meta http-equiv="Content-Style-Type" content="text/css">
34 <style type="text/css"><!--
35 pre.display { font-family:inherit }
36 pre.format { font-family:inherit }
37 pre.smalldisplay { font-family:inherit; font-size:smaller }
38 pre.smallformat { font-family:inherit; font-size:smaller }
39 pre.smallexample { font-size:smaller }
40 pre.smalllisp { font-size:smaller }
41 span.sc { font-variant:small-caps }
42 span.roman { font-family:serif; font-weight:normal; }
43 span.sansserif { font-family:sans-serif; font-weight:normal; }
44 --></style>
45 </head>
46 <body>
47 <div class="node">
48 <a name="Defining-an-FFTW-module"></a>
49 <p>
50 Previous:&nbsp;<a rel="previous" accesskey="p" href="Accessing-the-wisdom-API-from-Fortran.html#Accessing-the-wisdom-API-from-Fortran">Accessing the wisdom API from Fortran</a>,
51 Up:&nbsp;<a rel="up" accesskey="u" href="Calling-FFTW-from-Modern-Fortran.html#Calling-FFTW-from-Modern-Fortran">Calling FFTW from Modern Fortran</a>
52 <hr>
53 </div>
54
55 <h3 class="section">7.7 Defining an FFTW module</h3>
56
57 <p>Rather than using the <code>include</code> statement to include the
58 <code>fftw3.f03</code> interface file in any subroutine where you want to
59 use FFTW, you might prefer to define an FFTW Fortran module. FFTW
60 does not install itself as a module, primarily because
61 <code>fftw3.f03</code> can be shared between different Fortran compilers while
62 modules (in general) cannot. However, it is trivial to define your
63 own FFTW module if you want. Just create a file containing:
64
65 <pre class="example"> module FFTW3
66 use, intrinsic :: iso_c_binding
67 include 'fftw3.f03'
68 end module
69 </pre>
70 <p>Compile this file into a module as usual for your compiler (e.g. with
71 <code>gfortran -c</code> you will get a file <code>fftw3.mod</code>). Now,
72 instead of <code>include 'fftw3.f03'</code>, whenever you want to use FFTW
73 routines you can just do:
74
75 <pre class="example"> use FFTW3
76 </pre>
77 <p>as usual for Fortran modules. (You still need to link to the FFTW
78 library, of course.)
79
80 </body></html>
81