# Computing

NetCDF is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.

Availability:
Instructions for users:

Load the appropriate modules. Note that in newer versions of the NetCDF software the C library and Fortran interface are distributed as separate packages with separate version numbers. For some versions we built these as separate modules, so you therefore need to load both a netcdf/compilertype/c and a netcdf/compilertype/fortran module in order to use the Fortran interface. This is unecessarily complicated so on the latest modules we put both interfaces into the same modulefile and call it netcdf/compilertype/version.

The 'compilertype' needs to match the compiler family you want to use, eg 'intel' for Intel compilers. Once you have loaded the modules, the nc-config and nf-config commands will tell you how to link the library.

Licence Details:
Documentation:

To build this you first need to build szip, then hdf5, and then netcdf. Although Ubuntu has its own copy of this library, it doesn't have the Fortran interfaces built for other compilers than gfortran. Our versions are also newer.

 module purge
#module add szlib # on 18.04 use szlib2 system package
# unpack C interface
./configure --prefix=/usr/local/shared/ubuntu-18.04/x86_64/netcdf/gnu/4.6.1 --enable-netcdf-4
make
make check
make install
# unpack Fortran interface, set environment to see C interface
./configure --prefix=/usr/local/shared/ubuntu-18.04/x86_64/netcdf/gnu/4.6.1

make
make check
make install 

Now clean up everything, environment included (module purge)

# module add szlib
# in c interface
CC=icc FC=ifort ./configure --prefix=/usr/local/shared/ubuntu-18.04/x86_64/netcdf/intel/4.6.1 --enable-netcdf-4
make
make check
make install
# unpack Fortran interface, set environment to see C interface
make install