NetCDF data and datafiles

This is intended as a short introduction to netCDF data. The complete netCDF documentation can be found at the UNIDATA web site.


Quick links to
Climate and Forecast (CF) Metadata Convention Page from the BADC
List of downloadable software to write, read and handle NetCDF files

Contents

What is netCDF?

NetCDF (network Common Data Form) is an interface for array-orientated data access and a library that provides an implementation of that interface. Many groups have adopted netCDF as a standard way to represent their scientific data. The netCDF software was developed at the Unidata Program Center in Boulder Colorado USA.

Why use netCDF?

NetCDF and CF conventions

The BADC supports and strongly recommends the compliance with the Climate and Forecast (CF) Metadata Convention.

CF conventions are guidelines and recommendations as to where to put information within a netCDF file, and they provide advice as to what type of information you might want to include. CF conventions allow the creator of the dataset to include information about the data and the dataset itself (metadata) in a structured way, which makes it easier for other users to retrieve the information. Global attributes describe the general properties and origins of the dataset while local attributes are used to characterise the recorded variables.

The BADC provides Information on the CF Convention, illustrated by some examples.

What's in a netCDF file?

We have available a very simple example of a netCDF file with CF conventions applied. A netCDF dataset (the filename ends in .nc) is made up of three basic components:

The variables store the actual data, the dimensions give the relevant dimension information for the variables, and the attributes provide auxiliary information about the variables or the dataset itself. You can study an example of a netCDF file and see more details of the components in a netCDF dataset. The global attributes can also be added to the netCDF file, following CF conventions.

Reading and writing netCDF

The popularity of netCDF stems from its portability and relative ease of use. Although it is a binary data format the netCDF distribution comes complete with the ncdump utility which produces an ASCII dump of the dataset and thereby provides a quick-look facility. You can also generate netCDF files from ASCII data files using the ncgen utility.

The datasets are commonly written and read using library routines. The library routines are sensibly named and relatively consistently named across the different language implementations.

Help and tools
  1. Guidance and tools provided by the BADC:

  2. Selected links to available online software packages to write, read and handle NetCDF files:

Further information

For a more extensive description you are urged to read the UNIDATA documentation on netCDF.

The UNIDATA documentation also provides the File Format Specification for netCDF and Best Practice recommendations on writing netCDF files.

The NetCDF Climate and Forecast (CF) Metadata Convention defines metadata that provide a definitive description of what the data in each variable represents, and of the spatial and temporal properties of the data. The CF conventions generalize and extend the COARDS conventions developed under the sponsoring of NOAA.