6.0 Using C to read netCDF files
The simplest way to create the C code you need to read a netCDF is to use the C programs cdf2c.c (at the above site or http://www-c4.ucsd.edu/~cids/software/visual.html ). This program reads a netCDF file and creates another C program with the required calls to the netCDF libraries. This machine generated program only needs to be compiled (with correct include file and netCDF libraries). When executed this code fragment can then read the netCDF file and is ready for the C code to be added to undertake the analysis required by the user. The procedure for installing and compiling is described in the documentation from the web site listed above and is similar in operation to the cdf2fortran program described above.