> Date: Thu, 05 Feb 2004 09:13:35 +0000
> From: Clive Page <[log in to unmask]>
> On Wed, 4 Feb 2004, Ian Chivers wrote:
>
> It would be nice to know what exactly each group means by "converting from
> 77 to 95". Since almost all of f77 was included in f95 (and the bits
> that were lost are features that practically nobody used and are anyway
> supported by all the f95 compilers that I know) in a technical sense
> their programs are almost certainly already written in f95. So the
> term "converting" could mean any of a number of things, e.g.
>
> - removal of features that were never standard, e.g. REAL*8 etc.
> - conversion from fixed-format lines to free-format lines
> - conversions from all upper-case to lower-case in statement lines
> - addition of INTENT specifications to appropriate procedure arguments
> - elimination of most labels, e.g. change labelled-DO to DO with END DO
> - conversions from free-standing subprogram units to module procedures
> - conversion of common blocks to storage in a module
> - conversion of static arrays to automatic, allocatable or pointer arrays
> - and so on.
>
> The easier of these changes can be done by various tools that others have
> already mentioned, but some human work is generally needed as well. The
> more valuable conversions, as far as long-term maintainability of the code
> is concerned, are the ones that the tools currently don't do, and take a
> lot of human effort, in my experience. I'm not always sure that the
> results have been worth-while, as there is always the risk of introducing
> new bugs, perhaps by failing to appreciate some obscurity in the old code.
IMHO the simplest and most important of the conversions are:
1. conversion to free form source input.
2. wrapping the main program around the subroutines and functions,
(with the help of the CONTAINs statement).
This approach requires a minimum of effort, and is unlikely to introduce
new bugs (but note that any conversion to the modern form
is likely to find pre-existing bugs)
The above checks subroutine interfaces and may pick up some
typos in the original code.
> --
> Clive Page,
|