HP Fortran Programmer's Guide (B3908-90031; September 2011)

Migrating to HP Fortran
Approaches to migration
Chapter 10234
In addition, the f90 command sometimes reports incompatibilities — especially in syntax—one at a time.
Needless to say, fixing incompatibilities one at a time and recompiling after each fix may not be the most
cost-effective approach to migrating a large FORTRAN 77 program to HP Fortran.
Lintfor
The lintfor tool 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 HP-supplied tool that was developed specifically to help
in migrating HP FORTRAN 77 code to HP Fortran. It is located in:
/opt/fortran90/contrib/bin/fid
fid searches the target source-code file for various HP FORTRAN 77 extensions that are known to be
incompatible with HP Fortran. It also detects incompatible command-line options when given an f77
command line. fid reports both source-code and object-code incompatibilities between HP FORTRAN 77
and HP Fortran. Furthermore, if fid detects an incompatible extension whose functionality is enabled by
some other means in HP Fortran, it will suggest a fix.
fid works by searching the entire program and reporting all its findings at once. Like the f77 command, it
expects the target program to conform to HP FORTRAN 77 syntax and will report syntax errors along with
incompatibilities it detects. Unlike f77, however, if fid encounters a syntax error, it attempts to recover
and continue parsing the rest of the program. This recovery mechanism allows fid to accept programs that
contain HP Fortran language features.
Not all incompatibilities are on fid's detection list. Some cannot be found by any automated means, and
others require too much time to compute for even medium-sized programs.
To invoke fid, supply the fid command with one or more FORTRAN 77 source files and any desired f77
options. If a file has been partially migrated to HP Fortran, change its extension to .f for use with fid.
Following are example command lines:
$ fid +800 file.f
$ fid +es program.f
Following are examples of the warning messages fid issues when it detects an incompatibility:
fid Warning: The command-line option, +800,
is both source incompatible
and .o incompatible with F90
fid Warning on line 8 of file.f: ON EXTERNAL
not supported by F90
fid Warning on line 9 of file.f: Detected IOSTAT