HP Fortran Programmer Guide (766160-001, March 2014)

Table 45 Nonstandard intrinsic procedures in HP Fortran (continued)
SYSTEMORINT4FSETATANH
TANDQCOTANINT8FSTREAMBADDRESS
TIMEQCOTANDINUMGETARGCOSD
XORQEXTIOMSGGETENVCOTAN
ZEXTQFLOATIQINTGRANCOTAND
QNUMIRANDHFIXDATE
QPRODIRANPIACHARDCMPLX
RANISIGNIADDRDCOTAN
HP Fortran also provides nonstandard specific intrinsics that derive from standard generic intrinsics;
these nonstandard specific intrinsics are not listed in Table 11-4. They provide generic intrinsics
with the ability to operate on nonstandard data type sizes. For example, the generic intrinsic ABS
is defined by the Fortran 90 Standard to return the absolute value of the standard data types. HP
Fortran provides BABS and ZABS as extensions, enabling ABS to operate on INTEGER(KIND=1)
and DOUBLE COMPLEX values—both of which are nonstandard. Many of the nonstandard specific
intrinsics (including BABS and ZABS) are compatible with similarly named intrinsics available on
other implementations.
Using porting options
HP Fortran provides a number of compile-line options for porting programs. The most important of
these is the +langlvl=90option. Compiling your program with this option will cause the compiler
to issue warning messages for all nonstandard features.
In addition, HP Fortran includes options that provide compatibility by changing the compiler’s
assumptions about the program or by causing the compiler to generate code that executes
compatibly with the original implementation. The advantage of using options when porting is that
they minimize having to edit and modify source code.
The following sections describe how options can help when porting programs that contain:
Initialized variables
Data types that are larger than the default sizes of HP Fortran data types
Names that clash with HP-specific intrinsics
Names that end in the underscore character (_)
One-trip DO loops
Different formats
Escape sequences
Uninitialized variables
As noted in Automatic and static variables” (page 67), the default behavior of HP Fortran is to
allocate storage for program variables from the stack. However, older implementations of Fortran
often allocate static storage for variables. One of the differences between stack storage and static
storage is that static variables are initialized to 0s by the compiler, whereas automatic variables
(variables allocated from the stack) must be explicitly initialized by the programmer.
Programs written for implementations of Fortran that allocate static storage by default sometimes
rely on the compiler to initialize variables. Compiling and executing such programs on
implementations that allocate stack storage can have disastrous results. To make HP Fortran
144 Porting to HP Fortran