Changes between Version 6 and Version 7 of Documentation/UserGuide/CodingGuidelines
- Timestamp:
- 2022-02-28T14:28:49+01:00 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/CodingGuidelines
v6 v7 2 2 3 3 Author: J. Ghattas [[BR]] 4 Last revision: B. Guenet (2020/03/19)4 Last revision: J. Ghattas (2022/02/28) 5 5 6 6 Coding 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. … … 8 8 Moreover, 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). 9 9 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 athttps://docs.google.com/document/d/1xOOWkynuqpD4JIHUscUKBuTQXzyvxK5o/edit10 Detailed 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 11 11 12 12 But the main "take home" messages are: … … 28 28 * Do not use non-ascii characters (typically, accentuated characters) in comments. They are non portable and can induce treatment failure by code analysis scripts. 29 29 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. 31 31 32 32 * 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]) … … 36 36 * 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]). 37 37 38 * Do not use nested WHERE loops. 39