NetCDF4 Files at PSD

We have decided at PSD to switch our file format from netCDF3 to netCDF4-classic wherever possible. New datasets will be created in netCDF4 and we will be converting older files to netCDF4-classic. NetCDF4 has the advantage that files may read faster (much faster sometimes) in some applications (e.g. NCL). It also has the advantage that we will not need to pack the data using a scale and offset and users will not need to unpack data. NetCDF4 provides compression that is comparable to the use of short integers (~50% for most files). The compression they use is lossless, also an advantage.

Most applications should be able to read netCDF4-classic if they are compiled against the latest NetCDF library, and that library was built with NetCDF4 support enabled, requiring HDF5 libraries. Unidata's NetCDF website has explicit instructions for building NetCDF correctly. You may need to change your code if you explicitly unpack the data. NCL's short2flt routine will not need to be changed if you use that. In some cases, users have had issues if their application wasn't compiled with HDF libraries correctly. We do NOT support any netCDF application ourselves. Please contact the individual application support directly and/or read Unidata's netCDF webpage. If you are using the R package, they have specific instructions on their web site for dealing with NetCDF4 files: ncdf4.pdf Page 19 of the PDF document has a working example for R.

Unidata has a program called nccopy that will convert NetCDF 4 files to NetCDF 3. If you are not able to get an application to work, you may find that useful though it will increase the size of the file. In the case of most of the files in our archive, the NC3 size will be double the NC4 size. Also, OPeNDAP might be useful, as it renders the file as if it were NetCDF3 Classic. See our OPeNDAP web page for details. You may contact us if all the above doesn't help.

To determine a file type:
ncdump -k file.nc
To convert a netCDF4 file to netCDF3, try one of these, depending on what you want your output to be:
nccopy -k classic filenetcdf4.nc filenetcdf3.nc
nccopy -k 64-bit-offset filenetcdf4.nc filenetcdf3.nc
You can also use OPeNDAP and nccopy to download and convert at the same time.
nccopy -k 1 http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/pressure/air.2014.nc air.2014.nc
This will result in a larger netCDF3 file (about twice as big).

Datasets that have been transitioned to netCDF4

DatasetDate
20th Century Reanalysis V2Aug 14,2014
NCEP/NCAR Reanalysis IOct 20,2014
NOAA High Resolution SSTAug 18,2014
CMAP PrecipitationJul 29,2014
NOAA ERSSTAug 21,2014
U of Delaware precipitation and temperatureJul 29,2014
JMA TemperatureJul 28,2014