cdf2fortran, a NetCDF functionality that you may answer your question
is cdf2fortran. A program with will open a netCDF file and generate
a fortran program to read the data.
see URL http://www-c4.ucsd.edu/~cids/software/
Man page for cdf2fortran follows.
Usage
cdf2fortran inputFilePath (optional)outpuFilePath
inputFilePath - The full path to the netCDF file for which you wish
to create a fortran routine to read the data. The netcdf filename
should end with the .cdf extension.
outpuFilePath - The full path to the file to which you wish to write
the resultant fortran code. If you do not provide an outputFilePath
the result will be written to the file readnet.f.
This program will ask the user for the name of a netcdf file to read.
It will open that file and using the proper netCDF calls, get info on
the variables and their dimensions. It then generates a FORTRAN
program that can be used to actually read the netCDF file and fill the
variables with data. This program can be used to read ANY netCDF file.
The user only has to write fortran statements to print the data or
pass to another program. Once you have generated a program, you may
use it to read any file of that data type; i.e., the program is
general until the powers to be change variable attributes.
Prerequisites -- This program cannot be compiled without the netCDF
library. The source code for the netCDF library can be obtained via
anonymous ftp to ftp.unidata.ucar.edu. The necessary files are located
in the /pub/netcdf directory.
The program also requires the inclusion of the file netcdf.inc
provided with the netcdf library release. This file contains required
constants, etc... The path to the directory containing this file must
be set in the Makefile provided with this release. Modify the COM_INCS
line to reflect the include file location on your system.
Example -- Assuming you have met all of the prerequisites, and that
you modified the compile.sh script to reflect the correct library
locations on your system and to reflect the proper compiler flags for
your system.
your_machine 1 > make
your_machine 2 > cdf2fortran /path_to_data_file/data_file.cdf
The resulting fortran code will be placed in the file readnet.f You
may add code to manipulate the data to readnet.f. |