| 25 | |
| 26 | === Matlab === |
| 27 | |
| 28 | The matlab function nccmp are able to compare all variables contained within two netcdf files. The original version can be found here: https://fr.mathworks.com/matlabcentral/fileexchange/47857-comparing-two-netcdf-files. |
| 29 | I have made some small modifications such that the information produced by the script are put into a file instead of printed to the screen. The update version can be found here:/ccc/work/cont003/dofoco/dofoco/SCRIPTS/debug |
| 30 | |
| 31 | Run the function by typing: |
| 32 | {{{ |
| 33 | NCCMP(ncfile1,ncfile2,tolerance,forceCompare) |
| 34 | }}} |
| 35 | Tolerance is if you allow some variation in the variables between the two files. We want identical files thus put [] here. |
| 36 | |
| 37 | forceCompare can be set to true or false. |
| 38 | True - write all occurrences of differences in a variable (specifically gives all the indices) to the file: all_diff.txt. |
| 39 | |
| 40 | False - only write if there is differences in a variable and its first occurrence of such differences to the file: first_diff.txt. |
| 41 | |
| 42 | For global simulation the True option can produce a large file and the information might be hard to process, if there are many differences between the compared files. In addition, the True option can make the much script slower. However, for small simulation the true option might be very useful. |