netCDF

Network Common Data Form

Documentation

NetCDF is a suite of libraries for system and machine independent generation, access and exchange of array oriented scientific data. The NetCDF libraries contain the interface for C, FORTRAN77, FORTRAN90 and C++. The libraries come with some binaries to access, and reformat netcdf-formatted data.

Visit the unidata netcdf web page for detailed documention.

Versions

The following versions are available:

ModuleVersionRemarks
netcdf-c4.9.2standard
netcdf-c4.9.2-precise-fpprecise floating point
netcdf-fortran4.6.1standard
netcdf-fortran4.6.1-precise-fpprecise floating point
netcdf-fortran4.5.3-hdf5-1.10linked against HDF5 1.10
netcdf-fortran4.5.3-hdf5-1.10-precise-fplinked against HDF5 1.10, precise floating point

Modulefiles and environmental variables

Note that netcdf-fortran requires a compiler and MPI module to be loaded first.
Run module spider netcdf-fortran/<version> to see which modules are required.

To load a netcdf module, first load one of these combinations:

  • intel-oneapi-compilers/2025.0.0 + openmpi/4.1.7
  • intel-oneapi-compilers/2025.0.0 + intel-oneapi-mpi/2021.14.0
  • intel-oneapi-compilers-classic/2021.10.0 + intel-oneapi-mpi/2021.14.0

Then load the netcdf module:

module load netcdf-c/<version>
module load netcdf-fortran/<version>

Loading a NetCDF modulefile extends PATH with the path to the NetCDF binaries. This includes nc_config and nf_config, which can be used to gain information on the path to include files and libraries in compiler scripts and makefiles. Use:

  • module show netcdf-c/<version>
  • module help netcdf-fortran/<version>

to investigate details on exported environment variables.

LD_RUN_PATH is extended when a netcdf-module is loaded. It can be used to define rpath in the binaries.

The netcdf-modules are not needed to run programs linked to a netcdf library!

Example to compile smp-programs using the netcdf library

Here we demonstrate the usage of environmental variables to find the netcdf - include files and to link the netcdf libraries.

Read more

Installing netcdf

We discuss the installation of serial and parallel netcdf at HLRN

Read more