                Experimental FORTRAN 2003 netCDF Interfaces

                         Richard Weed, Ph.D.
                     Engineering Research Center
                       Miss. State University

   This distribution of netCDF provides replacements for the old C wrapper
based netCDF FORTRAN interfaces with new FORTRAN 2003 code that
uses the FORTRAN 2003 C interoperability facility to call the netCDF
netCDF C interfaces directly. You will need a FORTRAN compiler that supports
the C interop facility as well as the IMPORT statement to build the new 
FORTRAN interfaces. At this time, (May 2006) there are only a handful
of FORTRAN compilers that do. The ones I know about are:

  g95 - All versions after 5/04/06 (A big thanks to Andy Vaught)
  Cray X1 ftn compiler
  IBM xlf95 for AIX and Linux on PowerPC (versions 10 or higher)

  Sun's Studio 11 compilers claim to support Fortran 2003 C interop.
features but its unclear from the limited on-line documentation Sun
provides if they support the IMPORT statement. 

There may be others such as NAG but their on-line documentation is unclear
about what parts of Fortran 2003 are supported.

All of the netCDF 3.6.1 nf_ routines and the version 2 interfaces are
supported by the FORTRAN 2003 based interfaces. This software eliminates  
the need for cfortran.h and its many system and compiler dependencies.
However, the old versions will be built by default so the user
must explicitly request the new interfaces as outlined in the
Linux/g95 example below. 

 A PDF file is included with this distribution that describes the new
interfaces in more detail.

How to build on Linux with g95.

1. setenv FC g95
2. setenv F90 g95
3. setenv FPP "g95 -E"
4. setenv FPPFLAGS "-DFortran2003 -DHAVE_INT1 -DHAVE_INT2"
5. setenv F90FLAGS "-O3 -Wno=155,157"
6. setenv FFLAGS "-O3 -Wno=155,157"
7. setenv CPPFLAGS "-DFortran2003"
8. ./configure
9. make

The HAVE_INT1 and HAVE_INT2 FPP define macros are required to add support
for one and two byte integers. Don't define them if your compiler
doesn't support one or two byte integers. The -DFortran2003 macro turns
on support for the new Fortran 2003 interfaces. This must be included
on both CPPFLAGS and FPPFLAGS. To build the old interfaces, use an
appropriate cfortran.h value like -Df2cFortran instead of -DFortran2003.
If you don't need the version 2 interfaces, add -DNO_NETCDF_2 to both
the CPPFLAGS and FPPFLAGS environment variables prior to running
configure

WARNING: This code is considered experimental so you use it at your own
risk. The author makes no warranty against any potential evil that
occurs from using this code and accepts no liability legal or otherwise.

Questions/comments/bug reports should be sent via email to :

rweed@erc.msstate.edu

RW 5/19/06
