Version 4 (modified by luyssaert, 10 years ago) (diff) |
---|
How to check whether two netcdf files are identical
cdo diffv
Rather than comparing plots, its faster and more precise to compare whether two netcdf files (i.e. a history or restart file between 2 model versions) are numerically identical. The follow command works on asterix and obelix
cdo diffv path_file_1 path_file_2 > output_file_name.txt
ADVANTAGE: the output file tells you which fields are different. Be aware, though that this method works best for smaller netCDF files. If your history file is more than a few megabytes, the output text file may be many hundreds of megabytes. In that case, the md5sum command may be a better option.
md5sum
If you expect that the files are identical (bit by bit) you can use
md5sum path_file
as a result you will get a code. Run the same command on the second file and only when the code is identical for both files, the files are exactly the same.
DISADVANTAGE: you only know whether the files are identical or not. If not, you have no idea which fields are different.
Attachments (2)
- differr100.sh (1.5 KB) - added by pmaugis 4 years ago.
- nccmp_obelix.m (13.9 KB) - added by pmaugis 4 years ago.
Download all attachments as: .zip