WOCE Logo  World Ocean Circulation Experiment
  Global Data Resource
 
   Home   |   Documents   |   Software/Resources   |   Help
 
 Inventories
 WOCE Bibliography
 WOCE Data and Summaries
     Updates
  Bathymetry
     Summary
     Data
  Updates
  Current Meters
     Summary
     Data
  Updates
  Drifters
     Summary
     Data
  Updates
  Sub Surface Floats
     Summary
     Data
  Updates
  Air-Sea Fluxes
     Data
  Updates
  Hydrography
     Summary
     Data
  Updates
  Profiling Floats
     Summary
     Data
  Updates
  Satellite Sea Level
     Summary
     Data
  Updates
  Satellite Sea Sfc Temp  
     Summary
     Data
  Updates
  Satellite Surface Winds
     Summary
     Data
  Updates
  Sea Level - Delayed Mode
     Summary
     Data
  Updates
  Sea Level - Fast Return
     Summary
     Data
  Updates
  Sea Surface Salinity
     Summary
     Data
  Updates
  Shipboard ADCP
     Summary
     Data
  Updates
  Surface Meteorology
     Summary
     Data
  Updates
  Upper Ocean Thermal
     Summary
     Data
  Updates
 Search Tool
  Updates
 Global Data History
 
netCDF Primer   | Software   | netCDF Online hyperlink  | WOCE Conventions

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 hyperlink). 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.