cdfdiff(1) | PnetCDF utilities | cdfdiff(1) |
cdfdiff - compares two classic netCDF files in parallel
cdfdiff [-b] [-q] [-h] [-v var1,...,varn] [-t diff,ratio] file1 file2
cdfdiff, a sequential version of ncmpidiff, compares the contents of the two classic netCDF files and reports the first difference found to the standard output. The classic file formats include CDF-1, CDF-2, and CDF-5.
For variables and attributes, it reports the array indices of the first element found different when option -t is not used. When option -t is used, it reports the element with the largest difference that fails to meet the tolerance requirements.
If neither argument -v nor -h is given besides the two file names, the entire files are compared.
When comparing two files entirely, the difference between cdfdiff and the Unix command diff is that cdfdiff skips the gaps between variables. The gaps may occur when the alignment feature is used to create a new file. This alignment allows to allocate a larger space for the file header and align the starting file offsets of fixed-size variables (see API ncmpi__enddef and PnetCDF hints). Oftentimes, the contents of gaps are non-zero arbitrary bytes. Thus, two netCDF files (of same or different sizes) can be reported identical by cdfdiff but not by diff.
An exit status of 0 means no differences were found, and 1 means some differences were found. Note on VMS-based system, the exit status values are reversed.
February 21, 2022
PnetCDF 1.12.3 | Printed: 1900-0-0 |