Next: , Previous: , Up: Utility programs   [Index]


ncvalidator

ncvalidator checks the header of a netCDF file for whether it conforms the classic CDF file formats. If the input file is a valid NetCDF file, then a message of successful validation is printed on command-line output, for example, File "testfile.nc" is a valid NetCDF file. Otherwise, a NetCDF error message is printed.

If no argument is given, command usage information is printed.

Synopsis

ncvalidator [-h] | [-t] [-x] [-q] input_file

Command-line Options

-t

Turn on tracing mode, printing progress of validation (version 1.10.0 and later).

-x

Repair the null-byte padding in file header. The null-byte padding is required by the NetCDF Classic Format Specifications. PnetCDF enforces this requirement, but NetCDF has never enforced it. This option checks the header for locations where null bytes are expected and replaces them with null bytes if non-null bytes are found. The repaired file is then conformed with the specification and allows both PnetCDF and NetCDF libraries to read the file without reporting error code NC_ENOTNC or NC_ENULLPAD. Noted that this repair is done in place and users might want to backup the input file first. Once the file is repaired, one may run ncmpidiff or See cdfdiff command to compare the contents of two files.

-q

Quiet mode. Print nothing on the command-line output. When in quiet mode, users should check exit status.

-h

Print the available command-line options

Example

Print the file offset information for all variables in a netCDF file.

% ncvalidator test/cdf_format/bad_dimid.nc1
Error  [0x0000005c]:
	Variable "var0": dimid[0]=5 is larger than the number of dimensions defined in file (3)
File "test/cdf_format/bad_dimid.nc1" fails to conform with CDF file format specifications

Next: , Previous: , Up: Utility programs   [Index]