11 Porting to HP Fortran
The goal of portability is to make it possible to compile and execute a program on different vendors’ platforms, regardless of the platform on which it was written. A portable Fortran 90 program contains no language elements except those mandated by the Standard and adheres to generally accepted coding practices.
In practice, however, programming is rarely so simple. Many Fortran programs have a long history and were originally coded at a time when portability was not a concern because many programs were written to execute on one platform only. Older Fortran
To make the task of porting easier, HP Fortran includes the following features:
•Language
•
This chapter includes the following sections:
•Compatibility extensions
•Using porting options
NOTE: For information about migrating HP FORTRAN 77™ programs to HP Fortran, see “Migrating to HP Fortran” (page 131).
Compatibility extensions
HP Fortran includes a variety of extensions to the Fortran 90 language. Most of these are compatibility
The following sections describe the compatibility extensions. For a list of all HP Fortran language extensions, see the HP Fortran Programmer’s Reference.
Except for the ON statement (see “Using the ON statement” (page 81)), all of the nonstandard statements supported by HP Fortran are provided for compatibility. These are listed by vendor in Table
Table 42 Compatibility statements
Statement | Implementation | Description |
|
|
|
ACCEPT | DEC | Reads from standard input. |
|
|
|
AUTOMATIC | Sun | Allocates storage on the stack. |
|
|
|
BYTE | DEC | Declares entities of type integer. |
|
|
|
DECODE | Earlier versions of Fortran | Inputs formatted data from internal storage. |
|
|
|
DOUBLE COMPLEX | Earlier versions of Fortran | Declares entities of type double complex. |
|
|
|
ENCODE | Earlier versions of Fortran | Outputs formatted data to internal storage. |
|
|
|
END (structure definition) | DEC | Terminates the definition of a structure or union. |
|
|
|
Compatibility extensions 141