NetCDF Library

General Information

Home page Versions Module dependencies
netCDF netCDF-Fortran Compiler MPI
www.unidata.ucar.edu/software/netcdf 4.4.0 4.4.3 GCC/4.9.3-2.25 OpenMPI/1.10.2
4.4.1 4.4.4 GCC/5.4.0-2.26 OpenMPI/1.10.3

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.

Usage on Idun

Load one of the netCDF, and the corresponding GCC and OpenMPI modules to use NetCDF on Idun, e.g. for C:

$ module load GCC/5.4.0-2.26 OpenMPI/1.10.3 netCDF/4.4.1

Compile and link:

$ icc test_netcdf.c -lnetcdf

or for Fortran:

$ module load GCC/5.4.0-2.26 OpenMPI/1.10.3 netCDF-Fortran/4.4.4
$ ifort test_netcdf.f90 -lnetcdff

Ncview

Versions Module dependencies
GCC MPI
2.1.7 GCC/4.9.3-2.25 OpenMPI/1.10.2
2.1.7 GCC/5.4.0-2.26 OpenMPI/1.10.3

Ncview is a visual browser for netCDF format files. Load the ncview, and the corresponding GCC and OpenMPI modules to use ncview on Idun, e.g.

$ module load GCC/5.4.0-2.26 OpenMPI/1.10.3 ncview/2.1.7

netcdf4-python

Versions Module dependencies
GCC MPI
1.2.6 GCC/5.4.0-2.26 OpenMPI/1.10.3

The Python netcdf4-python interface to the NetCDF library is available when loading one of the 4.3 versions of netcdf and the corresponding python module.

For example, create a netCDF file from python:

$ module load GCC/5.4.0-2.26 OpenMPI/1.10.3 netcdf4-python/1.2.6-Python-2.7.12
$ python
>>> from netCDF4 import Dataset
>>> rootgrp = Dataset('test.nc', 'w', format='NETCDF4')
>>> print rootgrp.file_format
NETCDF4
>>> rootgrp.close()
>>> exit()

Further Information

Scroll to Top