The netCDF data model consists of variables, dimensions, and attributes.
Variables
Dimensions
Attributes
For more information on the netCDF data model see The NetCDF Data Model.
NetCDF can be used to store many kinds of data, but it was originally developed for the Earth science community.
NetCDF views the world of scientific data in the same way that an atmospheric scientist might: as sets of related arrays. There are various physical quantities (such as pressure and temperature) located at points at a particular latitude, longitude, vertical level, and time.
A scientist might also like to store supporting information, such as the units, or some information about how the data were produced.
The axis information (latitude, longitude, level, and time) would be stored as netCDF dimensions. Dimensions have a length and a name.
The physical quantities (pressure, temperature) would be stored as netCDF variables. Variables are N-dimensional arrays of data, with a name and an associated set of netCDF dimensions.
It is also customary to add one variable for each dimension, to hold the values along that axis. These variables are call “coordinate variables.” The latitude coordinate variable would be a one-dimensional variable (with latitude as it's dimension), and it would hold the latitude values at each point along the axis.
The additional bits of metadata would be stored as netCDF attributes.
Attributes are always single values or one-dimensional arrays. (This works out well for a string, which is a one-dimensional array of ASCII characters.)
The pres_temp_4D example in this tutorial shows how to write and read a file containing some four-dimensional pressure and temperature data, including all the metadata needed. See pres_temp_4D.