Skip to content

CodingStandards

Andy Porter edited this page May 10, 2018 · 2 revisions

The aim of these coding standards is to produce a uniform code base that is easy to read/maintain and can be reliably grep'd. Some of the rules are really a matter of taste but since peoples' taste varies we choose to dictate :-)

Coding style

  1. implicit none is mandatory!
  2. Module imports should use the only clause.
  3. Try not to get carried away with Fortran 2008 features as they tend to upset compilers.

Rules regarding formatting

  1. Fortran key words should be in lower case.
  2. Commas should be followed by a single space.
  3. Each level of indentation should use three spaces.
  4. Continuation lines should be indented 'sensibly' - e.g. to line up routine arguments.
  5. Operators should be surrounded by single spaces.
  6. Lines should be no longer than 80 characters (but expressions may be continued on multiple lines).
Clone this wiki locally