[[PageOutline]] Last edited [[Timestamp]] '''Author''' : Rachid Benshila '''ticket''' : !#677 '''Branch''' : DEV_r1879_mpp_rep ---- === Description === Implementation of both methods to get mpp reproducibility, one from ECMWF (key_mpp_rep1) and the other from DFO (key_mpp_rep2). The target is to choose one, thanks to my reviewer's advices, but athis time (7th of June), I made an intensive use of cpp keys to delimit clearly the both methods. Both are based on the Idea of self compensated summation, see the paper "Using Accurate Arithmetics to Improve Numerical Reproducibility and Stability in parallel applications, Yun He and Chris Ding, Journal of supercomputing, Vol 18, Number 3, pages 259-277, doi 10.1023/A1008153532043. We have: sum = a+b error = b + (a-sum) In the next addition, the error is first added back : (sum,error) = SCS(a,b) (sum1,error1) = SCS(sum,c+error) These methods have been implemented in a new module lib_fortran.F90 with a few additions in lib_mpp.F90. In the sake of simplicity, I implemented a glob_sum function which is either a standard one( SUM + CALL mpp_sum), either one of the otw methods and the switch is done in lib_fortran. Nota: I also used this branch to implement a SIGN function which overwrite the standard fortran one (key_nosignedzero) to keep the f90 behaviour. === Testing === Testing could consider (where appropriate) other configurations in addition to NVTK]. ||NVTK Tested||!'''YES/NO!'''|| ||Other model configurations||!'''YES/NO!'''|| ||Processor configurations tested||[ Enter processor configs tested here ]|| ||If adding new functionality please confirm that the [[BR]]New code doesn't change results when it is switched off [[BR]]and !''works!'' when switched on||!'''YES/NO/NA!'''|| (Answering UNSURE is likely to generate further questions from reviewers.) 'Please add further summary details here' * Processor configurations tested * etc---- === Bit Comparability === ||Does this change preserve answers in your tested standard configurations (to the last bit) ?||!'''YES/NO !'''|| ||Does this change bit compare across various processor configurations. (1xM, Nx1 and MxN are recommended)||!'''YES/NO!'''|| ||Is this change expected to preserve answers in all possible model configurations?||!'''YES/NO!'''|| ||Is this change expected to preserve all diagnostics? [[BR]]!,,!''Preserving answers in model runs does not necessarily imply preserved diagnostics. !''||!'''YES/NO!'''|| If you answered !'''NO!''' to any of the above, please provide further details: * Which routine(s) are causing the difference? * Why the changes are not protected by a logical switch or new section-version * What is needed to achieve regression with the previous model release (e.g. a regression branch, hand-edits etc). If this is not possible, explain why not. * What do you expect to see occur in the test harness jobs? * Which diagnostics have you altered and why have they changed?Please add details here........ ---- === System Changes === ||Does your change alter namelists?||!'''YES/NO !'''|| ||Does your change require a change in compiler options?||!'''YES/NO !'''|| If any of these apply, please document the changes required here....... ---- === Resources === !''Please !''summarize!'' any changes in runtime or memory use caused by this change......!'' ---- === IPR issues === ||Has the code been wholly (100%) produced by NEMO developers staff working exclusively on NEMO?||!'''YES/ NO !'''|| If No: * Identify the collaboration agreement details * Ensure the code routine header is in accordance with the agreement, (Copyright/Redistribution etc).Add further details here if required..........