Program layout

The following general rules apply to the layout:

The standard layout of a program or subroutine is described below.
  1. Program unit statement (PROGRAM, SUBROUTINE, FUNCTION, MODULE).
  2. Comment block consisting of: The version number consists of several digits separated by a decimal point, and has a start value of 1.0. Major modifications result in an increase by a value 1 of digit 1, and in the decimal being set at 0. The modified digits are filled in on the next line to retain the previous information, and the modification is briefly described in brackets. Minor modifications result in the decimal being increased by a value 1 and, if required, a brief description of the modification.


    Routines which are clearly sensitive to machine accuracy contain a warning in the comments.
  3. Declaration of input and output variables, followed by a comment block with a description of these variables marked with i (input) and/or o (output). Use the lexicographic order, and always use the INTENT attribute.
  4. Local variables:
  5. Comment block consisting of:
  6. Program text.
    Format statements are given at the end of the program unit.
A template format of a subroutine is given in Chapter 13. No layout must be used for SWAN other than the layout of that example.

The SWAN team 2022-08-10