Additionally, if there appear to be actual arguments to subroutines or functions which are literal integers, the program will attempt to replace them with symbolic constants, and to define these constants in the declaration section of the module. Thus the line
CALL SUB( X, 5, STATUS )
will be replaced by
CALL SUB( X, INT__5, STATUS )
and the corresponding declaration statements
INTEGER * 8 INT__5
PARAMETER ( INT__5 = 5 )
will be inserted in the declaration section of the module. The program will attempt to insert these declarations near an INCLUDE statement, and if it cannot find one, it will write a warning to standard error, including the text of the declarations that it would have made.
Attention is paid to fortran 77 source format, so that lines more than 72 characters long are avoided (unless they were there in the first place).
Some attention is paid to the aesthetic qualities of the output: line breaks are made, where possible, following the usage in, e.g., KAPPA. An attempt is made to copy the style of case usage from the input.
No changes are made to comment lines so that, for instance, the Arguments stanza of subroutine prologues will not have argument types modified from `INTEGER' to `INTEGER * 8'.
No change is made to references to INTEGER type in IMPLICIT statements.
The program will write a warning on standard error for certain constructions in the code which are likely to cause trouble after the mass redeclaration of INTEGER as INTEGER*8 has occurred. These constructions are:
It will also not identify an INTEGER-type expression as such unless it is a single integer literal; for instance the expression `3 * 5' as actual argument of a subroutine/function ought to be retyped, but will not be spotted.
In a few cases, the line breaks are not made in very beautiful places. They should, however, always be correct.
Although this program behaves as a filter, it is written on the assumption that it will be run on a file of a finite length: it may buffer large amounts of input before writing output, and it may not free up memory.