ncdump [-c] [-h] [-v var1,...] [-b lang] [-f
lang] [-l len]
[-n name] [-d f_digits[,d_digits]]
file
Where:
-c
-h
-c
option except that the values of coordinate variables are not
included. (At most one of -c
or -h
options
may be present.)
-v var1,...,varn
-c
or -h
options, is to
include data values for all variables in the output.
-b lang
lang
begins with
C
or c
, then C language conventions will be
used (zero-based indices, last dimension varying fastest). If
lang
begins with F
or f
,
then Fortran language conventions will be used (one-based indices,
first dimension varying fastest). In either case, the data will be
presented in the same order; only the annotations will differ. This
option is useful for browsing through large volumes of
multidimensional data.
-f lang
lang
begins with C
or
c
, then C language conventions will be used (zero-based
indices, last dimension varying fastest). If lang
begins with F
or f
, then Fortran language
conventions will be used (one-based indices, first dimension varying
fastest). In either case, the data will be presented in the same
order; only the annotations will differ. This option may be useful
for piping data into other filters, since each data value appears on a
separate line, fully identified.
-l len
-n name
ncgen -b
in generating a default netCDF
file name. By default, ncdump
constructs this name from the last
component of the pathname of the input netCDF file by stripping off any extension
it has. Use the -n
option to specify a different name. Although
the output file name used by ncgen -b
can be specified, it may be
wise to have ncdump
change the default name to avoid inadvertantly
overwriting a valuable netCDF file when using ncdump
, editing
the resulting CDL file, and using ncgen -b
to generate a new netCDF file
from the edited CDL file.
-d float_digits[,double_digits]
float_digits
significant digits.
If double_digits
is also specified,
double-precision values will be displayed with that many significant
digits. If a variable has a `C_format' attribute, that overrides any
specified floating-point default. In the absence of any
-d
specifications, floating-point and double- precision
data are displayed with 7 and 15 significant digits respectively. CDL
files can be made smaller if less precision is required. If both
floating-point and double-presision precisions are specified, the two
values must appear separated by a comma (no blanks) as a single
argument to the command. If you really want every last bit of
precision from the netCDF file represented in the CDL file for all
possible floating- point values, you will have to specify this with
-d 9,17
.
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
foo.nc
:
ncdump -c foo.nc
foo.nc
, using C-style indexing for
the
annotations:
ncdump -b c foo.nc > foo.cdl
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
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