Free Source Code
Purple Sage Computing Solutions, Inc.
Fortran 2003 Examples
All Our Freely Available Source Code Is Licensed Under the Gnu General Public Licenses.
Obviously, at this date (2005), no Fortran 2003 compilers yet exist (the standard was only published in November of 2004!). Therefore, the examples offered here are available only on a best effort basis. That is to say, I believe I have done a reasonable job of interpreting the Fortran 2003 International Standard. And critically, no code here has been tested, nor even run through a Fortran 2003 compiler for static checking. Of course, if anyone believes that I have blundered when trying to interpret the draft standard, please advise. Also, some vendors have added some Fortran 2003 features to their existing Fortran 95 compilers, and have graciously volunteered to run some of these examples through these (sometimes experimental) compilers. I gratefully acknowledge these assistance I have received from these vendors, even when they wish to remain anonymous.
In order to distinguish Fortran 2003 source files from Fortran 90/95 source files, I have chosen to use the ".f03" file name extension for the Fortran 2003 source files.
Fortran Interface to pthreads
This module demonstrates some of the uses, and some of the limitations, of the C Interoperability features in the Fortran 2003 Standard. pthreads Module. This module describes a thin binding, that is, the features of pthreads, as seen by a C programmer, are plainly apparent to the Fortran programmer using this module.
Fortran Inheritance Example
This file demonstrates some of the uses of the Fortran 2003 inheritance features, especially the use of abstract types and deferred procedures. Inheritance Example. This inheritance example shows an abstract type providing features generally required for floating point iteration problems. Another type extends the abstract type for use solving a simple problem. A program uses the second module to compute a heat 2-d distribution, given boundary conditions on a square.
Fortran Asynchronous Input/Output Example
This file demonstrates a use of the Fortran 2003 asynchronous input/output features to implement a simple software pipeline. Asynchronous Input/Output Example. This asynchronous input/output example program shows a software pipeline as might be useful where calculations should overlap with data transfers.
Parameterized Derived Type Example
This file demonstrates some of the uses of the Fortran 2003 parameterized derived types, this example expresses the type rational module using parameterized derived types. PDT Example. This example uses a PDT to allow definition of variables of type rational using any kind of integer.