Restricting Programs to theHP FORTRAN 77 Standard [ HP FORTRAN 77/iX Programmer's Guide ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Programmer's Guide
Restricting Programs to theHP FORTRAN 77 Standard
The first step in writing portable FORTRAN 77 programs is to only use
features of the language that are available on every system to which you
port your programs. For HP systems, this feature set is defined by the
HP FORTRAN 77 standard, which fully implements the ANSI standard for
FORTRAN as defined by the ANSI X3.9-1978 documents. HP FORTRAN 77 also
includes all of the extensions contained in the Military Standard
(MIL-STD-1753) definition of FORTRAN 77. In addition, HP has included
extensions for compatibility, portability, and readability. The syntax
and semantics of these extensions to the ANSI standard are described in
the HP FORTRAN 77/iX Reference.
Do not use any feature that is not a part of the standard. When moving
FORTRAN 77 programs from a non-HP system to different HP systems,
identifying features that are not defined in the HP FORTRAN 77 standard
can be difficult. However, you can use the ANSI compiler directive to
help identify nonstandard features in HP FORTRAN 77 programs.
When the ANSI compiler directive is used in a program, all features not
conforming to the ANSI standard are flagged with appropriate warning
messages. An output listing with ANSI ON easily identifies all non-ANSI
features. However, the ANSI directive also flags any MIL-STD-1753 or HP
extensions with warnings. Therefore, it is still a tedious task to use
the full capabilities of HP FORTRAN 77 if you only use the ANSI compiler
directive. Most HP FORTRAN 77 compilers include additional directives
that allow you to specifically define which features will be flagged.
Refer to the HP FORTRAN 77/iX Reference for more details on the ANSI
directive and for information on other compiler directives that help
identify nonstandard features.
When using compiler directives to help identify nonstandard features,
place the directives in the source file when your program is being
developed. If this is done, any deviation from the chosen standard is
immediately flagged. If you are going to transfer an existing program
between systems, insert the directive and recompile the program on the
new system; any nonstandard features are flagged. Also, if you modify
your program in the future and recompile the program with the directives
included, the nonstandard features are again flagged. Therefore, by
using the ANSI directive or a system-dependent directive, it is easy to
identify features that are not common to both systems.
MPE/iX 5.0 Documentation