FORTRAN Reference Manual

FORTRAN Reference Manual528615-001
C-1
C
Converting Programs to
HP FORTRAN
This appendix contains suggestions to help you convert a FORTRAN application
program that was not written for HP FORTRAN to the syntax and semantics of HP
FORTRAN.
Comment lines
If the source program file has comments extending beyond column 72 of each line,
add the directive line
? ANSI
at the beginning of the file, so that HP FORTRAN will ignore all but the first 72
characters of each source line.
Some FORTRAN implementations permit comments on the same source line as
statements, but HP FORTRAN does not. Use an editor to move the comments to a
separate comment line. Begin each comment line with a “C” or an asterisk in
column 1.
Storage allocation for integer, logical, and real data types
If the program follows the ANSI FORTRAN 77 rules for storage allocation (which
specify that variables of integer, logical, and real data types all occupy the same
amount of storage space), add the directive line
? INTEGER*4, LOGICAL*4
at the beginning of the source program file.
Specifying variables for unit numbers
If the program uses variables for unit numbers in I/O statements, so that the unit
numbers do not “exist” as far as HP FORTRAN is concerned, add the directive line
? UNIT 1 - n
at the beginning of the source program file, where n is the highest unit number
used by the program. You might want to specify ranges of unit numbers, rather
than specifying the entire range of unit numbers, because FORTRAN allocates
space for a file control block for each unit that you specify in a unit directive.
Mixing CHARACTER and other data types
Neither the ANSI FORTRAN 77 standard nor HP FORTRAN support mixing
variables of type CHARACTER with other data types in the same common block,
but some other FORTRAN systems allow such mixing as an extension to the
standard.