Approaches to migration
The most direct (and painstaking) approach to migrating an HP FORTRAN 77™program so that it will compile and execute correctly under HP Fortran is to make a clean sweep through the original source code, removing all extensions and rewriting all nonstandard programming practices to conform to the Fortran 90 standard. The result will be a highly portable program.
The disadvantage of the
Although the task of migrating an HP FORTRAN 77™program to HP Fortran can be done manually, there are several utilities that can help to automate the search for incompatibilities. These utilities (including sources of information about migrating to Fortran 90) are described in the following sections.
HP-supplied migration tools
The HP migration tools include the HP FORTRAN 77 and HP Fortran compilers (f77 and f90), lintfor, and fid.
HP FORTRAN 77 compiler
You can use the f77 command to test source code for conformance to the FORTRAN 77 standard. The
If you use f77 for this purpose, the source code must conform to the FORTRAN 77 grammar. In other words, f77 will flag both
HP Fortran compiler
Thef90 command can be used similarly to the f77 command to detect incompatibilities in HP FORTRAN 77™ source files. The advantage of f90 over f77is that you can use it on code that already contains Fortran 90 features or to which you are incrementally adding such features as part of the migration process.
The main drawback of f90 as a migration tool is that a clean compilation under f90 does not guarantee that all incompatibilities have been found; some do not manifest themselves until runtime. Also, linking under
In addition, the f90command sometimes reports incompatibilities — especially in
not be the most
Lintfor
The lintfortool can be used on HP FORTRAN 77™ code to detect semantic assumptions that may not be valid for HP Fortran code. However,lintfor does not accept the Fortran 90 grammar and therefore has the same drawbacks as the f77 command.
Fortran incompatibilities detector
The Fortran Incompatibilities Detector (fid) is an
/opt/fortran90/contrib/bin/fid
Approaches to migration 139