next up previous contents index
Next: Variables Up: Named Constants Previous: PARAMETER Statement

Guidelines

One of the limitations of Standard Fortran at present is that there is no way of allocating memory dynamically. One of the best ways around this is to use named constants to specify array bounds; this makes it much easier to alter programs to suit new requirements.

Names should also be given to all mathematical and physical constants that your programs require. If the same constants are needed in several program units then it may be sensible to compose a suitable set of PARAMETER statements for all of them and bring them in where ever necessary using INCLUDE statements.

If you define double precision constants in a PARAMETER statement do not forget that each literal constant value must include an exponent using the letter D.

There are no constant arrays in Fortran: the only way to overcome this limitation is to declare an ordinary array in a type statement and initialise its elements with a DATA statement (described in section 11).



Mario Storti
Wed Nov 4 19:32:56 ART 1998