Changes between Version 6 and Version 7 of Documentation/UserGuide/CodingGuidelines


Ignore:
Timestamp:
2022-02-28T14:28:49+01:00 (2 years ago)
Author:
jgipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/CodingGuidelines

    v6 v7  
    22 
    33Author: J. Ghattas [[BR]] 
    4 Last revision: B. Guenet (2020/03/19) 
     4Last revision: J. Ghattas (2022/02/28) 
    55 
    66Coding guidelines have been established to facilitate the development of the ORCHIDEE code. All developers should follow these guidelines when improving or adding new features to the code.  
     
    88Moreover, any new suggestions to these coding guide lines, in order to improve the readability, the efficiency and the robustness of the code are welcome. You can make these suggestions to the ORCHIDEE project group (orchidee-projet at listes.ipsl.fr). 
    99 
    10 Detailed guidelines must be read in [attachment:ORCHIDEE_Coding_Guidelines_v1.0.pdf​ coding_guidelines.pdf] and [attachment:ORCHIDEE_Coding_Guidelines_v1.0.doc coding_guidelines.doc]. It can be also found at https://docs.google.com/document/d/1xOOWkynuqpD4JIHUscUKBuTQXzyvxK5o/edit 
     10Detailed guidelines are established in [attachment:ORCHIDEE_Coding_Guidelines_v1.0.pdf​ coding_guidelines_v1.0.pdf]. Un update of this document has started and you can see the latest version here https://docs.google.com/document/d/1xOOWkynuqpD4JIHUscUKBuTQXzyvxK5o/edit 
    1111 
    1212But the main "take home" messages are: 
     
    2828* Do not use non-ascii characters (typically, accentuated characters) in comments. They are non portable and can induce treatment failure by code analysis scripts. 
    2929 
    30 * Take care of your indexation when using a loop and identified the statement by a comment just after your ENDIF or ENDDO. 
     30* Take care of your indexation when using a loop and identified the statement by a comment just after your ENDIF or ENDDO if it is a big loop. 
    3131 
    3232* Be mindful of loop ordering for best memory access (performance). If the embedded loops are independent, then the first index should correspond to the most inner loop. This ensures that one accesses contiguous memory blocks during the loop, which makes it faster (example on page 17 of [attachment:ORCHIDEE_Coding_Guidelines_v1.0.pdf​ coding_guidelines.pdf]) 
     
    3636 * You must do some test runs with the debug option activated during compilation. To activate compile debug options for testing the code some informations are summarized here([wiki:Documentation/UserGuide/flags howto]). 
    3737 
     38 * Do not use nested WHERE loops. 
     39