Print

Print


On Wed, 4 Feb 2004, Ian Chivers wrote:

> I was teaching last week (a one week fortran 95 course) and both groups
> on the course were involved or about to become involved in converting
> large production codes from 77 to 95.

Ian

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.

> secondly has anyone used more than one of them and can
> highlight some of the strengths and weaknesses of these tools.

I think I've used all of them at various times.  The results vary
surprisingly in the cosmetic appearance of the results, but that depends
on the layout of the input code to some extent, and is a matter of
personal opinion.  My recommendation would be to try them all, and then
compare the results.  Takes a lot less time than the next essential step:
assuring yourself that the converted program still compiles and runs in
exactly the same way as before.  I personally like Alan Miller's
conversion program as it does a more through job, but as he says, doesn't
always get things like INTENTs quite right.


--
Clive Page,
Dept of Physics & Astronomy,
University of Leicester, U.K.