HP 3000 Manuals

FORTRAN 77/XL Enhancements [ COMMUNICATOR 3000/XL Release 1.2, Version A.20.10 ] MPE/iX Communicators


COMMUNICATOR 3000/XL Release 1.2, Version A.20.10

FORTRAN 77/XL Enhancements 

by Erryl Johnson--Data & Languages Division/CLL 

This new version of FORTRAN 77/XL (A.02.00) has been enhanced by the
addition of HP 3000 extensions, and other extensions that provide
increased compatibility with FORTRAN 66/V, HP 1000 FORTRAN 77 and the
DEC/VMS implementation of FORTRAN 77.

HP 3000 EXTENSIONS 

FORTRAN 66/V I/O - The $FTN3000_66 compiler directive has been enhanced
by the addition of the IO option.  This option creates compatibility with
FORTRAN 66/V files.  This compatibility is achieved by reading and
writing CHARACTER items in unformatted files in two-byte blocks and by
performing multiple physical I/O operations for I/O lists that request
them.

FORTRAN 66/V LOGICALS - The $FTN3000_66 compiler directive has been
enhanced to include the LOGICALS option, which causes logical data to
have the same internal representation as FORTRAN 66/V.

PROGRAM UNIT PER OBJECT MODULE - The $RLFILE directive causes each
program unit (identified by a PROGRAM, SUBROUTINE, FUNCTION or BLOCK DATA
statement) to be compiled into its own object module and placed in a file
of type NMRL. In subsequent compilations into the same RL file, program
units will replace corresponding object modules of the same name.  This
capability allows you to add and delete entries on the program unit level
(versus module level) using Link Editor/XL.

The $RLINIT directive causes the compiler to initialize the NMRL file to
empty before placing any object code into it.  This is similar to the
$USLINIT directive in FORTRAN 77/V.

NATIVE LANGUAGE SUPPORT - The $NLS_SOURCE directive turns on or off
special processing to handle foreign language text appearing in the
source program.  The processing applies to input character strings or
output character strings and character constants.

EXTENDED RANGE DO LOOPS - Execution may be transferred out of, or into,
the range of a DO loop.

LIST-DIRECTED INTERNAL MEMORY I/O - Internal files may be used with
list-directed READ or WRITE.

RECL= ON SEQUENTIAL OPEN OF FILES - When a sequential file is opened the
record length may now be specified.

UNIT = SPECIFIER IN I/O ALLOWS RECORD NUMBER QUALIFIER - For direct file
access a record number may be included in the "UNIT=" parameter by
following the unit number with @rn where rn is a constant or expression
that specifies the record number.  For example, WRITE(UNIT=3@20...will
write to unit 3, record 20.

DEC/VMS EXTENSIONS 

BYTE DATATYPE - The BYTE statement is an HP extension to the ANSI 77
standard and has the same effect as the LOGICAL*1 statement.

VARIABLE EXPRESSIONS IN FORMAT STATEMENTS - This is Phase I of this
feature.  In this first phase integer variables, integer constants and
character constants can be used in format strings to allow variable
formats.  An example is FORMAT (I<ISIZE>), where ISIZE is an integer
variable.

PARENTHETICAL EXPRESSIONS IN PARAMETER STATEMENTS - A new PARAMETER
statement syntax is implemented where the list is not bounded by
parentheses, and the form of the constant determines the data type of the
variable.  An example is PARAMETER ii = 'ab', where ii is type
character*2.

PARAMETER STATEMENT ALLOWS INTRINSIC CALLS - ABS, CHAR, DIM, DPROD, IAND,
ICHAR, IEOR, IMAG, IOR, ISHFT, LGE, LGT, LLE, LLT, MAX, MIN, MOD, NINIT,
NOT, IXOR, AND CONJG are the intrinsics with constant arguments that are
allowed in the PARAMETER statement.

OCTAL, HEX, ASCII, AND HOLLERITH COMPATIBILITY - Hollerith, ASCII, octal
and hexadecimal constants are considered typeless constants.  Typeless
constants do not undergo the type checking that normally prevents the use
of expressions such as i='A000'+1 and c="30" X, where i is integer and c
is character.  The compiler will now accept the 'xx'[HO] syntax as well
as the currently accepted [HO]'xx'.

LOOSER TYPE CHECKING, AUTOMATIC TYPE CONVERSIONS - There is looser type
checking for assignments, expressions, array boundaries and subscripts.

LENGTH SPECIFIER FOLLOWING SYMBOLIC NAME OR FUNCTION - In a type
statement, an item may be followed by a length specifier.  This
specification overrides the length implied by the type statement.  For
example, in the statement INTEGER IA,II*2, variable IA is type integer*4
by default, but variable II is overridden and becomes type integer*2.

"$" MAY APPEAR IN SYMBOLIC NAMES - except in the first character of a
variable or program unit name.

VARIABLE MAY BE INITIALIZED IN TYPE STATEMENT - Variables may be
initialized in type statements by enclosing the initialization values
with slashes, for example INTEGER A/2/.

TRANSCENDENTAL FUNCTIONS ACCEPT DEGREE ARGUMENTS - Functions Sine,
Cosine, Tangent, Arcsine, Arccosine and Arctangent accept an argument in
degrees expressed in radians.

HP 1000 EXTENSIONS 

ARITHMETIC IF ALLOWED TO HAVE 2 LABELS - An arithmetic IF statement may
have two labels instead of three.  The first label is where execution
branches to for a negative value and the second label is where execution
branches to for a zero or positive value.

GAUSSIAN AND POISSON RANDOM NUMBER ROUTINES - Two new random number
generator functions are available.  Function GRAN generates Gaussian
random single precision real numbers and function IRANP generates
Poisson-distributed integer random numbers.

For more information on all of these enhancements please refer to the
updates to the FORTRAN 77/XL Reference Manual Kit (P/N 31501-60002).



MPE/iX Communicators