next up previous contents
Next: Pseudo-code Up: Program layout Previous: Program layout

General requirements

  With respect to the program layout the following rules should be applied

The layout of a program or subroutine is standard. The following rules with respect to contents and sequence should be applied.

  1. module statement (PROGRAM, SUBROUTINE, FUNCTION )
  2. Comment line starting with a c followed by a space and then 70 equals signs.
  3. Comment block consisting of

    The version number consists of a sequence number followed by a dot and another sequence number. The first number starts with 1, the second one with 0. In case of a small change, the second one is updated, in case of an essential change it is necessary to update the first sequence number and reset the second one to 0.
    The version numbers must be given in reversed order, i.e. last version number first.
    The comment block separator consists of a line with a c, a line with a c followed by a space and 70 times the sign, and again a line with a c.

  4. Comment block consisting of

    Subroutines which are sensitive to machine accuracy should contain a warning in the description.
    The reason that the first two lines should contain a complete documentation is that some tools are available that generate automatically the system documentation from the source files. These tools only use the first lines of the description.

  5. Comment block consisting of

    Keywords should be written with small letters and without space. In order to improve the readability it is allowed to use underscores.

  6. A block consisting of

  7. A block consisting of

    Each common should contain:

    It is advised to replace each common by an include statement, except when the software is exported to other computers.

  8. A block consisting of

    The description of the variables should be in lexicographic order.

  9. A comment block consisting of

    If an external subroutine is present in a special library, it is also necessary to indicate the source of this subroutine for example (IMSL).

  10. A comment block consisting of

  11. A comment block consisting of

  12. A comment block consisting of

    For some remarks concerning the pseudo code we refer to Section 3.2.

  13. Program text

If necessary, it is also allowed to have a separate block DATA STATEMENTS.
The sequence of the various blocks given above is fixed, but the blocks INPUT OUTPUT PARAMETERS, COMMON BLOCKS may be mutually interchanged, if the common block contains parameters necessary for the declaration of the input or output parameters.
The continuation mark can be chosen freely, however, a plus sign (+) is recommended.
In Section3.3 an example of a subroutine layout is given. Only this layout is allowed in ISNaS and SEPRAN subroutines. Tools to check and even to produce a part of the layout are treated in Chapter 5.


next up previous contents
Next: Pseudo-code Up: Program layout Previous: Program layout



ISNaS ontwikkeling
Wed May 24 08:37:14 METDST 1995