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

Migrating to HP Fortran
Migration issues
Chapter 10 231
Object code issues
Some migration problems do not manifest themselves until runtime, when the program behaves
unexpectedly or produces incorrect results. Such problems can occur when incompatible HP FORTRAN 77
object files and HP Fortran object files are linked together.
Although the format of object files generated by f77 is compatible with the format of object files generated
by f90, individual data items within the f77-generated file may not be. Problems with migration can occur
if the HP FORTRAN 77 object files represent data in a nonstandard form. For example, HP Fortran does
not allow misaligned data or nonstandard logical representations, whereas HP FORTRAN 77 does.
Procedure interfaces, on the other hand, usually do not present problems, so long as the procedures are
properly defined and called in the HP FORTRAN 77 source code. That is, as long as the definition and call
match in argument types, return types, and alternate return capability, the HP Fortran compiler can do the
appropriate conversions, copying, etc., to make the calls work.
To resolve object-code incompatibilities, you will need access both to the source file and to the f77
command line that was used to generate the HP FORTRAN 77 object file. Examine the source file for
directives that are not supported by HP Fortran, such as the $LOGICAL directive. See “Directives” on
page 225 for a list of the directives that are supported. Also, look over the f77 command line for any of the
unsupported options that are listed in Table on page 221.
If you find object-code incompatibilities, you should change the source code and recompile with the f90
command.
Data file issues
In general, data files are the easiest files to migrate because the data files produced by the two Fortrans are
compatible. However, problems can occur because of misaligned data and data types that are not supported
under HP Fortran. For example, HP FORTRAN 77 permits misaligned data, especially when working with
the structure extension. Also, HP FORTRAN 77 accepts nonstandard representations of logicals. Both
examples can result in data files that are incompatible with HP Fortran.
-Y +nls Enable Native Language Support
+Z +pic=long Generate position-independent code (large model)
+z +pic=short Generate position-independent code (small model)
Table 10-5 f77 options supported by f90 (Continued)
f77
option f90 option function