NERSCPowering Scientific Discovery Since 1974


Description and Overview

NetCDF (Network Common Data Form) is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.  This includes the libnetcdf.a library as well as the NetCDF Operators (NCO), Climate Data Operators (CDO), NCCMP, and NCVIEW packages.

Files written with previous versions can be read or written with the current version.

Using NetCDF on Cray System

There are separate NetCDF installations provided by Cray and by NERSC. On Hopper and Edison, Cray installations are recommended because they are simpler to use.   To see the available Cray installations and versions use the following command:

module avail cray-netcdf

 To see the NERSC installations and versions use the following command:

module avail netcdf

You will see that Cray installations are under /opt and NERSC installations are under /usr/common/usg.   Loading the Cray NetCDF modulefiles will also load an hdf5 modulefile. 

Using the Cray NetCDF Library 

No compile or link options are required as long as you use the Cray compiler wrappers. Below is an example for using the Cray compiler on Hopper:

% module swap PrgEnv-pgi PrgEnv-cray  (# or similar if needed to swap to another compiler)
% module load cray-netcdf
% ftn ...
% cc ...
% CC ...

Using the NERSC NetCDF Library

The $NETCDF compile option must be used.

% module load netcdf/4.1.3-nersc 
% ftn ... $NETCDF
% cc ... $NETCDF
% CC ... $NETCDF

Using the NERSC NetCDF Library Compiled with Intel

% module swap PrgEnv-pgi PrgEnv-intel
% module load netcdf/4.1.3-nersc
% ftn ... $NETCDF
% cc ... $NETCDF
% CC ... $NETCDF

Notice that on Hopper and Edison, all object files need to be listed on the command line before the netcdf libraries while linking.

Using NetCDF on Carver

The default library is compiled using PGI.  On these machines you need to load both modulefiles explicilty and use compiler options:

% module load netcdf hdf5
% mpif90 -Msecond_underscore $NETCDF $HDF5 ...
% mpicc $NETCDF $HDF5 ...
% mpiCC $NETCDF $HDF5 ...

NetCDF Operators (NCO)

The NetCDF Operators (NCO) are a suite of file operators that facilitate manipulation and analysis of self-describing data stored in the NetCDF or HDF4 formats.

To access the NetCDF operators, just load the nco modulefile with the  module load nco command. This command will automatically load the NetCDF modulefile.


The NCCMP tool compares two NetCDF files bitwise or with a user-defined tolerance (absolute or relative percentage).

To use NCCMP, just load the nccmp modulefile with the  module load nccmp command. This command will automatically load the NetCDF modulefile.

Climate Data Operators (CDO)

The Climate Data Operators (CDO) are a collection of command line operators to manipulate and analyse climate model data. Supported data formats are GRIB, netCDF, SERVICE, EXTRA and IEG. There are more than 350 operators available.

To use CDO, first load the modulefile cdo with the module load cdo command. This command will automatically load the NetCDF modulefile.


The NetCDF software was developed at the Unidata Program Center in Boulder, Colorado.

Availability at NERSC

PackagePlatformCategoryVersionModuleInstall DateDate Made Default
netcdf babbage libraries/ I/O host-4.1.3 netcdf/host-4.1.3 2014-01-08
netcdf babbage libraries/ I/O host-4.3.2 netcdf/host-4.3.2 2014-06-12
netcdf babbage libraries/ I/O mic-4.1.3 netcdf/mic-4.1.3 2014-01-08 2014-01-08
netcdf babbage libraries/ I/O mic-4.3.2 netcdf/mic-4.3.2 2014-06-12 2014-06-12
netcdf carver libraries/ I/O 4.0.1 netcdf/4.0.1 2009-12-05 2009-12-05
netcdf carver libraries/ I/O 4.1.1 netcdf/4.1.1 2012-01-16 2012-01-16
netcdf carver libraries/ I/O 4.1.3 netcdf/4.1.3 2012-05-17
netcdf carver libraries/ I/O netcdf/ 2013-06-11
netcdf edison libraries/ I/O 4.1.3-nersc netcdf/4.1.3-nersc 2014-03-07
netcdf hopper_cle52 libraries/ I/O 4.1.3-nersc netcdf/4.1.3-nersc 2015-03-01 2015-03-01
NetCDF pdsf libraries/ general 3.6.1 NetCDF/3.6.1 2012-03-09

PackagePlatformCategoryVersionModuleInstall DateDate Made Default
nco carver libraries/ I/O 4.0.2 nco/4.0.2 2010-07-16 2010-07-16
nco carver libraries/ I/O 4.0.5 nco/4.0.5 2012-01-14 2012-01-14
nco carver libraries/ I/O 4.3.1 nco/4.3.1 2013-05-14
nco carver libraries/ I/O 4.3.6 nco/4.3.6 2013-10-03
nco carver libraries/ I/O 4.3.8 nco/4.3.8 2013-11-26 2013-12-02
nco carver libraries/ I/O 4.4.0 nco/4.4.0 2014-01-29
nco carver_sl6 libraries/ I/O 4.4.0 nco/4.4.0 2014-08-15 2014-08-15
nco edison libraries/ I/O 4.2.5 nco/4.2.5 2013-02-05 2013-02-05
nco edison libraries/ I/O 4.3.1 nco/4.3.1 2013-05-04 2013-07-30
nco edison libraries/ I/O 4.3.8 nco/4.3.8 2013-11-22 2013-11-25
nco edison libraries/ I/O 4.3.9 nco/4.3.9 2014-03-07 2015-03-12
nco hopper_cle52 libraries/ I/O 4.4.8 nco/4.4.8 2015-03-01 2015-03-01

PackagePlatformCategoryVersionModuleInstall DateDate Made Default
nccmp hopper_cle52 other/ I/O 1.4.0 nccmp/1.4.0 2015-03-10 2015-03-10

PackagePlatformCategoryVersionModuleInstall DateDate Made Default
cdo carver libraries/ I/O 1.4.1 cdo/1.4.1 2012-01-13 2012-01-13
cdo carver libraries/ I/O 1.4.6 cdo/1.4.6 2012-05-24 2012-05-25
cdo carver libraries/ I/O 1.6.1 cdo/1.6.1 2013-07-02 2014-03-27
cdo carver_sl6 libraries/ I/O 1.6.4 cdo/1.6.4 2014-08-15 2014-08-15
cdo edison libraries/ I/O 1.5.9 cdo/1.5.9 2013-01-21
cdo edison libraries/ I/O 1.6.1 cdo/1.6.1 2014-11-13
cdo edison libraries/ I/O cdo/ 2014-11-13 2014-11-13
cdo hopper_cle52 libraries/ I/O 1.6.7 cdo/1.6.7 2015-02-27 2015-02-27