HP 3000 Manuals

FORTRAN 77/XL Enhancements [ COMMUNICATOR 3000/XL - REL. 2.0 (A.30.00) ] MPE/iX Communicators


COMMUNICATOR 3000/XL - REL. 2.0 (A.30.00)

FORTRAN 77/XL Enhancements 

by Erryl Johnson 
Data and Languages Division 

FORTRAN 77/XL (Version A.03.05) has been enhanced with the addition of HP
3000 extensions and other extensions, that provide increased
functionality and increased compatibility with the DEC/VMS implementation
of FORTRAN 77.

HP 3000 ENHANCEMENTS 

ISAM FILE SUPPORT - ISAM is an extension to FORTRAN 77 that allows a
programmatic interface to the KSAM file system on MPE XL. ISAM files are
used for random access of records with a key which is part of the record.
These files can be access sequentially.  The basic operations that can be
performed on an ISAM file are CREATE, OPEN, READ, WRITE, CLOSE, REWRITE,
DELETE and UNLOCK.

$NLS DIRECTIVE - The $NLS directive includes two options, LITERALS and
COMPARE.

  LITERALS OPTION - This option is the same as using the existing
  $NLS_SOURCE directive.  It is recommended that any occurrences of
  $NLS_SOURCE appearing in your FORTRAN 77 programs be changed to $NLS
  LITERAL.

  COMPARE OPTION - This option enables all operators that deal with
  string comparisons (LGE, LGT, LLE, LLT) to compare string variables and
  string constants using the collating sequence corresponding to the
  specified language.  Runtime native language I/O is also enabled.

$TABLES DIRECTIVE - The symbol table information is now printed even if
an error occurs at compile time.

$PAGEWIDTH DIRECTIVE - The user can now specify the length of output
lines in the compiler listing.

DEC/VMS EXTENSIONS 

TAB CHARACTER SPECIFIES A CONTINUATION LINE - A tab character in column
1-6 immediately followed by a digit from 1 to 9 will be treated as a
continuation by the compiler.

INITIALIZATION OF CHARACTER*1 VARIABLES - Character variables can be
initialized with octal, hexadecimal or hollerith constants.

CONSECUTIVE OPERATORS IN ARITHMETIC EXPRESSIONS - Consecutive operators
in arithmetic expressions are now allowed if the second operator is
either a unary plus or minus.  The unary (+,-) operators have the highest
operator precedence.  For example, in a = b--c, the negative will be
taken of "c" and then subtracted from "b".

MULTI-DIMENSIONED EQUIVALENCE - The position of an element of a multi-
dimensioned array can be specified as if it were a single dimensioned
array.  For example, given the declarations "integer name (10)" and "byte
message(2,5)", the statement "equivalence (name, message(1))" is now
legal.

FUNCTIONS %VAL, %REF, %LOC - The functions %VAL and %REF can be used for
passing arguments when passing mechanisms other than the FORTRAN 77
default are necessary.  The %VAL(arg) function passes the argument as an
immediate value, and the %REF(arg) function passes the address of the
value.  The %LOC(v) function returns the internal address of a storage
element.  %LOC is equivalent to the BADDRESS FORTRAN 77 intrinsic.

MISSING ACTUAL ARGUMENTS - A subroutine call can have arguments missing
and a zero will be passed by value for each missing argument.  For
example, "CALL FUN (a,,b,,)" is equivalent to "CALL FUN (a,0,b,0,0)",
where the zeros are passed by value.

VMS SPECIFIC INTRINSICS - Where applicable, FORTRAN 77 intrinsics can be
called by their VMS specific name.  Refer to the updates to the FORTRAN
77/XL manual set for a list of the intrinsics.

OPTIONAL COMMA PRECEDING I/O LIST IN WRITE STATEMENT - For example,
"WRITE (6,100) ,A,B" is equivalent to "WRITE (6,100) A,B".

WARNING FOR UNSUPPORTED I/O VMS KEYWORDS - A warning is issued when
certain unrecognized I/O VMS keywords are encountered.  Refer to the
updates to the FORTRAN 77/XL manual set for a list of the keywords.

NULL STRINGS - Expressions with string declarations that do not contain
characters are allowed.  For example, CHAR = ' '.

SEQUENTIAL OPERATIONS ON DIRECT ACCESS FILES - Sequential I/O operations
can be done on files that are opened for direct access.

USE OF & INSTEAD OF * FOR ALTERNATE RETURNS - Alternate return arguments
in subroutine calls can use "&" instead of "*".

VIRTUAL STATEMENT - The new keyword VIRTUAL can be used in the same
context as DIMENSION.

CONTROL-L FOR FORMFEED ON LISTING - A control-L is allowed anywhere a
blank is allowed.  If a control-L is found in column 1 a new page heading
is emitted and the control-L is removed from the listing.  If a control-L
is found anywhere else on the source line it is left in the listing for
the listing device to handle.

RECL I/O SPECIFIER CONVERTED TO INTEGER - RECL is allowed to be other
numeric types when it is used as an input parameter.  For example, in the
following statement "OPEN(1,file='F1', ACCESS='DIRECT', RECL=reclength)",
reclength may be declared as "REAL reclength".  When RECL is an output
parameter (as in INQUIRE), integer type is still required.

RECORDS - Records can be declared using the STRUCTURE and RECORD
statements.  Using these statements, data elements of different types can
be grouped together in records.  Record elements can then be accessed by
a unique name.  Other statements that have been added for records support
are UNION and MAP.

QUAD PRECISION, REAL*16 - Real*16 defines a 16-byte real number.  It
contains a 1-bit sign, a 15 bit exponent field and a 128-bit mantissa in
floating point format.  This provides 34 digits of decimal precision.

$NOSTANDARD COMPILER DIRECTIVE - The NOSTANDARD directive specifies
options for compatibility with industry standard non-HP FORTRAN 77
programs.  This directive has four options:  CHARS, LOGICALS, IO and
SYSTEM.

  CHARS OPTION - In FORTRAN 77 character items are passed by descriptor.
  That is, an address of the item to be followed by the length of the
  item by value.  The CHARS option also causes character items to be
  passed by descriptor, however the length is positioned differently than
  HP FORTRAN 77.  It is passed at the end of the parameter list.

  LOGICALS OPTION - This option causes the compiler to treat logicals as
  two whole types for LOGICAL*2 and four whole bytes for LOGICAL*4.  The
  value .TRUE. is represented by -1 and the value .FALSE by zero.

  IO OPTION - Numeric data types can be output with alpha format
  specifiers (A, and R). Also, the data bytes will be output in reverse
  order (starting at the right and progressing left).

  SYSTEM OPTION - The VMS system calls DATE, IDATE, SECNDS, TIME, RAN and
  EXIT will be recognized as normal FORTRAN Intrinsics.

    DATE returns a string in the form dd-mm-yy.

    IDATE returns 3 integer values containing the current month, day and
    year.

    EXIT is the same as a STOP statement without an argument.

    RAN is a random number generator that returns a floating point number
    between 0.0 and 1.0.

    SECNDS returns the number of seconds elapsed since midnight minus the
    number of seconds, passed as an argument.

    TIME returns a string in the form hh:mm:ss.

INITIALIZATION OF BLANK COMMON - Blank common can now be initialized by a
block data subprogram.

VOLATILE STATEMENT - The volatile statement identifies variables, arrays
or common blocks that will not be selected for global analysis and
optimization by the compiler.  When referenced, volatile variables are
loaded from memory.  When a volatile variable is changed, the variable
will be stored into memory (i.e., the variable will not reside in the
registers).

ACCEPT STATEMENT - The ACCEPT statement transfers input data from the
standard input unit to an internal storage area.  Input data is
transferred under sequential mode access.  The ACCEPT statement can not
be connected to user specified logical units.

WIDTH OPTIONAL ON FORMAT DESCRIPTORS - In FORMAT statements, if field
descriptors I, F, E, D, G, O, K, or Z are specified without a field width
value, default values for w, d and e will be used on the data type of the
I/O list element.

SHORT FIELD TERMINATION - A non-character input data field can be
terminated with a comma, causing the next field to start immediately
after the comma.

MINIMUM OUTPUT DIGITS FOR HEX AND OCTAL FORMAT DESCRIPTORS - The Z and
octal (O, @, and K) format descriptors now have the form Zm.n which
allows specifying "n" minimum digits to print as non-blank, forcing
leading zeros as necessary in place of filling the field with blanks over
to the first non-zero digit.  The "n" is ignored on input.

INTERACTIVE QUERY OF CURRENT VALUES IN NAMELIST READ - A question mark
("?") can be input to a NAMELIST READ statement to print the current
value of all the items on the NAMELIST being read.  Input is allowed from
either a terminal or a file and output is written to unit 6.

WARNING INSTEAD OF ERROR FOR COMPATIBLE DUPLICATE DECLARATIONS - When
duplicate compatible data declarations are encountered by the compiler,
the first declaration is used and a warning is issued.

READONLY KEYWORD ON OPEN STATEMENT - The READONLY keyword can be used in
an OPEN statement to specify that an existing file can only be used for
reading.  Any attempt to write to a READONLY file will generate a "FILE
SYSTEM ERROR" message.

For more information on all of these enhancements please, refer to the
updates in the following manuals:

 *  HP FORTRAN 77/XL Reference Manual (P/N 31501-60002)
 *  HP FORTRAN 77/XL Quick Reference Guide (P/N 31501-60003)
 *  HP FORTRAN 77/XL Programmer's Guide (P/N 31501-60004) 



MPE/iX Communicators