NetCDF - Network Common Data Form
The NetCDF libraries support a machine-independent format for representing scientific data.
External Links:
Unidata NetCDF page
NetCDF-C Introduction
Example Fortran code to test NetCDF
Here is an example Fortran 90 code that uses the NetCDF library from the Unidata NetCDF example programs page.
To avoid copy/paste errors when using, please copy this from the apps directory:
/usr/local/apps/examples/code/netcdf
Linking NetCDF with Intel compiler
To put the NetCDF libraries in the path for Intel, use
module load netcdf/4.9.2-intel2025-slurm
To test linking NetCDF with the Intel compiler, compile the example code above, run it, and check that it creates a properly formatted NetCDF file.
[unityID@login]$ cd /share/$GROUP/$USER [unityID@login]$ cp -r /usr/local/apps/examples/code/netcdf . [unityID@login]$ cd netcdf [unityID@login]$ module purge [unityID@login]$ module load netcdf/4.9.2-intel2025-slurm [unityID@login]$ salloc -p compute_partners --ntasks=1 --time=00:10:00 --qos=short [unityID@compute]$ mpiifx -o test_intel example_h3_cf1_6.f90 $(nf-config --fflags) $(nf-config --flibs) [unityID@compute]$ ./test_intel [unityID@compute]$ file example_h3_cf1_6.nc example_h3_cf1_6.nc: NetCDF Data Format data
Notes
NetCDF modules include the MPI libraries (Intel MPI for Intel). After loading the NetCDF module, type module list for the list of other included modules. To use NetCDF with another code, the MPI libraries must be the same.
NetCDF and prerequisite HDF5 were compiled with the following configure flags.
For prerequisite module: hdf5/1.14.6-intel2025-slurm ./configure --prefix=/usr/local/apps/hdf5/1.14.6-intel2025-slurm --enable-fortran --enable-hl --enable-parallel CC=mpiicx FC=mpiifx CXX=mpiicpx > configure.mylog 2>&1 &
For NetCDF module: netcdf/4.9.2-intel2025-slurm # Note: NetCDF must be built for each coding language. # Note: Even though NetCDF was configured for C++ support, it actually will not support C++ because HDF5 was built without C++ support. # Note: Thus, one must call the underlying C NetCDF API functions within your C++ application. ./configure --prefix=/usr/local/apps/netcdf/4.9.2-intel2025-slurm CC=mpiicx > configure.mylog 2>&1 & ./configure --prefix=/usr/local/apps/netcdf/4.9.2-intel2025-slurm CC=mpiicx FC=mpiifx > configure.mylog 2>&1 & ./configure --prefix=/usr/local/apps/netcdf/4.9.2-intel2025-slurm CC=mpiicx FC=mpiifx CXX=mpiicpx > configure.mylog 2>&1 &
If an application requires the NetCDF libraries/modules to be compiled with different flags, the user must install a custom version under a space for user maintained software.
Last modified: October 11 2026 11:59:04.