netCDF File Issues


CDO (Climate Data Operators) Analysis

Problem:Users may encounter problems using MACA netCDF data using CDO (Climate Data Operators) tools from the Max-Planck-Institut fur Meteorologie. These problems stem in that the MACAv2-METDATA/LIVNEH netCDF datasets are in the netcdf4 format and that these files do not have time as the UNLIMITED dimension. In general, I believe that CDO does not support netcdf4, but needs netcdf3 (classic) format.

Solution: The easiest thing to do to fix this problem is to convert the netcdf4 files to netcdf3-classic format. This can be done using either of the following options which require NCO:

  • nccopy is available as part of the netCDF software distribution. This can be used to convert a netcdf file from netcdf4 to netcdf3 with:

    nccopy -k classic filenetcdf4.nc filenetcdf3.nc using this guidance

  • ncks is available as part of the NCO (netCDF Operators) library and can also be used to convert a netcdf file from netcdf4 to netcdf3 format with:

    ncks -3 filenetcdf4.nc filenetcdf3.nc using this guidance
One can check the changes by using:
  • ncdump -k filenetcdf3.nc to check the netCDF version, i.e. classic vs netCDF-4
  • ncdump –h filenetcdf3.nc to show that the time has unlimited dimensions giving time = UNLIMITED ;