Online NetCDF-FORTRAN77/90 interface guides can be found on:
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f77/
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/

and general information on the Network Common Data Format on:
http://www.unidata.ucar.edu/software/netcdf/

-----------------------------------------------------------------------------------------

This is a programme demonstrating all important features:
1. Getting info about an .nc file
2. Reading an .nc file
3. Creating an .nc file
4. Assigning attributes and descriptions to variables
5. Writing variables and descriptions in an .nc file

 

netcdf_rw_example.f

 

-----------------------------------------------------------------------------------------

NOTE:

In order to be able to use the netcdf library, it has to be properly installed and the environment paths have to be set correctly. This can usually be done in home folder shell files .cshrc, .bashrc or .bash_profile (OS X) or any file sourced by them.

Eg/ add the line
$ LD_LIBRARY_PATH=/location/of/your/netcdf/libraries
$ export LD_LIBRARY_PATH

Alternatively, you can specify the paths while compiling using
-L /location/of/your/netcdf/libraries
and
-I location/of/your/netcdf/include/files
To include the libraries, add -lnetcdff to the command.  So using the gfortran compiler, it might look like this:
gfortran    -o     netcdf_script.exe   netcdf_script.f    -I/usr/local/include     -L/usr/local/lib    -lnetcdff  

-----------------------------------------------------------------------------------------