0

I run a climate model on cluster. The necessary moudels have been loaded, icluding:

module load netcdf/c/4.6.1-intel-2013.1 module load netcdf/fortran/4.4.4-intel-2013.1 module load cdo/1.9.1

The error message is:

cdo genbil: Started child process "setgrid,maps/grid_q_geo_Lucazeau_2019_grl_Colgan_2022_ant_Burton_2020.txt maps/grid_q_geo_Lucazeau_2019_grl_Colgan_2022_ant_Burton_2020.nc (pipe1.1)". cdo(2) setgrid: Open failed on >maps/grid_q_geo_Lucazeau_2019_grl_Colgan_2022_ant_Burton_2020.nc< Unsupported file type (library support not compiled in) To create a CDO application with NetCDF support use: ./configure --with-netcdf=<NetCDF root directory> ...

I believe this issue is similar to that discussed on Stack Overflow at How do I find the NetCDF root directory?. However, I am not sure how to resolve it in a cluster environment. Can anyone provide guidance on how to address this issue?

M Wang
  • 1

1 Answers1

0

The easiest way to install CDO is using conda, which will handle all of those issues for you.

You can also install CDO from source with netCDF support as follows:

wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/hdf5-1.8.13.tar.gz
tar -xvf hdf5-1.8.13.tar.gz
cd hdf5-1.8.13/
./configure -with-zlib=/opt/cdo-install -prefix=/opt/cdo-install CFLAGS=-fPIC

make
make install
cd ..

wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.0.tar.gz
tar -xvf netcdf-4.4.0.tar.gz
cd netcdf-4.4.0/
CPPFLAGS=-I/opt/cdo-install/include LDFLAGS=-L/opt/cdo-install/lib 
./configure -prefix=/opt/cdo-install CFLAGS=-fPIC
make
make install

cd ..

wget https://code.mpimet.mpg.de/attachments/download/20826/cdo-1.9.8.tar.gz
tar -xvzf cdo-1.9.8.tar.gz
cd cdo-1.9.8
./configure -with-netcdf=/opt/cdo-install -with-hdf5=/opt/cdo-install
make
make install
cd ..

This will install somewhat out of date versions, so you might want to update things. Bash scripts are available here: https://github.com/pmlmodelling/nctoolkit/tree/master/cdo_installers

Robert Wilson
  • 3,192
  • 11
  • 19
  • Thank you, that's a great idea! So, just to confirm, you're suggesting that I should install all the necessary dependencies and then compile the climate model in Conda, right? – M Wang Jun 23 '23 at 01:39
  • Your error message says you need to install CDO with Netcdf support. You either need to that using a source installation or from conda. Conda is preferable. – Robert Wilson Jun 23 '23 at 06:46