
X1ClS
SIGMA
5/7
FLAG
Scientific
A XEROX
Data
COMPANY
Systems
Reference Manual

FLAG
Pri
ce:
$4.
00
REFERENCE
MANUAL
for
XDS
SIGMA
PRELIMINARY
September 1 969
5/7
90
COMPUTERS
EDITION
16
54A
Xerox
© 1969, Xerox Data Systems, Inc.
Data
Systems/701 South
Aviation
Boulevard/EI Segundo,
California
Printed
90245
in U.S.A.

ACKNOWLEDGMENT
The FLAG (Fortran Load And
Phillip
Horton,
of
the
Vanderbi
In
cooperation
piler
available
Sherrod,
It
University
with Vanderbi It
to
those customers who
Go)
and
Douglass Henry
Computer
University,
FORTRAN.
reference
The
Reference
IV-H
cerpted
all
the
extended
programs
Intrinsic
Reference
material
from
the
material
input/output
that
are
and
Basic External
Manua
in this manual was
Manual (XDS
XDS Sigma
in
Chapter 6 dealing
5/7
capabilities.
available
to FORTRAN
Functions",
I.
90
RELATED
Title
XDS Sigma 5
XDS Sigma 7 Computer Reference
XDS Sigma
XDS Sigma
XDS Sigma
XDS Sigma
XDS Sigma
XDS Sigma
Computer
5/7
Batch Processing
5/7
Batch Processing Monitor
5/7
FORTRAN IV-H
5/7
FORTRAN IV Reference
5/7
FORTRAN IV
5/7
FORTRAN IV Library
Reference
Operations
Compiler
0966)
FORTRAN IV
was
developed
under
Center,
Nashvi
Xerox
require
the
largely
though several
Reference
with FORMAT
by
the
direction
lie,
Tennessee.
Data
Systems is making
characteristics
taken
from
important
Manual (XDS
statements
Furthermore, FLAG provides most
IV
users. These subprograms
taken
from
the
previously
PUBLICATIONS
Manual
Manual
Monitor
Reference
Reference
Operations
Manual
Manual
Manual
Technical
Manual
Manual
Manual
Norman
of
of
the
XDS Sigma
sections
and
mentioned
Wheeler,
Dr.
George
the
FLAG
a fast
load-and-go
5/7
have
900956),
specifications
of
the
function
are
listed in
FORTRAN IV
Publication
900959
90
900954
901198
900966
900956
90
90
Robert
Haynam
Com-
FORTRAN
been
ex-
notably
and
with
"Table
No.
0950
11
43
15 24
sub-
9
The
specifications
depend
on a
specific
of
the
software system
configuration
of
equipment
described
such as
in this
ii
publication
additional
tape
are
units or
NOTICE
subject
to
change
larger
without
memory. Customers should
notice.
The
availability
consult
or performance
their
XDS sales
of
some
representative
features
for
details.
may

CONTENTS
INTRODUCTION
l.
How This
The FLAG
FLAG Programs 1
Conditional
DATA
2.
Limits
Constants
Identifiers
Variables
Functions
EXPRESSIONS
3.
Arithmetic
Mixed
Relational
Logical
ASSIGNMENT
4.
CONTROL
5.
Labels
GOT 0 Statem
ASSIGN
IF
CALL
RETURN
DO
CONTINUE
PAUSE
STOP
END
INPUT/OUTPUT
6.
Input/Output
Manual
on
Values
Integer
Real
Constants
Double
Complex
Double
Logical
Literal
Constants
Sca
lars 8
Arrays
Evaluation
Expressions
Expressions
Logical
Evaluation
Unconditional
Assigned
Computed
Statement
Statements
Arithmetic
Logical
Statement
Statement
Statement
Statement
Statement
Statement
List Items 27
Special
Is
Organized
Compiler
Compilation
of
Quantities
Constants
Prec ision
Constants
Complex
Constants
Expressions
Expressions
Operators
STATEMENTS
GO
IF
Statement
List
Constants
Constants
Hierarchy
Hierarchy
STATEMENT
ents
GO
TO
Statement
GO
TO
IF
Statement
Statement
Lists
Considerations
- X
Cards
TO
Statement
Statement
10
10
10
12
13
14
14
15
16
18
18
18
18
18
19
19
20
20
20
21
22
22
25
25
25
26
27
27
28
Input/Output
Formatted
1
3
5
5
5
5
6
6
6
7
7
7
8
8
8
9
7.
Acceptable
Intermediate
END
NAME
Simplified
OUTPUT
INPUT
FORMA T
F
Format
- E Format
D
Format
G Format
I
Format
L Format
A
Format
R Format
Z Format
M Format
H
Format
'Format
X
Specification
T
Specification
P
Specification
/
Specification
Parenthesized
Adjustable
Numeric
Widthless
Numeric
Comma
FORMA T
FORMATs
Extended
Memory-to-Memory
ENCODE
DECODE
Direct
BUFFER
BUFFER
Random
Auxi I iary
REWIND
BACKSPACE
END
Carriage
DECLARATION STATEMENTS
Classification
Implicit
Explicit
Confl
Array
Declarations
Array
References
DIMENSION
IMPLICIT
Statements
Input/Output
FORTRAN
Input/Output
and
ERR
Forms
LIS T Statement
Input/Output
Statement
Statement
Statement
Input
Field-Termination
and
Stored
Input/Output
Input/Output
Access
Input/Output
FILE
Control
icting
Storage
Statement
Using NAME
(Fixed
Decimal
(Normalized,
(Normalized,
(General)
(Integer)
(Logical)
(Alphanumeric)
(Alphanumeric,
(Hexadecimal)
(Machine
(Hollerith)
(Hollerith)
(Skip;
(Tab) 49
(Scale
(Record
FORMAT
FORMAT
Numeric
Input
Statement
Statement
IN
OUT
Statement
Statement
Declarations
Declarations
Specifications
Strings
with
List
Interfac
in
Arrays
Data
Input/Output
Statement
for
Printed
of
Identifiers
and
Redundant
to
Array
Statement
Statements
II
Statements
Statements
of
the
READ
Statements
LIST
Point) 38
with
E Exponent) 39
with D Exponent)---
--
Right-Justified)
Dependent)
Space
or
Backspace)
Factoror
Separator)
Specifications
Input
Width
ing 57
Capabilities
Conversion
Statements
Elements
Power
Specified
Statements
Output
Declarations
___
of
10) 49
__
28
29
30
31
32
32
32
33
34
37
40
40
42
42
43
44
45
46
47
47
48
51
52
53
54
55
56
56
58
59
59
60
60
61
62
62
63
63
64
64
64
64
65
65
65
65
65
66
66
66
67
67
iii

Explicit
Optional
Storage
COMMON
EQUIVALENCE
Interactions
EXTERNAL
BLOCK DATA Subprograms
DA
Placement
PROGRAMS
8.
Main
Subprograms
Arguments
Library Subprograms
OPERATIONS
9.
Running a FLAG
Job
F
INDEX
Type
Statements
Size
Specifications
Allocation
Statement
Labeled
Blank
Arrangement
Referencing
T A
DATA
DA
Statement
FUNCTION
SUBROUTINE Subprograms
Dummy
Dummy
Adjustable
Dummy Subprograms
Basic
Additional
The FLAG
Setup
LA G Debug
COMMON
COMMON
of
Statement
Statement
Variable
T A
Constant
and
AND
Programs
and
Scalars
Arrays
External
Examples
of
Storage
Order
Functi ons
Dummies
Dimensions
Library Subprograms
Control
Mode
Statements
of
COMMON
Data
in
COMMON
Statement
Allocation
List
Li
st
of
Declaration
SUBPROGRAMS
Subprograms
Functions
Job
Card
Statements
Statements
68
APPENDIXES
69
70
70
71
A.
B.
STATEMENTS
FLAG
DIAGNOSTIC
MESSAGES
98
100
71
72
73
73
_
75
76
76
77
77
78
79
80
1.
2.
3.
4.
Sample
Array
FLAG
FLAG
Processing
XDS FLAG Program 2
Storage
Job
Job
ILLUSTRATIONS
Setup -Single
Setup -Multiple
Mode
Program
66
96
Programs in Batch
97
80
80
80
81
82
83
84
84
85
86
86
86
86
93
93
93
95
96
104
Sample
l.
Mode
2.
Valid
3.
4.
Evaluation
r:::.
f\,~ixed
-'.
Standard
6.
FORTRAN II/FORTRAN IV
7.
Permissible
8.
9.
Intrinsic
10.
FLAG
Program
of
Mixed
Operators
Type
Combinations
of
VOiiob!e
Unit
Correspondences
and
Dummies
and
Option
Basic External
TABLES
Expressions Using
+ - * /
for
Logical
Assignments
Codes
Expressions
Types
and Expression
Equivalent
Exponentiations
"-Aodes
Statements_
Between
Functions
Arguments
__
3
12
12
14
16
28
30
83
87
94
iv

How
This
Manual
Most
of
the
material
several
though
convenience
the
FORTRAN IV-H Manual
The
remainder
of
general
contains
interest
the
important
of
those
of
this
essential
is
Organized
in this manual was
sections
who may
Chapter
to
the
operations
already
is
indicated
summarizes
new user.
information for
are
Chapters
taken
from
be
1.
the
familiar
by a
the
most
INTRODUCTION
from
the
Sigma
5/7
FORTRAN IV-H
Sigma
5/7
FORTRAN IV
with XDS FORTRAN
bracket
2 through 8
in
important
compiling
the
left
hand margin
features
are a detailed
and
running FLAG programs.
Reference
IV-H,
of
FLAG
description
Reference
Manual (XDS 90
material
of
and
the
page.
then
of
in this manual
briefly
the
Manual
presents
FLAG
(XDS 90
09
56C).
that
information
language.
09
For
differs
Chapter
66B),
the
from
9
l
already
Users
areas
marked by
able
to
The
FLAG
The FLAG (FORTRAN Load And Go) system for XDS Sigma
designed
operating
•
Comprehensive
• Fast compi
•
Significant
•
Special
FLAG may
oping his program. Further,
ment
where
FLAG
Programs
FLAG programs
cution
nal
to
program
familiar
brackets,
start
running FLAG programs
Compiler
to
be
compatible
characteristics:
diagnostic
lation.
reduction
accounting
be
used in
the
job stream
are
comprised
of
the
program and
the
program and
can
be
written
with
XDS
and
then
with
messages
in
total
and
processing
preference
it
contains
of
the
data
read
into
out
while
FORTRAN
other
processing
to
should
an
to
the
processing
IV-H
will
probably
read
Chapter
with
compilers
at
features
standard
be
numerous small programs, many
ordered
be
processed by
computer
9 for
minimum
compile
the
delay.
of
this
and
time
for
small-to-medium
to
minimize
FORTRAN
primary FORTRAN
set
of
statements
during
program
continues.
an
class.
execute
compilers
the
perfer
to
explanation
5/7
computers is
However, FLAG
time.
Monitor
program. Some
Statements
system
when
compiler
of
that
describe
execution.
belong
scan
Chapters 1 through 8 noting
of
FLAG
operations.
sized
the
system in
which
data
essentially
provides
programs.
overhead.
user
are
the
procedure
values
Similarly,
to
one
a FORTRAN IV-H
to
is
in
the
debugging
the
typical
written
of
to
data
two
by
to
be
general
Such users wi
the
user a
phase
university
novice
values
programmers.
be
followed during
processed may
generated
classes:
the
II
compiler
unique
of
environ-
changed
thus
set
devel-
be
exter-
by
be
of
exe-
the
1.
Executable
2.
Nonexecutable
program form, as well as
data
Statements
I
ine
on
the
sequence
The first
by
other
trailing)
t See
Appendix
statement/,
statement/,
initial
ization.
defining
form consists
numbers
field,
portions
ignored.
a FLAG program follow a
and
columns 1 through 5,
of
the
Chapter
A.
of
have
program. Labels
that
perform
that
provide
providing
80
spaces
no
effect
is
5, IIControl
computation,
information
information
prescribed
or
columns;
on
the
program. Col umns 1 through
used for
Statements
are
statement
written
input/output
to
the
format.
however,
as
decimal
II,
contains
to
the
compi
program
the
last
labels.
a more
operations,
ler
about
during
Figure 1 is a sample
eight
Statement
integers,
extensive
and program flow
storage
execution
col umns
72
are
labels
with
all
discussion
assignments,
about
FORTRAN
are
used
used for
allow
blanks
input/output
Coding
only
for
the
statements.
statements
(leading,
of
statement
control.
data
types
formats and
Form. Each
identification
to
be
referenced
embedded,
labels.
Introduction
and
or
or

The
body
of
each
statement
be
continued.
acter
other
zero
in column 6. If a
ing
on
continuation
Column
upon
spersed
1 may
the
with
Statements
constants
The
set
of
FLAG
than
blank
contain
program.
continuation
may
have
and
in FORMAT
characters
accepts
or
zero
statement
I ines
are
the
Comment
lines).
blanks
statements).
acceptable
Letters t :
Digits:
Speci
al
characters:
(useful)
Special
t
characters:
(other)
This
character
set
conforms
Figure 1 illustrates a sample
is
written
an
in columns 7
unl
imited
in column 6. The
is
labeled,
ignored.
character C to
lines may
inserted
to
ABC
indicate
appear
as
desired
FLAG
is
D E F G H I J K L M N 0 P Q R
0123456789
+ - * / =
to
the
Extended
FLAG program. An
through
number
of
continuation
initial
the
label
that
anywhere
to improve
()
• , $ I &
Binary-Coded
explanation
line
must
the
in
blank
Decimal
72,
but
of
each
appear
line
is
the
program,
readabil
II
is
given
if
additional
I ines. Each
statement
on
the
initial I ine
to
be
treated
except
ity,
except
STU
Interchange
in Table
space
is
required, a statement
continuation I ine
contains
as a
only
of
the
comment
the
statement;
only,
within a statement
within
literal
fields
V W X Y Z
Code
(EBCDIC)
1.
must
characters
with
(i.e.,
(e.
g.,
standard.
may
contain a char-
blank
or
labels
appear-
no
effect
inter-
in
Hollerith
PROBLEM
PROGRAMMER
I-r--.-.,--r---t"""""+-"',
~-.--,.--r-+-!
hI.O~J,F,
1 1 I
1 3
Sa
m pi e
____________________
II
NT EGE R
T I • , •
iK
=
iii
, • • • • !
.....,lR.;;E=;A,D,
,(
,F,A,C,T,~R,)
lK
= K • F AC T
lJFACT6R
1 2
WRI T E
Iii
,(
'
ii'
,1,
(1
iii
FACTOR,
Ii'
~.
•
,5,
),
,
= '
O'S , 6)
i 1
iii
_
• • , i
.,.
'f~-,.~TR-,-T-·,--y---r--,.__,__.-,---r---.--r-......,........-r--T"'"
,l-1r,J-r3.,J
(j
R
'K~'-'
I i * ---,---"'"
FORTRAN
K
.·-,.--r··--~"T"-.,._r_r_l--y--r--rj-,--,--.,..--,r--r--.--.--...--.---.--,--
,'--'
,---r--r--r---r-...---r--.---r--r
.1,
lr-~T-r--T-r-.--,---rl---r-.,...--,.
.... , ...
.,--
.
-'~·TT-'~-,.-
·--TM-"...-----r--
S!:I:»ls
~
SCIENT:FIC
CODING
Identification
FORTRAN STATEMENT
..-, -,..---r-.
......
,
'·~·-T--~--
,---1'
..
-T----r-r---.--'
"'l"'--,.
, i , i
T~.--.--r-r-r--T
DATA
'---
SYSTEMS
FORM
......
·
-,-,........,-,
-r,---.----.--r--.---.--..
--r""'-'--T-"-r-~
",-,---'---r--~..---r-,--r-r-I
y-1-.----.-.-
-r·-r-r-.-·
T-,"'·"-
...
I-..--
•
Iii
~-;-'-""---'
T
....
'-'-'---'-"--,---"
¥
,.-.~
STC:SP
5 F
eRMA T (t'6)
t--.-·-,-.--r-=6~f-'-+1~_.~R,M:
t--r-T-,-----r-+-+I,!=-r--"'-
'~';jEND
~
-.=....-,-,
--.--.----r-.......-r,--r-,
T .
(::~
:",~-,_T"~
.--.--.----.,
-.,
:-1""':
~-r_~-Q:
f:=:-~=~·~..,...-y-~,---,--.--r.
ir---r-",
~"-r""""-'"
"r
··Y·
....
,...........,.--....,.._·......--.-,
~,
.
..,--.--......--,-._
- ..
------'
-r........-.,.--.,...-r.
.
....,.......,.,
--.--.-.-
--_
~-r:---,---r-...,.....,r-T--r--,--,
•
..,.....-rj
-.-...,..---,.-~
....
_-----------
dollar
sign
($)
tThe
be
used in FORTRAN
Chapter
7), $ follows Z in
character
identifiers,
the
is
accepted,
such as
set
of
2 FLAG Programs
Figure
$,
letters.
1.
though
FIVES,
Sample
not
recommended,
or
$300. For
XDS FLAG Program
as a
letter
the
purposes
of
of
the
the
alphabet.
IMPLICIT
It
may
statement
therefore
(see

Table
1.
Sample
Program
Line
1,2
3
4
5
6
7
8
9
Meaning
The
character
nonexecutabl e statement
A
An
assignment
An
input
from
unit
fied by FORMAT 5
Statement
If FACTOR <
If
If FACTOR >
Statement
factor.
by
the
statement
The
and
one
The C in
the
value
C in
column 1 defines
statement
command
1.
10 tests
FACTOR =
11
In
other
value
continuation
column6causesline9
of
that
The form in
(line
the
0,
0,
0,
is
another
words,
of
FACTOR.
appearing
the
current
that
that
causes
which
14).
value
of
control
control
control
assignment
the
current
on
lines 8 and
line.
value
these I ines
defines
sets K equal
the
the
FACTOR
is
is
is
to
of
to
value
value
and
transferred
transferred
transferred
statement
valueofK
9 is
bea
continuation
FACTOR minus
the
to
of
FACTOR
of
FACTOR
transfers
to
to
to
that
an
as
comments.
compiler
1.
control
statement
statement
statement
assigns
is
replaced
assignment
of
1.
the
to
be
appears
12.
13.
11.
to K the
by
line
variabl
es FACTOR
read
into
external
to
statement
value
the
currentvalue
statement,
8.
This
storage.
to
the
11, 12,
of
the
written
statement
and
K as
integers.
The
value
is
computer
expression
of K multiplied
as
assigns
is
or
13 as follows:
an
initial
to
K times
FACTOR
read
speci-
line
10
11
12
13
14
15
16
Conditional
When
the
GO
(I
ine
6)
occurs;
Statement
The
written
for
The
FORMAT
FORMA T
The END
the
In
this program,
executed
statements
Compilation
12,
WRITE
output
out
designated
control
statement
statement
line
source
program.
four times,
on
- X
TO
an
assignment
statement,
on
unit
FORMAT
statement
informs
if
lines
Cards
statement
108,
corresponding
correspond
the
the
4,
which
statement).
STOP
causes
the
processor
value
statements
5, 12,
is
statement,
executed,
13,
causes
is
normally
execution
to
i ng to
during
of
FACTOR is
and
13 will
an
assigns
the
name
assigned
READ
statement
WRITE
statement
compilation
initially
on
line 7 through
be
unconditional
the
value
of
the
to
the
of
the
program
on
line
on
that
3 as
10 wi
executed
once
transfer
zero
variable K and
Printer
line
it
read
II
to
to
be
5.
12.
has
.by
be
each.
of
the
variable
(see
terminated.
reached
line
5,
executed
control
its
value
statement
the
statement
three
to
statement
K.
to
6,
line
physical
10 will
times,
be
15
end
and
10
of
be
the
FLAG
provides
is
processed as a
Otherwise,
a means for
statement
the
card
is
treated
only
conditional
when
as a
comment.
compilation
the
CX
option
of
statements.
is
specified
on
Any
the
line
FLAG
that
contains
control
Conditional
an X in
card
(see
Compilation
column
Chapter
- X
9).
Cards
1
3

This
feature
intermediate
to
be
removed from
treated
checkout
as comments
procedures.
enables
output
the
programmer to
and
special
the
program. Instead,
only.
Also,
error
These
they
include
checking.
statements
may
easily
in his program
When
the
program is
remain in
be
reinstated
checkout
compiled
the
listing,
at
additional
has
been
without
however,
any
time.
statements
completed,
the
CX
and
may serve as
for
checkout
these
option
purposes, such as
statements
and
the
statements
documentation
do
not
have
are
or
Continuation
is
also
an X card.
lines
for X cards should
For
C
FOR
~
-lsTATEMENT
NUMBER
1 5
X·
X
3 FeRMAT (
x
example:
COMMENT
J
6 7
'l!r
:c~PRINT
10 15
••
_,
PR I NT
also
be X cards;
A.
3 •
X.
3 • U .
6F
furthermore, a normal
E •
Y I
30
F
~
20
B
.J
...•
I I
C.
25
. .
D.
.
7')
. I
V.
W
.
, X,
I
line
may
have a continuation
FORTRAN STATEMENT
35
40
.
.
I
-.~
....
~--
..
--
line
that
45
I
4
Conditional
Compi
lotion
- X Cards

2.
DATA
Numerical
the
numerical
ample,
numerical
the
is
All
lim
Integer
that
Real
of
positive
nificant
rate,
the
execution
identified
data
Integer
Reai
Double
Complex
its
data
is,
-2
data
which
depending
quantities -constants
values
encountered
integer
quantity
processed by a FLAG program
on
31
(sometimes known as
are
or
negative
digits.
5 is
that
of
the
program, a
and
referenced
precision
Values
are
precise
31
to
+2
within
the
values
That is,
on
the
represented
is
of
Quantities
representations
- 1.
range
the
value
and
in a program. A
as
referenced
variable
by
an
identifier.
Doubl e Compl
Logical
Literal
Integer
data
floating-point
5.398
within
this
sixth
most
assigned to the
variables
11511;
by
name
may
can
of
may
79
x
10-
range
significant
the
rather
take
be
classed
ex
the
only
data)
to
or
datum.
- as
distinguished
constant
number
on many
range
be
assigned
can
7.237
the
value
digit
IT,
than
as
of
be
x 10
will
is a
to
three
by its
values
one
of
integers
integral
assigned
75
(i.e.,
zero.
be
in FLAG
quantity
decimal
explicit
rather
seven
types:
from
-2,
values
approximations
65
16-
Real
data
accurate,
are
a means
whose
value
places,
appearance
than
being
147,483,648
within
63
to
16
have
an
while
the
of
identifying
is expl
as
113.
14211.
in a program
restricted
to +2,
this
range.
of
real
numbers,
).
A real
associated
seventh
the
icitly
stated.
A
variable
statement.
to
one. A variable
147,483,647;
the
magnitudes
datum
may
acquire
precision
will sometimes
of
nature
For
is
6+
sig-
beaccu-
of
ex-
a
During
Double
have
Complex
real
imaginary
val ues for real
Double
precision
Logical
Literal
ues. Any
precision
an
associated
data.
complex
data
Data
data
The first
part
values.
are
of
Constants
Constants
each
pi
us
Integer
Integer
2,
are
type
of
or minus
Constants
constants
147,483,647.
data
precision
are
approximations
of
of
the
data.
data
can
acquire
character
the
characters
data
that
data.
AI
operators.
are
may
approximate
of
15+
the
two real
complex
have
though
represented
number. The
the
same form
only
the
strings of up to 255
discussed in
do
not
vary
numeric
The
operator
the
significant
of
complex
data
approximates
as
values
IItrue
Section
in
value
constants
is
not
by strings of
identical
numbers. These
values
complex
'l
characters.
and
considered
digits.
digits.
that
or IIfalse
1 may
are
are
considered
set
the
may
data
ll
appear
referenced
part
The
of
values
approximations
real
part,
be
assigned
except
that
•
Like
logical
in
literal
by naming
as
being
of
the
magnitude
as real
and
the
to
both
data,
data.
unsigned,
constant,
of
an
data.
take
second
each
the
real
literal
their
however.
integer
However;
the
form
real
part
are
and
data
values.
they
constant
double
of
an
datum
identical
imaginary
do
not
There
are
may
be
preceded
(See
Chapter
must not
precision
ordered
approximates
have
to
the
parts
are
numeric
constants
3.)
exceed
pair
set
by
data
of
the
of
double
val-
for
the
Examples:
382
13
997263
1961
1000000000
323344224
000546
382437
8
o
Data
5

Rea I Constants
Real
constants
the
the
numeric
power
value
of
are
ten
by
represented
and
consists of
which
the
by strings
the
letter
numeric
of
value
digits
with a
decimal
E,
followed by a signed or unsigned 1-or
is
to
be
multiplied.
point
Thus,
and/or
the
following forms
an
exponent.
2-digit
The
exponent
integer
are
permissible:
that
follows
represents
n.m
n. mE±e
where
n,
m,
and e are
The plus sign
For
example,
forms:
0.567E+05
567000.
The val
ue
of
constant,
Since
any
but
real
Examples:
5.0
0.01
n.
E±e
n.
strings
preceding e is
. 567E5 has
5. 67E4
E-1
a real
onl y
constant
567E02
constant
the
7 most
may
7.6E+5
6.62E-37
.m
nE±e
of
digits.
optional.
the
meaning.
567
x 105 and
56700.
56700.000E-00
may not
significant
be
written
exceed
digits
in a
the
are
variety
3.141592265358979323846
.58785504
can
also
I imits for real
retained.
of
ways,
be
represented
data.
Any number of
the
user has freedom
by
any
of
of
the
digits
choice
following
may
be
regarding
equivalent
written
form.
in a real
Double Precision Constants
Double
the
double
precision
exponent.
precision
n. mD±e
constants
To
denote a constant
constant
n. D±e nD±e
where
n,
m,
and e are
D
signifies a double
The plus sign
The
value
of a double
may
be
written
preceding
in a
strings
e is
precision
double
Examples:
1. 2345678765432D1
.9963D+3
Complex Constants
Compl
ex
constants
are
expressed as
are
formed
may
be
of
digits
precision
optional.
constant
precision
576.3D+01
.1254D-02
exactly
specifically
written
constant
constant,
an
ordered
in
may
like
any
not
312.
885.
pair
as
of
exceed
but
D-4
D+3
real
constants,
double
the
precision,
following forms:
the
only
the
15 most
of
constants
except
limits for
significant
in
the
that
the
exponent
double
form
the
letter
must be
precision
digits
are
D is used
present.
data.
retained.
instead
Any
of
Thus, a
number of
E in
digits
6
Constants

where
c 1
and
c2 are
signed
or
unsigned,
real
constants.
The
complex
constants
(1.
(98. 344E
( - 1 . , - 1
Neither
Double Complex
Double
part
is a
Examples:
(.757D6,3D-4)
(7. ,ODO)
(-4.
Neither
Logical
Logical
constant
have
34,52.01)
000.
part
of a complex
complex
double
286DO,
part
of a double
Constants
constants
(c1,c
values
as
indicated:
11,34452E-3)
)
Constants
constants
precision
757000.0DO
1.
3)
complex
may assume
) is
interpreted
2
983.
constant
are
formed
constant,
7.0DO
-4.286DO
either
1.
34
44
-
1.
0 1
may
exceed
in
exactly
the
complex
+
+
+ 1.
constant
of
the
as
+
52.0li
+
34.
000.
.0003DOi
O.ODOi
3DOi
may
two forms
meaning
452i
Oi
the
value
the
same
constant
exceed
c
+ c
i,
where
2
1
limits
established
way
as
complex
becomes a double
the
value
limits
i =
/=1.
for
real
constants.
complex
established
Thus,
data.
If
either
constant.
for
double
the
following
the
real
precision
complex
or
imaginary
data.
.
TRUE.
where
these
forms
Literal
Constants
A
literal
constant
where
is a string of up to
character
Within a literal
apostrophe).
by
blanks
are
Examples:
'ALPHANUMERIC
'IIDON"T!'"
Literal
constants
1. An
2. A constant
3.
argument
A PAUSE
.
FALSE
have
has
strings.
constant,
For
example,
not
considered
can
to a
item in a
statement
.
the
logical
the
form
255
two
consecutive
'AB"CD'
to
be
INFORMATION
appear
in
three
function
DATA
('Sl
form only)
or
statement
values
"true"
alphanumeric
quotation
represents
consecutive.
'
contexts:
subroutine
and
"false",
and/or
special
marks may be used
the
five
characters
respectively.
characters.
to
AB'CD.
Note
that
blanks
represent a single
However,
quotation
are
significant
quotation
(') marks
in such
mark (or
separated
A I
iteral
constant
cannot
appear
as
an
element
of
an
expression.
Constants
7

[
Identifiers
Identifiers
as subprograms
are
strings
and
of
letters
COMMON
and
decimal
blocks.
digits,
(See
Chapters 7 and
the
first
of
which
8 for discussions
must be a
letter,
of
COMMON
used to name
and
subprograms.)
variables
as well
Identifiers
ignored;
for
Examples:
in FLAG may consist
therefore,
clarity,
A345Q
X
ELEVAT
Variables
Variables
ables
a I
If
a
following
1.
2.
These
Consequently,
such (see
established
Scalars
are
may
be
iteral
string.
variable
implicit
Variables
Variables
classifications
"Explicit
for
it
data
any
has
is
whose
whose
double
the
ON
advisable
STRESS
L9876
whose
of
the
data
Normally,
not
been
typing
identifiers
identifiers
are
precision,
Type
applicable
of
TIME
and
not
to
use
J3
DIFFER
values
may
types.
integer
assigned
conventions
begin
begin
referred
Statements"
to as
complex,
data
up
to
six
alphanumeric
ONTIME
variables
to a particular
types.
are
identifiers
MELVIN
SETUP
vary
during
(There
is
are
assumed:
with
the
with
any
the
IIUKLMN
double
in
Chapter
are
identical.
that
program
no such
used.)
data
letters
other
complex,
7). The
characters.
There
correspond
QUANTY
execution
entity
as a
type
(see "C
I,
J,
K,
letter
are
rule".
and
values
are
no
to
FLAG
and
literal
lassification
L,
M, or N
classified
logical
assigned
Blank
restricted
statement
are
referenced
variable;
are
as real
variables
to
variables
characters
identifiers
types.
any
of
Identifiers",
classified
variables.
must be
may
embedded
with
an
type
of
as
integer
explicitly
not
in
in FLAG;
identifier.
variable
Chapter
variables.
exceed
identifiers
however,
Vari-
may
contain
7), the
declared
the
limits
are
as
A
scalar
Examples:
Jl
Arrays
An
array
arrays
FLAG
arrays
on
Array
EI
ements
array
An
identifier,
where:
v is
si
n is
Subscripts
variable
is
see
el
is a subscript (see below)
is a
single
datum
NAME SCALAR EQUATE
data
in
which
the
data
may
have
up
to
seven
"Array
Declarations"
ement
is a member
followed by a
the
array
name
the
number
list
of
subscripts,
of
the
of
subscripts
entity
accessed
form
an
ordered
dimensions
in
Chapter
set
of
data
enclosed
which
E
and
7.
comprising
must
be
via
an
NEW
set.
Associated
are
referenced
in
parentheses
equal
identifier
DHO
an
array.
to
the
number
with
by
of
an
Array
the
appropriate
XXX8
an
array
identifier.
el ements
of
dimensions
type.
is
the
property of dimension.
For a
complete
are
referenced
of
the
array
discussion
by
the
array
(0 < n ~ 7)
be
any
[
A subscript may
not
integer
Identifiers/Variables
8
it
is
converted
expression
to
that
integer
mode (by
has a
resultant
truncation).
mode
of
integer,
real,
or
double
precision;
if
the
result
is

The
evaluated
nated
as ALPHA(K-4),
Examples:
result
Subscripts
for a
the
subscript
value
of
must
K must
always
be
be
greater
greater
Array
than
than
4.
Elements
zero.
For
example,
if
an
array
element
is
desig-
[
MATRIX
CUBE
DATA
J35Z
BOB
Functions
Functions
quantities,
tion
A
function
in
where
Functions
IJKLMN
are
called
reference
reference
parentheses
is
is
a.
I
IIArguments
are
rule
(3,9,5,7,6,1,2)
(5*
J,
P,
3)
(I,
J, K,
L,
M,
N)
(1+4,
6*KRAN-2,
(3,IDINT(DSQRT(D)))
subprograms
arguments,
constitutes a reference
the
name
an
argument.
classified
applies.
is
denoted
of
and
in
The
that
the
Dummies
the
are
and
function
Arguments may
same
type
ITEMP)
referenced
produces a single
to
the
value
by
the
identifier
,
Chapter
way
be
as
variables;
ll
of a function
MATRIX(3,
CUBE(5*
DATA(I,
J35Z(I+4,
BOB(3,IDINT(DSQRT(D)))
as
basic
that
constants,
8).
is
not
9,5,7,6,
J,
P, 3)
J,
K, L,
6*KRAN-2,
elements
quantity,
produced
names
variables,
that
affected
1,2)
M,
N)
ITEMP)
in expressions. A
called
by
the
function,
the
function,
expressions,
is, unless
by
the
the
the
type
function
when
followed
type
is
of
its
function
value.
operating
by a list
or
array
specifically
arguments.
acts
upon
one
or
more
The
appearance
on
the
of
arguments
or subprogram names (see
declared
of a func-
given
argument.
enclosed
otherwise,
the
[
Examples
SIN(A+B)
Many
library
of
function
CH ECK(7.
functions
references
3,
are
provided
are:
J,
ABS(Y)) KOST(ITEM)
in FLAG. In
addition,
the
user may
define
his own
functions
(see
Chapter
8).
Functions
9

3.
EXPRESSIONS
Expressions
ences.
may
operands.
and
An
be
unary -that
the
evaluation
are
expression
Expressions may
Arithmetic
An
arithmetic
stant,
variabl
The
arithmetic
Operator
+
*
/
**
Arithmetic
expressions
A
-TERM
1.
2607
ACE -
DEUCE
W90ML * DE
F(5.8E2) = A /
strings
of
operands
may
contain
is,
they
may
be
of
any
expression
Expressions
expression
e,
or
operators
is a
function
Operation
Addition
Subtraction
Multiplication
Division
Exponentiation
are:
may
references
{binary}
be
+ W9CMI / XKA9RU
B9J
(L)
separated
subexpressions; subexpressions
operate
classed
sequence
or
(binary)
of a
relatively
on a
as
arithmetic,
has a
unique
of
integer,
connected
Positive
or
Negative
by
operators.
single
(unary)
simple
result.
real,
by
operand.
logical,
double
arithmetic
(unary)
form
Operands
are
They may
or
relational.
preCISion,
operators.
may
be
constants,
expressions
also
be
All expressions
complex,
enclosed
binary,
and/or
variables,
in
parentheses.
operating
are
double
or
on
single
complex
function
Operators
pairs
valued,
refer-
of
con-
or
the
more compl
x + (112 *
-B
+ SQRT(B ** 2 - 4 * A * C) + T *
(X
+
Y)
-((M + N) * (Z -
Evaluation Hierarchy
The expressi on
A +
B/C
might
be
eval
(A + B)
or
as
A +
(B / C)
10 Expressions
(G)
** 3 +
uated
/ C
icated
**
L(3)
O.
7352986E-7
Q(J»)
as
form
+ N / SDS) -
(H)
(S
+ B / I * (K(J) /
(V1
-
VO) + (Z
1 -
ZO»)

Actually,
that
it
is
the
latter
necessary
form is
to
formulate
the
way
rules
the
expression
for
expression
is
interpreted
evaluation
without
so
that
explicit
such
grouping.
ambiguities
do
This
exampleillustrates
not
occur.
Subexpressions
sions
as
x *
where
(I +
sion. The
1.
The innermost subexpressi
eval
2.
The
Operation
Exponentiation
Multiplication
and
Additi
Subtracti
Some
additional
1.
At
anyone
evaluated
2.
Consecutive
have
in
(Z
+ Y *
L)
may
evaluation
uated.
arithmetic
Division
on
and
on
from
(H
be
conventions
level
exponentiations
been
defined
- G / (I +
called
the
hierachy
operations,
Operator
**
*
/
+
of
evaluation,
left
to
right.
as
expressions
L) -W) + M(8))
innermost
is,
therefore,
on,
followed
in
the
following
Order
1 (highest)
2
3
are
necessary.
operations
Consequently,
are
performed
enclosed
subexpression,
as
follows:
by
the
next
order
of
of
the
1/
J / K / L is
left
to
in
parentheses.
and
innermost
precedence:
same
order
right.
(H
- G /
subexpressi
of
equivalent
Thus
It is
(I + L) -W)
on,
precedence
to
also
unti I
(except
((I /
possible
is
the
next
all
subexpressi ons
for
J)
/
K)
to
have
nested
innermost
exponentiation)
/
L.
subexpres-
have
subexpres-
been
are
I
L
3.
4.
A ** B ** C
is
interpreted
The use
differentl
The
sequence
As
an
algebraic
written
as
Example:
The expressi on
is
evaluated
as (A **
of
parentheses
y.
"operator
(A + B)
A *
(B
F + G
r =
1
D - r - H
r = C * r
4 3
is
notation,
/
c.
+ C *
(D
in
the
2
B)
** C
recommended,
operator"
parentheses
- E /
sequence
(F
is
+ G) -
as
many FORTRAN systems
not
permissible.
are
used
to
define
H) + P(3))
Therefore,
evaluation
interpret
A * -B must
sequences
consecutive
be
expressed
explicitly.
exponentiation
as
A * (-B).
A+B
Thus,
-C-
is
r 5 = B + r 4 +
r = A * r
6 5
where
the r are
the
i
P(3)
vari ous
level s of
eval
uati
on.
Arithmetic
Expressions
11

Mixed
V/hen
elements
expression
specifications
Expressions
an
arithmetic
may
contains
not
of
expression
appear
more
its
elements.
contains
in
an
arithmetic
than
one
type
Table 2 illustrates
Table
2.
elements
of
Mode
expression
element,
of
Mixed
of
more
than
except
the
mode
how
the
mode for
Expressions Using
one
as
of
type,
function
the
expression
mixed
IT
IS Known
arguments
expressions
Operators
as a mixed
(see
is
determined
+ - * /
rule
by
is
determined.
expression.
2,
,below).
the
type
When
and
Logicai
an
length
+-*/
INTEGER
REAL
DOUBLE
PRECISION
COMPLEX
DOUBLE
COMPLEX
It
can
Type
Doubie
Complex
Real
Integer
be
seen
that a hierarchy
Compiex
or
Double
INTEGER
Integer
Real Real
Double
Precision Precision
Complex Complex
Double
Complex
of
type
Precision
REAL
Real
Double
Double Double
Complex
and
length
Precedence
1
(highest)
2
3
4
DOUBLE
PRECISION COMPLEX
Double
Precision
Double
Precision
Double Double
Precision
Double
Complex
Complex Complex
specifications
exists.
The
order
Complex
Complex
Complex
Complex
Double
of
precedence
DOUBLE
COMPLEX
Double
Complex
Double
Complex
Double
Complex
Double
Complex
Double
Complex
is:
I
L
12
During
evaluation
resultant
The
1.
2.
Mixed
mode
foil owi ng rul es al so
Subscripts
ated
in
their
Only
expression
Expressions
of
mixed
of
each
operation
appl y to
and
arguments
own mode (i.
elements
Base
T
...
+o,..,or
£
...
~~~.
Real
Double
Complex
Doubl e Compl
Precision
expressions
are
e.,
of
Table
the
will
be
mi
xed
expressi
independent
integer)
the
types
3.
Valid
mode
as
shown in
of
and
shown
Type
of
an
ons:
the
expression
neither
in
Table 3 may
Combinations
operand
Table
affect
2.
nor
in
be
will
which
are
for
combined
"
} {
}
ex
**
**
be
converted,
they
appear.
affected
Exponentiations
by
with
,
the
Exponent
T_,,~~~~
1I11"'~"'"
Real
Doubl e
Integer
if
necessary,
These
mode
of
an
exponentiation
Preci
so
expressions
the
outer
operator.
si
on
that
the
are
evalu-
expression.

4.
5.
6.
The mode
arithmetic
Complex
these
types,
that
is
higher
Integer,
to
have
Values
of
of
the
expression.
of
the
results
of
an
exponentiation
operations
and
double
it
than
real,
imaginary
expressions, subexpressions,
acquires
(or
and
double
parts
(see
Table
precision
double
different
precision
of
zero.
elements
complex
from)
1).
have
type.
all
values
and
operation
the
This is
its
constituents.
that
appear
elements
same
may
can
level
the
in
not
be
determined
of
precedence.
only
case
complex
exceed
in which
or
double
the
value
in
the
same manner as
If
an
an
complex
limits
expression
expression may
expressions
associated
contains
that
for
both
have a type
are
assumed
with
the
other
of
mode
Relational
The form
where
Evaluations
pressions
Relational
Examples:
of a relational
e1 and
e
is a
of
are
operators
Operator
.IT.
.LE.
.EQ.
.NE.
.GE.
.GT.
l.LT.6
O.GT.8
O.
LT.
(2.
O.
LT.
- (2. **
Expressions
expression is
are
logical
cause
Meaning
less
Less
Equal
Not
Greater
Greater
N)
N)
arithmetic
operator
expressions
type.
comparisons
than
«)
than
or
to
(=)
equal
than
than
is
true.
is
false.
is
always
is
always
2
relational
relational
of
**
expressions whose mode is
(see below)
result
in
either
equal
to
(I)
or
to
equal
between
(~)
to
arithmetic
(:;:::)
(»
true,
while
false.
of
the
integer,
two
values
expressions.
real,
IItrue
or
double-precision
"false
ll
ll
or
,
i.e.,
relational
ex-
When two
each
mode expression is
A
test
these
amount in
binary
It
is
where
relational
arithmetic
in its own mode. The comparison is then made in
for
equality
quantities
their
representations
not permissible
(X
(L.LT.
(X
.GT.
expressions requires.
expressions
converted
between
are
only
binary
to
.GT.
O.2345E6))
O.
2345E6) is a
approximations
representations.
will
nest
are
to
the
real or
produce
relational
relational
compared,
mode of
double
It
these results.
expressions such as
using a
higher
precision
to
most
values,
can
only
subexpression,
relational
the
mode of
precedence.
quantities
numbers
be
said
that
rather
operator,
higher
may
not
be
that
are
computations
than
an
arithmetic
the
two expressions
precedence;
meaningful on a
"essentially"
whose
operands
expression,
i.
e.,
binary
equal
Relational
the
may
and
as
are
first
evaluated,
value
of
machine.
differ
by a small
results
have
the
definition
Expressions 13
the
lower
Since
exact
of

logical
Expressions
Logica! expressions are expressions of the
where
e.
are
I
c.
I
Evaluations of logical expressions result in
Logical elements
1. a ·Iogical
2. a logical
3. a relational
4.
any
5. a logical expression
6.
any
Logical Operators
There
are
Operator
.NOT.
.AND.
.OR.
Table 4
1. .
NOT. e is
2.
e1 .AND.
3. e1 .OR. e2 is
logical elements.
are
the
variable
constant
of
the
above
of
the
above,
three
logical operators:
illustrates
e2 is
binary
are
defined
or
expression
encl osed in
enclosed
preceded
Type
unary
binary
binary
the
meanings
"true"
only when e is
"true"
"true"
logical
when
operators
as
one
of
the following
logical
function
parentheses
in
parentheses
by
the
unary
of
the
logical operators.
"false".
only when both e1 and
either
or both e1 and
form
(see below).
either
of
reference
logical
the
entities:
operator
e2 are
e2 are
two
"true".
values,
.NOT.
"true".
"true"
or
"false".
Expression
e True
e False
e1 False e2 False
e1 True e
e 1
False
e1 True e2 True
14 Logical Expressions
Values
---
---
2
E2
False
True
Table
4.
Evaluation
.NOT.
False
True
---
---
---
---
of
Logical Expressions
e
---
Evaluation
e
1
.AND.
e
2
e
1
---
---
False False
False
False
True True
True
True
.OR. e
2

Evaluation Hierarchy
Parentheses
expressi ons.
A
.AND. B .OR.
does
not
have
A
.AND.
where
(B
.OR.
The
evaluation
1.
arithmetic
2.
relational
3.
the
innermost
4.
the
logical
Operator
.NOT.
.AND.
are
used to
Consequentl
the
same
(B
.OR.
0(3)
hierarchy
expressions
expressions
logical
operations,
Order
1
(highest)
2
define
y,
0(3)
meaning
0(3)
.NE.
X)
for
(the
subexpression,
evaluation
.NE.
as
.NE.
may
logical
relational
in
the
sequences
X
X)
be
called a logical
expressions
operators
followed
following
order
explicitly,
subexpression.
is
are
all
by
the
of
precedence:
of
next
ina
manner
equal
precedence).
innermost
similar
logical
to
that
discussed
subexpression,
etc.
for
arithmetic
.OR.
example,
For
L
is
interpreted
L
Note:
3
the
expression
.OR
•.
NOT. M .AND. X .GE.
as
.OR.
«.NOT.
It
is
permissible
other
e
not
is
e1 .AND
is
legal.
ator
.NOT.
if X and Z are
are
not
.NOT. X .AND.
.NOT.
words
.AND
1
valid,
equival
M)
Two
applies
(X
.AND.
to
have
..
OR. e
while
..
NOT.
consecutive
should
logical
ent:
.AND.
(X
.GE.
two
contiguous
2
e
2
.NOT.
be
variables
Z
Z)
Y
Y))
operators
enclosed
having
logical
are
in
parentheses
the
values
operators
not
permissible.
if
TRUE
only
it
contains
and
when
The
FALSE,
the
second
logical
two
or
more
respectively,
operator
expression
quantities.
the
is
.NOT.
to
which
For
following
i in
the
oper-
example,
expressions
the
first
In
Z
(also,
In
the
is
NOTed,
expression
FALSE), results in
second
expression X .AND.
resulting
.NOT.
in
the
X is
the
value
evaluated
value
Z is
TRUE
first
FALSE for
evaluated
for
the
and
produces
the
expression.
first
and
expression.
the
produces
value
the
value
FALSE. This,
FALSE. Then
Log i ca
when
ANDed
the
with
value
I Express ions 15
FALSE

4.
ASSIGNMENT
STATEMENT
Many kinds
ment,
matical
A
si
mpl e assignment
where
This
not
declare
of
which
notation.
v = e
v is a
e is
statement
that
statements
defines a computation
variable
an
means, lIassign
N = N + 1
is
not a contradiction:
The expression
expression is
verted
to
evaluated
the
type
statement
arithmetic
v
.!.:.
equal
need
not
of
the
are
recognized
(a
scalar
or
logical
to
it
increments
be
the
in
its
own mode,
variable
has
the
or
to v the
e,
but
same
according
Table
by
the
FLAG
to
be
performed
form
an
array
element
expression. (v must
value
rather
it
the
current
type
as
the
independent
to
5.
Mixed
and
of
the
expression
sets v
equal
value
variable,
Table 5 and
Variable
compiler.
is used in a
of
any
be a logical
to
of
N by
although
of
the
Types
The most
type)
e.
II
It is not
e.
Thus,
1.
type
of
assigned
and
Expression Modes
manner
variable
the
in
practice
the
variable.
to
the
basic
of
similar
only
an
equation
statement
it
usually
variable.
these
to
if
e is a
Then,
is
the
equations
logical
in
the
is. When
if
permissible,
assignment
in normal
expression)
true
sensei
it
state-
mathe-
it
does
is
not,
the
it
is
con-
Variable
Type
integer
real
double
precision
complex
double
complex
logical
The symbols used in
Symbol
X
F
Meaning
Direct
The
the
truncated
will
The
cision
Expression
integer
X
F
real
I
1
X P
double
precision
I I
F P X
R
D D D P
R
R X
N N N
Table 5 have
assignment
value
greatest
be
truncated
variable
is less
is
truncated
integer
to
4274,
is assigned
than
the
following meanings:
of
the
exact
to
integer.
less
than
or
and
-0.6
to 0).
at
the
high-order
the
real
that
of
integers,
value.
The
truncated
equal
to
Values
end
as
or
double-precision
conversion
the
that
well.
Mode
complex
value
absolute
are
greater
Results in this
to
real
complex
I
I
R
D D
i
I
N N
is
equal
to
the
val
ue
of
the
expression
than
the
maximum
case
generally
approximation
precision
may
of
cause
double
I
R
P
X
sign of
the
value.
a loss of
logical
the
expression times
(e.
g.,
4274.9983
size
of
an
are
not meaningful.
Since
significant
N
N
N
N
N
X
integer
real
is
pre-
digits.
16 Assignment
Statement

Meaning
The
P
R
D
N
Examples:
precision
The
real
part
of
The
real
imaginary
Not
allowed.
part
the
variabl
part
part
of
of
of
the
the
of
the
e is
the
value
variable
set
variable
variable
A = B
Q(I) = Z
L = F
CRE(8,
PI
**
2 + N *
.OR
..
NOT. C .AND.
ED)
= R (ALL, MEN)
= 4 * (ATAN(O. 5) + ATAN(O. 2) + ATAN(O. 125))
(L
- J)
(R.
GE.
is
increased
is
to
zero.
is
23.
assigned
assigned
is
set
to
9238E-l)
or
decreased
the
the
zero.
real
approximation
double
accordingly.
precision
approximation
of
the
expression.
of
The
the
expression.
imaginary
The
Assignment
Statement
17

Each
executable
less
this
Labels
If
program
identified
be
referenced.
sequence
control
by
labels.
statement
is
interrupted
is to
be
Nonexecutable
5.
CONTROL
in a FLAG program is
or
modified
transferred
by
to a particular
statements
executed
a control
statement,
may
have
STATEMENTS
in
the
order
of
its
appearance
statement.
that
labels,
statement
but,
except
must
for FORMATs,
be
identified.
in
the
the
source
Statements
labels
program,
should
un-
are
not
Statement
zeros
Statement
compilation
GO
GO
statements:
Unconditional
This
where
one
labels
are
not
857
labels
TO
Statements
TO
statements
statement
GOTO
k is a
whose
98
consist
significant.
00857
may
be
or
execution.
transfer
unconditional,
GO
TO
Statement
has
the
k
statement
label
is k. For
GO
TO 502
X = Y
of
up
to
The following
8 5 7
assigned in
control
assigned,
form
label.
example,
The
five
085
result
decimal
any
from
and
in
digits
labels
7
order;
one
point
computed.
of
the
and
are
equivalent.
their
numerical
in a program
execution
must
of this
be
greater
values
to
statement
than
have
another.
zero.
no
FLAG
is
that
effect
the
Embedded
on the
includes
next
blanks
sequence
three
forms
statement
and
leading
of
statement
of
GO
executed
is
TO
the
502
statement
Assigned
The format of
r..n
....,...., •
where
v is a nonsubscripted
kj is a statement
18
Control
A = B
502
will
GO
TO
Statement
the
assigned
Tn
"rtk
...., • 'L\
l'
the
statement
Statements
be
executed
k
2'
GO
I.,
"3'
...
labels
label
immediately
TO
is
I.,
\1
,
"n'J
integer
k 1 - kn·
(the
list
variable
after
enclosed
that
in
the
GO
has
been
brackets
TO
statement.
assigned
is
optional).
{via
an
ASSIGN
statement,
see
below} one of

Each
label
be
the
label
corresponds
Examples:
appearing
of
a program
to
the
current
in
the
statement).
assignment
I ist must
be
This
Of
defined
statement
the
variabl
in
the
program in
causes
e (v). I
control
which
to
the
be
transferred
GO
TO
statement
to
the
statement
appears
label (k.)
(i.
e.,
must
that
ASSIGN
GO
The
GO
ample) must
Computed
The
computed
where
k. is a
I
v is a nonsubscripted
This
statement
variable
ing
the
but
is no
Examples:
5371
TO
LOC, (117,56, 101,5371)
TO
statement
have
GO
TO
GO
statement I abel
causes
v,
for 1
computed
longer
so
TO
LOC
transfers
been
set
Statement
TO
statement
control
~ j ~
n.
GO
TO
considered.
control
bya
previously
integer
to
If
j is
statement.
to
the
executed
is expressed
variable
be
transferred
not
between 1 and
In most
statement
ASSIGN
as
whose
to
the
previous
labeled
value
statement
n,
5371.
statement
determines
whose
no
transfer
FORTRAN systems,
Note
prior
to
label
occurs,
that v (the
to
its
which
of
is kj,
and
control
this
variable
execution
the
k.
where
situation
in
control
I
j is
passes
has
11
LOCI
the
the
to
been
in
the
GO
TO
will be
integer
the
statement
considered
above
ex-
statement.
transferred.
val
ue
of
the
follow-
an
error,
Statement
GO
TO
(98, 12,405(3), N
GO
TO
(1,8,7,562),
GO
TO
(4,88,
GO
TO
(63,9,3,2),
ASSIGN
The
where
Examples:
Statement
ASSIGN
ASSIGN k TO
k is a
v is a nonsubscripted
ASSIGN 5 TO
ASSIGN
ASSIGN
ASSIGN
statement,
statement
22
1234
99999
1),
v
JUMP
TO M
TO
TO
I
N
J
used
to
label
integer
IRETURN
IERROR
Expression
3
2
o
8
assign a
variable
label
Value
to a variable,
Transfer
405
8
next
statement
next
statement
has
the
to
form
A
variable
that
has had a
label
assigned
to
it
may
be
used
only
in
an
assigned
GO
TO
statement.
ASSIGN
Statement
19

A
variable
a
variable
ill ustrates improper usage:
that
has most
that
has not been assigned a label may not
recently
had a label assigned
to
it
should not be used as a numeric
appear
in
any
context
requiring a
quantity.
label.
Conversely,
The following
case
ASSIGN
A =
This usage is not permissible
is
loaded.
703 TO
HI/LOW
Furthermore,
HI
M = 5
cannot
be
substituted for
ASSIGN 5
or
vice
versa,
IF
Statements
Very often
may be
arithmetic
Arithmetic IF Statement
The format for
called
to
M
because
it
is
desirable
conditional transfer statements,
and
logical.
arithmetic
the
to
IF
because
integer
constant
change
statements is
the logical flow
the
value
of
HI
is
"5" is implied in the first
of
are
used for this purpose. There
indeterminate,
a program on
since its
case,
the
basis
and
of
value
depends on where
the
label "5" in
some test.
are
two forms
the
the
second.
IF
statements, which
of
IF
statements:
program
where
e is
The
arithmetic
IF
IF
IF
If
e is a real
the
expression involves
For this reason, floating
for
zero.
Examples:
Statement
IF
IF
IF
IF
an
e < 0,
GO
e =
0,
GO
e>
0,
GO
or
(K)
1,2,3
(3
* M(J)
(C(J,
10)
(NEXT +
expression of
IF
statement is
TO
TO
TO
double precision expression, a
-7)
+ A / 4)
LAST)
integer,
are
statement
interpreted
k1
k2
k3
any
amount of computation, a very small number is more
point
arithmetic
76,4,3
23,
12,
3,156,3
12
real,
labels.
to mean
IF
Expression
47802
-6
0.0002
o
or
double
test
for
statements
value
precision modes.
exact
zero
may not be meaningful on a binary machine.
generall
y should not be programmed
Transfer
3
76
12
156
to
likely
to result than
to
have a unique branch
an
exact
If
zero.
Logical IF Statement
The logical
20
IF
Statements
IF
IF
statement is represented as
(e) s

where:
e is a
The
statement
lowing
after
the
Examples:
IF
IF
IF
CAll
This
statement,
foil owi ng forms:
CALL
CALL p (a1, a2, a3,···
logical
is
any
executable
s is
the
logical
statement
(FLAG
.OR.
(OCTT *
(.NOT.
Statement
P
mode
expression
statement
executed
IF
s,
TRR
SWITCH2) REWIND 3
used
statement
unless
L)
GO
.L T.
5.334E4)
to
call
if
the
expression e has
is
executed.
the
statement s causes a transfer.
TO
3135
CALL THERMAL
or
transfer
,an)
except a DO
The
control
to a subroutine
statement
the
value
statement
or
another
IItrue";
following
subprogram
logical
otherwise,
the
logical
(see
IF
statement
the
next
IF
will
Chapter
executable
be
executed
8),
may
take
statement
in
any
either
of
fol-
case
the
[
where
P is
is
a.
i
arithmetic
subprogram
A
subroutine
used in
For
Arguments
many results
store
A
A
to
not
Other
an
example,
CALL CHECK
the
resulting
CALL INVERT(A,
complete
subroutine
be
executed
cause
it
examples
the
identifier
an
argument,
is
similar
expression.
that
are
scalars,
as
desired.
matrix
discussion
name
has
as
a resul t
to
take
of
CALL
of
which
or
logical
names.
to a function
Furthermore,
array
The
in
K,
B,
D(J))
of
the
no
type
of
on
any
implicit
statements
the
subroutine
may
expressions,
(See
"Arguments
elements,
following
the
array
usage
and
(e.g.,
the
CALL.
subprogram.
be
any
of
the
statement
and
except
type.
are
that
it
while a function
or
arrays
call
might
B,
and
set
D(J)
forms
of
arguments
real,
integer)
Therefore,
given
below.
following:
label
Dummies",
does
not
must
may
be
be
used
to
equal
to
associated
the
appearance
Statement
Constants;
arguments
Chapter
necessarily
have
at
least
modified
invert
to
the
determinant
supprograms
with
labels
subscripted
(&a.,
where
8.i
return a value,
one
argument, a subroutine
by a
subroutine,
the
matrix
A,
of B ..
is
contained
it;
it
merely
of a subprogram
are
identifies
identified
or
nonsubscripted
a.
is
the
I
and
effectively
consisting
in
Chapter
name
by a
statement
must
not,
of K rows
the
block
in
a CALL
preceding
label),
therefore,
may
returning
and
8.
of
statement
ampersand.
variables,
or
have
none.
as
columns,
instructions
does
array
be
or
CALL ENTER(&44, N)
CALL RX23A(X
CALL EVALUE
** Y -
7,0,
SQRT(A * A + B *
B)
/ DIV,
TEST)
CALL
Statements
21

RETURN
The
Statement
RETURN
RETURN
RETURN v
statement
causes
an
exit
from a
subprogram.
It
takes
one
of
the
forms
[
[
where v is
number
and
A RETURN
physically.
appear
The
subroutine
it
which
The
is
(counting
the
compile-time
Examples:
of
Dummies" in
in a
first form,
causes
the
the
second
used
to
determine
from
entry
to
Calling
33
CALL IT
66 X(8) =
an
integer
asterisks
statement
There
main
to
the
latest
function
form, RETURN v, is used
the
diagnostic
Program
constant
that
Chapter
must
may
program.
RETURN
first
executable
value
reference
which
left
to
right
subprogram
(LOCK,
Y(C,
K)
or
appear
be
8 for a
be,
chronologicall
any
(without
assigned
appeared.
statement
in
the
did
to
be
produced.
RET,
QR, & 11, &883)
in
number
+ CHEBY(Z, Y)
INTEGER
the
SU
BROUTINE
discussion
of
RETURN
the
v) is
the
statement
to
the
function
(See
to
provide
label
SUBROUTINE
not
contain
variable
on
the
y,
the
statement
following
also,
an
in
the
calling
statement)
any
asterisks
whose
value
statement
use
of
asterisks
last
statement
statements
usually
the
CALL
name
to
be
IIFUNCTION
alternate
argument
in
must
be
(see
11
SUBROUTINE Subprograms"
in SUBROUTINE
executed
in a
subprogram.
used.
In a
statement
returned,
exit
corresponds
the
as
Subprogramsll,
from a SUBROUTINE
list
will
to
dummy
list,
Subprograms
SUBROUTINE IT (i,
RETURN 1
greater
in
any
A RETURN
subroutine,
that
call
the
function
be
used
the
statement
the
than
zero,
statements).
subprogram,
it
ed
the
value,
Chapter
subprogram.
as
the
RETURN
but
statement
returns
subroutine.
to
8.)
return.
label
that
statement
X,
P,
no
greater
and
but
it
control
the
The
The
will
will
*,
*)
than
11
Arguments
need
not
should
not
from
In a
functi
expression
value
vth
asterisk
be
used.
cause
the
of
a
the
be
in
last
on,
v
If
When
subroutine
statement
the
return
DO
Statement
These
statements
depends
DO
DOkv=e1,e
where
k
v
el'
e2'
In
the
second
IT
is
called
883
if
the
RETURN 2 exit
from
the
function
are
used
on
the
value
of a variable.
k v = e
value
,e2,e
1
2
is a statement
is a nonsubscripted
and
e3
is
positive.
form,
e3
,
3
are
and
to
or
label
integer
the
by
statement
is
to
the
control
not
integer
preceding
is
executed.
point
the
repetitive
The
defined
variable.
constants
33,
of
ca
DO
statement
before
greater
comma
return
When
II
in 66.
the
are
is
to
statement
the
execution
may
DO
statement.
than
zero
omitted;
function
of a group
be
written
or
unsigned
in
this
RETURN 2
END
FUNCTION
RETURN
END
11
if
the
RETURN 1
subprogram
of
statements.
nonsubscripted
case
the
CHEBY (ARG, EXP)
exit
CHEBY
value
is
The
1 is assumed
is
called
number
integer
executed,
by
statement
of
repetitions
variables
for
e3.
or
to
whose
66,
22
RETURN/DO
Statements

A
DO
statement
called
a DO
DO
statement.
The
execution
1. The
2.
3.
4.
5.
6. The
The
ly. For this
FORTRAN systems may
The
than
Logical
variable v is
The
range
After
The
value
If
v
is
ing
the
actua
where
range
terminal
one
DO
statement
GO
Arithmetic
IF
loop,
of a DO
of
each
iteration,
ofv
greater
one
I number
max
([
the
brackets
of a DO
reason,
statement
of
the
following:
TO
statement
IF
statements
indicates
and
The
statements
is
than
whose
2
e
-
~
loop will
statement
that
all
last
statement
loop
assigned
the
then
e2'
label
of
iterations
1
e
] )
+ 1, 1 for e
represent
it
is
recommended
interpret
of a DO
are
specifically
the
block
statements
in a
proceeds
the
value
is
executed
value
compared
control
is
k).
the
always
this
range
of
statements
within
DO
loop
in
the
following
of
e1.
for
one
of v is
incremented
with
the
is
passed
Otherwise,
defined
be
situation
-I
3
largest
executed
that
(i.
e.,
allowed
by
0
initially
it,
except
is
the
iteration.
terminal
to
the
statement
the
process
the
DO
integra I va
at
least
satisfied
differently.
the
statement
as
terminal
following
for
the
terminus
manner:
by
the
value
(e
following
is
repeated
statement
lue
not
once,
whose
RETURN
STOP
PAUSE
statements
it
are
opening
and
bears
value
).
2
is
given
exceeding
even
DO
loops
label
statement
of a DO
to
be
executed
DO
statement,
the
of
e3.
If
the
terminus
from
step
by
the
if
the
conditions
should
is
k)
may
statement
statement
statement
e3 is
not
(i.
2.
va
lue
of
not
be
be
any
range.
repetitively.
constitute
label
k.
present,
e.,
to
the
the
expression.
for
termination
used,
especially
executable
Such a block
the
range
the
value 1 is
statement
are
since
statement
of
met
is
the
used.
follow-
initial-
other
other
[
[
[
[
Example:
22
25 SUM = SUM +
54
12 L = Y(I)
the
In
unless
passed
The
value
of v during
e 1 + (i -
where i is
is
made
tion
during
Caution:
DO
IF
SIGMA
IF
CONTINUE
example
the
arithmetic
to
statement
of
the
anyone
the
out
of
which
1)
number
the
If
undefined
54
I = 1,
15
O(I)
(SUM.
LT.
0.0) SUM = 0.0
= SUM + R(I)
(SIGMA
that
* e
- H **
3/
begins
with
statement
IF
statement
12
at
the
end
variable v appearing
iteration
is
3
of
the
current
range
of a DO
the
the
transfer
entire
number
when
occurred.
program
T)
54,54,
12
22,
the
causes a transfer
of
the
fifteenth
in a
DO
statement
iteration,
before
of
iterations
all
iterations
control
and
passes
range
to
statement
iteration.
e1
and
have
specified
out
of
statements
depends
e3
have
been
for a
of
the
25
through
12.
If
a
II
on
the
number
the
meanings
completed,
DO
loop ~ executed,
DO
loop.
15
iterations
the
54
wi
II
are
of
iterations
discussed
value
of v will
the
be
executed
completed,
completed.
previously.
value
of v becomes
be
15
that
times,
control
The
If a
transfer
of
the
is
value
itera-
The
value
of
the
indexing
modified
by a
subprogram
parameters
called
within
(v,e1,e2'e
the
range
)
3
cannot
of
the
be
DO.
modified
within
the
range
of
the
DO,
nor
DO
can
they
Statement
be
23

A transfer out
only
occur
if
)
1,e2
,e
3
(v,e
of
the
range
of a DO
there
has been a prior transfer
are
changed
DO
GO
25 H =
TO 8605
outside
K,
Y,
loop
is
the
range
permissible
out
of
the
at
any
time; however, a transfer into
of
the
DO
range (assuming
DO). For example:
that
none of
the
range of a
the
indexing parameters
DO
may
1
[
24 A = H
25
8605 R = SIN(G(H» + JSU
8606
is
permissible; in fact,
11
32 T(J)
is
not val
id
because
A
DO
loop may
of
DO
loops,
fers to this
transfer
made.
Examples:
statement
is
made out
In
this
/8
JGU
= Y(H) ** 3
GO
TO
24
the
GO
TO
11
DO
32 J =
R(J) =
47.
= Q
no transfer could possibly
include
the
same
statement
can
of
the
case,
the
statements 8605 through 8606
2,36,2
E-7
* T(J)
occur
another
return transfer must be to
DO
loop.
may be used as the terminal
be made only from
range
of
the
innermost
Do
loops may be nested; however,
the
innermost
out
DO
the
are
considered
of
the
DO
loop
can
innermost
part
of
DO
range.
they
statement
loop.
a return transfer into
DO
for
Up
loop.
any
to 25
III egal
the
DO
range.
cannot
be
overlapped.
number of
DO
DO
ranges; however,
ranges may be nested.
the
range of nested
The
sequence
Only
DO
In
a nest
trans-
if
loops be
a
DO 1000
DO 100 J = 1,
~O
10
10
CONTINUE----.J
DO 100 L = 1,
~OlM=l'MMJ
A=B
100
1000
The terminal
ments 200 and 201 in
~ONTINUE
THIS
= DO
statement
I =
1,
II
------.
JJ-----.
K = 1, K K l
LL
----LJ
END~
of a range may not
the
illegal
example
above.
I
physically
precede
200
201
2000
20
2
the
D0200W=
D0200X=
DO 20 Y =
CONTINUE
DO 200 Z = 1,
D02U=l,
Q =
R-------+----
1,
1,
1,
UU-
WW---
XX-
yy--+
ZZ.-J
__
........
~ONTINUE-T
IT = WRONG-.J
DO
statement, as
is
shown
in
the
case
of
state-
24 DO Statement

CONTINUE
This
statement
CONTINUE
and
must
tion
and,
the
insertion
72
88
Statement
appear
consequently,
of a label
DO
IF
CONTINUE
H(33) = T(3,
is
72,
(X
written
in
that
1=
** I +
as
form. The
has no
at
any
point
1,20
O.
9999E-5)
R,
L,
E)
/22.5
CONTINUE
effect
on a running program. The purpose
in a program. For
72,
72,
88
statement
example:
does
not
cause
the
of
compiler
the
CONTINUE
to
generate
machine
statement
is
instruc-
to
allow
[
CONTINUE
PAUSE
PAUSE
where
Statement
statements
PAUSE
PAUSE
PAUSE
n is
's'
This
statement
puter
operator
beginning
If
an
integer
played
STOP
to
Statem
statements
n
's'
an
unsigned
is a
literal
causes
to
with
the
or a literal
the
computer
ent
are
most
are
written
integer
constant.
the
program
perform some
statement
constant
operator
often
used
as
constant
to
cease
specified
immediately
is
appended
when
the
as
the
terminal
of
up to
five
execution
action.
The
after
the
PAUSE.
to
the
program pauses;
statement
digits
(1 ~ n ~ 99999).
temporarily,
operator
PAUSE
statement,
otherwise,
presumably
can
then
of a DO
signal
the
word
the
word
range,
for
the
the
PAUSE
PAUSE
as in
purpose
program
and
is
displayed.
the
of
to
continue
this
example
allowing
value
above.
the
com-
execution,
will
be
dis-
STOP
statements
STOP
STOP
where
n is
an
This
statement
returned
before
to
termination.
n
unsigned
terminates
the
calling
are
written
integer
the
program.
in
the
form
constant
execution
If
an
of
a running program.
integer
is
appended
to
If
the
it
appears
STOP
within
a subprogram,
statement,
CONTINUE/PAUSE/STOP
it
will
be
output
control
immediately
Statements
is not
25