ncmpidiff(1)

πŸ’– ncmpidiff β€” like diff but for netCDF files, and it goes PARALLEL bestie πŸ’–

okay so you know how diff compares two text files? this is that, but for netCDF files, and it runs across a whole MPI crew at once. it's part of the PnetCDF utilities. it compares two netCDF files side by side and tells you the first thing that's different. no cap, that's the whole job. πŸ¦‹


✨ SYNOPSIS ✨

mpiexec -n np ncmpidiff [-b] [-q] [-h] [-v var1,...,varn] [-t diff,ratio] file1 file2

πŸŽ€ DESCRIPTION πŸŽ€

ncmpidiff runs in parallel on np number of MPI processes to compare the contents of the two files and reports the first difference to the standard output. it's giving group project where everyone actually does their part πŸ’…

For variables and attributes, it reports the array indices of the first element found different when option -t is not used. But when option -t is in the chat? then it reports the element with the largest difference that fails to meet the tolerance requirements. slay, very detail-oriented of it.

If neither argument -v nor -h is given besides the two file names, the entire files are compared. the whole thing. every last byte of content. main character energy fr fr.

When comparing two files entirely, the difference between ncmpidiff and the Unix command diff is that ncmpidiff skips the gaps between variables. okay so let me explain the lore: those 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 ncmpidiff but not by diff. iconic behavior honestly, diff is just dramatic πŸ™ˆ


🌸 OPTIONS 🌸

  • -b β€” Verbose mode β€” print results (same or different) for all components (file, header, or variables) in comparison. she's a talker, let her talk πŸ’–
  • -q β€” Quiet mode β€” print nothing on the command-line output. This also disables verbose mode. When in quiet mode, users should check exit status. See below in "EXIT STATUS". πŸ‘€
  • -h β€” Compare file header only. just the header bestie, nothing else 🌸
  • -v var1,...,varn β€” Compare only the given list of variables (names separated by comma without space).
  • -t diff,ratio β€” Compare variables element-wisely with tolerance (diff and ratio separated by comma without space).

diff is the absolute value of element-wise difference of two variables with the same name but stored in the two input files.

ratio is the relative element-wise difference ratio defined as |x - y|/max(|x|, |y|), where x is an array element from a variable in the first file and y is the corresponding array element of the same variable in the second file. |x| represents the absolute value of x.

Note: when this option is used, the output reports only the first array element that fails to meet both tolerance requirements. so like, first fail wins, we move on 🫢

πŸ‘‘ EXIT STATUS πŸ‘‘

An exit status of 0 means no differences were found, and 1 means some differences were found.

⚠️ heads up bestie: on VMS-based system, the exit status values are reversed. yes really. chaos 😭

πŸ¦‹ SEE ALSO πŸ¦‹

ncmpidump(1), cdfdiff(1), diff(1), pnetcdf(3)


⭐ DATE ⭐

July 1, 2026


and that's the whole page, bestie β€” ate and left no crumbs. this was printed 2026-11-02, it's all about PnetCDF 1.15.0, and yes the manual page itself is literally named ncmpidiff(1) in case you forgot in the last five seconds πŸ’œ mwah, go compare some files πŸ’…βœ¨

πŸ“¦ where this page comes from