NetCDF

NetCDF (network common data format), is the file format used by the climate community. The main feature is that netcdf files are “self-describing”, i.e., the meta-data is already in the file, you do not need any documentation to go with the data.

There are many built-in tools to know what is in a netcdf file. You first have to install the netcdf library, on epic, just do:

module load netcdf

The most useful command is:

ncdump -h file_name.nc

This will give all info about variables in the file. You may want to use:

ncdump –h file_name.nc | less

Use q to quit.

Find info about a particular variable in the file:

ncdump –h file.nc | grep some_var

Netcdf libraries version 4 and higher support compression:

nccopy -d 9 in_file.nc out_file.nc

In many instances, this will half file size.

To quickly view a variable in a netcdf file, use the ncview program, on epic, just do:

module load ncview

Then:

ncview file_name.nc
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License