Changes between Version 10 and Version 11 of Documentation/UserGuide/DifferencesNetcdf


Ignore:
Timestamp:
2020-02-28T17:48:52+01:00 (4 years ago)
Author:
pmaugis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/DifferencesNetcdf

    v10 v11  
    1212cdo diffv   path_file_1   path_file_2 > output_file_name.txt 
    1313}}} 
    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.  
     14The 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.  
    1515 
    1616The 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 diffv command, thus not all variables in the restart files can be compared by this method 
     17However 5dim variables are ignored by the ''cdo diffv'' command, thus not all variables in the restart files can be compared by this method 
    1818 
    1919ADVANTAGE: 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. 
     
    3838=== Matlab === 
    3939 
    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] 
     40The 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]. 
     41I 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] 
    6342 
    6443Sadly, 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''.  
    6544 
    6645Next run the function by typing: 
    67  
    6846{{{ 
    69 NCCMP(ncfile1,ncfile2,tolerance,forceCompare) 
     47NCCMP(ncfile1, ncfile2, tolerance, forceCompare) 
    7048}}} 
    7149 
    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. 
    7351 
    74 ''forceCompare'' can be set to true or false.  
     52''forceCompare'' can be set to True or False.  
    7553 
    7654- True - write all occurrences of differences in a variable (specifically gives all the indices) to the file: all_diff.txt.  
    7755 
    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'.  
    7957 
    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.  
     58For 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.  
    8159 
    8260I recommend that you use the re-ordered files from the difffer100.sh script as inputs to nccmp.  
    83