FORTRAN Reference Manual

Converting Programs to HP FORTRAN
FORTRAN Reference Manual528615-001
C-3
Dynamically allocated local variables do not retain their values between successive
invocations of their procedure. This can cause failure of some programs that
depend on such retention of local data values.
The ANSI FORTRAN 77 language includes a SAVE statement so that the
programmer can specify explicitly which variables must be allocated statically, but
many existing FORTRAN programs do not use the SAVE statement because it has
no effect on a system that allocates all variables statically anyway.
If you suspect that a program you are converting might have been written with the
assumption that all data is allocated statically, simply add a SAVE statement (with
no variable list) to every subprogram. A SAVE statement with no variable list
makes all variables in the subprogram static. You might want to be more selective
to avoid permanently allocating data space.
Redefining LOGICAL*1 or BYTE data types
Some FORTRAN implementations include a LOGICAL*1 or BYTE data type, which
is treated as unsigned 8-bit integer data, as an extension to the ANSI FORTRAN
77 standard. HP FORTRAN does not support this feature. You can usually replace
references to LOGICAL*1 or BYTE data types with INTEGER*2, but you might
have to add references to the CHAR and ICHAR intrinsic functions when
combining data of types BYTE and CHARACTER.
Redefining REAL*4 and REAL*8 data types
Some FORTRAN implementations include the data type designators REAL*4
(synonymous with REAL) and REAL*8 (synonymous with DOUBLE PRECISION)
as extensions to the ANSI FORTRAN 77 standard. To compile the program with
HP FORTRAN, use an editor to replace all occurrences of REAL*4 with REAL and
REAL*8 with DOUBLE PRECISION.
Redefining COMPLEX*16 data types
Some FORTRAN implementations include the data type COMPLEX*16 (meaning
double-precision complex) as an extension to the ANSI FORTRAN 77 standard.
You can use an editor to replace COMPLEX*16 with COMPLEX to make the
program acceptable to HP FORTRAN, but of course this change will be
accompanied by loss of precision in the results computed by the program.
Expressions that exceed 255 characters
The ANSI FORTRAN 77 standard does not specify the maximum length that a
standard-conforming processor must support for variables, array elements,
functions, constants, and expression values of type CHARACTER. Some
FORTRAN systems support up to 32,767 characters but HP FORTRAN supports a
maximum of 255 characters.
If this limitation is a problem, you can try declaring the variable as a RECORD with
components whose lengths total the required number of characters. HP FORTRAN
allows you to use a RECORD name without a following circumflex (^) and