Changes between Version 10 and Version 11 of Documentation/UserGuide/DifferencesNetcdf
- Timestamp:
- 2020-02-28T17:48:52+01:00 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/DifferencesNetcdf
v10 v11 12 12 cdo diffv path_file_1 path_file_2 > output_file_name.txt 13 13 }}} 14 The attached script [https://forge.ipsl.jussieu.fr/orchidee/attachment/wiki/Documentation/UserGuide/ restartability/differr100.sh differ100.sh] by Josefine Ghattas does that also and nicely.14 The attached script [https://forge.ipsl.jussieu.fr/orchidee/attachment/wiki/Documentation/UserGuide/DifferencesNetcdf/differr100.sh differ100.sh] by Josefine Ghattas does that also and nicely. 15 15 16 16 The comparison is easier if the same variables are contained in the two netcdf files in the same order. 17 However 5dim variables are ignored by the cdo diffvcommand, thus not all variables in the restart files can be compared by this method17 However 5dim variables are ignored by the ''cdo diffv'' command, thus not all variables in the restart files can be compared by this method 18 18 19 19 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. … … 38 38 === Matlab === 39 39 40 The matlab function 'nccmp' is 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. 41 I have made some small modifications so 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 on IRENE:/ccc/work/cont003/dofoco/dofoco/SCRIPTS/debug/nccmp.m and here on obelix:/home/data03/dofoco/SCRIPTS_obelix/debug. 42 43 Run the function by typing: 44 {{{ 45 NCCMP(ncfile1, ncfile2, tolerance, forceCompare) 46 }}} 47 Tolerance is whether you allow some variation in the variables between the two files. We want identical files thus put [] here. 48 49 forceCompare can be set to true or false. 50 True - write all occurrences of differences in a variable (specifically gives all the indices) to the file: all_diff.txt. 51 52 False - only write if there are differences in a variable and its first occurrence of such differences to the file: first_diff.txt. 53 54 For global simulations 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 script much slower. However, for small simulations the True option might be very useful. 55 56 57 58 59 60 61 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. 62 I have made some small modifications such that the information produced by the script are put into a file instead of being printed to the screen. The updated version can be found [https://forge.ipsl.jussieu.fr/orchidee/attachment/wiki/Documentation/UserGuide/restartability/nccmp_obelix.m here] 40 The matlab function nccmp are able to compare all variables contained within two netcdf files. The original version can be found [https://fr.mathworks.com/matlabcentral/fileexchange/47857-comparing-two-netcdf-files here]. 41 I have made some small modifications so that the information produced by the script are put into a file instead of being printed to the screen. The updated version can be found [https://forge.ipsl.jussieu.fr/orchidee/attachment/wiki/Documentation/UserGuide/DifferencesNetcdf/nccmp_obelix.m here] 63 42 64 43 Sadly, matlab is not on obelix, but on IRENE. To open matlab on IRENE type ''Matlab'' or if you wish to run from the terminal type ''matlab -nodesktop''. 65 44 66 45 Next run the function by typing: 67 68 46 {{{ 69 NCCMP(ncfile1, ncfile2,tolerance,forceCompare)47 NCCMP(ncfile1, ncfile2, tolerance, forceCompare) 70 48 }}} 71 49 72 '' Tolerance'' is if you allow some variation in the variables between the two files. We want identical files thus put [] here.50 ''tolerance'' is if you allow some variation in the variables between the two files. We want identical files thus put [] here. 73 51 74 ''forceCompare'' can be set to true or false.52 ''forceCompare'' can be set to True or False. 75 53 76 54 - True - write all occurrences of differences in a variable (specifically gives all the indices) to the file: all_diff.txt. 77 55 78 - False - only write, if there is differences in a variable, the first occurrences of such differences to the file: first_diff.txt.56 - False - only write, when there are differences in a variable, the first occurrence of such differences to the file 'first_diff.txt'. 79 57 80 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 restart files. In addition, the True option makes the script much slower. However, for small simulation the True option is very useful.58 For global simulations, the True option can produce a large file and the information might be hard to process, if there are many differences between the compared restart files. In addition, the True option makes the script much slower. However, for small simulation the True option is very useful. 81 59 82 60 I recommend that you use the re-ordered files from the difffer100.sh script as inputs to nccmp. 83