ncdump

ncdump [-c] [-h] [-v var1,...] [-b lang] [-f lang] [-l len] [-n name] [-d f_digits[,d_digits]] file

Where:

Usage Notes

ncdump generates an ASCII representation of a specified netCDF file on standard output. The ASCII representation is in a form called CDL (``network Common Data form Language'') that can be viewed, edited, or serve as input to ncgen. ncgen is a companion program that can generate a binary netCDF file from a CDL file. Hence ncgen and ncdump can be used as inverses to transform the data representation between binary and ASCII representations. See ncgen for a description of CDL and netCDF representations.

ncdump defines a default format used for each type of netCDF data, but this can be changed if a `C_format' attribute is defined for a netCDF variable. In this case, ncdump will use the `C_format' attribute to format each value. For example, if floating-point data for the netCDF variable Z is known to be accurate to only three significant digits, it would be appropriate to use the variable attribute

Z:C_format = "%.3g"

ncdump may also be used as a simple browser for netCDF data files, to display the dimension names and sizes; variable names, types, and shapes; attribute names and values; and optionally, the values of data for all variables or selected variables in a netCDF file.

Examples

    Look at the structure of the data in the netCDF file foo.nc:

    ncdump -c foo.nc

  1. Produce an annotated CDL version of the structure and data in the netCDF file foo.nc, using C-style indexing for the annotations:

    ncdump -b c foo.nc > foo.cdl

  2. Output data for only the variables uwind and vwind from the netCDF file foo.nc, and show the floating-point data with only three significant digits of precision:

    ncdump -v uwind,vwind -d 3 foo.nc

  3. Produce a fully-annotated (one data value per line) listing of the data for the variable omega, using Fortran conventions for indices, and changing the netCDF dataset name in the resulting CDL file to omega:

    ncdump -v omega -f fortran -n omega foo.nc > Z.cdl