Changes between Version 210 and Version 211 of DevelopmentActivities/ORCHIDEE-DOFOCO


Ignore:
Timestamp:
2019-10-16T15:47:10+02:00 (5 years ago)
Author:
alanso
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DevelopmentActivities/ORCHIDEE-DOFOCO

    v210 v211  
    598598* We could compare the spin-ups to maps of soil carbon stocks to check the order of magnitude. Soil carbon maps should only be formally compared with the control run (spin-up + transient simulation) for the year 2000 because that run includes the simulated effects of N-deposition, management, litter raking and land cover change. The more simple configurations of the spin-up do not account for these processes or do not account for the right sequence of processes. 
    599599 
     600== Testing guidelines before committing new code to ORCHIDEE-CN-CAN on svn == 
     601 
     602In some rare cases after bugfixes or implementation of new code, problems with reproducibility or 1+1=2 might unintentionally be introduced. Often these are related to incorrect variable dimensions in different sub-routines, memory issues or the lack of variables in the restart files. Such issues are easier to catch sooner than later. Thus, to minimize the time spent on debugging reproducibility and 1+1=2 issues, the following simple test are suggested/required before each commit of substantial code changes*:  
     603=== 1+1=2 === 
     604If you do not run these test globally, make sure to use impose_veg=y. 
     605The standard F2 run.def settings have been tested/are currently tested and still results in 1+1=2 issues. Thus, please always make the test for the standard settings. In case of other run.def settings during your developments, make same tests for your settings also. 
     606 
     6071) 1Y vs. 12*1M (compare the final restart files) 
     608 
     609Most issues should be caught with (1). In case of problems, it will make the debugging easier if you can track down the onset of difference between the files (i.e. start of year, onset of growing season, end of year etc.) Thus, continue with test like 
     610 
     6112) 1D+1D=2D (compare the final restart files) 
     612 
     6133) 1M+1M=2M (compare the final restart files) 
     614 
     615=== Compare netcdf files === 
     616The comparison is easiest if the same variables are contained in the two netcdf files and they are in the same order. The differ100.sh script by Josefine Ghattas, nicely does this. Moreover, it uses cdo diffv to compare the files, however 5dim variables are ignored by the cdo diffv command. 
     617 
     618=== Have to check for differences between to netcdf files that have variables with dimensions higher than 4 === 
     619The 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. 
     620I 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/nccmp.m  
     621 
     622Sadly, matlab is not on obelix, but on IRENE. On IRENE open matlab by typing ‘Matlab’ or to run from the terminal type matlab -nodesktop.  
     623 
     624Next run the function by typing: 
     625 
     626{{{ 
     627NCCMP(ncfile1,ncfile2,tolerance,forceCompare) 
     628}}} 
     629 
     630Tolerance is if you allow some variation in the variables between the two files. We want identical files thus put [] here. 
     631 
     632forceCompare can be set to true or false.  
     633 
     634- True - write all occurrences of differences in a variable (specifically gives all the indices) to the file: all_diff.txt.  
     635 
     636- False - only write if there is differences in a variable and its first occurrence of such differences to the file: first_diff.txt.  
     637 
     638For 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.  
     639 
     640I recommend that you use the re-ordered files from the difffer100.sh script as inputs to nccmp.  
     641 
     642Debugging: 
     643- If possible limit the spatial scale (to maximize speed).  
     644- Track down the problem. The best approach depend on the source of the problem (memory issue or lack variable in the restart file etc.). For memory issue a debugger could be the best choice. For lack of variables in restart file best to run two identical runs with different period lenghts – either manually or by Totalview while tracking down which variables are causing the differences. Hopefully, the differences in the restarts files will give you a clue on which variable to start the investigation from. 
     645 
    600646== Merging CN-CAN into the trunk == 
    601647In 2016 the CAN functionality was added to the CN branch with revision 3238. The end of CN branch is revision 5638. The first update of the CN-CAN branch incorporates the changes what were done to the CN branch between revision 3238 and 5638. Note that this already includes most of the changes done on the trunk because revision 5638 of the CN branch is mostly up to date with the trunk.