A number of users of our SPEIbase dataset worried because they could not read our netCDF files in their software. Indeed, some commercial softwares such as Matlab, ArcGIS and Idrisi do not have support for NetCDF4 or did not have it until recently. The main reason for us to use netCDF4 for the SPEIbase is because it allows for data compression, resulting in large file size and internet traffic saving. We did not use any of the other fancy options implemented in netCDF4 such as grouping, compound types or multiple unlimited dimensions. This means that our netCDF4 files conform to the classic model, so they can be converted back to the netCDF3 legacy format.
One way of converting to netCDF3 is by using the
nccopy program by unidata. For example, to convert a netCDF-4 classic-model format file foo4c.nc to a classic format file foo3.nc:
nccopy -k classic foo4c.nc foo3.nc.
Another way would be to install the netCDF operators (NCO) toolset from unidata, and then use the
ncks -3 foo4c.nc foo3.nc.
ncks allows for much greater functionality. For example, if one wants to extract the first 100 times from an SPEIbase file:
ncks -d time,0,100 spei_12.nc output_file.nc
would generate a (smaller) netCDF file with only those timesteps. In a similar fashion, it is possible to use
ncks to select a specific geographical region.