FORTRAN RELEASE DOCUMENT
SOFTWARE RELEASE 8.1
Part No. 004778
Revision 01
This document describes the FORTRAN
software for releases 8.0 and 8.1.
It contains the procedures for
installing 8.1 FORTRAN software, the
features and enhancements of releases
8.0 and 8.1, the software errors that
have been corrected, and the
remaining errors, limitations, or
restrictions. In addition, this
document lists the latest changes to
documentation.
The release notes for standard DOMAIN
software are documented in another
set of release notes and are located
in the system /doc directory. These
release notes will be delivered along
with the standard software. The
release notes for other optional
DOMAIN components are documented in
separate sets of release notes, one
set for each component. Optional
product release notes are also
located in the /doc directory once
each component is installed. These
separate release notes will be
delivered along with any optional
software you purchase from Apollo.
APOLLO COMPUTER INC.
16 Elizabeth Drive
Chelmsford, Massachusetts 01824
c 1984 Apollo Computer Inc.
All rights reserved.
Printed in U.S.A.
Print date: October, 1984
This document was formatted using the FMT tool
distributed with the DOMAIN Computer system.
Apollo Computer Inc. reserves the right to make changes in specifications and
other information contained in this publication without prior notice, and the
reader should, in all cases, consult Apollo Computer Inc. to determine
whether any such changes have been made.
THE TERMS AND CONDITIONS GOVERNING THE SALE OF APOLLO COMPUTER INC. HARDWARE
PRODUCTS AND THE LICENSING OF APOLLO COMPUTER INC. SOFTWARE CONSIST SOLELY OF
THOSE SET FORTH IN THE WRITTEN CONTRACTS BETWEEN APOLLO COMPUTER INC. AND ITS
CUSTOMERS. NO REPRESENTATION OR OTHER AFFIRMATION OF FACT CONTAINED IN THIS
PUBLICATION, INCLUDING BUT NOT LIMITED TO STATEMENTS REGARDING CAPACITY,
RESPONSE-TIME PERFORMANCE, SUITABILITY FOR USE OR PERFORMANCE OF PRODUCTS
DESCRIBED HEREIN SHALL BE DEEMED TO BE A WARRANTY BY APOLLO COMPUTER INC. FOR
ANY PURPOSE, OR GIVE RISE TO ANY LIABILITY BY APOLLO COMPUTER INC.
WHATSOEVER.
IN NO EVENT SHALL APOLLO COMPUTER INC. BE LIABLE FOR ANY INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT
LIMITED TO LOST PROFITS) ARISING OUT OF OR RELATING TO THIS PUBLICATION OR
THE INFORMATION CONTAINED IN IT, EVEN IF APOLLO COMPUTER INC. HAS BEEN
ADVISED, KNEW OR SHOULD HAVE KNOWN OF THE POSSIBILITY OF SUCH DAMAGES.
THE SOFTWARE PROGRAMS DESCRIBED IN THIS DOCUMENT ARE CONFIDENTIAL INFORMATION
AND PROPRIETARY PRODUCTS OF APOLLO COMPUTER INC. OR ITS LICENSORS.
Reader_Notice
This document resides on-line in a file named /doc/ftn.release_notes. To
view the file on-line, simply read this file. To print a copy of this
document on an NEC Spinwriter, use the PRF command with the -npag and -pr
options.
To print a copy on a PRINTRONIX line printer, first convert the file using
the OS (overstrike) command and direct the output to a pathname file. Then
use the PRF command with the -npag and -ftn options, making sure to name the
overstruck file as the one to be printed.
iii
CONTENTS
Section Page
CHAPTER 1 OVERVIEW OF SOFTWARE RELEASE 8.1 . . . . . . . . . . . . . . 1-1
CHAPTER 2 INSTALLING SR8.1 FORTRAN SOFTWARE. . . . . . . . . . . . . . 2-1
CHAPTER 3 FEATURES AND ENHANCEMENTS . . . . . . . . . . . . . . . . . 3-1
CHAPTER 4 ERRORS CORRECTED . . . . . . . . . . . . . . . . . . . . . . 4-1
ERRORS CORRECTED SINCE SR8.0 . . . . . . . . . . . . . . 4-1
ERRORS CORRECTED SINCE SR7.0 . . . . . . . . . . . . . . 4-2
CHAPTER 5 CURRENT ERRORS, LIMITATIONS, AND RESTRICTIONS . . . . . . . 5-1
CHAPTER 6 NOTES THAT BEAR REPEATING FROM SR7 . . . . . . . . . . . . . 6-1
CHAPTER 7 DOCUMENTATION . . . . . . . . . . . . . . . . . . . . . . . 7-1
Contents iv
CHAPTER 1
OVERVIEW OF SOFTWARE RELEASE 8.1
SR8.1 FORTRAN fixes six bugs found in SR8.0 FORTRAN.
SR8.0 FORTRAN has new FTN command options and contains changes in existing
command options. It also performs more optimizations for better generated
code. FORTRAN, BIND, and the loader have been changed to promote "longword
alignment," which causes programs to execute faster on DSP160s and DNx60
nodes. FORTRAN now supports conditional processing and the in-line comment
facility has been extended to allow users to select their own designator for
in-line comments. For details, see Chapter 3 of this document.
We have provided new on-line examples. When you install FORTRAN on your
node, the examples will be located in /ftn/domain_examples/ftn_examples.
This directory contains files of sample programs and examples used in the
DOMAIN_FORTRAN_User's_Guide.
FTN 1-1 Software Release 8.1
CHAPTER 2
INSTALLING SR8.1 FORTRAN SOFTWARE
This chapter describes how to install FORTRAN Compiler software on a node,
DSP80, or DSP160. You can only add this software to a node that is running
the SR8.1 version of the DOMAIN operating system. If a node is not running
the SR8.1 version, follow the SR8.1 software update procedures. These
procedures are described in Chapter 2 of the Standard Software Release
Document.
You need 375 blocks to add the FORTRAN Compiler software to a node.
The software installation procedures assume that you do not have links to any
optional software objects except for possible links to the following:
/sys/help
If you have links to any other system software, you should delete the links
before starting the installation. Failure to delete the links may result in
the objects pointed to by the links being deleted.
Perform the following steps to install the SR8.1 FORTRAN Compiler software on
a node.
The terms used in this procedure are as follows:
o "Work node" is the node you are using to enter the commands to do the
software installation.
o "Target node" or target volume is the disked node whose software you
are installing or updating.
o "Source node" or source volume is a disked node that has already been
updated with the new software, which you are copying onto the target
node.
1) Log in to a work node as a SYS_ADMIN (secure network only) and start
a Shell on the work node. (This can be the target node.) The target
node must be running SR8.1.
If your source for SR8.1 FTN is floppy disks:
a. Use the WORKING_DIRECTORY (WD) command to set your working
directory to the entry directory on the target volume as
follows.
$ WD //targetvolume<RET>
2-1 Update Procedures
b. On the work node, insert the FTN floppy disk in the floppy
disk drive.
b. Use the READ_BACK (RBAK) command to load the SR8.1
installation programs as follows.
$ RBAK -DEV F0 -F 1 INSTALL -AS INSTALL -MS -L<RET>
If your source for SR8.1 FTN is a magnetic tape:
a. Use the WORKING_DIRECTORY (WD) command to set your work
node's working directory to the target node's entry directory
as follows.
$ WD //targetvolume<RET>
b. Mount the SR8.1 Standard Software tape on to the tape drive
and place the drive on-line.
c. Use the READ_BACK (RBAK) command to load the SR8.1
installation programs as follows.
$ RBAK -DEV M0 -F 1 INSTALL -AS INSTALL -MS -L<RET>
If your source for SR8.1 FTN is another node in the network:
a. Use the WORKING_DIRECTORY (WD) command to set the working
directory of the work node to the /INSTALL directory of a
source node (a node that has already been updated) as
follows.
$ WD //sourcevolume/INSTALL<RET>
b. Use the COPY_SR8.1_INSTALL program to copy the /INSTALL
directory from the source node to the node you are updating
as follows.
$ COPYSR8.1INSTALL //sourcevolume //targetvolume FTN <RET>
COPY_SR8.1_INSTALL does not change your old
/INSTALL/ACL_DIR/SYS_ACLS and /INSTALL/ACL_DIR/SYS_IDACLS.
2) Use the WORKING_DIRECTORY (WD) command to set the work node's working
directory to the /INSTALL directory on the target node as follows.
$ WD //targetvolume/INSTALL<RET>
3) Execute the INSTALL command specifying FTN as the single parameter as
Update Procedures 2-2
follows:
$ INSTALL FTN <RET>
4) Follow the instructions from the INSTALL command. Specify the source
of the optional software as FLOPPY if you are loading from floppy
disks; specify TAPE if you are loading from magnetic tape; specify
NET if you are loading from another node.
If you are loading the software from floppy disks, you must insert
the appropriate floppy disk into the disk drive If you are loading
the software from magnetic tape, you must mount the tape and place
the tape drive on-line. If you are loading the software from another
node in the network, the source node for the software must be running
SR8.1.
5) After the installation program installs the FORTRAN Compiler
software, the program prompts you as follows:
Options:
RERUN -- There were errors in the transcript
pad and you wish to rerun the installation.
FINISH -- The installation ran to completion error free.
There is no additional optional software you
wish to install.
CONTINUE -- Install additional optional software.
Enter Option:
Scroll through your transcript pad. If you find any errors, specify
RERUN to reinstall the software. If you want to complete the
installation, specify FINISH. If you want to install another
optional software product, specify CONTINUE.
If you specify CONTINUE, the program shows you a list of the optional
software products available at SR8 and their disk block requirements,
and prompted as follows:
"Please enter the name of the software to be installed:"
To start the installation of the next product, specify the product
name. After you have loaded all the desired optional products,
specify FINISH.
2-3 Update Procedures
6) The INSTALL program now prompts you as follows to shut down and
restart the node.
To complete the installation, shut down, reset and
restart the target node. Login as a SYS_ADMIN
and run the cleanup procedure by typing:
$ wd //target_node/install
$ opt_cleanup
and restart the target node.
Shut down the target node, and log in again as a system
administrator.
7) After restarting the target node and logging in as a SYS_ADMIN, use
WORKING_DIRECTORY (WD) command to set the target node's working
directory to /INSTALL as follows:
$ WD /INSTALL <RET>
8) Execute the OPT_CLEANUP command to complete the installation of the
optional software as follows:
$ OPTCLEANUP <RET>
Update Procedures 2-4
CHAPTER 3
FEATURES AND ENHANCEMENTS
SR8.1 just fixes bugs, so there are no enhancements to FORTRAN since SR8.0.
FORTRAN 8.0 does contain the following new features and enhancements over
SR7:
o New FTN Command Options
-CPU 160, -CPU 460, -CPU 660, -CPU PEB, -CPU ANY (default)
Take advantage of floating point and 32-bit integer multiply/divide
machine-level instructions available on DSP160s and DNx60 nodes or on
nodes equipped with performance enhancement boards (-CPU PEB);
improves program's execution speed.
-CONFIG name1 name2 ...
Conditional processing; compiles statements associated with specified
attribute(s) (name1, name2) via conditional compiler directives in
the source module.
-INLINE <char>
Selects specified character ("char") as designator for in-line
comments.
-[N]ALIGN
Longword alignment; improves execution speed on DNx60 nodes and
DSP160s. -ALIGN is the default.
o Changes to Command Options
-[N]OPT
Performs global optimizations. -OPT is now the default.
-[N]PEB
FTN 3-1 Software Release 8.1
This option has been replaced by -CPU PEB. (See "New FTN Command
Options" above.) Note, however, that SR8 FORTRAN will still respond
to -[N]PEB.
o FORTRAN now performs more optimizations, for better generated code.
o FORTRAN, BIND and the loader have been changed at SR8 to promote
longword alignment. (The loader is a piece of standard software that
loads sections of object modules into memory at run time.) Longword
alignment is the allocation of constants, variables, and arrays to
memory addresses that are multiples of four (i.e., four bytes is a
longword). This improves program execution speed on DNx60 nodes and
DSP160s. Longword alignment is important for all data except
INTEGER*2. The changes to FORTRAN, BIND, and the loader ensure
longword alignment of constants and local variables.
To take advantage of longword alignment, you should recompile modules
compiled with earlier FORTRAN releases. Recompile and rebind all
modules in a program; if one module is not recompiled, it could
affect the performance of the entire program. In addition, check
that variables in COMMON blocks are longword aligned.
The start of a COMMON block will be longword aligned. Variables in
COMMON blocks will be longword aligned as long as they are displaced
a multiple of four bytes from the COMMON block start. They will be
displaced a multiple of four bytes from the COMMON block start as
long as no INTEGER*2 or CHARACTER data are in the COMMON block. The
displacement of a variable from the start of the COMMON block is
given (in hex) in the fourth column of the symbol map, generated when
you use the -XREF compile option.
o FORTRAN now supports conditional processing; i.e., FORTRAN will
compile (or ignore) source statements marked with conditional
compiler directives (%IF predicate %THEN, etc.), depending on which
arguments you use with the -CONFIG switch in the compiler command
line.
o FORTRAN's in-line comment facility has been extended to allow users
to select their own designator for in-line comments. (See -INLINE
<char> above.)
Software Release 8.1 3-2 FTN
CHAPTER 4
ERRORS CORRECTED
This chapter lists the errors that SR8.1 and SR8.0 have fixed.
4.1 ERRORS CORRECTED SINCE SR8.0
SR8.1 fixes the following bugs found in SR8.0:
o The TANH, SINH, and COSH functions were mistakenly generating
floating point faults for large REAL and DOUBLE PRECISION arguments.
o In FTNLIB, the function CSQRT was erroneously generating the error
"arg of log function less than or equal to zero (library/floating
point)" when both arguments were zero. Now, when both arguments are
zero, CSQRT will not issue an error.
o FTN was generating the message "internal error - short branch
optimization" when compiling a very large program unit that contained
a computed GOTO statement.
o On machines other than DN460s or DN660s, FTN was sometimes taking an
address fault when compiling a very large program because it was
running out of address space.
o On software floating point machines, DOUBLE precision subtraction
involving constants was sometimes causing address faults.
-- reference to illegal address
-- odd address error
-- access violation
FTN 4-1 Software Release 8.1
o FTN was issuing an error message when it encountered a constuct such
as the following:
SUBROUTINE NX(IR)
.
.
.
CHARACTER AR(*)*(*)
.
.
.
ENTRY CX(AR)
.
.
.
4.2 ERRORS CORRECTED SINCE SR7.0
SR8.0 fixed the following bugs found in SR7.0:
o Errors Relating to Use of Performance Enhancement Board:
Incorrect code generated if -PEB option was selected, due to
improper tracking of PEB integer accumulator.
Incorrect code generated if programs containing COMPLEX variables or
arrays were compiled with the -PEB option.
Single precision floating point compares to zero not executing
correctly.
Access violation when attempting to raise 0.0D0 to the 1.0D0 power
on a PEB node.
o Errors Relating to FORTRAN Intrinsic Functions:
ATAN and ATAN2 intrinsics could cause PEB interrupts for large
values.
CEXP, SIN, DSIN, COS, and DCOS intrinsics would generate a runtime
error (overflow in convert) if absolute value of the argument was
greater than or equal to 25736.0.
EXP and DEXP intrinsics were not accurate for arguments between
-.0866434 and 0 on non-PEB nodes. ALOG was not accurate for
arguments between .9962775 and 1.0 on non-PEB nodes.
o Incorrect code generated on calls to the floating point package
(FFP).
Software Release 8.1 4-2 FTN
o Incorrect code generated in programs where an extended DO range
precedes a DO loop.
o Bad streams file headers in files created by programs that perform
WRITEs followed by REWIND.
o Compiler failures when compiling source files with multiple program
units.
o Insufficient address space when compiling small programs that
compiled correctly under SR6 FORTRAN.
o Compiler failures due to access violations or internal compiler
errors.
FTN 4-3 Software Release 8.1
CHAPTER 5
CURRENT ERRORS, LIMITATIONS, AND RESTRICTIONS
None.
FTN 5-1 Software Release 8.1
CHAPTER 6
NOTES THAT BEAR REPEATING FROM SR7
The following items appeared in the "SR7 Release Notes" and should be noted
for SR8.1 as well:
o New FTN Command Options
-IDIR pathname
Adds a pathname to the search hierarchy for directories for include
file names. Up to 63 -IDIR options may be given.
-ZERO
Initializes all common blocks and statically allocated local
variables to zero, unless these entities are explicitly initialized
with DATA statements.
o New FORTRAN Statements
DO WHILE
Continues DO loop while the given logical expression is true.
END DO
Terminates the range of a DO or DO WHILE statement.
o DO statements terminated with END DO do not require statement
labels.
FTN 6-1 Software Release 8.1
CHAPTER 7
DOCUMENTATION
The DOMAIN_FORTRAN_User's_Guide, Order Number 000530, Revision 04 describes
all FORTRAN statements, DOMAIN enhancements to the ANSI 1978 FORTRAN
standard, and how to compile, bind, execute, and debug FORTRAN programs on
the DOMAIN system. This manual was not updated for SR8; therefore, make the
following changes to Revision 04:
o In Chapter 2, add the following paragraph to Section 2.1.4:
You can select an alternate designator for in-line comments by
compiling with the -INLINE <char> switch, where "char" is the
desired designator, enclosed in quotation marks. For example,
$ FTN MYPROG.FTN -INLINE '!'
selects "!" as the in-line comment designator for MYPROG.FTN.
o Change Section 2.1.9 ("Compiler Directives") as follows:
DOMAIN FORTRAN recognizes the following compiler directives:
%INCLUDE, %LIST, %NOLIST, %EJECT, and the conditional directives
%IF predicate %THEN, %IFDEF predicate %THEN, %ELSEIF predicate
%THEN, %ELSEIFDEF predicate %THEN, %ELSE, %ENDIF, %VAR, %ENABLE,
%CONFIG, %ERROR, %WARNING, and %EXIT. All compiler directives must
start in column 1.
The conditional directives (%IF predicate %THEN, etc.) make the
compilation of a statement or series of statements dependent on
which arguments you use with the -CONFIG switch in the compiler
command line. This feature allows you to tailor a source module
for a specific application or node configuration at compile time.
For more information about the -CONFIG switch, refer to "Compiler
Switches" in Chapter 3. For more information about conditional
processing, see "Conditional Processing" in Chapter 5.
FTN 7-1 Software Release 8.1
o In Chapter 3, add the following compiler switches to Table 3-1:
Switch Default Effect
-CONFIG name1 name2... none Conditional processing;
compiles statements
associated with "name1",
"name2", etc. (via
conditional compiler
directives in source code).
-IDIR pathname none Provides an alternative
pathname for the include
file(s) cited in the
source code. You may use
as many as 63 -IDIR switches
in a compilation.
-INLINE char default Selects specified
is "{". character ("char") as
an in-line comment
designator.
-[N]ZERO -NZERO Initializes to zero all
common blocks and
statically allocated
variables in the
program unit, except
variables explicitly
initialized in DATA
statements.
-[N]ALIGN -ALIGN Makes program execute
faster on DSP160s and
on DN460/660 nodes,
but increases the
size of generated code
slightly.
o Chapter 3, Table 3-1; replace the entry for -OPT with the following:
Switch Default Effect
-[N]OPT -OPT Performs global program
optimizations.
Software Release 8.1 7-2 FTN
o Replace the entry for -PEB with the following:
Switch Default Effect
-CPU {PEB|160| -CPU ANY Specifies the CPU type
460|660|ANY} on which the program
will run; enhances program
performance by using the
specified CPU's
machine-level
instructions for floating
point and 32-bit integer
multiply/divide operations.
Use this switch in one of
the following forms:
-CPU 160, -CPU 460 or
-CPU 660; programs
compiled with one of these
switches can run only on
DNx60 nodes or DSP160s.
Attempts to execute such
programs on other nodes
result in errors.
-CPU PEB - programs
compiled with this switch
run only on nodes equipped
with performance enhancement
boards (PEBs). Attempts
to execute such programs
on other nodes result in
errors. This switch
replaces the -[N]PEB
switch in earlier software
releases. (-PEB and -NPEB
are still recognized in
SR8 FORTRAN, however.)
o Change Section 3.2.9 (p. 3-9) as follows:
3.2.9. Optimized Code
By default, FORTRAN performs global optimizations on the generated
code. You can disable this by compiling with the -NOPT switch. The
-DBA switch also disables global optimizations.
FTN 7-3 Software Release 8.1
o Chapter 3, p. 3-9. Replace Section 3.2.10 with the following:
3.2.10. CPU Selection
The -CPU switch takes advantage of the floating point and 32-bit
integer multiply/divide machine-level instructions available on
nodes equipped with performance enhancement boards (PEBs), and in
the floating point units of DNx60 nodes. This switch improves the
execution speed of programs running on those nodes.
Use the -CPU switch in one of the following forms:
o -CPU 160
o -CPU 460
o -CPU 660
o -CPU PEB
o -CPU ANY
Specifying -CPU 160, -CPU 460, or -CPU 660 causes the compiler to
use the DNx60 machine-level floating point and 32-bit integer
multiply/divide instructions. Programs compiled with -CPU
160/460/660 will run only on DNx60 nodes and DSP160s.
Specifying CPU -PEB causes FORTRAN to generate in-line code for the
performance enhancement board (PEB), thereby speeding up the
program's execution. Programs compiled with this switch will run
only on DN320 nodes and on other nodes equipped with PEBs.
Programs compiled with -CPU ANY will run on any node.
o Add the following to the descriptions of the FORTRAN compiler
switches on pages 3-8 through 3-10.
3.2.15 Include Directories
The -IDIR pathname switch directs the compiler to search
an alternate directory (pathname) if it cannot open an
include file by the pathname supplied in the source code. The
format of this switch is
-IDIR pathname [-IDIR pathname...]
You can use as many as 63 -IDIR pathname switches. Each pathname
specifies one alternate include directory.
Software Release 8.1 7-4 FTN
For example, assume your source code contains the %INCLUDE
directives
%INCLUDE 'my.options.ins.ftn'
%INCLUDE 'local/other_things'
and you compile as follows:
$ FTN test_program -idir /new_options -idir \look_here_too
DOMAIN FORTRAN will try the following pathnames (in order)
until it can successfully open the include files:
1. my.options.ins.ftn
2. /new_options/my.options.ins.ftn
3. \look_here_too/my.options.ins.ftn
1. local/other_things
2. /new_options/local/other_things
3. \look_here_too/local/other_things
(A single backslash, \ , represents the directory above the
current working directory. A single slash, / , represents the node
entry directory; i.e., the top directory on the node.)
FTN 7-5 Software Release 8.1
3.2.16 Initialization to Zero
The -ZERO switch causes DOMAIN FORTRAN to initialize to zero
o all COMMON blocks declared in the program unit, except
for those variables and arrays in COMMON blocks
that are explicitly initialized by DATA statements;
o all statically allocated local variables in the program
unit, except those explicitly initialized with DATA
statements.
You can use the -ZERO switch in conjunction with -SAVE, which
allocates static storage to all local variables. Note that
the -ZERO switch does not initialize local variables that have
been allocated stack storage. Also note that compiling with -ZERO
may increase "program invocation time" -- the time between your
invocation of the program (e.g., $ MY_PROG) and the execution of
the program's first instruction.
3.2.17. In-Line Comment Designator
DOMAIN FORTRAN allows the use of in-line comments; i.e., comments
that appear at the end of a statement line. The standard
designator for in-line comments is a left brace character ({). (An
in-line comment continues to the end of the line; thus, a right
brace at the end of the comment has no special meaning.) For
example, in the following line
CALL pgm_$exit {This is an in-line comment.
the sentence following the "{" is an in-line comment.
Software Release 8.1 7-6 FTN
The -INLINE <char> switch lets you select any character (char,
enclosed in quotation marks) as a designator for in-line
comments. For example, if program MYPROG.FTN uses "!" as an
in-line comment designator; i.e.,
CALL pgm_$exit !This is an in-line comment.
compile as follows
$ FTN MYPROG.FTN -INLINE '!'
3.2.18. Conditional Processing
The -CONFIG switch is used for "conditional processing," by which
you direct FORTRAN to compile (or ignore) certain source statements
depending on the arguments given in the -CONFIG switch.
Within the source module, you use the conditional compiler
directives (%IF predicate %THEN, %ELSEIF predicate %THEN, and so
on) to define the statements to be compiled given certain -CONFIG
arguments. Refer to Section 5.3.1, "Conditional Processing," for
information about using these directives.
o Chapter 3, Section 3.3 (BINDING OBJECT MODULES)
For information about enhancements and corrections to the DOMAIN
Binder, refer to the DOMAIN_System__Command__Reference__Manual, Order
Number 002547, Revision 02 and to the STANDARD SOFTWARE RELEASE
DOCUMENT for SR8.
o In Chapter 4, Section 4.2.1, add the following sentence to paragraph
6:
Note that include files cannot contain END statements.
o In Chapter 5, Section 5.3 ("Compiler Directives"), change the first
paragraph as follows:
In addition to statements and comment lines, a DOMAIN FORTRAN
program can contain the following compiler directives: %INCLUDE,
%LIST, %NOLIST, %EJECT, and the conditional directives %IF
predicate %THEN, %IFDEF predicate %THEN, %ELSEIF predicate %THEN,
%ELSEIFDEF predicate %THEN, %ELSE, %ENDIF, %VAR, %ENABLE, %CONFIG,
%ERROR, %WARNING, and %EXIT. Each directive must start in column
1, and its first character must be the percent sign (%).
FTN 7-7 Software Release 8.1
Add the following to Table 5-3 ("DOMAIN FORTRAN Compiler
Directives"):
Directive What_It_Does
%IF[DEF] predicate %THEN Control structure for
text conditional processing.
%ELSEIF[DEF] predicate %THEN "Text" is compiled if
text "predicate" evaluates to
%ELSE TRUE; i.e., if predicate
text is selected at compile
%ENDIF time with the -CONFIG
compiler switch. (See
Additional: "Conditional Processing,"
below.)
%VAR name1 name2 ...
%ENABLE name1 name2 ...
%CONFIG
%ERROR 'string'
%WARNING 'string'
%EXIT
Add the following section:
5.3.1. Conditional Processing
In DOMAIN FORTRAN, you can earmark sections of code for
"conditional processing," and then select them at compile time with
the -CONFIG compiler switch.
Conditional processing is similar to conditional compilation, in
which you mark source statements with an upper- or lowercase "D" in
column 1, and then compile them by using the -COND compiler switch.
While both methods allow you to tailor a module for a particular
application at compile time, conditional processing is the more
versatile of the two.
In conditional processing, you associate attribute names or
conditional expressions ("predicates") with source code statements
("text"), and then compile those statements by using the
appropriate predicates as arguments to the -CONFIG switch. The
compiler directives %IF predicate %THEN, %ELSEIF predicate %THEN,
and so on, determine which statements will be executed depending on
whether a specified predicate evaluates to TRUE or FALSE. An
attribute name is TRUE if it appears as an argument to the -CONFIG
switch or is "enabled" within the source module with the %ENABLE
directive.
For instance, a source module might contain statements you want
compiled only if the module is to run on a color node; i.e., if the
attribute name COLOR, as specified in the program's conditional
directives, evaluates to TRUE. To process those statements, you
Software Release 8.1 7-8 FTN
would compile with -CONFIG COLOR.
Conditional processing applies to the Pascal compiler as well as to
FORTRAN. The syntax of the control structures, described below,
reflects that fact.
Command_Line_Syntax
$ FTN source_filename -CONFIG name1 name2 ...
Conditional_Compilation_Control_Structure_Syntax
%IF predicate %THEN (or %IFDEF predicate %THEN)
text
%ELSEIF predicate %THEN (or %ELSEIFDEF predicate %THEN)
text
%ELSE
text
%ENDIF
"Predicate" is of the form:
name -- attribute name
not predicate -- highest precedence logical operator
predicate and predicate -- next highest logical operator
predicate or predicate -- lowest precedence logical operator
(predicate) -- grouping
Additional Syntax:
%VAR name1 name2 ...; -- enumerate (declare) set of valid
attributes
%ENABLE name1 name2 ...; -- enable attributes
%CONFIG -- predeclared attribute
%ERROR 'string' -- generate compiler diagnostic
%WARNING 'string' -- generate compiler diagnostic
%EXIT -- stop processing this file
FTN 7-9 Software Release 8.1
Syntax_Restrictions
o Lines must exclusively contain either conditional
compilation directives or language source text.
o Only attribute names given on the command line and names
created with %VAR may be used in a predicate.
o %ERROR and %WARNING must be on lines by themselves.
Semantics
o Names must be declared in a %VAR directive before being
used. Names used as arguments to the -CONFIG switch must
also appear in a %VAR statement before being used in a
predicate.
o A name evaluates to TRUE in a %IF or %ELSEIF directive if it
is used as an argument to the -CONFIG switch or is enabled
in the source code with an %ENABLE directive.
o A name evaluates to TRUE in a %IFDEF or %ELSEIFDEF directive
if-and-only-if it is declared with a %VAR directive.
o The predeclared attribute name %CONFIG is TRUE if the
-CONFIG switch is used with a non-null argument.
o Declaring an already declared name, or enabling an already
enabled name will result in a warning. Using an undeclared
name will also result in a warning.
Software Release 8.1 7-10 FTN
Chapter 5, change the description of the DO statement as follows:
DO -- Executes a block of statements zero or more times.
FORMAT
DO [s[,]] i=e1, e2 [,e3]
REQUIRED_ARGUMENTS
i DO loop index variable; can be of type
INTEGER*2, INTEGER*4, REAL, or
DOUBLE PRECISION.
e1 Initial value of the DO loop index
variable; can be a constant, variable,
or expression of type INTEGER*2,
INTEGER*4, REAL, or DOUBLE PRECISION.
e2 Limit value of the DO loop index
variable; can be a constant,
variable, or expression of type
INTEGER*2, INTEGER*4, REAL, or
DOUBLE PRECISION.
OPTIONAL_ARGUMENTS
s Optional statement label indicating
the end of the DO loop range.
, Optional comma after statement
label.
[,e3] Increment value; can be a
constant, variable, or
expression of type INTEGER*2,
INTEGER*4, REAL or DOUBLE PRECISION.
The index variable is increased
by e3 after each pass of the DO
loop. If you omit this variable,
the increment value is 1.
FTN 7-11 Software Release 8.1
DESCRIPTION
DO begins the execution of a loop that extends from the DO state-
ment to a labeled terminal statement or to an unlabeled END DO
statement, inclusively. The terminal statement must be in the
same program unit as the DO.
If you omit the terminal statement label ("s"), you must use an
unlabeled END DO as the terminal statement. Otherwise, the terminal
statement can be a labeled END DO or any other executable statement
except:
unconditional GO TO
assigned GO TO
arithmetic IF
block IF
ELSE IF
ELSE
END IF
RETURN
STOP
END
another DO
CONTINUE is frequently used as the terminal statement of a DO range.
(The rest of the DO description remains unchanged.)
Software Release 8.1 7-12 FTN
Add the following statement after the DO statement:
DO WHILE -- Executes a block of statements as long as the specified
logical expression is true.
FORMAT
DO [s[,]] WHILE (e)
REQUIRED_ARGUMENTS
(e) A logical expression, enclosed in
parentheses, that can be tested to
be either true or false.
OPTIONAL_ARGUMENTS
s Optional statement label indicating
the end of the DO WHILE range.
, Optional comma after statement label.
DESCRIPTION
DO WHILE begins the execution of a loop that extends from the DO
WHILE to a labeled terminal statement or to an unlabeled END DO
statement, inclusively. You must use an unlabeled END DO as the
terminal statement if the DO WHILE has no terminal statement
label.
FTN 7-13 Software Release 8.1
DO WHILE is similar to the DO statement, except that instead of
executing a set number of times, a DO WHILE loop continues
executing as long as the logical expression in the DO WHILE
statement, (e), is true.
DOMAIN FORTRAN tests the expression at the beginning of each
execution of the loop, including the first. If the expression
is true, the compiler executes the statements in the DO WHILE
loop. If the expression is false, control goes to the next
statement after the loop.
EXAMPLE
* DO WHILE with unlabeled END DO as the terminal statement.
DO WHILE (IREM .GE. IDIV)
IREM = IREM - IDIV
IQUOT = IQUOT + 1
END DO
Software Release 8.1 7-14 FTN
Add the following statement after the END statement:
END DO -- Terminates the range of a DO or DO WHILE statement.
FORMAT
END DO
REQUIRED_ARGUMENTS
None.
OPTIONAL_ARGUMENTS
None.
DESCRIPTION
END DO, which may be written ENDDO, terminates the range of a DO or
a DO WHILE statement. An END DO statement may be labeled or
unlabeled. If the corresponding DO or DO WHILE includes the label
of the terminal statement, you must use a labeled END DO as the
terminal statement. However, if the label of the terminal statement
is not included, then you can use either a labeled or unlabeled END
DO.
FTN 7-15 Software Release 8.1
EXAMPLES
* Unlabeled END DO as the terminal statement of a DO loop.
* Note that the DO does not have a terminal statement label.
ITOTAL=0
DO I=1,20,1
ITOTAL = ITOTAL+MYARRAY(I)
ENDDO
* Unlabeled END DO as the terminal statement of a DO WHILE loop.
* The DO WHILE does not have a terminal statement label.
DO WHILE (X .GT. Y)
ARRAY(X,Y)=1.0
X=X-1
END DO
* Labeled END DO as the terminal statement of a DO loop.
ITOTAL=0
DO 10 I=1,20,1
ITOTAL = ITOTAL+MYARRAY(I)
10 ENDDO
* Labeled END DO as the terminal statement of a DO WHILE loop.
DO 30 WHILE (X .GT. Y)
ARRAY(X,Y)=1.0
X=X-1
30 END DO
Software Release 8.1 7-16 FTN
Chapter 5, description of the REWIND statement, paragraph 1. Change
the sentences in parentheses as follows:
(The READ and WRITE statements position sequential files implicitly
-- to the end of the record most recently read or written. ENDFILE
writes an end-of-file marker after the last record read or written
in a sequential file, and positions the file pointer just after the
marker. BACKSPACE explicitly positions a file before the record
most recently read or written.)
In Chapter 6, Change the second bulleted item in Section 6.3.2 as
follows:
o In-line comments cannot span lines. (In-line comments are
comments that appear at the end of a statement line. An
in-line comment must begin with a left brace, {, or a
designator defined with the -INLINE compiler switch.)
Add the following to Section 6.3.3 ("Important Compiler Options",
page 6-17):
-INLINE <char>
This compiler switch selects the specified character ("char") as a
designator for in-line comments. For example, if your program uses
the exclamation point (!) as an in-line comment designator, compile
as follows:
$ FTN <program_name> -INLINE '!'
Appendix A, page A-3. Change the last sentence in paragraph 1 as
follows:
The subsequent 23 bits contain the mantissa of the number without
the leading 1.
Page A-3. Change the last sentence in paragraph 3 as follows:
The remaining 52 bits hold the mantissa without the leading 1.
Appendix C, sample program SERVER.FTN (Figure C-7, page C-12).
Change line 36 as follows:
CALL mbx_$put_rec(handle, retptr, int4(6), status)
FTN 7-17 Software Release 8.1