- Use of the universal language FORTRAN 90, and try to avoid obsolescent features like statement functions, do not use GO TO and EQUIVALENCE statements.
- A continuation line begins with the character & indented by three spaces compared to the previous line, while the previous line ended with the character &.
- All the variables must be declared. The code is usually compiled with implicit none.
- Never use continuation lines in the declaration of a variable. When searching a variable in the code through a grep command, the declaration line will be found.
- In the declaration of a PUBLIC variable, the comment part at the end of the line
should start with the two characters "!:
". the following UNIX command,
grep var_name *90 \ grep \!:
will display the module name and the line where the var_name declaration is.
- Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF statements.
- use a space after a comma, except when it appears to separate the indices of an array.
- use call to ctl_stop routine instead of just a STOP.
Gurvan Madec and the NEMO Team
NEMO European Consortium2017-02-17