Sigma XDS 5, XDS 7 Reference Manual

X1ClS
SIGMA
5/7
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
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
[
END
Statement
,A,n
END
ment
must
END
If program
of
a STOP
The
following
If
the
an
END
This
limitation dicated as
by
though
statement
appear
control
statement.
restriction
compiler
statement
is
the
following
they
were
is used
in
the
reaches
has
due
END
to
form
an
applies
encountered
and
will
to
an
historic
examples,
statements.
inform
END
to
act
the
FLAG
statement
any
statement
only
the
accordingly.
FORTRAN
certain
statements,
compiler
during
the
that
characters
An
feature;
that
execution
begins
END
END
namely,
although
it
has
reoched
of
with
the
at
the
statement
the
legitimate
the
physical
any
program (or subprogram)
character
end
may not
way
in
of a line,
string
appear
which
continuation
FORTRAN
it
end
of
END:
assumes
on a
continuation
statements,
a program. The
the
effect
that
the
statement
line.
is
specified.
will
be
processed
is
As
state-
that
is
in-
Processed
column:
Similarly,
6
x
x
illegal
as
EN D Statements
7
•••
END
FILE
2
END
END
statements
RATE
(I,
J,
of
= A * B
K)
=
.NOT.
the
same
Q
nature
as
those
in
Not
6
x
x
1 N
2 D
the
first
Processed
7
.....
END
FILE
2
END
RA
END (I, J ,
K) = .NOT.
E
column
as
will
END
Q
be
Statements
TE
treated
= A * B
as
END
statements.
26
END
Statement
6.
INPUT
jOUTPUT
The FORTRAN sion
between
typewriters,
1.
READ one
2.
FORMAT editing
3.
Auxiliary
The
data binary-coded of
transmission
specificati
computer
card
and
WRITE
of
the
statements
information
I/O
transmitted
strings
the
on
statements.
Input/Output
An
input/output
of
their
transmission. These lists
where
m.
are I ist
I
language
units,
statements
group
of
statements
by
of
I/O
lists
list
represents
items
provides a series
storage
characters statements
and
and
line
that
external
used in
that
conjunction
specifies
for
input/output
an
separated
external
printers.
devices
positioning
or refer
ordered
have
by
of
statements
data
These
cause
specified
with
their
internal
and
statements
unformatted
to
external
group
the
form
commas,
that
handling
statements
lists
the
input/output
and
demarcation
are
transmitted
binary
values
devices,
of
data
names
as
shown.
determine
devices,
are
of
data
external
of
lists
that
the
such
as
of
three
types:
to
be
transmitted
of
formatted
representation
external
as
records
in
a form
similar
of
data
names,
identify
control
magnetic
files
(as on
of
the
of
and
tape
between
records
magnetic
sequential
to
internal
and
- for
data
to
condition
and
computer
to
provide
information
storage.
formatted
be
transmitted
for
paper
conversion
tapes)
data
transmis-
tape
handlers,
storage
consisting
For
either
data -to
and
the
and
and
of
type
format
order
List
Items
A list item may
A
single
datum
Examples:
A
MAT
RIX(25,
Multiple
1.
2.
data
An
array
the
array.
Example:
If B is a
where
j
DO-implied
and
and
B(l,
k
an
2-dimensional
expression
be
either a single
identifier
L)
identifiers
name
1), B(2, 1), B(3, 1),
are
items
is
are
appearing
the
dimension
are
lists
of
one
the
ALPHA(J,N)
in
array,
or
multiple
name
B
one
of
in a
list
the
•.. , B(l,2),
I imits of B
of
one
of
the
forms
datum
of a scalar
two forms:
without
---
list
item
B(2,2),
or
more
identifier.
variable
subscripts
B is
equivalent
.••
, B(j,
identifers
or
an
is
considered
to
k)
or
other
array
element.
equivalent
DO-implied
to
items
the
listing
followed
of
by
a comma
each
element
character
in
v
= e
1,e2
enclosed
in
parentheses.
Input/Output
27
The
elements
parentheses
: ...
,..J",,,:
... ,,, ...
'II,","""I"~
t'''--I'-oIII
Examples:
DO-impl
(X(I), (A(I), I = 1, «C(I,J),D(I,J),
with a
"'
..
..
1=
v,
e1'
DO
·n",+", ..
""
.......
_.oJ
ied List
1,4)
10,2)
e2'
and e3
implication
c c
TI
-1'
J =
1,3),
have
are
nnrl c mn"
-2' _ .. --3
1=1,4)
the
same meaning as
considered to be in
nnn",nr
-1""'.--*
in
....... -
...
_,
Equival
X(l),
X(2), X(3), X
A(l),
A(3),
thic::
ent
Lists
A(5),A(7),
defined the
rnnn'"
--"\::)-_ ... / --
for
range of
nnlv
(4)
A(9) C(l,l),D(1,1),C(1,2),D(1,2),C(1,3),D(l,3) C(2,
1), D(2, 1), C(2, 2),
C(3,
1), D(3, 1),
C(4,
1), D(4, 1),
Since
J is
the
C(3,2), C(4,
innermost
D(2,2),
D(3,2),
2), D(4, index,
the
DO
the
nc::
C::llhc::rrintc::_
------.r·-
2),
statement.
DO
implication.
...
C(2,
3), D(2, 3)
C(3,
3), D(3, 3)
C(4,
3),
D{4,
3)
it
varies more rapidl y
The items
For
input
than
enclosed
lists
I.
in
the
Special
2.
3.
4.
5.
Input/Output
All integer
device
List
Considerations
1.
The ordering of a list is from
accompanied
when An
unsubscripted
Constants may
For input lists For
example,
(I,
J,
A (I), I = 1, J,
I,
J,
(A(I), I = 1, J,
As
an
output
(I,J,A(I),
The number
array
appear
the
as
an
list
1=
of
items in a single list is limited
Statements
input/output
variable
in
1.
The number may be assigned
statements specify a
reference
one
of two ways:
by
controlling
name in a list implies
in
input/output
DO-implying
input list
2)
2)
l,J,2)
whose
2. The number may be a standard These standard assignments may
left
to
right with
DO-implied
repetition
indexing parameters.
the
lists
only
as subscripts
index
parameters (v, e
is not
allowed
is
allowed
is
allowed
only
device
value
to a device
unit
be
unit
number, u. This number may be
then
identifies
at
program run time.
number assignment, which is
overridden
by
of items enclosed in
entire
array.
, e2, e3) may not
1
by
the
statement
or
as indexing parameters.
length
parentheses
appear
within
specifications.
either
the
unit. This unit number corresponds to
run-time
recognized
assignments,
as referring to a
if
necessary.
(other than subscripts)
the
parentheses
an
integer
constant
an
actual
particular
as list items
or
an
physical
device.
Table 6 shows standard
access
random
devices.
device
assignments for FLAG. There
Unit Number
5,
i05
6,108
7,106
If
nonstandard control standard
28
Input/Output
cards
unit
unit
numbers placed number
Statements
are
used in a program
in front of
is
OUTIN (scratch mode).
the
FLAG control
Table
6.
they
card
If
Standard
must (see
a unit is
are
no standard
Unit
Assignments
Standard Assignments
Card
reader
Line
printer
Card punch
be
assigned
Chapter
to
be
to
9). The
assigned
unit
assignments for
the
desired
default
to
an
device function input
device
by use
of
an
magnetic
of
assigned,
(e.
g.,
tapes
ASSIGN
non-
card
or
reader ments
follow.
!ASSIGN
To
assign
!ASSIGN F :2,
To
assign
!ASSIGN
To
assign
!ASSIGN
or
magnetic
To
assign
F:l,
unit
number 2 to
unit
number 3 to a labeled
F:3,
unit
number 4 to a scratch
F:4,
tape}
the
IN
option
unit
number 1 to
(DEVICE, 51),
(DEVICE,
the I ine
LO,
(IN)
printer:
L)
magnetic
(LABEL, DATAFILE),
disc
(FILE, TEMP4)
should
the
(INSN,
file:
be
card
tape
PHS),
specified reader:
with
serial
(IN)
on
number
the
ASSIGN
'PHS'
control
from
card.
which
data
Some
will
sample
be
read:
assign-
Formatted
Formatted
Input/Output
I/o
READ{u,
WRITE(u,
statements
f)k
f)k
Statements
are
used
to
process
binary-coded
(BCD)
records.
These
statements
have
the
forms
where
u is a
[
A
formatted
k
FORMAT equivalent values
into
Each
formatted
record
using
if
specifically
record
than
acters
are
A BCD
record records. which
case
been
specifically
as
magnetic
Sigma
Monitor
device
is
a FORMAT
is
an
READ
specified,
simple
character
unit
input/output
statement
into
list,
if k contains a DO-implication.
strings
input/output
more
than
one
requested
are
(or
can
be)
lost,
on
input
has a maximum
For
example, a punched
it
is
considered
written
or
paper
tape,
reference
number
statement
list,
{unsigned label
which
causes
binary
values.
and
outputs
statement
READ
or
by
the
FORMAT
physically
they
are
treated
size
of card
to
be
blank
is
indistinguishable
the
FORMAT
and
operations
the
character
begins
WRITE
present
132
contains or
integer
or
an
unsubscripted
may
be
These
them.
processing
statement.
statement.
does
as
blanks.
characters.
empty.
(within
statement
manuals
or
integer
variable}.
array
omitted. A comma
string
in
the
external
are
then
assigned
Conversely, a formatted
with a new
More
than
However,
not
cause
Certain
80
characters.
In
other
the
may
determine
for a complete
attempting
processing
devices
A
words, a record
program)
description
name.
may
to
the
record.
one
record
from the
optionally
record
variables
record
of a new
may
may
an
empty
actual
to
It
is
may
to
read
impose
contain
into
which
size
of
BCD
precede
be
converted,
appearing
WRITE
not
possible
be
processed
(or
write)
record;
other
as
any
record.
of
record
records).
the
according
in
the
statement
to
by
more
on
output
restrictions
few
as
zero
number
However,
written
list
k.
to
the
list
k,
or
the
converts
internal
process a particular
these
statements
characters
the
on
characters,
of
blanks
on
(see
extra
the
size
devices
the
on
char-
have
XDS
a
of
in
such
The
list k may
record
(on
more
than
information
IIH
Format
input)
one
is
Codes
be
or
record
either
ll
omitted
writing
used,
read
under
from a
into
IIFORMAT
Examples:
READ(105,
READ(5,
6)X,
FORM)
Y,
(A{I),
T(3, 5)
WRITE(N,FMT)(MASS(J,3),J=l, WRITE(102,93)
MESAGE,
one
if
1=
formatted
blank
the
FORMAT
or
written
1,40),
ERR
record
from
Statements
H,Q 100,
NO
input/output
(on
output).
statement
the
locations
ll
}.
1)
statement.
However,
begins
with
in
Hollerith
storage
Normally,
information
or
occupied
this
has
may
slash
specifications,
by
the
the
effect
actually
be
FORMAT
Input/Output
of
skipping
processed,
in
which
statement
Statements
one
and/or
case
{see
29
Acceptable
The
following
sical
device,
FORTRAN
FORTRAN
as shown in
II
Statements
II
statements
Table
Table
are
accepted
7.
7.
FORTRAN II/FORTRAN IV
by FLAG. Each
of
these
Equivalent
statements
Statements
designates a specific
phy-
READ
Statement
This FORTRAN
READ
f, k
where
is a
k
is
The
READ
statement
according
list k,
PUNCH
This FORTRAN
to
or
the
Statement
FORTRAN Statement
READ
f, k
PUNCH f, k
PRINT f, k
II
input
statement
an
input
list
causes
the
FORMAT
equivalent
II
output
II
statement
label
or
as
described
the
specified,
simple list
statement
FLAG Equivalent
READ
(105, f)k
WRITE
(106, f)k
WRITE
(108,
has
the
form
an
array
name
of
the
FORMAT
earlier
character
into
if k contains a DO-implication.
has
stri ng in
binary
the
form
in
this
the
values
chapter
external
which
f)
k
statement
record
are
then
describing
to
be
assigned
Standard
Assignment Card Card Line
read
from
to
reader punch
Printer
the
devi
the
data
ce
105 and
variables
converted,
appearing
in
the
PUNCH
where
f is a k
This
statement
statement,
Statement
PRINT
The form
PRINT f, k
where
f is a k
The PRINT
FORMAT
Chapter).
f,
k
statement
is
an
output
causes
and
to
of
the
FORTRAN
statement
is
an
output
statement
statement,
be
label
list
described
internal
output
label
list as
causes
and
to
or
data
on
devi
II
PRINT
or
described
internal be
an
array
earlier
to
ce
statement
an
array
output
name
be
converted
106.
name
earlier
data
on
of
in this
is
of
in this
to
be
device
the
FORMAT
chapter
into
character
the
FORMAT
chapter
converted
108 (see
statement
statement
into
also
strings, as
character
"Carriage
describing
specified
describing
strings, as
Control for
the
data
by
the
data
specified
Printer
the
applicable
Output"
by
FORMAT
the
in this
applicable
30
Input/Output
Statements
II
FORMA T -Free"
READ
and
PRINT
Statements
"FORMAT-free"
READ, k
PRINT, k
where
k is
an
for
"FORMAT-free"
to
be
read
by
actual
FORMAT
Intermediate
These netic
Input/Output
statements
tapes,
discs,
READ(u) k
and
WRITE(u) k
where
forms
of
input/output
READ
one
READ
specifications
process
and
the
READ
variable
should
statement
used
Statements
information
drums.
and
list
be
the
by
They
PRINT
of
the
separated
values
should
"FORMAT-free
in
internal
have
the
statements
usual
form.
by
either a comma
be
punched 8 per
ll
(binary)
form
are
Output
READ
form
also
and
and
provided.
values
or
one
card
PRINT
are
designed
or
will
are
The
be
more
using
(8G)
to
general
forms
printed 8 per blanks; as
many
and
provide
if
more
cards
(8*
(2XG.6))
temporary
are
as
follows:
line;
input
than 8 values
as
necessary.
respectively).
storage
values
are
(The
on
mag-
u is a
k is
The
binary
size
of
the
of a binary
A
logical programmer format
of
ment
must
the
record.
no
limit
to
record
will
The
records included mation
produced
ment.
Other
produced
If
the
list
Unlike
formatted
written,
it
Examples:
device
an
input/output I ist,
READ/WRITE items
in
READ/WRITE
record
is
concerned.
intermediate
be
input
If
the
the
number
be
read
produced
in
the
records
by
FORTRAN
on
other
k is
omitted
input/output
can
only
unit
statements
the
list k (see
may
consist
binary
by
one
input
list
of
or
written,
by
binary
to
an
intermediate
systems
machines
from a
be
processed
number
statement
of
(See
The
information.)
and
only
requests
items
that
regardless
WRITE
facilitate
or
by
binary
statements,
which
process
"Allocation
are
contained
several
SDS
one
more
can
statements
reading
binary
will
not
other
programs
READ/WRITE
by a READ
may
be
data
of
physical
Sigma
Monitor
This
READ
statement.
data
from a
be
processed
of
the
or
backspacing
WRITE
necessarily
no
data
statement
omitted as a string
Variable
in
one
records;
(see
below)
of
Types",
logical
however,
binary
reference
means
that
the
It
is
permissible
binary
record
by a single
amount
do
not
statement
interpret
cannot,
of
data
consist
the
is
in
general,
to
of proper
meant
the
statement, a record
transfer
with
can
no
occur list
digits,
Chapter
record.
it
is
and
operations
information
than
is
READ/WRITE
be
transferred.
just
the number
to
be
records
and,
be
input
is
skipped,
in
such
therefore,
in
arranged
7).
All
treated
manuals
output
to
read
less
present,
statement,
data
to
be
of
physical
read
subsequently
the
same
using a binary
or
an
operation.
into
words,
the
items
as a single
for a description
by a single
information
an
error
since
generated.
records.
way.
an
empty
has
little
depending
appearing
record,
binary
than
will
occur.
only
Control
Thus"..
by a binary
Similarly,
READ
statement.
record
If
an
empty
purpose.
as
WRITE
is
one
binary
is
written.
in
the
far
as
of
present There
logical
words the
READ
record
on
list
the
the
state-
infor-
state-
tapes
is
the
in
is
are
READ(3) E 1 (K),
READ
(N)
WRITE(MIN)R(J),
(M(K,
ARRAY
L), L =
G(J)
WRITE(3)VALUE
1,22)
Input/Output
Statements
31
END
and
Both
the
performed
ERR
Forms
formatted
if
an
error
of
the
and
intermediate
occurs
READ
or
an
Statements
binary
end-of-fi!e
READ
mark is
statements
read.
may
The
optionally statements
include a specification are
written
of
action
to
be
READ(u, f, END=s
READ(u,
where
sl
and
either
may
If
an
end-of-file
diately
NAME
The NAME form
where
When statement.
A NAME to since to
NAME
an
be
placed
it
input.
to
statement
LIST
the
v.
array
LIST
enables
l'
END=Sl'
s2
appear
ERR=s2)k
are
each a statement
first.
mark is
sr
Statement
LIST
statement
LIST v l' v 2' v 3'
are
scalar
the
or
appears
name
user
I
name
statement
in
the
ERR=S2)k
encountered
If
an
error
is used
to
...
, v
array
identifiers.
in a NAME
with
no
identifiers
list;
i.
e.,
to
input
any
label.
during
occurs,
define
n
all
variable
Both
the
control
the
variables
Dummy
LIST
declaration,
following
nondummy
without
the
END=sl
processing
will
be
variables
it
causes
scalars
knowing
and
of
the
transferred
that
may
may
all
elements
all
and
arrays.
at
the
ERR=s2
READ
statement,
to
statement
be
processed
not
appear.
of
the
appropriate
This
compile
time
are
array
variables
can
optional;
control
s2'
by
INPUT
be
helpful
which
may
be
that
variables
if
both
will
be
transferred
statements.
processed
appear
during
program
it
will
are
in
present,
It has
by
an
the
checkout,
be
desirable
imme-
the
INPUT
program
The NAME Each program has its own NAME LIST. This means
1.
2. If two
Examples
Simplified
This FORMAT can
process editing input trolling
A
variable
for
example,
It
simply
LISTs.
NAME
NAME
NAME
is
the
or
in a
the
LIST
variables
that
appears
the
or
more programs depends
of
NAME
LIST
LIST
T,
G,
LIST
NORM,
LIST
Input/Output
most
straightforward
statements
every
formatting.
very
input
or
type
free
form
operation.
defined
variable
on
which
statements:
I,
F,
RATE,
BOB, PHIL,
other of
variable
Values
without
in
one
is in
have
form
kinds
may
program
COUNT,
the
in a program
program
COMMON
separate
DOUG
of of and
be
may
variables
is
doing
ITEM
input/output.
input/output
is
suitable
written
usual FORTRAN
unit
and
QUANTITY
out
the
not
the
which,
for
in a
are
be
aiso
with
inputting.
independent
following:
processed
appears
the
same
It
does
not
although
almost
any
natural
requirement
form
of
those
by
an
INPUT
in
the
other
name,
There is
require
FORTRAN
more
chosen
that
the versatile,
the
defined
statement
program.
it
is
possible
no
;onflict
programmer
application
by
the
user
know
in
any
to
between
to
are
also
that
compiler.
exactly
other
in
another
input
the
learn
more
does
Similarly,
what
program
program unless,
into
either
separate
anything
complicated.
not
require
data
FORMAT
units.
of
them.
NAME
about
special can
is
con-
It
be
32 NAME
LIST
Statement/Simplified
Input/Output
OUTPUT
Statement
The OUTPUT
OUTPUT k OUTPUT, k OUTPUT(u) k OUTPUT(u), k
where
k is u
The
name
pri
ate
For exampl
OUTPUT
might
X Y = X + Y = SQRT(X**2 + Y**2) =
an
defines unsigned unit
of
each
format.
e,
produce
=.500000
1.
20000
statement
108,
X,
1.
may
have
any
of
the
output
list,
consisting
the
logical
integer
which
list
item
Y, X + Y, SQRT(X**2 + Y**2)
the
following
70000
unit
or
integer
is
the
will
lines
1.30000
number
variable.
standard
be
output,
of
output:
of
following
variables,
of
the
If
print
unit.
followed
forms:
expressions,
device
no
unit
by
an
on
which
number is
equal
and/or
the
specified,
sign
and
character
output
then
data
the
the
strings.
is
to
be
output
value
written.
will
automatically
of
the
It
may
item, in
an
be
any
be
appro-
on
Complex the
which might
values
are
following
DOUBLE PRECISION D COMPLEX C
LOGICAL
OUTPUT(6), I,
I =
R = D = C =
example:
L
result
79
4370.72
99301.
3922310385
(-56.2234,334.882)
L = T
Each
value
is
written
maximum
If
the
comma~er
When
Storage
width
of
first
item
in
the
word OUTPUT.
OUTPUT, (A +
an
unsubscripted
",
Chapter
DIMENSION OUTPUT M, A
output
as
R,
D,
C,
in
these
lines:
on a separate
any
line
is 132
the
output
list
B),
X(I)
array
name
7). For
M(2,2), A (2)
example,
complex
L
line,
characters;
begins
Otherwise,
appears
constants;
beginning
excess
with a left
the
in
the
the
other
in
column
characters
parenthesis,
list
item
output
will
list,
data
types
2 (so
will
and
appear
the
that
be
no
entire
are
also
no
lost.
unit
to
be a unit
array
output
carriage
number
is
output
in
natural
control
is
number. For
will
specified,
in
storage
forms,
as
shown in
take
place).
there
must
be
exampl~
order
(see
"Array
The
a
OUTPUT
Statement
33
r
which
To
output
a
literal
as
in
could
M =
A
print
553
-4
o
11245
.472962
-33.0000
headings
constant).
the
following:
or
other
In
alphanumeric
this
case,
no
information,
equal
sign
or
value
a list item may
will be
~eneratedi
be a character
only
the
string
enclosed
character
string
in
quotes
itself
is
output,
(i.
e.,
OUTPUT
which
generates
FINAL COORDINATES
Implied therefore
OUTPUT, (K, A(K)/B(K), K = N 1, N2)
which
could
K=3
A(K)/B(K) =
K
A(K)/B(K) = etc.
Another ment. put on a
OUTPUT
The
actual
need
not
'FINAL
DO
loops may
preceded
produce
=4
feature
An
OUTPUT list item may consist
record.
(4)
format
be
concerned
COORDINATES'
the
line
be
used, as in
by
a comma.
this
output:
14.6135
15.0873
is
provided which
This wiii
X,
specifications
I,
cause
J,
AA, *
about
them,
the
enables
an
iNPUT
used to
since
following
OUTPUT records
of a single
statement
output
they
example.
asterisk
the
various types
are
provided
to
terminate
to
Note
that
be read
(*),
automatically.
which
reading.
of
data
subsequently
the
list begins with a
will
cause
For
exampie,
are
shown Note
that
parenthesis
by a "NAMELIST" INPUT
the
characters
below,
all
although
the
*END* to
formats
the
programmer
are
widthless.
and
state-
be
is
out-
Data
Type integer real double
precision complex double
complex
logical
INPUT
The INPUT of
where
34
variabl
INPUT
INPUT(u)
u is
INPUT
Statement
statement
es. The forms
the
unit
number, as
Statement
Using NAME
Using
is
the
of
Format
lPG.6 lPG.15 lP,
lP,
L
NAME
LIST
counterpart
the
statement
described
LIST
lH(G.6, lH(G.
Specifications
-X,
15,
-X,
of
the
OUTPUT
are
shown
under
the
lH,G.6,-X,
lH,
G.
statement,
below.
OUTPUT
lH)
15,
-X,
lH)
except
statement.
that
When
it
is
not
specified,
written
without a specific
it
is
assumed to be 105.
list
This form identified the
user to
run.
run
of
to
the
by
the
decide
INPUT
input
at
run
statement
itself,
rather
time
which
is
designed
than variables
to do
being
self-identified
named
(if any)
explicitly
are
to
be
input.
in
an
input
input, and
That is,
list
to
select
the
within
different
variables
the
program. This
being
input
input
enables
variables
are
from
statement
This
where
the
r.
are
or commas thay
are
of
the
v = c
first form,
v
ignored.
replacements
is a scalar
blanks
Each
In
the
c is a
The
second
a is s.
I
c
form
is
is
the
an
processes records
each
a form
be
used to
separate
r. may
I
variable
constant
a subscript,
of
is
used to
identifier
an
input
of
which
appropriate
of
the
of
replacement
the
take
one
and
appropriate
into
an
an
array,
may be a signed
constant.
form
(similar to
r.. There may
I I
of
the
an
assignment
be
any
number
following forms:
type.
array
element.
or
Here,
unsigned
integer,
statement).
of
r. on a
and
Either
record.
semicolons
Except
within
(;),
as
constants,
indicated,
The third form
IIInput/Output
(see
a c.
J
m
When
an in which of
constants as
the
separating
specifies
is
an
is a constant
is
equal
entire the
array
there
comma
Example:
=
ALPHA
1. 4E-5 .87,
100000000000. ; X =
This
is
the
only
Variables that no
that
their
names
identifier
are
list
input
ll
Lists
).
In this
array
name,
of
an
to
the
number
array
is
specified
is stored (i.
are
elements
is
optional.
7302,
-67,
24.0983281640957 0;
case
in which a
to
be
processed by
can
be
recognized
after
it, which causes
into
an
entire
case,
appropriate
of
elements
as
above,
e.,
columnwise;
in
the
etc.
single
an
at
run
array,
in
the
same manner as
type,
and
in
the
array.
the
constants
see
array.
The
INPUT item (an r.) may
INPUT
statement
time.
Note
a"
permissible
c.
Figure J 2,
constants
I
must
that
this
scalars
are
assigned to
Chapter
may
overlap
have
can
and
described
7).
appear
from
been
be
done
arrays to
for
explicit
successive
Note
on
separate
one
referenced
that
record
array there
input
by a NAME
by using a NAME
be
placed
in
input/output
elements must
be
records, in which
to
another.
LIST
LIST
the
name list.
in
the
the
same number
statement
statement
lists
order
case
so
with
The permissible forms constant
is to
be
of a constant
assigned.
that
appears
on
an
input
record
depend
on
the
INPUT
type
of
Statement
the
variable
Using NAME
to which
LIST
the
35
r
I
1.
For
integer, specification. widthless formats. This includes
constants stants within
2.
For
complex
where
complex
real,
(except
are
terminated
constants.
variables,
c 1
and
constant
and
The
constant
Hollerith).
at
If
this rule is followed, INPUT
c2 may
as
described
double
the
the
each
precision
may
therefore
all
Note,
first
blank
constant
be
any
in
Chapter
variables,
take
the
forms discussed in
howevei,
that
follows a
must
be
of
the
forms discussed
2.
any
that
replacements
of
the
the
of
since
digit
form
constant
the
forms
Chapter
they
or
decimal
above
is
scanned
described
2 for
are
scanned
may
be
for real
integer,
point.
written
data.
according
under
with
A good rule
to a G.O
"Numeric
real,
a widthless format,
exactly
The meaning
{width
less}
field
Input Strings" for
and
double
is
as assignment statements.
not
is
to
the
precision
these
con-
embed blanks
same as for a
3. For
Note
and arrays,
INPUT processing terminates when an asterisk example,
or
I ogi cal
TRUE.
.
or
the
the
letter
Thus,
that
T =
55E-2;
J
= -3746E 02 i LGL(12,
CPX = (7. 32D-2,
0, 14,
R(55,-2) = 55.349384531062851907
J=9
SOOLE = T i FLAG = F ORTRAN4
variabl
or
constant
Tor F appears.
T,
F,
TRUE,
if
the
items in
the
resultant
A(l,
3.71*
es,
.
FALSE
may be
and
an output
1,3) = 4,
I
3)
the
constant
any
character
Such a field is
FALSE
are
OUTPUT
records
DSL
-2)
= .
k'=()
,"
.....
, ,
statement
= 2
FALSE.
ARRAV=()
.........
may
string
all
permissible
can
,...
take
either
that
terminated
are
restricted
be
processed by
character
-,
of
the
forms
can
be processed by a widthless format;
by
the
input
strings for
an
is found in
first comma
to
scalars,
INPUT
the
or
nonleading
logical
statement.
variables.
array
elements
input string,
blank.
(with
wherever
that
is,
constant
that
may be. For
one
in which
subscripts),
C
= (2,
7.08364724286E-03)
ARRAY
*END*
The *END* enables ments. For exampl e
OUTPUT
generates
36 INPUT
=
1.
0
2.718281828459046
3.
141592653589793
-3944483
at
the
end
the
user
to
(4)
A,
records
Statement
that
Using NAME
of
the
separate
S,
C,
*,
can
second
OUTPUT records
ARRAY,
be
*, CPX, J(3), *
processed by
LIST
example
three
is
into
the
form
"files"
separate
of
end record
that
can
INPUT
generated
later
be processed
statements.
by
the
by
OUTPUT
one
or more INPUT
statement,
and
state-
FORMAT
Statement
The FORMAT
input/output
(BCD)
gram.
where
and
In
general,
ments
are
expressed as
FORMAT
n
~
0
is
S.
I
tions in
where
The commas fications. For
example,
123F27.13X
wi
II
be
interpreted
123
, F27.13 , X
not as
12
, 3F27.1 , 3X
To
obtain
the
statement
or
conversion
(Sl,S2,S3"",Sn)
either
a format
the
form
r(S
l'
S2'
m
~
o.
is a
S. is as
J
between
In
the
the
absence
the
specifications
as
latter
interpretation,
is
used
to
specify
DECODE/ENCODE
performed during
specification
S3'
•..
,S
m)
repeat
count
as
described
described
Si
(and Sj)
of
a comma,
above;
are
the
the
commas
the
conversion
operations.
of
one
in
other
optional
compiler
output
of
the
below.
words,
except
are
required.
to
It is
is
the
forms
repetitions
where
attaches
be
performed on
nonexecutable
reverse
described
of
may
ambiguities
as much
below
as
data
being
and
may
that
performed during
or a
repeated
be
nested (to
would
arise
possible
to
transmitted
be
placed
ten
from not
the
left-hand
anywhere
input.
group
levels).
during formatted
in
the
FORMAT
of
such
specifica-
separating
specification.
speci-
pro-
state-
Every FORMAT
ments. An the
use
the
array
Format
of
data
an
input/output
secutive
where
entire
of
assignment
itself
specifications
values,
format
rFw.d rlw
rEw.d rDw.d rGw.d
the
characters
of
conversion,
is
an
is
omitted,
is
equivalent
statement
FORMAT (the
statements
is
referenced
describe
and
editing
list is processed
specifications.
rLw rAw rRw
F,
E,
data
optiona
316
16,16,16
its
I,
value
to
unsigned
should be
parentheses or
by
the
the
to
be
by
Format
rZw
rMw
r1s
I
nHs
D,
G,
I,
generation,
is
assumed
labeled
input
input/output
kind
executed.
a sing
L,
integert that
so
statements.
or
type
Ie
format
specifications
iX Tw iP r/
A,
R,
scal ing,
to
be
that
and
of
Each
Z, M,
indicates
1.
the
references
items
In this
statements.
conversion
integer,
specifi
cation,
may
H,
quotation
editing,
that
For
example,
may be made
they
enc
lose) may
case,
as
to
be
performed,
real,
double
whi Ie
be
any
of
the
mark
and FORMAT
the
specification
to
it
by formatted
be
stored in
described
complex
under
specific
precision,
data
following forms:
(I),
X,
control.
is
input/output
an
array
"FORMATs Stored in
data
to
be
or
T,
to
logical
are
P,
be
datum
operated
and slash
repeated
state-
variable
generated,
on by two
(/)
r times. When r
through Arrays",
appearing
define
the
scaling
con-
in
type
tSee
also
"Adjustable
Format
Specifications".
FORMA T
Statement
37
r
I
w is
an
optional
braic
signs,
and
a
specification,
cOiiveis;on pSifoimed. This is
d for F,
n is
F
Format
Form:
rFw.d
Integer,
Double precision values
a
lIows for the
E,
D, and input G
tional
digits
appearing
sumed
to
be
zero,
are
equivalent.
For
output G specifications, d is
number
is
is a signed
(Fixed
real,
of
significant
an
unsigned, decimal
a string
of
integer
Decimal
double
appropriate
unsigned
blanks} the
and
the
characters
t
{plus signs
Point)
preCISion,
are
converted
number
intege/
of
the
size
of
specifications,
in
the
the
decimal
digits
integer
or
of
digits
that
defines
external
the
external
discussed
magnitude portion
that
that
acceptable
are
either
with full precision
representation
field depends on
individually
is
an
point
character
also
an
unsigned
appear
in
the
defines
to
the
optional}. The function
part
of
complex
in
the
fractiona
width in
the
characters
of
the
data
the
characteristics
under
eCich
optional,
of
external
number
FLAG processor (see
if
I portion
unsigned
the
external
preceding
integer/
field;
of
characters
of
data
may
sufficient
of
it should not
therefore,
width
the
{including
being processed.
specification.
intege/
field.
but
in this
i is
described
be
processed by this form
is
field.
digits,
of
that
If
d is
not
appear.
context
its
value
being processed.
Chapter
1).
under X
specified
decimal
the
data
specifies
present, its
it
should not be
by w, and
points,
If
w is not present in
and
the
the
number
value
That is,
is
and P specifications.
used
of
the
Ew.O
to
conversion.
type of
and
define
zero.
value
alge-
of
is
of
frac-
as-
Ew
the
d
Output. The field is right justified with as many leading blanks as necessary. sign.
When no width
to express the
and
where 1) represents
If
a lost wi for
In order
where n
Internal values
Consequently,
273.4
-.003
-442.30416
349.5203 70000
-22
for
the
specification
.03359,
value
the
-1.22315
w
-67
requires more positions than
II
be from
specification
432034. to
insure
~
d+2+n
is
the
7
is
speGified
value,
the
the
that
number
for is is is is
plus is is is
is
left
F4.4,
is
is
are
converted
the
specification converted converted converted converted
converted converted converted
2F.4,
converted
character
or
converted converted such a loss of
of
digits
to
to to to
(i.e.,
w is not present),
one
blank
to
to to
the
to .0336'O-67.000Ob blank.
most
significant
to to
to
the
to real constants, rounded
F11.
4,
273.4000
-,
r\nr\1"\
I.UVVV
-.0030
-442.3042
the
to
the
right of the
349
.%
70000.00
-22.Ob
output
list
are
2232 0000
digits
left of
allowed
does not
by
portion
of
occur,
the
decimal point.
the
the
converted
field.
Therefore, for
magnitude
field.
the
following
This
to d decimal
Negative
field
contains
of
w,
only w digits
is
not
treated
relation
places
with
values
are
only
the number of
the
specification
as
must hold true:
an
wi
error
an
overall
preceded
F.
i,
II
appear,
condition.
length
of
with a minus
digits
necessary
and
the
Thus,
w.
digits
also
II
t See
38 FORMAT
Adjustable Format
Statement
Specifications
n.
Input. Input point the
If
the of
is
Input Strings". is
present
value
will
33
802142
.34562
-7.001
the
width
first comma
the
next
333,
.003
converted
3.33
strings may
Each string
in
be
is is is is
w is not
or
field
begins.
to
the
.003
take
the
input
explicitly
converted converted converted converted
specified,
blank
that
va
lues
will
string,
defined
to
follows a
For
any
of
be
of
the
to to
to
conversion
the
specification
E Format (Normalized, with E Exponent)
Form:
rEw.d
Integer, precision
the
real,
va
lues
appropriate
double
are
number
preCISion,
converted
of
digits
or
with
in
the
the
integer,
length w with d characters
va lue
by
that
.033
802.142 .34562
-7.001
starts
digit
either full
precision
fractiona I portion
real,
of
d is
decimal
with
or a decimal
2F.2,
part
of
complex if
or
double
ignored, point.
the
first point.
the
string
sufficient
of
and
For
non-blank
data
width
the
precision
in
the
fractional
the
number
the
specification
The comma
may
be
processed
is
specified
fie
Id.
constant
of
character
or
blank
portion
digits
FlO.3,
in
by
by
wand
forms
discussed
of
the
in
the
the
input
is bypassed
this form
the
under
"Numeric
value.
fractiona I portion
string
of value
If
and
ends
before
conversion
conversion.
of d allows
a
decimal
Double
of
with
for
Output.
where
Internal right E15.8:
When ters used,
is
where
Internal
.ddd
•.•
.ddd
•••
ddd
... d represents d digits,
lO±ee
values
justified
90.4450
-435739015. .000375
the
width
necessary
the
output
-774.119,1.00001977
converted
-.77412En03n.l0000EhOlu
1)
represents
dE
ee
dE-ee
are
and
-1 .2
0.0
to
to
values
w is not
express
list
are
rounded
preceded
is
co
is
converted
is
converted
is
converted
is
converted
is
converted
present
the
the
character
converted
to d digits,
by
the
nverted
in
value
blank.
to
real
constants
while
ee
or
-ee
is
and
negative
appropriate
to to -.43573902E to to to to
the
format
of
the
number
.90445000E
.37500000E-03
-. 1 OOOOOOOE .20000000E
.OOOOOOOOE
specification,
data,
plus
of
the
interpreted
values
are
of
blanks.
02 09
01 00 00
the
one
blank
forms
as a
multiplier
preceded
The
converted
to
the
right
by a minus
following
field
of
the
of
the
sign.
are
examples
contains
field.
forms
only
If
The
external
for
the
number
the
specification
the
specification
of
field
charac-
is
2E.5
is
The
field,
counted
tude
digits,
the
from
decimal
the
point,
right,
includes
and
the
sign
the
of
exponent
the
value
digits,
(minus
the
sign
or
(minus
space).
or If a
space),
width
the
letter
specification
FORMA T
E,
the
is
Statement
magni-
of
39
insufficient the
left
or most
i=V',......,·u
..
'I.lor.
_"
.....
IIIt-'I
.....
"".
magnitude
significant
to
allow
portion
expression of
of
the
field.
an
entire
This
value,
is
not
only w digits
treated
as
an
will
error
appear.
condition.
The
digits
lost
are
from
EllA
-.2014E .3619E 00 .1340E-03
of
To
Value
-2013.55 .361887 .000134
prevent
a loss
w ~ d+6
satisfied
is which is
by
an
indicationof
60255.034
0.0000072
the
specification.
is is
Input. The discussion
characters.
need
not
Conversion
have
exponents
Examples:
Input
Value
-113409E2
-409385E-03 849935E-02 6851
04
this kind,
magnitude converted converted
"Numeric
is
identical
specified.
Specification
E9.6 E.2 E10.5
E.O
E8A
2014E 04 3619E 00
~
1340E-03
it
is
necessary
Note
range for to to
-05
Input Strings
to F format
to ensure
that
the
05
ll
Converted
-11.340900
-4.09385 .0849935
6851.0
E6A
14E 19E
40E-03
above
any
datum. For
containsa
conversion.
to
04 00
that
the
feature
description
In
relation
can
be
example,
of
particular,
used
for
the
intentiona
the
forms input
Ily to
specification
permi~sible
fields
for conversion in E format
obtain
the
E3.0,
for strings of
exponent
input
field,
First,
the determine is
interpreted
decimal
the
point
is
positioned
actual
position
as -.113409E02;
of
the decimal
which,
o Format (Normalized, with 0 Exponent)
Form:
rDw.d
similar
This format is character
E.
for E12.6,
and
for D
12.6,
Input under D format
G Format (General)
Form:
rGw.d
G format is
the performs depends on the format
that
is
to E format, with
For
example,
-667.334
-667.334
only
is
is
is
the
format
type
converted
converted
same as for E
that
may
of
the
used when processing list items
according
to
the
point.
when
evaluated
the
exception
to
-.667334E
to
-.667334D
and
F formats.
be
used
with
any
list items. For a
of
the
specification;
In
the
first
(i.e.,
-.113409 x 102),
that
for
output,
03
03
type
of
data,
Gw.d
specification,
various types.
then,
example,
the
including
the
value
of
the
-113409E2 with a becomes
character
logical.
the
following
-11.340900.
D will
The form of conversion
exponent
specification
be
present
table
shows
is
applied
instead
the
equivalent
of
to
E11.6
of
the
it
40
FORMAT
Statement
List Item Type
Input
Output
integer
real
double
precision
logical
Note
that,
as
parts
require
For
integer
and
the
only
is
case
When so used,
Output
of
Real precision way; small.
number ma I point
appended.
not To
its).
values
that
is,
Specifica
of
digits
anywhere
If,
be
used;
express this
Select
i-1
lO
:s
with
all
individual
logical
in
which
the
equivalent
and
Double
depends
they
are
Ily, d is
that
wi
within
however,
instead
the
algebraically,
an
integer
M < 10i
Iw Iw Fw.d Fw.d Lw
other
formats,
specifications,
list items,
d is not assumed
formats shown
Precision
on
the
magnitude
expressed
in
interpreted
II
be
output.
or
at
either
preceding
number will
let M represent
i such
that
(if
M =
0.0,
(see
below) below)
(see Lw
complex
the
d (in
Data
F format
as
If
or
trailing
be
then
values
are
and
conversion
Gw.d)
need
to
be
zero
if
above
become
Under G Format. The form
of
the
values.
whenever indicating the
va
lue
end
of
those d
normalized
the
i =
O)
the
of
zeros
and
magnitude
possible,
the
digits,
would
processed
occurs
not
be
not
specified. width
G format
number
number
be
output
of
as
as
shown
specified;
less
but
in E format for
of
significant
is
such
that
is
required
with
a fol.lowing
the
value
two
separate
above
if
G format is
also
(see
of
output
attempts
that
what
wi
to
express
to
for
real
it
is
present,
"Numeric
conversion
to
express
values
digits
desired,
it
can
II
be
done,
the
exponent.
be
output
items;
the
or
double
it
very
useful in a
Input Strings ").
used
numbers in
that
be
expressed
and
va lue
(rounded to d
real
and
precision
wi
II
be
widthless
with
real
the
are
too
and
this is
by
no
exponent
correctly,
imaginary
data.
ignored.
and
double
most
large
exactly
placing
wi
F format
significant
This
form.
natural
or
too the
the
deci-
II
be
will
dig-
Assuming a ing
to
specification
the
specification
Fn.m,4X
If
i is less
than
Ew.d
Note
that
when
would
otherwise
a more
readable
Value
.02639 .2639
2.639
26.39
263.9
2639.
Note
that
the
are
lost
at
the
should hold true:
w
~
d+6
of
Gw.d,
0 or
greater
than
F format is used, four
be.
In this
way,
way.
The following
G
10.
3
.264E-Ol .264
2.64
26.4
264. 04
.264E
choice
of
F or E format is
left
as in
other
numeric
let
d,
the
numbers
G
.3E-Ol .3
3. .3E 02 .3E
.3E
n =
w-4
specification
blanks
are
that
examples
10.1
03
04
independent
conversions.
and
m =
used is
output
are
output
illustrate
of
To
d-i.
Then,
following
in columns
the
effect
the
value
ensure
if
O:s i
the
number, in
will
of G format
of
the
that
this will
:s
tend
width
d,
conversion
the
to
line
output
w.
not
positions
up
on
If
w is not
happen,
takes
place
where
underneath
values
of
large
the
following
accord-
an
exponent
each
various
enough,
other
sizes:
digits
relation
in
When no
followed
Scale This has that
factors
the
values
width by
four
effect
output
is
blanks.
(see
specified,
lip
Specifications
that
all
in F form
values
the
with
number
")
apply
output
a P
scale
will
be
followed
to
G format
in G format
factor
are
cannot
by a
single
only
when
unchanged
subsequently
blank;
the
E form is
(except
be
values
for
input
output
used,
rounding).
using
the
in F form will
not
w}1en
the
It
also
same FORMAT;
FORMA T
not
be
F form is used.
has
the
effect
the
scale
Statement
41
r
factor
will
take
a power
Note
rounding
In but value
giving
have
I Format {Integer}
Form:
of
10.
that
the
rounding
that
is
PRINT
~
FORMAT(lP,
principle,
when rounded
been
F form
of
M is
normalized
9.98E 01, which is
1.00E 02, which is less
rIw
Integer, width In truncation
real,
double
specification w is
other
words,
of
the
effect
appl
ied when
5,99.76
G.2)
is
to
two
precision,
values
most signifi
during
applied
to
be
used
digits
(.9976E 02),
the
of
sufficient
greater
cant
input
but
to M {above}
the
number
if
the
it
becomes
way
it
is
accurate.
or
either
magnitude,
than
the
digits
not
during
output.
to
determine
is
actually
value
100.,
then
the P scale
printed.
part
of
maximum permissible
that
is
lies in
which
If
the
complex
real
normally
output.
the
range
is
factor
first rounding had
and
associated
Thus,
whether
Consider
outside
is
data
double
size
the
new
to
use E or F format
the
.1
:5
M < 100. The
the
range;
applied
may
be
processed by this form of conversion.
precision
of
integer
with
integer
value
will
be
following
so E form
(9.976E 01), and
been
values
data
case:
value
is
used throughout,
are
converted
may
be
operations.
different
is
not
necessarily
99.76
does
used. First
finally
the
processed,
from
lie
the
this
final
in full
without
the
old by
the
in
this
unrounded
value
value
precision.
same
range,
is
rounded
would
If
the
the
Output. values; a minus sign, tion
The specified.
is
converted
where
If
the in for
Input. External be As
processed by
Internal
however,
16
impl ies
273.4
-.003
-44204.965
converted
345.9,
345b700000-2b~30300
-IS
represents
magnitude
the
external
the
specification
-778801
identical
noted
above,
4570000000000000000000000.942
4.57
x 102
values
are
the
integers
and
the
field
wi
that
is
converted
7 is
converted
is
converted
is
converted
field
occupies
This minimum
70000,
to
of
string, and
input
to F format processing, with
however,
an
I (widthless) format,
numberofdigits
-2,
-.999,
the
character
data
requires more positions
the
12,
is
converted
strings may
the
4
converted
may
II
to to to 0 to
the
3030.3030
digits
to
most
to
contain
be
right-justified
273
-44204
minimum number
blank.
lost
take
any
significant
into
integer
as many
7
is
followed by
are
the
01
of
the
the
exception
digits
a real
constants.
digits
and
of
positions required to express
than
is
most
forms discussed under
will not
or
double
Real and
as
are
specified
preceded
one
permitted
significant.
thatfractional
by
blank.
by
be
truncated.
precision
the
Forexample,
the
This is not
variable,
double
by w.
appropriate
value
"Numeric
portions
precision
Negative
number
the
for
the
of
the
treated
Input Strings"
of
a val
For
example,
wou
Id
data
are
values
of
blanks.
data
value
specification
width
w,
as
an
error
ue
are
lost through
the
produce
the
truncated
are
preceded
The
whenever w is
51
the
only w
digits
condition.
and
conversion will
truncation.
input
field
internal
to
integer
by
specifica-
un-
output
list
appear
Thus,
value
L Format
Form:
Only
42
FORMA T
rLw
logical
(Logical)
data
Statement
may
be
processed with this form
of
conversion; any
other
data
type
causes an
error
to
occur.
Output.
The T
and F characters
.TRUE.
.FALSE.
where
15
Logical
represents
values
is
converted
is
converted
the
are
converted
are
preceded
character
to to
bl
by
ank.
to
w-l
either
blanks.
a T
or
For
an F character
examples,
for
using
the
values
the
specification
II
true
II
and
L4,
"false",
respectively.
Specifications
.TRUE
• FALSE. is
Input. "true" field
If
a
or
"falsel~
has
the for commas, fields,
processed
True
T
TRUE
.
TRUE. RIGHT STAFF 24T+T42
For
widthless
first
non-blank
terminate appears,
comma
the
are
the
ignored.
in
width
value
which
logical
character
field.
field
which w is
is
converted converted
is
specified,
respectively.
"false".
terminate
by
an
L7
format,
False
F
FALSE
FALSE
READ
LEFT
(blank)
input,
is
The first T
has
the
value
undefined
to
to
the
first T
If
no
Tor
Characters
the
input
have
the
field
terminates
a comma,
or F encountered
IIfalse".
will
cause
or F encountered
F is found
appearing
string
(see
the
indicated
at
it
terminates
As
above,
the
following
before
between
IIComma
values:
the
first comma
the
field;
within
characters
conversions:
in
the
next w characters
the
end
of
the
the
Tor F and
Field-Termination
or
non-leading
if
it
is
not
the
field
determines
appearing
field,
the
the
end
II).
a comma,
the
between
determines
value
is
"false".
of
the
field
For
example,
blank.
the
~alue.
the
next
If
first
In
blank
neither
Tor F and
whether
are the
other
the
Thus a
ignored,
following
words,
or comma
a T
nor
the
value
blank
except
input
if
the
wi
an
F
blank
is
II
or
A Format (Alphanumeric)
Form:
rAw
Output. mal The number item
ples
Internal
digits)
per
of
(see IIStorage
illustrate
Data
Type
integer,
or
logical
double
precision
binary
character.
characters
Allocation
the
form
real,
values
are
converted
The most
produced
significant
by
an
Statements
of
A format
conversion:
Interna I Binary/Hexadecima
1100
1001 1101 0101
item
ll
,
Chapter
to
character
digits
depends
7).
1110
are
on
Assuming
I
0011 0101
C 9 D 5 E 3 5 C
1100
0100 1101 0110
1110
0100
C 4 D 6 E 4 C 2
1101 0011
1100
0101 0111 1011 1111 0010
D 3 C 5 7 B F 2
strings
converted
the
number
1100
at
the
first.
of
words
standard
1100
0010
rate
That
size
of
eight
binary
is,
conversion
of
storage
allocated
specifications,
Aw
A4 A2 A6 A
A8 A6 All A
Externa
INTi,
IN
1mINT~',
INT*
DOUBLE=2 DOUBLE
1m1'5DOUBLE=2
DOUBLE=2
digits
is from
the
I S tri
(two
hexadeci-
left
to
for
that
following
ng
right.
type
exam-
of
where
1)
represents
the
character
blank.
FORMA T
Statement
43
As
with
all
In
each
of
the
data
fully, integer
with to
express
is
not
preceded
When
to
fully express
AI
phanumeric
lowing ways:
1.
the
treated
by
the
field
Previously
other
format conversions,
examples
and
therefore
variabies.
data
value
as
an
error
the
appropriate
width
is
the
character
conversions
input
using
above,
In
not
the
has
the
the
exampies,
completely,
condition.
number
specified,
value
are
normally
an
alphanumeric
complex
first A format
same
effect
note
the
When w has a
of
bl
ank
the
of
the
used
data
as
the
that
external
characters.
external data.
to
output
format
are
treated
specifies
widthless
when
field
value
character
The
external
Hollerith
(A
or
either
exactly
form.
the
magnitude
is
shortened
greater
string consists
character
information
R)
as two
the
Normally,
from
than
real
number
necessary,
of
w does
the
string
right
of
that
of
only
or
as two
characters
alphanumeric
not
provide
(least
significant)
the
external
the
number
is
not
followed by a
has
been
double
created
precision
required
information is used
for
to express
enough
portion.
character
of
positions
blank.
in
one
values.
positions
string
necessary
of
the
the
This is
fol-
2. Using a I
It
is
not
The
reason
non-printable
Input. When ters
associated
For
example,
ABCDEFGHIJ is
However, when
the
most
filled
with
iteral
recommended
for this
characters
the
with
if
the
the
significant
blanks.
UVWXYZ
where
-6
represents
Naturally,
the
Widthless number an
integer
cessing would
is
converted
if
the
list item
ABCDEFGHIJKLMNOP
ABCD EFGH
is
completely
specifications
of
characters
variable,
be
to
constant
that
this form
is
that
not
may,
width w is
the
data
list item
converted
value
of w is positions Consequently,
is
converted
the
character
width
has a
filled
cause
associated
and a double
in
the
following manner:
IJKLMNOP
(i. e., in a DATA
of
conversion
all
the
256 possible
however,
larger
type is
integer,
of
the
bl
value
with
the!
with
than
of
the
to
less
than
list item
when
to
ank.
equal
the
1st
item
the
precision
be
useful in
necessary
corresponding
and
GHIJ
the
the
UVWXYZb'1:>
to external
to
data
statement,
be
characters
(that
the
specification
number
are
filled
list
item
the
number
field.
be
fi
II
type
of
variable,
or
passed as
used with random
that
can
other
contexts
is, when its
list
item),
the
A 10
is
of
characters
with w characters,
is
double
of
ed by
the
in
precision
characters
the
next n characters
list item.
that
order,
an
argument)
numeric
be
produced
(e.
g.,
on cards, or in ENCODE
magnitude
list item is
used,
associated
and
and
associated
If
a list
and
a field
values
can
is
greater
filled
with
the
the
remainder
the
field
with
from
contained
specification
created
actually
than
the
with
the
data
type of
specification
the
data
the
input
references
of
other
than
be
printed.
operations).
number
rightmost
of
the
the
positions
is
type
of
string,
to
a real
3A
were
as
above. The
of
charac-
characters.
list item,
are
A6,
the
list item,
where n is
variable,
used,
the
pro-
A
general
fields
rule
are
considered
for this
type
of
to
be
right-justified.
conversion
R Format (Alphanumeric, Right-Justified)
Form:
rRw
This form internal
justified
Output.
acters
format
44
of
values
with
When
from
output.
FORMA T
conversion
are
considered
trailing
the
the
rightmost
This
Statement
is
similar
Hollerith
size
of w is
(least
difference
to A conversion,
to
be
right-justified
blanks.
insufficient
significant)
is
illustrated
is
that
to
portion
in
internal
allow
the
values
but
the
with
leading
expression
of
the
examples
rule
of
of
internal
at
the
are
considered
internal
binary
the
value.
top
justification
zeros,
complete
In
all
of
the
to
be
left-justified,
whereas
internal
other
following
is
reversed.
with A format
value,
R format
respects
page.
it
is
while
external
In
other
they
are
takes
identical
words,
left-
char-
to
A
Data Type
Internal Character
Va lue
w
A Format R Format
integer,
or
logical
double
where
1) represents
Input.
As characters most) portion
remaining A format
list Data
left
Item
Type
integer,
or
logical
real,
precision
on
output,
associated
of
the
portion.
justifies
real,
DOUBLE=2
the
bl
ank
character.
R format
with
the
differs
type
I ist item with w
In
other
words, R format
the
characters
Externa I String
XYINT*
from A format
of
the
input
characters
right
and
inserts
4
2
6
none
8
6
10
none
I ist
from
justifies
trailing
w
4
6
2
none
INT* IN
f>1>INT*
INTi~
DOUBLE=2 DOUBLE 1>f:>DOUBLE=2
DOUBLE=2
only
when
the
specified
item.
In this
case,
R format
the
input
string,
preceded
the
characters
Hollerith
blanks.
Interna I after A
Conversion
XYIN
INT"'~
XYf1I) XYIN XYIN
INTi~
T*
f1DINT~~
INTi~
DOUBLE=2 UBLE=2
1')"oDOUBLE=2
DOUBLE=2
width
(w)
fi
lis
the
by
enough
and
inserts leading
For
example,
Interna I after
R
Conversion
XYIN
INT~'~
zzXY
is less than
least
significant
binary
zeros
binary
the
number of
to
zeros,
(right-
fi
II
whi
the
Ie
double
precision
where
1>
z represents
Note
that
external
represents
the
field
the eight
Hollerith
OOABAB
were
processed
Hollerith
by
constants
the
4HOOAB
mat should be used.
Z Format (Hexadecimal)
Form:
rZw
Z
conversion
the
external
is
similar
field
consists
85DOUBLE=2
Hollerith
binary
character
format
character
zeros.
zero
specifications
and
2RAB,
to R conversion,
of
hexadecimal
is not
which
except
digits,
8
6
10
none
blank
and
represented
A4,R2
into
are
not
that
which
85DOUBLE 85DOUBfrl) DOUBLE=2
85DOUBLE
interna
two
integer
equivalent.
the
internal are:
lIy as
variables,
For
data
85DOUBLE zz85DOUB
DOUBLE=2
85DOUBLE
eight
binary
the
resulting
input
as
true
is
processed 4 bits
zeros.
Consequently,
values
right-justified
at a time
if
the
would
be
the
integers, R for-
instead
of
8,
and
o
123456789ABCDEF
FORMA T
Statement
45
Output.
ber
'of
"Storage
If
w
is
number
Wher:l
field
Internal
characters
Allocation
not
specified
of
positions
width
binary
values
produced
Statements",
large
necessary
permits,
are
by
an
enough,
to
all
of
converted
item
depends
Chapter
the
express
the
digits
to
hexadecimal
on
the
7). For exampl
leftmost
the
data,
in
digits
an
the
item
number
e,
an
are
lost, as in
digits
are
output,
digit
strings
of
words
integer
are
right-justified
including
at
the
rate
of
storage
allocated
produces 8 di gits, a
other
numeric
in
leading
formats.
the
zeros.
of
4 bits
double
field,
for
If
with
per
digit.
that
type
precision
w
is
larger
preceding
The num-
of
item (see
number, 16.
than
the
blanks.
When w is
blank
is
Examples:
Data
integer, real,
logical
double
precision
wheref>
Input.
When
ciated
with
not
specified,
to
facilitate
Type
or
subsequent
Internal
0000 0000
a a a 8 E 3 5 C
0100
4 1 3 2 4 3 F 6
1010
A 8 8 8 5 A 3 a
represents a blank
the
width w
the
data
type
of
the
full number
of
rereading
Binary/Hexadecimal
0000
1000
0001
0011
0010
1000
1000 1000
character.
is
larger
than
necessary
the
corresponding I ist item),
digits
of
the
necessary
value
1110
0100
0101
(i.
0011
0011
1010
e.,
to express
(see
below).
0101
1111
0011
when its the
I ist item
the
1100
0110
0000
magnitude
is
fi
II
ed
value
is
greater
with
is
Zw
z8
Z6
Z10
Z
Z16
Zl1
z18
Z
the
output,
followed
Externa I Stri ng
0008E35C
08E35C
f>f>0008E35c
0008E35C
413243F6A8885A30
3F6A8885A30
f>n413243F6A8885A30
413243F6A8885A30
than
the
number
rightmost
characters
by a blank.
of
digits
in
the
The
asso-
fi
eld.
When w corresponds
There is, al a widthless Z string at
The following
is
too
however, a significant
phanumeri
terminates
the
left.
External Input
small,
the
digits
to
the
number
c.
Therefore, commas may
input
at
(Note
are
examples
string the
that,
of
is
first
when w
Field
3A70049B f:>f:>b3A7iJ'b 1:>D68,470 19
DCBA987654321
52CA91,
123456789 ABC,
1:>1)4%1>3
where
15
represents a blank.
M Format (Machine Dependent)
M format format most
is
intended
appropriate
primarily
to
are
right-justified
digits
associated
difference
not
dependent
~mma
of
or
is
specified,
Z format
Format
Z5
Z8 Z8 Z12
Z
Z
Z
for
output.
the
machine
with
between Z and
be
used
to
on
the
non-leading
blanks
input
(assuming
Internal
0003A700 0003A700 00000D68 98765432 0052CA91 56789ABC 00000049
It
provides a machine-independent
on
which
in
the
I ist item, as
the
list
item,
wi
th R format.
the
item
R format on terminate a hexadecimal size
associated
blank,
are
treated
an
Hexadecimal
the
program
like
all
integer
with
other
as
zeros.)
list
Value
is
running. Thus, on
is
input.
the
list
numeric
item):
As
completely
Z format
input
string.
item;
formats. Excess
method
usual, when
filled
is
the
with
the
a numeric format,
Furthermore,
a widthless
hexadecimal
digits
of
dumping information in
an
octal
machine
width
external
the
will
it
exactly
not
length
input
be
would
field.
of
lost
the
46
FORMAT
Statement
be
interpreted
the
same as Z
as 0 format, and on a
(hexadecimal)
H Format (Hollerith)
Form:
nHs
where
n
:s
255
character
format. Thus,
machine,
it
could
also
as A
be
format.
used for
On
input,
the
Sigma
though this is
5/7,
it
is
interpreted
not
recommended.
exactly
Output.
The n
Specification
IRE 8R'b1>VALUE: 5R$3.95
9HX(2,5)'b=1)
where1S Care
be
Input. The n
~s
represents
should
created,
as shown in
Specification
3H123 1
OHNOWf>IS'bTHE 5HTRUEf> 6H'b1>f>f>f>f>
where1S
that
If
n is
are
not
represents to
present,
characters
be
taken
and
so
characters
appear
the
that
the
the
on
its
that
an
in
the
External
E
'b1WALUE:
$3.95
X(2,5)1>='b
character
the
characters
in
the
following
Input String
ABC 1:>T FALSE
RANDOM
character
output
value
is assumed
string s
String
blank.
character
string s
string s contains
from
other
are
examples:
IMEf>FOR1>
blank.
record
This
generated
to
are
transmitted
format
replaced
feature
be
1.
to
the
external
exactly n characters,
specifi
cations
by
the
next n characters
Resultant
Specification
3HABC lOHf>TlMEf>FORf> 5HFALSE 6HRANDOM
can
be
used
to
by
the H specification.
record.
are
not used as
change
from
the
For
so
that
the
titles,
instance,
the
part
of
input
dates,
desired
the
string.
record.
column
external
This
replacement
headings,
field
will
etc.,
, Format (Hollerith)
This is
an
alternate
requiring
Form:
The ever, specifi
Output.
is
Within
string
note
cation.
output
ABLE
the
characters
s may
the
The string s
as
the
BODIED
a I
string
restrictions
format for
in
contain
stri ng
not more
below
is
transmitted
the I character
Hollerith
the
string
transmission
to
be
than
255
concerning
to
the
external
is
represented
similar
counted.
characters.
the I character. A repeat
device
by
two
to
that
Any
Hollerith
in a
manner
adjacent I characters;
done
by H format. This
characters
count,
similar
may
r, may
to
that
thus,
has
the
advantage
appear
for H format. Thus,
Ip
(see
optionally
ILL
TAKE
FORMAT
Chapter precede
FIVE
Statement
is
output
1); the
of
how-
not
as
47
r
Inp·ut. The
quentiall
is
the
y from
used
to
MATRIX
specification
'MATRIX'
characters
process
the
the
itself
input
input
is
appearing
string.
field
changed
between
Therefore,
to
the
quotes
if
the
are
specifi
replaced cation
by
the
same
number
of
characters
taken
se-
Blanks in FORMAT
X Specification (Skip; Space or
The form
This
If i is
lar
of a record
Output.
below}.
of iX specification
positive,
to
that
of
is
For
In
'WXYZ' ,
generate
where b represents
_A~
to
are
the
WXYZfr&Of>IJKL
negative
the
equivalent
value
left,
assuming
'FORTRAN' , -3X,
'FORTKNOX'
statements
the X specification
causes
no
it
has
an
effect
the
backspace
equivalent
positive
other
words, a
4X,
following
of i causes
to
the
to
values
'IJKL'
external
the
character
that
this
specification
are
significant
Backspace)
is
conversions
similar
control
backspacing ~ the
field
'KNOX'
on a typewriter.
of
i,
the
of i blanks
string:
blank.
processing to "beck up" in the record. The next
is
not
beyond
only
in
to
occur.
to
that
next i positions
will
of a space
beginning
be
the
beginning
Instead,
created.
Hand'
bar
In
particular,
of
in
the
specifications.
it
causes i positions
on a typewriter;
an
the
record.
output
record
For
example,
of
the
record.
attempt
if
to
will
the
specifications
field
For
example,
of
the
it
is
negative,
backspace
be
blanks
vIi!!
external
then begin I i I
the
field
it
has
beyond
---
(normally,
specifications
to
be
"skipped
an
effect
the
beginning
however,
ChOicctCiS
".
simi-
see
48
Note
that previously output, characters
The produced
K
generate
As
equivalent:
it
ability
= 13
and
PRINT 5, K ,
5 FORMAT(
Q (13) =
illustrated
XXXX
4X
FORMA T
when
either
produced
is
not
necessarily
have
been
to
specify a negative
at
the
end
Q(13) + 350.8,
'Q('
the
string
350.
80
in
the
Statement
backing
in
the
generated
of
external
Q(K)
above
up
positions
true
that
in
count
fields
the
statements
example,
or
moving forward by
being
skipped
the
specification
those
positions,
in
an X specification
by
widthless
-X
if
i is
') F.2)
not
specified
means
are
not
4X
since
numeric
of
destroyed.
will
produce
all
output
makes
formats (i.
it
is assumed
an X specification,
Thus, in
four
records
it
possible e.,
to
be
blanks.
are
D,
1.
the
initially
to
backspace
E,
F, G,
Thus,
characters
exampl e given
It
will,
however,
set
to
blanks.
over
and
I). For
the
following
that
may
above
under
if
the
blank
example,
specifications
have
no
that
been X
other
is
for
are
Input.
example,
and
the
will
The
F5.3,
the
input
76.4lIGNORE697
characters
IGNORE
not
be
next i characters
with
the
specifi
6X,
13
stri ng
processed.
from
cations
the
input
string
are
ignored
whenever
i is
positive
(that
is,
they
are
skipped).
For
Negative tions
and
are
and
T Specification (Tab)
The form
This
less
X
It specification
when
three
val
ues
13,
-lX,
the
string
123456
equiva
lent
13,
E4.1
the
stri ng
1233456
of
the T specification Tw specification
of
the
position
specification;
1 FORMAT( 5X
FORMAT(
2
can
be
seen
width columns
3 FORMA
provides a capability
less formats
of i cause
E4.l
to
no
from
of
numbers
T(G.
causes
in
transfer
T6
the
7,
T21,
iii
processing
the
record
AS
AS
above
are
being
beginning
G.
characters
is
that
of
data
-2X Tl2 , 17
example
7, T 41,
from
(either
was
being
occurs.
17
that
that
an X specification
used
and
in
positions
G.
7)
the
input
For
it
the
input
or
output)
processed
example,
is
permissible
character
1,
21,
string
before
position
and
to
be
processed
to
begin
at
the T specification.
the
following
to
tab
either
does
not,
is
thus
41,
the
following
character
FORMATs
forward
namely
unknown.
again.
position
or
that
of
FORMAT
Consequentl
w in
It
functions
are
equivalent:
backward. tabbing
For
example,
statement
y,
the
the
record,
exactly
Furthermore,
to a given
to
could
specifica-
print
print
be
regard-
like
position
(or
read)
used:
an
a T
Note
that
backward
be
processed
As
with X specifications,
If
no
w is
P Specification
The form
again.
given,
of
the P specification
it
(Scale
tabbing
it
is assumed
Factor
iP
A P
specification
of
the
forms
i
10
for
and
-i
10 for
output
input
causes
the
can
is
not to
or
Power
value
cause
possible
be
is
of
1.
of 10)
the
previously
to
tab
That
is, T is
scale
factor
output
information
to a position
the
same
to
be
set
previous
as
T1.
to
i,
to
be
to
where
overwritten,
the
beginning
the
scale
or
of
factor
previously
the
record.
is
treated
FORMA T
read
input
to
as a multiplier
Statement
49
r
At
the
beginning of
zero.
Any number of P
scale
factor
to
be chanQed several times during a formatted
within a single
the
value
Scale
factors
put G conversions.
input/o~tput
of
the
scale
are
each
specifications
factor
effective
formatted
operation
is not reset to
only
with F,
input/output
may be present in a FORMAT
due to
E,
operation,
the
number
zero.
and
D conversions,
before
input/output
of
items in a list (see "FORMAT
any
processing occurs,
statement,
operation.
floating-point
the
scale
factor
thereby
input G conversions, and
causing
If
a
the
FORMAT
and
List
value
is
re-scanned
Interfacing"),
is
set
of
the
E-type
to
out-
Output. shifted right i Thus, for D-and E-type for F format examples
The examples for E conversion
sion. When G conversion uses the F form, however, sca always represents the internal
The
value
of
the
list item is
places.
output
illustrate
Format External field when internal
2PFI0.3
1 PFI0.3
OPFI0.3
-1
PFlO.3
-2PFI0.3
-3PFI0.3
-4PFI0.3
2PE14.3 27.183E-Ol
1 PE14.3
OPE14.3 .272E
-1
PE
14.3
-2PE14.3
-3PE14=3
-4PE14.3
On D-and E-type conversions, the
output,
it
is
not (unless i
output
scaling:
2.71828
271.828
27.183
2.718 .272 .027 .003 .000
2.718E
.027E .003E .OOOE .OOOE
value.
the
above
scaled
external
is
0).
Scale
00 01 02 03 04 05
are
simi lar to those
by
the
multiplier
exponent
number is equal to
factors
do
not
-2.71828
-271.828
-27.183
-2.718
-.272
-.027
-.003
-.000
-27.183E-Ol
-2.718E
-.272E
-.027E
-.003E 03
-.OOOE
-.OOOE
that
Ie
factors do not
lOi. This scaling
the
affect
00 01 02
04 05
would result from D conversion and E-type G
field (±ee)
internal
value
numbers whose
apply.
causes
the decimal point to be
is
correspondingly reduced by
(except
value
0.00000 0.09999 .000
.000 .000 .000 .000 .000 .000
.OOOE .OOOE .OOOE .OOOE .OOOE .OOOE .OOOE
Thus, a number output in G format
for rounding),
value
is
zero.
is:
00 99.990E-03 00 9.999E-02 00 .100E 00 00 00 00 00
while
The following
9.999
1.000 .100 .0lO .001 .000 .000
.010E .00lE .OOOE .OOOE
conver-
1.
01 02 03 03
Note
that
when a
case
of
E format, this may cause
the
discontinuity
Input. During has no
effect.
is
scaled
by 10-
scaling
It internal
50 FORMA T Statement
during
External Field
-71.
436
-71.
436E
can
be
seen
value;
external
scale
in
F,
E,
':'owever, when
1
;
that
an
input
00
that,
if
it
value
= internal
factor
is
in
effect,
additional
the
way
the
exponent
D,
and G input conversions, if
the
input string does not
is,
the
decimal point
operation:
Scale
Factor
OP
3P
-lP
3P
-lP
on both input and output, if
does not,
then
value x Wi
output
scaling
changes.
is
Effective
-71.
436
-.071436
-714.36
-71.
436
-71.
436
rounding takes
to be required, as shown
the
input string
moved
Value
the
contain
left i places.
external
an
number has
place
after
the
scaling--has been performed.
above
in
contains
exponent
The following examples
field,
an
exponent
an
exponent
the
the
output
field,
value
indicate
specified,
of
of
0.09999.
the
scale
the
external
the
it
is
equal to the
factor
field
effect
In
the
Note
of
Once
a sca
ation,
unless redefined
a
OP
specification.
A,
and
the
FORMAT(2(F
A,
K,
and B
as
illustrated
List
'Item
A F.3
K 2PF.3 X
B -2PF.3
Ie
factor
K,
X,
B
FORMAT
are
below:
Effective Format
Speci
has
For
.3,
2P), E
all
converted
fi
cat
2PE12.4
been
established during
by
an
additional P specification.
the
list
12.4,
-2P)
using
the
F.3 format
ion
an
input/output
specification,
To
reset the
operation,
scale
but
all
it
remains in
factor
three
to
have
effect
zero,
it
different
throughout the
is
necessary
scale
factors in
to
oper-
write
effect,
When i is not
P is
/
Specification
The
form
r/
Each
slash(/)
/ /
//
••. / or input, fication
the
final right parenthesis in a FORMAT
Output. record is statements
10
specified,
equivalent
of
the / specification
or
r/),
and blank records
and
either
Whenever a slash
begun.
WRITE
FORMAT (F5.
to
OP
(Record
Separator)
/
specified
since
no conversion occurs
of
the
If
no
(5, 10) X, Y
3//113)
its
value
causes
are
generated
parenthesis
specification
conversion has
is assumed
is
another
to
be
zero.
Therefore,
record to be processed.
between
during
characters
statement
is
encountered,
been
performed when
each
output
operations. The same
surrounding
is
not ignored.
the
of
the slash
the
current
the
In
the
case
of
contiguous
specifications,
condition
field
specifications
record being processed is
slash is
encountered, a blank
slash
specifications
records
are
are
,ignored during
can
occur
when a slash
contiguous; a slash
output,
record is
(i .e.,
preceding
and
another
created.
speci-
The
are
processed in
1.
A record
2. The first slash record is begun.
3. The second slash is no conversion
4.
The
value
encountered,
the
following manner:
is
begun, and X
is
encountered,
occurred
of
the
variable Y is
and
the
encountered,
third record is
is
converted
between
with
the
record
the
second record is
the
terminations
converted
terminated.
the
specification
containing
of
with
the
F5.3.
the
external
terminated,
the
first and second records,
113
specification,
representation
and a third record is
the
closing
of X is
the
second
right
terminated,
started.
record was
parenthesis
FORMAT
and
another
Note
that
blank.
character
Statement
since
is
51
r
I
If
a th i
rd
i tern Z were
WRITE
(5,
the
following
5.
A fourth record
additional
6. The first slash is
7.
Again, started.
8.
Since
or
Note
since The
original
or
both of which would cause
The two statements
4
cause specification
the
there
sixth record, which
that
the processing
10
FORMAT
the
specification
FORMAT
FORMAT
10
FORMAT
10
WRITE
(M,4)
FORMAT
the
generation
EA), followed by
added
10)
X, Y, Z
is
begun, and Z
re-encountered,
second slash is processed; the fifth record, which
are
no
more list items, the
(F5.3,//)
113
statement
(F5.3, 2/113)
(F5.3,2/,113)
X
(3/EA/)
of three blank records, followed by a record
to
the
output Ii
steps would occur:
is
also
blank,
of
Z in steps 5 through 8 is
was not
identical
utilized.
could
another
is
converted
the
fourth record
is
also
have
effects.
blank
st,
specification
output.
as in
using the
been
record.
specification
is
terminated,
113
is not processed, a termination occurs, and
equivalent
written as
F5.3.
and
a fifth record is begun.
is
blank,
to processing with
containing
is
terminated;
the
and
the
statement
value
of X (converted
the sixth record
the
by
the.
is
final
effect
Input. The input, records
READ
4
FORMAT
cause
three assigned to X, ated
with a
ment, which
Parenthesized
Within a FORMAT statement preceded
where r
is
equivalent
by
and
3 FORMAT (3(A4,
FORMAT (A4,
3
of slash
ary
ignored in the cases where
(M,4)
X
(3/EA/)
records to be bypassed, a va lue from
and
a fifth record to be bypassed. This means
FORMAT
is
statement
not true
in
FORMAT
an
the
to
optional
S.
I
are
defined
F.
F.
2, 3X, A4,
repeat
2, 3X),
specifications
containing
FORTRAN systems
during input operations is similar to
slash
Specifications
any
number of
count,
previously, and m
31)
F.
in the form shown on
2, 3X, A4,
blank
records
the
fourth record to be
specifications
that
ignore a final slash.
specifications
~
O.
For example,
F.
2, 3X,
31)
are
may
created
that,
can
during output. For example,
converted
as with
be input by use of
be
repeated
the
following
the
the
effect
(with the
the
last example for
by
enc
page.
statement
for output,
the
identical
losing them in parentheses,
except
the
specification
output,
FORMAT
that
statements
EA) and
recordscre-
state-
for
There
is
no limit to
During
52 Parenthesized FORMAT
input/output
the
number
processing
Specifications
of
repetitions
each
repetitive
of
this form
specification
that
can
be present in a
is
exhausted in turn, as
FORMAT
is
each
statement.
singular
specification.
The following
34
FORMAT (4X, 2(A8,
1125 FORMAT (I,
8 FORMAT (2(18, 2(3X, F 12.9), F12.
In
the
last
example
The
presence scanned cular, the of
if
more list items
when
last
one
this process is
are
additiona I examples
R4,
above,
of
parenthesized
one
or
more such groups
encountered
contained
X,7G.3),
F.7,
5(E
14.8,
repetitions
groups
are
specified
prior
to
the
in "FORMAT
of
repetitive
I4,3(D,
2/),
have
within
than have final
and
specifications:
L5))
E 14.8)
9), A 16)
been
nested.
a FORMAT are
processed the first time through
appeared,
right
parenthesis
List
Interfacing".
statement
the
rescan
Nesting
begins
of
the
of
this
affects
with
FORMAT
type
is permissible
the
manner
the
the
statement.
FORMAT
group
in
which
whose
A more
to a depth
the
FORMAT
statement.
right
parenthesis
complete
of
ten
levels.
is
re-
In
parti-
was
discussion
Adjustable
The
adjustable
statements
form
Any tion. merely
N.
of
quantities
is a
The following the
1.
2.
3.
4.
in
is
highly
of
the
quantities
When
an
a form of
Also,
there
32
FORMAT
valid
statement,
values
are
Integer,
data
wi
II
wand
d (width
or
(skip
The
resultant
When N prior
to
3,4,
and
the
3 FORMAT
which
are
A,B,C,D
and
the
3 FORMAT (3E4.1, 12X,
FORMAT
FORMAT
order
to
handle
variable,
r,
N is
encountered,
specification
is no limit to
replaced
set
utilized:
real,
be
scale
appears
th e items
1,A,B,C,
statement
statement
by N in a format
(NX,
FNA,
and
of
rules
double
truncated
and
factor
value
one
(if
(NEN.N,
equivalent
Specifications
specifications
slightly
and
which
W,
d,
or i (see "FORMAT
and
the
N(3X,
seven
values
defines
precision,
to
integer
decimal
count)
(negated
12,-2,D
point)
specifications
or
more times in a
any)
that
NX,
to
the
list
different
could
its
value
does not
number
E.5),
will
the
manner in
or
value.
if
preceded
are
NP,
-2P,
G 14.8)
feature
not
of N characters
specification.
NP,
either
specifications
to
G 14.8)
often
el
situations.
be
processed
Statement")
is
obtained
conflict
NGN.N)
be
taken
which
part
may
by a minus sign) may
single
be processed by
from
with
For
form
the
of
complex
may
be
replaced
specification,
iminates
Furthermore,
without
may be
the
next
any
variable,
that
may
example,
the
list.
value
of
data
be
replaced
by N
the
specification.
the
need
to
it
facilitates
this
feature.
replaced
input
or
output
subprogram,
be
used in a FORMAT
N must
be
its
may
be
only
or
-N.
negative
values
be
specified
supplied
by
must
An
write a great
the
by
the
letter
list item. The
etc.,
whose
statement
in a list
as
values
N,
whereas r (repeat
only
when N is used
appear
sequentially
example
is
number
input
of
records whose
N in a format
identifier
and
for
N.
the
list
of
FORMAT
letter
or
to
the
the
way
Non-integer
count)
to
replace
in
the
specifica­N is may
be
number
in
which
and
i
i.
list
and
5.
Whenever N is
Format
Specifications"),
sequently,
7, A,
are
equivalent
A,
B, C and
used
the
difference
B, C and
to
with a specification
3FN.2
3F7.2
one
value
between
must
the
that
is
be
supplied
following
enclosed
for
two
examples
in
repetition-type
each
repetition
should
7, A,
are
equivalent
A,
B,
7,
C
B,
be
7, C
to
parentheses
of
the
specifications
noted:
and
3(FN.2)
and
3F7.2
Adjustable
(see
FORMAT
"Parenthezised
enclosed.
Specifications
Con-
53
r
6.
In
the
above
the
value
count. a.
b. However, when
The same rule
When
ing in
are
equivalent
specifications
are
equivalent
of
the
that
0,4,
Y
0, Y
y
the
example,
Y
it
repeat
count;
can
repeat
count
specification
and
to
and
the
appearing
and
to
and
was noted
whereas,
be
extended
(r)
of a single
must
NG20.N,
F8A
repeat
count
within
N(G20.N},
F8.4
that
in
the
specification
in 3(FN.2},
to
include specification
be
supplied. For
F8.4
of a parenthesized
the
parentheses
F8.4
3FN.2,
the
number
repeat
counts whose
is
replaced
example,
are
the
group is
bypassed, inc luding
one
of
values
by N
following
replaced
value
of
N is
required for N is
values
are
zero:
and
its
value
combination
by N and its
any
Ns
required,
equal
is
zero, of
list and FORMAT,
value
that
may
regardless
to
any
is
zero,
appear.
the
Ns
repeat
appear-
all
the
Thus,
of
In both of cation
The certain
the
within
abi
lity
to
specifications
above
parentheses
specify
T=O
IF
(BOOlE)
F = 1 - T
PRINT 17,
17
FORMA
outputs
the
7. The this purpose in
As
an
example
205
The
value versions to be performed by uous to be
correctly
the
n in
an H specification,
value
of READ(101,205) FORMAT(
input
the
last
processed by
T = 1
BOOlE,
T(Ll,
N(3HRUE),
strings
TRUE
of N may be supplied by
an
input list is not
the
flexibility
I,
NE , A4}
for K
defines
field
input
examples, no
can
zero
repeat
within a FORMAT
T,
or
FALSE
provided by
K, K,
(A(J),
not only
the E specification.
into
A, regardless of
the
above
value
be
used
counts in this way
F
N'
AlSE'}
depending
the form shown in
considered
J=l,K},
the
statements:
was supplied for
to
determine
statement.
an
expression in
adjustable
CODE
number
the
the G specification;
whether
gives
on
the
value
statement
either
to be a true
format
of
va lues
At
the
same time,
number of such fields. Thus,
or not
the
For
example,
of
BOOlE.
17
above
an
input
specifications,
to
be
input
the
programmer
can
input
or
list item.
into
the
alphanumeric
value
the
Note be
used.
an
output
consider
the
however, enclosing the
of
N will
be
supplied.
facility
that
array
all
of
selecting
although
list, but
the
A,
value
the following input records
an N cannot
an
statements
but
also
of CODE
expression used for
the
or
skipping
number can
be
specifi-
replace
of
con-
contig-
can
1,
67.49,
HOPA
5
-14.3
37
.09711623 0 3E12 JASU
,NONE
This
example
nation
Numeric
The permissible kinds D,
G,
In
other
be
integers,
54
Numeric
illustrates not
(see below).
Input
Strings
and I conversion. Any fie
words, numbers for input with E format need not have
etc.
Input Strings
only
of
input strings
adjustable
that
Id
that
format
specifications,
may be processed by numeric conversions
can
be
read using
one
but
also
of these formats
exponents,
numbers for input with I format need not
widthless formats
are
can
be read using
exactly
and
comma field
the
same for
any
of
the
termi-
F,
E,
others.
A
numeric
exponent.
E±e
where
the
in
which
input
An
plus
case
string
exponent
sign is
the
plus sign is
consists
is
normally
optional
of a string
specified
and
e is a
not
optional.
of
one-
digits
as
or
two-digit
Thus, a
with
variety
or
without a leading
number.
of
forms may
The form
be
sign, a decimal
±e
is
also
accepted
used
to
express
point,
data
and/or a trailing
(without
for
numeric
the
input:
E),
plus signs
fields
the
format
of
the
be
substituted
that
data
is
to
be
type
value
is used (with
be
of
specified).
±n.m
±n.m±e
are
contain
specification
to
field.
is
(if
any), a numeric
assigned
of
wi
II
be
used to
embedded
±n ±nE±e ±n.mE±e ±n±e
where
the
When
input
the
d in
placed d positions the
end
A D may
indicate form
of
exponent
which
it
Any
numeric
the
input
specification
A comma may interpretation (no
width
Width less Numeric Input
optional
the
left
Note
for
double
list
item
processed
terminate
±n. ±n.E±e ±n.±e
no
decimal
of
that
the
E in
precision,
is
double
may
any
type
and
±.m ±.mE±e ±.m±e
except
the
the
trailing
in
point
(as in Ew.d).
beginning
exponent
an
exponent
nor
string
precision.
be
used
in
floating-point,
of
list
any
numeric
blanks
an
(as in
may
is
it
will
with
item),
exponent
the
first
If
none
of
the
exponent,
begin
field,
necessary
be
converted
any
numeric
if
the
fractional
field,
depends
field
without
column
is
specified
with
either
with
no
to
use a D format. Regardless
with
type
necessary,
as
described
on
whether
above)
or
if
change
full
of
and
portion
below.
or
an
it
is assumed
no
exponent
a D,
in
double
format
then
of
not
E (as
described
the
decimal
to
E,
+,
or-.
meaning
precision
specification.
converted
the
value
Leading
the
format
above).
point
is
positioned
be
zero.
is
present, d positions
or
value.
to
integer.
is lost.
blanks
specification
of
if
the
the
If
are
It
the
The
is not format used or
input
When
always
decimal
list
list
item
used
according
point
to
the
necessary
item
is
integer,
the
I format
ignored.
is
widthless
to
left
to
the
to
is
of
The
The
principle
that
the
number
ber
at
that
1. Leading
2.
Any
number
a.
Between
b.
Between
c.
Between
3. A
blank
4.
When a widthless as
blanks. found. number
For
clarity,
the
field.
of
the
field
The
following
behind
widthless
is
finished. A blank
point.
Although
Thus:
blanks
do
not
of
blanks
the
leading the E and the
plus
that
follows a
(or
any
Normally, a widthless
Special
of
numbers should
it
numeri c
has
terminated.
is a
typical
provision is
values
the
terminating
input
cause
termination;
may
appear
plus
or
the
pi
us
or
minus sign in
digit
or
other)
made,
may
generally
Therefore,
widthless
is
that
also
in
the
minus sign
or
minus sign
decimal
field
format
however,
be
read
be
blank
numeric
the
field
indicates
they
following
the
exponent
point
runs
off
does
from a
written
or
comma
the
next
input
ends
that
are
and
the
or
first
terminates
the
end
not
terminate
to
terminate
blank
without
does
field
line
when
the
number
ignored.
places:
first
digit.
digit
and
the
the
of
the
record,
any
embedded
not
affect
begins
consisting
the
number
is
of
the
exponent.
first
digit
field.
input until
at
widthless
and
they
the
with
the
of
eight
is
finished,
of
record,
least
fields
wi
II
blanks.
value
character
values:
finished.
if
it
the
exponent.
the
extra
one
non-blank
at
the
all
be
The first
of
the
following
A comma
is
meaningful
characters
end
of
zero.
blank
number,
character
the
record.
will
it
is
the
blank
always
to
finish
will
be
has
Thus,
then
considered
or
indicates
the
num-
interpreted
been
any
terminate
part
comma.
73
2E-4
.0007
-35.4
0 0 -16 27.08614E
12
Numeric
Input
Strings
55
r
I
The
but
following
3E
~ou
Id
be
-300.
is
not a
typical
2
+
interpreted
+
3.7
widthless numeric
3.7
as five
values,
-4.
4
namely,
17E
1700.
input
2
line:
5-
.005
03
Numeric Input with
When a width
apply
rules
1. Leading blanks
2.
Once
3. Any string of
For a format
produce
the
others
Note,
in
cause
the
justified
and/or
is
specified,
to
blanks in numeric
any
nonblank
specification
the
value
are
permissible,
the
fourth
trailing
in
their
fields.
widthless formats.
Width
Specified
are
ignored,
digits
shown in
example
blank
the
field
terminates
fields
with a width
except
character
that
is
omitted
such as F10.0, with no P
the
top
but
less
that
has
been
has
line
of
readable.
-
.00.4
they
found,
an
the
- 4 E - 3
-
.004
4
-
40
- 8
middle column
to a zero.
do
this
is
a common
- .
-4
of
is
equivalent
Failure
-
the
to
only
when
the
specified:
are
counted
all
blanks
assumed
column. The first
scale
value
factor,
of
7'.5 7'50+13
.
750E10
4
Care
75
.
above,
should
75
+
75
that
pitfall
width
is
as
part
of
beyond
zero.
all three
that
the
E 12
E'l 0
o 1
E 16
the
exponent
always
be
that
can
exhausted
the
field
point
input
strings in
I ines in
OE
+
is
interpreted
taken
also
be
or
a comma
width.
are
treated
each
column
0.0
+
-0
-
to
assure
avoided
is
found. The following
as zeros.
each
of
the
columns
are
typical
0
as 10
rather
that
exponents
by using comma
below
numeric fields;
than
as 1,
be-
are
right-
termination
Input strings the
presence
currently regardless the
are
The string
Two tion
is
converted
t
For
thesis
being
character
3450,88412,
equivalent
345088412
contiguous 516,
the
303,
, - 1, ,
303
consistency
are
being
of
a comma in processed is
of
the
value
following
to
F4.3,
containing
comma
string
000450
to
the
0
-1
with symbolic
also
accepted
processed
of
the
F5. 3
the
commas would
characters
values
0
450
as
under
the
string.t In
considered
w in
the
comma. For
and
indicate
input
field
terminators.
control
ended,
field
specification.
also
(via
of
F,
other
and no
example,
be
correctly
an
empty
the
INPUT
Use
E,
D,
G,
I,
or L specifi
words,
whenever
additional
The comma is not processed,
th-e
specification
processed by
field,
statement),
of
the
comma is recommended,
a comma
characters
which has
the
cations
appears
are
2F13.3
and
the
specifications
the
value
characters
may
be
in such
converted.
and
the
string
zero.
Therefore, for
semicolon,
however.
terminated
an
input
This
termination
the
next
2F. 3
or
2F8. 3.
asterisk,
at
any
point by
string,
the
field
occurs
field begins with
the
specifica-
and
right
paren-
56
Comma
Field-Termination
and
the
stri ng
0, ,
'"
is
converted
o 0 0 0 0
to
the
values
The comma must, F4.0
were
used
1234,
the
value
would
giving
it a value
FORMAT
Formatted time a formatted
processor
1. When
2.
3. During
and
input/output
operates
control
Subsequent been
terminated)
more
characters
on
output
an
final
right
and
no I ist items
on
occurrence
of
course,
to
process
already
of
zero.
List
Interfacing
READ
in
the
is
initially
records
or
on a
the
extra
input
operation,
parenthesis
remain
of
the
fall
the
input
be
terminated
operations
or
WRITE
following
received, a new
are
started
the
final
record
characters
of
the
to
same
conditions.
within
string
because
are
controlled
statement
manner:
only
right
parenthesis
than
are
are
lost, on
processing
FORMAT
be
processed.
the
is
after
(or
of
is
field
it
is
of
field
by
executed,
input
a slash
of
can
be)
input
an
input
sensed,
Construction
meant
to
width,
the
FORMAT control
record
is
read,
specification
the
FORMAT physically they
are
record
is
or
when
of
terminate.
and
the
comma would
requested
is passed
present
treated
terminated the an
output
to
or
construction
has
been
has
been
does
as
blanks.
whenever
FORMAT processor
record
For
example,
by
each
the
FORMAT processor. The FORMAT
processed
sensed.
not
cause a new
terminates,
if
terminate
READ
of a new
(and Attempting
a slash
requests
the
format
the
or
WRITE
output
the
preceding
to
record
specification
an
item
and
the
specification
following
statement.
record
read
to
be
from
record
field,
is
begun.
record (or
write)
begun;
or
the
the
is
written
Each
has
list
4.
5.
Every
time a conversion cessed, forms because that exists.
would
When
version following
When
made been
statement another scan
a.
the
the
of a conflict
does
Thus, for
WRITE(6, 12)
12
FORMAT(///4HABCD)
produce
there
specification
the
to
determine
processed.
list
takes
If
there
is
rescanned.
FORMAT
appropriate
not
require
example,
three
are
no more items
the
READ
final
right
If
following
item
is
place
as follows:
are
no
specification processor conversion between a specification
a I ist
blank
has
or
WRITE
parenthesis
if
all
the
list
the
present,
parenthesized
requests
item
(i.
the
statements
records
remaining
been
found,
statement
of
list items
has
been
RE~r
an
additional
and
proceeds
e.,
and
a FORMAT
(including
exhausted,
WRITE
groups
(i.
e.,
a I
isf
H, " X,
one
record
in
the
the
current
that
statement
record
of
specifications
F,
E,
D,
item.
with
and a data
T,
containing
list
and
record
initiated
statement
those
to
the
that
is
begun,
G,
If
one
the
next
P,
or
the
the
be
current
initiated
I,
L,
A,
or
more items
field
type,
an
/),
it
is
ABCD
final
right
is
terminated,
input/output
is
encountered
used
as
values
record
the
and
the
within
the
R,
Z,
M, or N
remain
specification.
error
occurs.)
processed
before
reaching
parenthesis
and
control
operation.
by
the
of
N in
is
terminated,
il1put/output
FORMAT
FORMAT
specifi
in
the
(If
conversion
If
the
whether
the
has
is passed
FORMAT
adjustable
and
operation.
statement
statement,
cation)
I ist,
the
processor
is
next
specification
or
not
another
final
right
been
reached
to
the
processor, a test
specifications)
control
However,
is
rescanned.
the
is passed
entire
is
to
be
not
possible
I ist
parenthesis.
or a con-
statement
to
if
The
FORMAT
pro­per-
is
item
is have the
re-
one
b.
If
one
or
more
parenthesized parenthesis the
following
was
the
example,
last
groups
one
encountered
the
rescan
do
appear,
begins
prior
at
however,
to
the
point
the
the
final
right
indicated.
rescan
parenthesis
is
started
with
the
of
the
FORMAT
FORMA T
group
and
whose
statement.
list
Interfacing
right
In
57
FORMAT{3X,{F7.2,A5),{X
I I I I I i
'ABC'3(3I4,2(G
15.7
II
//),R3)),E20.12,3HXYZ)
c.
6.
Each list with
7. Each least
statement
8.
The same rules pie
If
the
group
peat
count
value
new statements
5 FORMAT( A4 /
are
equivalent
5 FORMAT(
item
the
exception
READ
or
one
adjustable
wi
records in
is used
of
PRINT
PRINT
to
WRITE
II
be
apply
these
at
which
again
N is
not
5,
CODE,
to
the
5,
CODE,
A4/
be
converted
of
complex
statement
or
conversion
processed,
to
DECODE
cases
1 1 1
rescan
begins
here.
the
rescan
begins has a
for
each
rescan. In
supplied when
5,
(A(J),
N(G20.8)
statements
(A(J),
5(G20.8)
is processed by data,
containing a non-empty
but
an
and
is
described
J=
)
J=l,
)
whichare
(see
step 4 above)
error
wi
ENCODE
under
the
50)
last closing parenthesis
of
internal
group.
repeat
count
particular,
rescan
takes
place;
1,50)
one
specification
processed
1\
occur.
operations
"Memory-to-Memory
by
two
list must
specification.
as
final parenthesis
of
FORMAT.
(r) in front
if
the
the
or
one
such-specifications.
refer
to
READ
Data
of
repeat
count
old va lue is used. Thus for
iteration
to a FORMAT
If
this
condition
and
WRITE.
Conversion".
right
it,
the
previous
was
specified
of a repeated
statement
is
The
value
of
with
example,
specification,
that
contains
not
met,
the
interpretations
the
re-
an
N,
the
FORMAT
of
multi-
a
at
FORMATs
As
mentioned specifications a string of
READ with
WRITE
while
WRITE
If
the
the
externa
Stored
characters),
or
WRITE
no subscripts. For
(4,
(4,
variable M is
in
previously,
enclosed
statements
R)
E,
F, G
R(l»
E,
an
I stri ng
(F8.5,4HNAIL,I3)
and
the
statements
READ
(N,90)(M(I),I = 1,4)
90
FORMAT
Alternatively, M could Care
must
In
these
cases,
be
(4A4)
taken
all
when storing
characters
Arrays
a FORMAT, therein, usually
that
example,
F,
G
integer
be
a dummy
including
may
be
stored in
by
use
of
an
refer
to a FORMAT stored in
refers
to
a FORMAT stored in
the
following
FORMAT
refers to a
array,
1
J
array
corresponding to a
into
an
array
in
the
string s,
the
an
input
statement
are
a FORMAT
including
beginning
array.
statement
are
two methods
equiva
lent
containing
blank
left
parenthesis,
The FORMAT must
or
an
assignment
an
array
must
reference
an
array
R,
whose
location
that
may
the
TO
f
1
literal
constant
characters,
argument (see IIArguments and Dummies
specifications
are
the
final
right
parenthesis,
be
stored as a
statement.
only
has
been
be
used to store a FORMAT in M:
statements
M(l)
'1'
/'l'
1"11.L.)
M(3) M(4)
of
significant,
Hollerith
the
identifier
ASSIGNed
4H(F8.
I.TTe
'.'n
"'tn.J,"'tn
4HNAIL 4H,I3)
the
nHs
while
to R(l).
and's' blank
and
string
(i.e.,
of
the
array,
forms.
characters
the
ll
).
58 FORMATs Stored in Arrays
are
insignificant
instead
Element
M(l)
M(2)
14(3)
M(4)
which
(F8.5,
where'G
of
integer,
is not
the
4Ho'G'O'O,
represents
in
all
the
Storage
(F 8 •
5,4Hf>f)"of>
NAIL
,I3)'M>M>
desired
NA,
the
other
specifications.
following
after
'Df>'Df>
1>f>f:l'f)
result,
I, L,I3)
character
results
READ
since
blank.
it
would
is
For
example,
occur:
equivalent
to
if
the
M in
the
FORMAT
above
READ
statement
were
double
precision
Even though a FORMAT may
(I8)
it
must
be
stored in
able
(or
an
array
rather
than
as
Extended
The
statements
"Memory-to-Memory "Direct "Random
are
optional
that
the
Input/Output
Input/Output"
Access
features
FLAG system
Memory-to-Memory
The
statements
an
ENCODE/DECODE
an
input/output integer in FORMAT
These
array.
an
ENCODE/DECODE
being
statements
ENCODE(c, or ENCODE(c,
an
element)
if
the
scalar
described
Input/Output within
avai
ENCODE
operation,
list
and
an
Whereas
used, records
have
the
f, s,
f,
an
s}
array.
below
Data
and
operati
n}
be
quite
short,
It
may
will
be
treated
contained
the
Capabilities
under
the
Data
Conversion"
Statements"
the
FLAG
lable
for
their
Conversion
DECODE
however, internal external
form
k
k
on may
after
buffer
record
the
such
as
not
be
stored
as
though
FORMAT.
headings
language.
use
includes
are
similar
no
actual
area.
This
has a certain
be
specified
first
record
DECODE(c, f, s,
or
DECODE(c, f,s) k
in a
the
scalar
Programmers
these
optional
to
formatted
input/output
buffer
area
physical
by
the
programmer. When
follow
each
n}
scalar
were
wishing
(BCD)
other
k
variable, assigned
to
statements.
WRITE
takes
place;
is
specified
length,
in memory in
since a reference
the
location
use
any
of
these
and
READ
data
by
the
programmer
the
length
of
mu
Itiple
order
of
a FORMAT
statements
statements,
conversion
the
simulated
records
of
increasing
to a
scalar
statement,
should
respectively.
takes
place
and
is
usually
internal
are
specifi
storage
vari-
ensure
between
an
record
ed
by
address.
In
the
where
c
defines
subscripted
specifies
array
indicates
element,
n is
of
k is a comma may
the
a FORMAT
in
which
the
or a scalar
an
optional
characters
an
input/output
optionally
number
variable.
a FORMAT has
first
integer
actually
of
characters
statement.
element
variable.
variable
processed
I ist
of
precede
been
or
starting
the
usual form,
the
Extended
per
internal
It may
stored.
location
into
which
(generated
list k.
Input/Output
be
and
record.
the
statement
of
will
or
scanned).
the
be
It
internal
stored,
Capabi
may
be
an
integer
label
of
a FORMAT
buffer.
upon
completion
lities/Memory-to-Memory
It
constant
may
of
or
statement
be
an
array
the
operation,
an
or
name,
Data
integer
the
non-
name
of
an
array
the
number
Conversion
an
59
Thus,
the
ENCODE/DECODE
statements
can
be
illustrated
as
r
r ENCODEl
lOECODE
Characters
fied as record;
ENCODE
The ENCODE specified
If
the extra necessary operations, {generated}
For
example,
3 FORMAT(2H(F
in
the
starting
in
other
Statement
by
number of
characters
to
K
=
12
L=5
ENCODE(l2,
I
the
words,
statement
f,
and
characters are
fill
the
the
first
into
it.
the
(characters,
buffer
are
location.
at
causes
to
be
placed
lost;
they record, thing
following
3,
M)
K, L
,
I,
processed
When a new
character
the
in
generated
are
it
is
filled
done
with
statements
1H. ,
format,
not
start,
at
the
c +
1.
list items to
storage
by
the
filled
out
each
record
might
I,
1H)
count) jist
rate
of
record
is
It
is
recommended
be
beginning
FORMAT
into
the
with
trailing
is
be
used
)
four
per
begun,
converted
at
location
statement
following
blanks.
to fill
it
to
create,
word
without
it
starts
at
that c be
to
BCD
character
s.
is
greater
record.
In
fact,
with blanks;
for
later
regard
to
the
type
of
the
first
character
an
integral
than
If
fewer
on
this
use, a FORMAT stored in
multiple
strings,
the
specified
characters
ENCODE
is
done
following
according
are
operations,
before
any
of
size
the
variable
the
four
characters.
to
the
of
the
generated
as on
characters
the
array
speci-
previous
FORMAT
record,
than
are
WRITE
are
stored
M:
the
BCD
FORMAT so
The
(F
12n.
where b represents
DECODE
The DECODE specified
As
with formatted
ified
by
the
new record
If
n
is
specified,
can
be
very INTEGER KARD(80), DAVE/DAVE READ
4 FORMAT(20A4)
DECODE(80,5,
5 FORMAT(A4,
IF
6 FORMAT(NX, NF)
created
would
56)niSiS
the
character
Statement
statement
by f,
and
count
is
begun
useful. The following
4,
KARD
(KODE
stoied
READ
(c),
only
it
will be
I)
.EQ.
causes
operations,
the
when
KARD,
DAVE)
into
occupy
the the
extra
specifically
set
to
NC)
bl
characters
the
first
ank.
character items in list k.
if
the
example
string
the
FORMAT
are
requested
number
of
makes use of this
1/
KODE, J
DECODE(80,6,
three
elements
beginning
statement
assumed to
by
characters
KARD)
of M and
at
location
requires more
be
blanks;
the
FORMAT (see "FORMAT and
scanned.
feature:
NC,
J, (A(I), 1=1, J)
would
s to
they
When
appear
be
characters
are
not
scanning
as
decoded,
obtained
according
from a record
from
list
with widthless formats, this
to
than
the
next
Interfacing").
the
FORMAT
are
record. A
spec-
The
above
statements
DAVE
2,
Note
that,
in
DECODE
way
60
Memory-to-Memory
essentially
because
it
1.
75,
the
above
initially
could
be
used to
80.91 example,
provides
fills its buffer with blanks.
Data
Conversion
the
capability
the
read
records
first DECODE
of
"reading
of
the
statement
the
form
card
is
used twice".
to
decide
how to
ENCODE
interpret
cannot
be
the
used in
rest
quite
of
the
the
card.
same
Direct
FLAG
provides
BUFFER
which
have
1.
They matted binary, environment. extension into tions giving
Input/Output
the
facility
IN
and
BUFFER
two
major
capabilities.
permit
the
processing,
READ
and
WRITE
READ
and
WRITE
That
of
computer
fixed-length
manual).
the
physical
The
programmer
to
perform
statements
statements
is, in FORTRAN,
memory,
BUFFER
complete
OUT
both
and
records
IN
and
asynchronous
on
that
control
input/output
input
and
output,
handle
records
process
as
BUFFER
information
binary
information
such,
binary
comprise a logical
OUT
over
the
of
only
records
routines,
data
and
operations
records
up
to
that
is
considered
have
record
however,
enabling
of
132
is
intended
special
(see
through
arbitrary
characters
for
to
be
ized
the
XDS
process
him
to
the
two
length
and
in
length,
communication
a form
of
control
information
do
Sigma
such
information
5/7
things
library
routines
format.
and
unformatted,
only
intermediate
FORTRAN IV
exactly
as:
Ordinary
with
a FORTRAN
storage,
and
are
as
specified,
for-
or
an
broken
Opera-
2.
The
and
where
interpret read in
conjunction
BUFFER ables output the
BUFFER
CALL
CALL
u is
m
w
n is
IN
the
is
program.
IN
BUFFER
BUFFER
an
device
is
if
m=O,
indicates
also
specifies
of
positive
is
an
is
indicated
optional, the in progress. In n is
binary
and
write
and
BUFFER
programmer
taking
place,
and
BUFFER
IN(u,
OUT{u,
integer
on
which
an
integer
the
the
be a scalar.
the
val
integer
as
1 =
operation
2 =
successful
3 =
end-of-fi
4 =
operation
number
of
normally
tapes
produced
binary
cards,
with
the
ENCODE
OUT
to
initiate
and
to
OUT
m,
s, w, i,
m,
s,
w,
constant
constant
mode is BCD;
starting
number
ue.
scalar
follows:
but
words
general
equal
or
the
operation
or
location
It may
of
into
incompl
compl
I e
encountered
complete
when
specified
actually
to
w (see below)
this
on
and
proceed
subroutines
n)
i,
an
be words to
which
etion;
in
an
operation,
test
the
n)
integer
is
to
an
integer
otherwise,
of
of
any
is
ete
no
but
error
is
input
count
other
machines
and
DECODE
parallel
continue
status
of
the
are
called
nonsubscripted
be
performed.
nonsubscripted
the
mode is
the
internal
type,
although
be
input
or
dynamically
errors
has
occurred
an
integer
or
output.
is
significant
statements,
with
the
BUFFER
in
the
buffer.
output,
stored
scalar
It
is
only
or
by
program
with
IN
following
variable
variable
binary.
integer
starting
an
into
not
for
other
programs,
process
and
computation
or
BUFFER
fashion:
that
that
(An
integer 0 or
Normally,
is
recommended
at
s,
indication
which
is
continuously
BUFFER
IN
long
formatted
other
input/output
and
other
OUT
specifies
determines
s is
the
and
must
of
the
status
stored,
upon
set
up
operations;
processing
operation
the
logical
the
1 is
customary.)
identifier
for
ease
be
an
of
completion
lion
the
in
records.
operations.
at
some
unit
mode
of
of
an
of
manipulation.
integer
the
operation.
flyll as
BUFFER
while
later
number
the
operation;
array,
constant
of
the
the
operation
OUT
This
en-
the
input/
point
in
of
the
but
it
may
or
scalar
The
status
operation,
operations,
is
Thus,
the
BUFFER
CALL
BUFFER
{
BUFFER
IN/BUFFER
IN
}
OUT
OUT
(unit,
calls
mode,
can
start,
be
illustrated
words,
as
indicator,
count)
Direct
Input/Output
61
I
I
A
BUFFER into, ing
location
It
is
permissible
device,
or
written
including
IN
of
or
from,
the
to
BUFFER
consecutive
buffer.
intermix
intermixing
OUT
operation
That
asynchronous
on
always
words
in
iSI the
variable s merely
the
same
results
memory
operations
unit~
with
and
in
the
no
specifies
standard
processing
regard
to
the
READ/WRITE
of
the
type
starting
only
of
one
physical
the
variable
location.
operations
in
any
record.
specified
order
Data
as
and
is
the
on
read
start-
any
BUFFER
A
in
words pearing words
When
of-file.
The despite
Example:
The record
IN
call
on
BUFFER
the
specified
are
specified
in
the
are
present
an
end-of-file
No
error
status
the
following
length:
INTEGER
1 CALL
2
GO
3 M = MIN
PRINT
GOTO
4
STOP
5 FORMAT (/X, ILENGTH = I
IN
causes
mode.
by w than
record
are
on
the
is
data
will
will
be
error,
and
can
statements
BUFFER
BUFFER
TO
IN
(2,3,4,3,),
(N,5000)
5,
M, (BUFFER(K), K =
1
data
The
actual
changed
record
read,
be
read
indicated
be
could
(5000)
(5,
1,
J
to
number
are
actually
in memory,
than
i is
set
into
memory
when
used
if
be
used
BUFFER,
1,
1/
be
read
of
present
are
speci
to
3;
magnetic
upon
an
irrecoverable
the
programmer
to
list
5000,
J,
M)
(X, lOZlO))
into
memory from
words
in
and
that
fi
ed
by
encountering
binary
N)
entered
the
fact
w,
the
tape
chooses
tapes,
the
into
physical
will
extra
units
will an
error
occurs.
to
in
hexadecimal,
specified
memory is
record
be
reflected
words wi II
remain
end-of-file.
ignore
the
unit,
the
minimum
that
is by be
positioned
However,
error.
ten
beginning
read,
only
the
value
lost,
and
immediately
the
data
words
of
per
at
wand
the
of
n wi
will
line,
the
number
n.
II
be
be
preceded
location
n.
That
of
However,
greater
following
read
into
specified,
is,
if
words
if
more
than
the
memory
by
the
more
ap-
w.
end-
62
BUFFER
A
calion
fied
mode.
record
on
attempt
If
the
indicator
has,
nonetheless,
As
mentioned
statement.
records
it
expects
logical
Note
that
ment
using
size
of
magnetic
Direct
OUT
BUFFER
The
number
the
device
to
write
30
variable
above,
This
has
created
record
by
to
find
{which may
the
output
IAI
format.
tape
Input/Output
OUT
being
words
been
records
one
BUFFER
the
control
produced
records.
causes
of
words
used,
on a card,
{i}
has
.written
written
important
OUT.
words
consist
However,
data
to
requested
in
which
been
on
the
ramification:
It
can be used
generated
of
several
in
BCD
this
be
written
in BCD,
set
to
specified
in
binary
by
BUFFER
does
from memory,
is
always
case n will
would
indicate
device.
by
BUFFER
the
to
backspace
by a binary
physical
OUT
not
include
written,
be
less
result
in n
an
error,
OUT
BACKSPACE
WRITE
records}.
is
virtually
carriage
beginning
unless
it
than w (it
being
set
an
irrecoverable
are
not
statement
over
any
statement
identical
control
is
can
the
kind
on
with
larger
never
to
20.
same
may
of
so
to
printed
the
specified
than
the
be
greater).
write
error
as
those
not
be
BCD record Sf
that
it
may
that
produced
output
location,
maximum
has
produced
used
to
but
backspace
by a
or
any
size
For
example,
occurred.
by a binary
backspace
in
binary
over
BCD
restrictions
in
the
speci-
of a physical
an
The
data
WRITE
over
binary
records
the
entire
WRITE
state-
on
the
Example:
The
statements
INTEGER M(40)
1
READ
2
FORMAT (20A4)
CALL
3
IF
below
(105,2)
BUFFER
(INDIC < 2)
could
M
OUT
GO
be
(106,
TO
used
1,
3
to
M,40,
read
INDIC)
BCD
cards
and
pack
them
onto
binary
cards.
GOTO
Note
that
FORMA T
Random
FLAG a Ilows full use
READ
where
u is
k is
Random They
differ
1. They
and
the
reference
to
be
Access
DISC
an
the
disc.
is
also
(see
below).
an
access
from
refer
ENDFILE
1
scanned
u,
s, k
integer
an
input/output
input/output
the
to
random
operations
to
the
array
twi
ce.
Input/Output
of
random
constant
integer
standard
access
WRITE
constant
I ist,
operations
binary
access
are
or
nonsubscripted
as
files
not
M in
the
READ
Statements
devices
DISC
or
nonsubscripted
described
are
READ/WRITE
rather
applicable
through
u,
s, k
previously.
performed
statements,
than
to
to
statement
util
integer
integer
in
binary,
sequential
them.
causes
ization
variable
variable
however,
files.
of
whose
and
two
the
therefore
cards
(40 words)
following
value
specifies
whose
value
do
not
in
two
ways:
Consequently,
to
be
read
two
statements.
the
logical
defines
the
starting
reference
the
a FORMAT
REWIND, BACKSPACE,
and
unit
causes
number
disc
address
statement.
the
of
2. Information is control specified bound
by
one
and
As
an
analogy, element to-Memory
In
READ
DISC
by
s. Reading is from
With
WRITE
at
the
location
The
value
of
Auxiliary
The
following
not
thought
words or
only
or
DISC
s may
record
in
the
input/output
the
binary one
READ
the
group
of
Data
Conversi
statements,
the
statements,
defined
be
considered
READ/WRITE
disc
elements
words
appropriate
by
s.
Input/Output
set
of
statements
of
as
being
boundaries.
statement.
may
be
on
II)
are
the
to
As
list.
With a knowledge
restriction
thought
in
any
random
.
read
into
device.
binary
word
be
an
Statements
enables
the
broken
into
unit
many
locations
that
the
of
as a one-dimensional
order,
much
the
items
defined
values
of
the
address
relative
programmer
to
records.
of
the
disc
of
the
required
data
written
as
in
by
list
items
to
the
start
manipulate
Random
Data
by
array,
an
ENCODE
the
are
of
magnetic
Access/
is
processed
or drum
sizes one
from
list k,
written
the
are of
WRITE
which
or
starting
on
user1s
tapes
Auxi I
exactly
used
various
statement
DECODE
from
the
file.
and
iary
as
specified,
as
are
required
items
the
must
it
is
possible statement
the
disc
appropriate
sequential
Input/Output
with
for
the
items
programmer is
be
input
with
to
select
an
(see
II
Memory-
location
device,
disc
defined
starting
files.
Statements
no
not
63
REWIND
This
statement
REWIND i
where
i is
Statement
is
an
unsigned
expressed
integer
as
constant
or
integer
variable.
Execution
BACKSP
The
where i is
When a BACKSPACE record. record
REWIND
END
This
where mark
Sometimes, cal
wind
the such
of
a REWIND
ACE
Statement
BACK
SPACE
BACKSPACE i
an
unsigned
For
binary
is
interpreted
and
BACKSPACE
FILE
Statement
statement END
i is
is
unit
their
monitor will
devices.
FILE
an
to
be
it
number
tapes
causes
i
unsigned written.
is
statement
desirable
to
at recognize
statement
has
the
integer
statement
tapes, a logical
as
end-of-file
integer
some
the
end
all
the
statements
to
take
other
of
this
constant
is
information
constant
device,
the
anomaly
causes
the
unit
whose
form
or
integer
executed,
record
that
are
marks
to
be
or
integer
a program
such as a I
job, it is permissible to
and
variable.
the
unit
may consist
output
by
executed
written
variable
that
has ine
handle
the
referenced
one
on
been printer.
logical
of
more
binary
for
tapes
the
specified
whose
written
specify
situation
unit
number is i
by
the
integer
than
one
WRITE
statement.
already
unit,
value
determines
for
output
Since
such programs
an
ENDFILE
appropriately.
to
value i is
physical
positioned
and
has
on
magnetic
or
It
be
rewound.
backspaced
record.
the
often
REWIND
is
In this
at
IIload pointll
the
form
unit
on which
tape
write
operation
not permissible to BACKSPACE
one
case a logical
have
an
and
assign
end-of-fi
on
any
logical
no
end-of-file
that
Ie and
effect.
logi-
re-
device;
64
Carriage
The first certain
character
characters:
Character
o
If
one
of
these
left
one
position.
Any
other
record
is
printed;
printing)
Carriage
cannot
Control
in
characters
For
character
the
be
Control for
for
Printed
an
output
Effect
to
Skip Space
two
is
example,
appearing
record
performed
Printed
Output
record
first I
lines
present,
the
as
the
remains
without
Output
that
ine
of
page
before
it
is
replaced
second
first
unchanged.
hampering
is
intended
before
printing
character
character
the
for
printing
printing
by a
blank
before
is
printed
in a record causes
This
includes
printing
the
speed on
may control
the
record
in column 2.
the
carriage
11+11
character,
all
lines.
the
is
printed.
printer
to
be
whose
carriage
The record
single
spaced
traditional
by
containing
is
before
function
not
shifted
the
(over-
7.
DECLARATION
STATEMENTS
Declaration
allocation,
Note:
[
Classification
An
The which way
Implicit Declarations
Unless
statements
1. When appl
2.
3.
4.
5.
6.
7.
statements
initial
All
declaration
order
given
identifier
scalar array subprogram COMMON
category
the
other An An
parentheses.
An
list
otherwise, An
statement
An
does
Library functions type
may
into
the
identifier
identifier
specifically
are
implicitly
icable,
letter identifier identifier
identifier
enclosed
identifier
(i.e.,
identifier
appear
is not
block
(implicit
it
equivalent
are
used
values
of
statements
at
the
end
of
Identifiers
be
classified
which
an
appears
is to
be
classified.
declared
classified
an
identifier
type
that
is
called
is a function
This does
is a
statement
in
parentheses.
is
an
error.
is
classified
other
is
implicitly
in a
COMMON,
have
to
to
variables,
discussed in
of
the
as
referring
identifier
in
the
to
be
classification
with
subprogiam
not
apply
function
Again,
as a scalar
than
followed
classified
an
inherent
implicit
define
the
data
and
to
provide
this
chapter.
to
any
is
placed
and
program. These
in a
particular
according
is
a CALL
to
It must
EQUIVALENCE,
type.
to
the
integer
if
it
may
statement
if
it
appeOis in
declared
definition
also
comply
this
does
not
variable
by a
left
as a scalar
type
associated
Chapter 8 contains a complete
type
of
similar
chapter
of
the
following:
the
type
appearances
category
following
begins
be
altered
is a subprogram.
arrays.
if
it
appears
with
apply
if
it
makes
parentheses
if
it
does
or
NAMELIST
with
variables
information.
are
subject
(if
any)
constitute
or
type,
set
with
I,
by use
an
expression,
to
the
rules
to
declared
any
or in a CALL
not
them,
and
to
associated
identifiers
of
rules.
J, K,
L,
of
the
the
left
given
arrays.
other
appear
statement. as
shown
functions,
the
rules
with
explicit
that
M,
or
N.
IMPLICIT
followed
of
an
equal
in
Chapter 8 under
appearances
statement).
in
an
executable
in
Table
description
the
dimensions
for
statement
it
depend
or
implicit
appear
by
in
It
is
real
statement).
an
argument
sign,
within
6 (see
of
these
placement
on declarations
executable
if
it
followed
11
Statement
an
executable
or
DATA
Chapter
functions.
of
arrays,
the
contexts
begins
jist
enciosed
by a dummy
statement,
8).
storage
and
in
of
the
or
DATA
with
any
in
FunctionslJi
or
DATA
but
Inherent
Explicit Declarations
All
other
declarations
in
any
way
other
array
declarations
type
dec
larations storage a !location subprogram subprogram
Conflicting and Redundant Declarations
Except
and
may not
real
where
conflict.
type,
specifically
or
are
than
those
declarati
dec
larations
definitions
For
example,
defined
explicit
noted
as
declarations.
described
a subprogram in more
ons
to
an
the
above.
contrary,
identifier
Explicit
may
Explicit
declarations
definitions
not
be
than
one
declarations
and
declarations
both
a subprogram
place,
etc.
are
include
required
of
the
name
in
order
classification
and
an
array
to
classify
of
an
name,
Declaration
an
identifier
identifier
both
integer
Statements
65
Array
Declarations
Array
dec
larations
explicitly
define
an
identifier
as
the
name
of
an
array
variable
and
have
the
form
v(dl, d2,
where
v is
the
n
is
the
d.
is
an
I
to
seven
may
Array
dec
larations
DIME
NSION Explicit C
aMMON
Examples:
x (10)
ARRAY (5, 15, 10) CUBE
(4,7)
DATA
(4,3,6,12)
Array
Storage
Although
array varies
(i.
an
elements
with
the
e.:
2-dimensiona I arrays
d3,···,
identifier number
unsigned
be
type
array
dn)
of
dimensions (see
scalar
may
statements
statements
statements
may
in
sequence
highest
of
the
array
dimensions
integer
variables
that
instead
appear
have
frequency,
in
several
(from low address
are
stored
associated
defines
"Arrays"
of
dimensions,
the
next
"column-wise").
with
the
array
the
maximum
in
Chapter
integers
storage
leftmost dimension
3).
(see
"Adjustable
it
is
placed
toward high address
value
of
When v is
in
varies
Figure 2
the
corresponding
a dummy
Dimensions" in
storage
as a linear
with
illustrates
array
storage),
the
next
array
dimension. Arrays may
in a subprogram, d1 through d Chapter
string.
such
highest
storage.
8). n
This string
that
the leftmost dimension
frequency,
have
contains
and
so forth
up
the
References
References clared
for the
ber
of subscripts
to
to
Array
array
array
are
Elements
elements
(except
treated
array
A(3,
2.
Element
A(l,l,1) A(2,l,l) A(3, A(1,2,l} A(2, A(3, A(l,3,l) A (2, A(3, A(1,1,2) A(2,l,2)
A(3,l,2)
A(1,2,2)
A(2,2,2) A(3, A(l,3,2)
A(2,3,2)
A(3,3,2)
Array
of
subscripts
Item
1
2
3
I
4
5 6 7
8
9
10 11 12 13 14
15 16 17 18
Figure
must
contain as discussed for EQUIVALENCE as errors.
the
number
3,2)
1,
1)
2,1)
2,
1)
3,
1)
3,
1)
2,2)
Storage
corresponding
statements).
to
References
the
that
number
contain
of
dimensions an
incorrect
de-
num-
66
Array
Declarations
Furthermore, the
array
declaration.
the
array.
the
value
of
each
subscript should
Otherwise,
the
references
be
within
may
not
the
be
range to
data
of
the
belonging
corresponding
to
the
dimension,
set
of
elements
as
specified
that
in
comprise
[
[
[
DIMENSION
This
statement
DIMENSION
where a
lIocation
DIME
DIMENSION
IMPLICIT
This
statement
Dec
larati
IMPLICIT
where
each
and
c.
J
An IMPLICIT
be
overridden
Statement
the
Vi
are
of
the
NSION
Statement
l1.
ons
C.
is a type
I
type(c
type
is
INTEGER REAL COMPLEX
LOGICAL DOUBLE PRECISION DOUBLE COMPLEX
is a
character
Z,
declaration
is used
only
to
v1' v2' v3'···,
array
declarations
arrays
dec
lared.
MGO(l7), L TO(15), AD(184),
is used
It has
l'
c2, c3,
one
single
A-G,
by
an
must
X(2,3,
to
alter
the
form
convention
...
of
the
six
alphabetic
follow
M-N,
may
explicit
,c
define
v n
the
conventions
of
m)
type
character
the
S
override
type
declaration
the
dimensions
as
described
For
example:
BB(36,22, 34)
4,5,
10), PETROL(5,6)
the form
declarations/
or
first
in
alphabetic
the
normal
of
arrays,
previously. A DIME
for
implicit
two
such
sequence.
(IJKLMN)
(see
below).
and
typing
characters
rule
As
has
from
separated
For
of
an
example,
the
form
NSION
the
IJKLMN
example,
implicit
statement
rule
by
a dash (minus
type
classification.
the
statement
does
not
discussed
affect
under
sign);
the
It, in
the
type
I1Implicit
second
turn,
or
may
IMPLICIT
would
cause
1.
Identifiers
2.
Identifiers
3.
Identifiers
integer.
4.
Identifiers
5.
All
The
statement
IMPLICIT REAL(A-Z)
would
cause
t
..
Optiona I Size
complex
other
types.
the
identifiers
all
COMPLEX(C),
following beginning beginning beginning
beginning
identifiers
Specifications"
implicit with C are with with
with K are
are
LOGICAL(T,
type
T, F, H,I,J,
rea! (normal
to
be
real
later
conventions
complex.
L,
M,
or N are
or
Ware
integer
convention).
unless
in this
F,
L-N),
logical.
integer.
(normal
explicitly
chapter
INTEGER(H-J,
to
be
in
force:
The I and J are
convention).
declared
describes
otherwise.
the
W)
redundant
declaration
here,
because
of
double
DIMENSION/IMPLICIT
precision
these
and
are
normally
double
Statements
67
Whilean For
exampl
implicit
e,
the
type
declatation
statement
may
be
redundant,
it
must not
conflict
with
any
other
implicit
type
declaration.
iMPliCIT
is ill
egal
An IMPLICIT
Explicit
These
statements
where
type
[
S.
I
REAL(A-Z)
because
Type
REAL
enclosed
N is
declared
statement
does
Statements
are
used
to
is
one
of
the
declaration/
INTEGER
DOUBLE PRECISION
is a type
ration.
type
specification
Optionally, a scalar,
in
slashes,
specification
I iNTEGER(N)
to
be
both real
not
affect
the
define,
for
may
explicitly,
that
the
purpose
take
any
is
array,
and
types
of
the
COMPLEX
LOGICAL
DOUBLE
either
the
or
of
defining
of
the
following
integer.
basic
external
type
of
COMPLEX
identifier
array
declaration
initial
an
identifier.
of a scalar,
values
forms:
library
may
functions.
They
array,
be
followed
for
the
have
the
function,
by a
variables.
form
DATA In
or
other
is
an
constant
array
words,
decla-
list
each
For a
descdption
Note
that
REAL
initializes
DA
initializes
Exampl es
COMPLEX
LOGICAL
INTEGER
INTEGER
identifi array identifier/DATA array
X,
Y,
only
Z,
TAX,
Y,
X,
Y,
of
expl i ci t type
GEORGE,
ROOT,
er
declaration
constant I ist/
declaration/DATA
of
DATA
constant
Z/3.7
/
while
Z/3.7,
3.7,
and
Z.
statements:
C3,ALPHA,CARRY(5,5),
BINARY, BOOLE(4,
NETRTE(9)/O,l,l,2,3,5,8,
PP
lists,
3.7/
4,
constant
and
their
XYZ
4,
4),
list/
function,
TRUTHF
see
13,
21/,MASS/O/
"DATA
Statement"
later
in this
chapter.
tSee
also
"Optional
68
Explicit
Type
Size
Statements
Specification
II
in
this
chapter.
An
explicit
in
combination
indicated:
type
declaration
IMPLICIT LOGICAL{L-P) REAL
LEVEL,
with
PERCNT
the
standard
overrides
implicit
any
implicit
typing
declaration.
rule,
would
cause
Thus,
the
the
statements
following
identifiers
to
have
the
types
[
LEVEL3
LEVEL
KAPPA
POROUS
PERCNT -
X
Optional
In
addition
data.
This
*n
where
n is
the
case
of
option
is
used
Type
logical
-
-
real
-
integer
logical
-
real
real
-
Size
Specifications
to
the
standard
option
takes
the
number
integer
to change
of
and
type
the
form
bytes
logical,
ieci
to
Standard Size
(bytes)
declarations,
occupied
only
the
double
by
the
standard
piecision
Optional Size
an
data
size
and
(bytes)
optional
(there
is
permitted,
complex
are
form
four
to
is
provided
bytes
and
double
that
in a
word,
the
option
complex,
specifies
and
has
as
shown
eight
no
the
bits
effect.
below.
exact
in a
byte).
However,
size
of
In
this
the
Integer Real Complex
Logical 4
Double
cal
The in fies,
1.
precision
to
complex
INTEGER*4 REAL*4
REAL*8 COMPLEX*8 COMPLEX*16
LOGICAL*4
*n
modifier
Chapter
depends
In
the
data
may
8),
and
on
the
IMPLICIT
IMPLICIT REAL*8{I-K),
data
with
appear
explicit
statement,
statement,
4 4 8 8
are
identical
size
INTEGER REAL double COMPLEX doubl
LOGICAL
in
type
to
specification
precision
e compl
ex
three
kinds
statements.
as
follows:
the
*n is
INTEGER*4(A-H),
real
of
appended
16
data
with
of
16
bytes.
statements:
This
size
podtion
to
the
specification
Thus,
IMPLICIT
of
type
LOGICAL(L,
statements,
the
*n
declaration
of 8 bytes;
relative
N)
FUNCTION
to
the
word,
double
type
as
in
complex
statements
declaration
data
that
are
identi-
(discussed
it
modi-
Optional
Size
Specifications
69
2.
3.
In
the
In
explicit both. vidual over
FUNCTION
REAL
FUNCTION
COMPLEX
type
When
appended
size
specification
the
* n
appl
statement,
MULT*8(X, Y,
FUNCTION
statements,
to
of
yi
ng to
the
the
*n
CNVERT* 16(C)
the
*n
can
the
type
word,
their
own.
whol e
statement.
is
appended
Z)
be
appended
the
In
other
*n
For
to
the
to
holds
words,
exampl
the
for
name
all
the
e:
of
the
type
word,
identifiers
*n
appended
function,
or
the
listed,
to
an
rather
than
identifiers
excepting
identifier
to
being
those
takes
the
type
declared,
with
an
precedence
word.
or
indi-
In
the the
second
element
Storage
These
statements allocation The
storage
COMMON
EQUIVALENCE
To
make
by
each
type
Tvne
"/1-
-
integer real double complex doubl e compl logical
COMPLEX*8
LOGICAL
first
example example
of
array
Allocation
are
information
allocation
statement
proper
use
of
of
variable.
precision
ex
CUM,
LAUDE*
FLAG(lO), TRUTH*4(1O)
CUM
and
FLAG
FLAG,
and 4 bytes
and
16
LAUDE
TRUTH
are
per
Statements
used
to
is
provided,
statements
statement
the
storage
The
arrange
variable the
are
allocation
following
Words
2 2
4
compiler
table
both
are
arrays,
element
storage
statements,
indicates
of
type
each
are
in
special
allocates
it the
complex;
having
required
ways,
all
is
often
standard
CUM
10
elements.
for
array
as
variables
necessary
size
has 8 bytes,
TRUTH.
required
within
to know
associated
Four
by the
while
bytes
the
programmer.
program
the
amount
with
each
LAUDE
are
in
type.
has
required
an
arbitrary
of
storage
16. In
for
If
no
each
storage
order.
required
COMMON
The storage
The
where
70
Storage
Statement
COMMON
provides
COMMON
COMMON
the
w.
have
I
/c/v
where
c is Vi
Allocation
statement
a means
statement
w1 w2 w3
the
, v2'
1
either
is a scalar,
is used to
by
which
has
...
form
v3,···,
Statements/COMMON
v m
the
array
identifier
the
wn
assign
more
form
name,
variables
than
one
of a labeled
or
array
Statement
to a region
program or subprogram may
COMMON
declaration
of
storage
block
or
is
called
reference
absent,
COMMON
the
indicating
storage.
same
blank
COMMON
data.
COMMON
When all
other
W1
(the
first
places,
specification
blank
COMMON
in
the
statement)
is
indicated
is to
by two
specify
blank
consecutive
COMMON,
slashes. For exampl
the
slashes may
e:
be
omitted.
In
COMMON
For
each
specification MON. GHIA, block
Label
Labeled
other
Any cutable All needed
The type of a labeled
The
and
GROUP3.
ed
COMMON
COMMON
and
blank
labeled
program (see
labeled
by
variables
or
number
SUBROUTINE A REAL COMMON
MARKET, SENSE
(wi),
variables
COLD
COMMON
COMMON
the
program
defined
COMMON
T, V, W, X(21)
are
are
assigned
blocks
COMMON.
Chapter
blocks
require
as
between
/SET1/T,
the
/GROUP3/X,
the
variables
assigned in
to
blank
are
discrete
block
may
be
8). References
need
not
definition.
being
in a
particular
program in which
block
must
be
V,
W, X
listed
are
the
order
they
COMMON,
sections
referenced
be
identical
of
are
defined
labeled the
SUBROUTINE B COMPLEX
COMMON/SET
Y, JUMP
assigned
appear.
while
the
COMMON
by
any
made by
in
anyone
COMMON
block
in
all
the
G,
//
to
Thus, in
X,
number
block
program; in
is
referenced.
programs in
F(ll)
l/G,
GHIA,
the
Y,
F
COLD
indicated
and
region
of
programs
name, which must
block
COMMON
the
above
JUMP
are
and,
or
fact,
do
not
However,
which
it
example,
placed
as
subprograms
only
necessarily
is
such,
are
be
identical
those
the
definition
defined.
in
block
or
to
blank
MARKET, SENSE,
labeled
independent
that
blocks
have
For
COMMON
comprise
in
all
references.
containing
to
correspond in
of
the
overall
example:
of
an
COM-
each
exe-
data
size
references
Both SET1
as
containing
routine B declares
Reference ences
may COMMON a
single
Block names must
1.
Subprogram names
2.
Other
labeled
A however,
Blank
COMMON
The
section
there
is
only labeled executable programs program.
SUBROUTINE GAMMA
COMMON
to
may
be
occur
statements.
labeled
COMMON,
COMMON
block
COMMON
it
is
usually
of
the
one
program (see
define
the
COMMON
24
words;
12
items
made
to
in a singl e
In both
be
unique
defined,
names
block preferable
COMMON
such
area,
blank
Chapter
blank
COMMON
E,
D(20, 10), S
block;
the
definition
of
complex
the
name
COMMON
cases
block
of
with
respect
explicitly
may
have
to
choose
region assigned
and
empty
COMMON
8), do areas
SET
1:
in
type.
of a labeled
statement,
the
processor links
the
appropriate
to:
or
implicitly,
the
same name
block
block
areas,
not
have
of
different
SUBROUTINE COMMON
correspond
subroutine A specifies
COMMON
or
names
to
blank
name
specifications
defined
to
correspond in
in
block
the
block
together
name.
to
be
as
an
identifier
that
are
(or
unlabeled)
in
the
sizes,
and
ETA
R(10), N(5)
size.
name may
all
external
totally
various programs
yet
That
24
items
more
than
variables,
references
in
any
unique.
COMMON
always
size.
both may
is, both subprograms
of
real
type,
and
once
in
any
program.
be
specified
classification
refer
to
and
For
instance,
be
defined
is
not
it.
Furthermore,
subprograms
portions
in
any
as
other
discrete;
the
of
define
the
definition
Multiple
number
of
being
in
the
than
those
in
other as
that
comprise
following two
the
same
the
block
in
refer-
individual
block,
into
above;
words,
opposed to
an
sub-
executable
sub-
COMMON
Statement
7]
Subroutine GAMMA COMMON
Any a
single
blank
that
number
of
COMMON
COMMON
contains
references
will
defines
a maximum
may
statement
be
placed
a minimum
of
be
made
to
or in several
together
of
202 words in
60
words,
blank
COMMON
in
the
depending
COMMON
statements. In
blank
COMMON
blank
COMMON;
on
the
types
with a program. The multiple
either
area.
of
the
case,
subroutine
variables
all
ETA E,
D, S,
references
variables
declares a blank
R,
and
N.
may
occur
defined
as being in
in
Variables
may (see "DATA
Arrangement
Each abies region in a their
cause
in
blank
of
labeled
declared
particular
normal
COMMON
COMMON
Item
are
the
following
COMMON
arranged
sequence
1
2
3
4
5 6
7
8
9
10
11
12 13
Block E
W
X(l,l) X(2, X(3,1) X(1,2) X(2,2) X(3,2)
X(
X(2,3) X(3, 3) J
COMMON
Statement"
COMMON
to
be in the
from
section
/E/W,
K,M/E/Y
arrangement
1)
1,3)
Y
may
later
block
and the
labeled
low address
is
contained
(see "Array
X(3, 3)
//T,
//C(4),
Blank
not
be
in
this
chapter).
blank
block
storage
in
the
Storage")
B,
Q/E/J
H,
N(2),
of
COMMON:
COMMON
T
B
Q
K
M
C(l) C(2) C(3) C(4)
H
N(l) N(2)
Z
initialized
COMMON
or the
toward high address
low address word or words
within
(using a
unlabeled
the
COv'\MON
area
area.
DATA
contain,
storage.
Z
statement)
The
variables
of
block
that
while
in the order of
in
each
The first
section.
or
area.
variable
For example the statements
those in
their
section
Array
labeled
appearance,
of
the
to be
declared
variables
COMMON
the
COMMON
as being
are
stored in
vari-
72
Since
a segment
be
aware
of which items in a segment
SUBROUTINE TOM COMMON
will
define
the
Item
1 A 2 3
52 53 54
102
COMMON
Statement
of
the
COMMON
IS/A,
B(101)
block
S as follows:
TOM
B(l) B(2)
B(51) X(51) B(52) B(53) Y(2)
B(101) Y(50) Y(50)
DICK
A X(l)
X(2) ALPHA(3)
Y(l)
region
contain
SUBROUTINE DICK
COMMON
COMMON
HARRY
ALPHA(l) ALPHA(2)
ALPHA(52)
Y(l) Y(2)
may
be
defined
certain
IS/A,
X(51)
/S/y(50)
differentl
variables.
y in
each
For
example,
SUBROUTINE COMMON
COMMON
/S/ALPHA(52)
program,
HARRY
/S/y(50)
it
may be
quite
important to
which allows to
access
the
assume
A,
B,
the array
X, Y,
routine
variable
and
TOM
Y by
ALPHA
and
are
DICK
that
of
to
access
identifier,
the
same
the
and
type).
variable
yet
the
A by
integrity
that
of
identifier,
the
block S is
the
routines DICK
maintained
and
(these
HARRY
examples
Referencing
Incorrect MON
the
reference block following
The FLAG system ing a variables variables
the
of
Data
in
COMMON
referencing
blocks
must
number
to
the
first
chart:
Type
of
Variable
Integer Real 4 Double Precision Complex
Double Complex Logical
variable
in
the
R,
I, and CPX
COMMON
displacement
be
constructed
associated
storage
automatically
of
any
length
same
block,
R,
I,
CPX
of
these
of
COMMON
with
location
Reference
to
be
it
may
are
REAL,
variables
data
so
that
the
of
the
Number
4
8 8 8
4
begins
the
first
be
necessary
INTEGER,
within
will
terminate
the
displacement
variable
variable).
every
COMMON
assigned
and
the
block
execution.
of
(displacement
The
reference
within a block.
to
insert
an
COMPLEX,
is
as
shown
each
variable
is
the
number for
block
as
unused
respectively,
below:
To
ensure
number
if
its
To
obtain
variable
correct
in
the
of
type
specification
the
in
and a COMMON
block
bytes
of
correct
the
referencing
is
from
variable
block.
of
an
integral
the
beginning
is
shown in
were
8,
thus
displacement
For
example,
block
data,
COM-
multiple
of
the
allow-
for
other
if
is
defined
of
the
the
as
-t
R
+
-!
displacement
4
bytes
displacement
4 bytes
displacement
1
I
8
displacement
of
length
of 4 bytes
bytes
for I
4),
Statement
CPX
_I
The
displacements
(instead
with a length
proper
displacement
EQUIVALENCE
and
the
displacement
would
for
CPX.
= 0 bytes
= 4
bytes
= 8
bytes
= 16
bytes
CPX
are
have
evenly
of
to
be
divisible
CPX
would
inserted
by
their
reference
be
12,
which
between R and
numbers.
is
incorrect.
I or
between I and
However,
In
that
CPX to
if R were
case,
provide
an
extra
the
REAL
word
*8
The EQUIVALENCE
assign more
than
EQUIVALENCE
statement
one
variable
sl'
s2'
to
s3'···'
controls
the
same
sn
the
allocation
storage
of
location
variables
or
locations.
relative
to
one
It
is expressed
another.
as
EQUIVALENCE
Generally,
it
is used
Statement
to
73
where
each
of
(v1' v2' v3'···' v m)
Each
equival
the
foil owi ng
1.
A
scalar
2.
An
array
DIMENSION
REAL
EQUIVALENCE
would
make
When
multiple
DIMENSION
3.
An
array
count
is
ately
following
two
elements
of
X (see IIAllocation
REAL
EQUIVALENCE (A(7),
would
make
the
s.
is
an
equivalence
I
eliCe
set
sPedfi
eS
three
forms: I
or
array
name.
element,
B,
C,
where
A(3,
A,
3)
X(ll)
(A(l,3),
Band
A(l,3)
subscripts
name
as
follows:
statement
followed
in
the
is position
beyond X and
of
B,
C,
A(3,3)
A(l,3)
and B equivalent.
that
all
For
arrays,
the
subscripts
B),
equivalent,
are
to
be
which
by
an
unsigned
location
2;
and
refers
Variable
B)
set
of
the
v.
the
(C, X(l»
and,
used
the
array
of
the
so
on.
to
X(3, 1),
Types
the
form
aie
to be assigned the same
location
are
referenced
unsigned
integers.
similarly, C and
in
an
EQUIVALENCE
is
declared.
integer first
ll
Thus,
).
element
element
if
X is a 3 x 3
where
of
the
size
count
the
is
that For
X(l)
equivalent.
statement,
enclosed
array
is
array,
(in words)
storage
of
the
example,
that
in
denoted
X(l)
of
an
location.
first
element.
the
statements
statement
parentheses.
as
position
means
the
element
The
must
The
1;
the
same
as
is
dependent
v.
may be one
I
be
preceded
meaning
element
X(l,
1); X(3) is on
by a
of
this
immedi-
the
type
of
See
also
that
cannot
Example:
The
is to
Word
2
3
4
5
6
7
8
9
where
IIInteractions
be
implemented.
effect
of
the
statements
DIMENSION REAL
W, X INTEGER REAL
* 8
LC,
ELSIE
COMPLEX C
EQUIVALENCE
cause
the
indicated
Variables -Set
LC(l) LC(2)
=
W(l) = ELSI
LC(3) = W(2) = LC(4) = W(3)
I
rlc\
L\..\J}
LC(6) LC(7)
the
arrangement
of
Storage
W(3),
Allocation
X(3,3),
J
(W,
LC(2), ELSIE), (X(6),
equivalences:
1
E1
ELSI
E2
of
set
LC(7)
Variabl
X(l, X(2, X(3, X(l,2)
X(3,2) X(l,3) X(2, 3) X(3,3)
1 has no
Statements
es -
1)
1)
= C 1
1)
=
C2
= J
bearing
J,
Set
on
ll
,
below,
C(3»
2
the
arrangement
for
further
of
set
rules
2.
concerning
equivalences
74
EQUIVALENCE
Statement
The
statement
EQUIVALENCE (LC(2),
has
the
same
same
as
the
Interactions
No
storage
and
EQUIVALENCE
thi
s is
the
contradictory
In
all
EQUIVALENCE allocations blocks
It
is
upper
EQUIVALENCE
item
allocation
EQUIVALENCE
not
followed,
cases,
the
of
COMMON
can
not
permissible
bound
established
declared
COMMON
DIMENSION
to
results
as
set
(J, X(6))
of
Storage
declaration
statement
set
should
such
reference
storage
specifications.
be
for
declaration
be
/BLK1/A(5),
allocation
made
equivalent.
an
EQUIVALENCE
by
in
that
Z(lO),
W),
the
EQUIVALENCE
in
this
Allocation
is
determines
contain
references
storage;
V(5)
references
is
not
allowed.
Consequently,
that
the
last
to
cause a segment
segment.
B/BLK2/E(4),
(W(l),
case.
Statements
permitted
the
are
either
sequence
is,
two
to
cause a segment
item
defined
Both
conditions
ELSIE),
H,
(C(3),
statement
to
cause
allocation
to
more
than
redundant
specified
EQUIVALENCE
variables
to
be
to
be
lengthened
are
Y(2,2)
J), (J, X(6))
in
the
previous
conflicts
or
in a COMMON
in
in
demonstrated
in
of
the
variables
one
variable
contradictory.
statements
the
same
of
the
COMMON
that
segment.
beneath
the
example,
arrangement
referenced
than
has
The
statement
are
COMMON
However,
the
in
the
and
previously redundancy
takes
not
allowed
block
region
lower
bound
exampl
the
of
storage. in
or
to
it
is
es
below.
set
(J,
Each
them
Therefore,
been
allocated.
is normal I y
precedence
to
define
in
different
be
lengthened
not
permissible
established
X(3,
2)) is
COMMON
ignored;
over
conflicting
COMMON
beyond
by
the
any
for
the
no When
the
an
first
EQUIVALENCE (A,
The
first EQUIVALENCE
an
extension
Item
of
BLK1
A(l)
2
3
4
5
6
7
8
A(2)
A(3)
A(4)
A(5)
B
the
block
==
Z(l)
==
Z(2)
==
Z(3)
==
Z(4)
==
Z(5)
==
Z(6)
Z(7)
Z(8)
Z),
(V(4), E(2))
set
is a permissible
BLK2.
The
B
LK2
E(l) + V(3)
E(2)
E(3)
E(4)
H
Y(l,
Y(2,
Y(l,2)
declared
(i
II
ega I extension)
V(l)
V(2)
==
V(4)
==
V(5)
1)
1)
extension
storage
of
the
block
allocation
BLK1,
would
whereas
appear
as
the
second
shown
below.
set
illegally
defines
9
10
Note:
Assume
all
Z(9)
Z(lO)
items
are
of
Y(2,
the
2)
same
data
type.
Interactions
of
Storage
Allocation
Statements
75
The
fact
that requirement programs
comprising
COMMON
that
labeled
segments
COMMON
portions
of
an
may
be
lengthened
blocks
executable
of
the
program,
by
EQUIVALENCE
same
name, contain
which
the
dedarations
are
defined
identical
in
number
in
no
separate
of
words.
way
nullifies
programs or
the
sub-
EXTERNAL
The EXTERNAL
where
The EXTERNAL so example,
but
The EXTERNAL
Example:
Library (e. subprogram.
L
the
p.
that
they
if
CALL
appears
EXTERNAL F
functions
g.,
SIN)
Statement
statement
are
subprogram
I
statement
may
be
passed
the
subprogram
ALPHA(F)
in
no
other
statement
(see
Table
appears
in
has
the
identifiers.
declares,
as
arguments
name F appears
context
to
can
be
8) may
an
EXTERNAL or
form
as
a subprogram, names
to
other
in
the
indicate
used
not
to
avoid
appear
that
as
explicit
subprograms
statement
it
is a
subprogram,
this.
arguments
type
statement,
that
might
otherwise
(see
II
Arguments
it
would
to a subprogram.
it
must
refer
be
and
Dummies
be
implicitly
If
the
to a variable
classified
ll
classified
name
of a library
implicitly
in
Chapter
or a user-supplied
as
scalars,
8).
as a scalar.
function
For
[
BLOCK
FLAG program,
and subprogram must programs,
BLOCK DATA subprograms must
Within more DATA
When initiaiizing variabies
in
1. The
2.
Data
DATA
Subprograms
permits
BLOCK DATA
may
each
The
may
variables
which
begins
contain
be
they
have
a BLOCK DATA subprogram,
statements;
COMMON
position
size
of
each
be
entered
only
declaration
terminated
no
block,
within
COMMON
into
in
with a
names
type
the
labeled
statements
in
so
block
more
COMMON
statement
statements
with
an
nor
are
appear
initialization
END
they
of
the
executed
before
may
to
be
form
(described
statement.
the
main
of
not
be
used for
initialized
in
this
Since
in
the
usual
program
labeled
initialization.
in a
special
chapter) BLOCK DATA subprograms may
sense.
and
all
COMMON
iabeied COMMON, compiete deciarations
that
of
those
block
than
will
one
variables
correspond
COMMON
that
to
block
are
the
in a
being
size
single
initialized
declared
BLOCK DATA subprogram.
program
and
DATA
other
variables
snouid
in
called
statements
subprograms.
must
be
be included
will
be
correctly
all
other
programs
a BLOCK DATA
described
not
accomplished
for
established.
below.
be
called
oJ;
the variables
that
use
by
it.
sub-
by
one
The
other
or
76 EXTERNAL
Statement/BLOCK
DATA Subprograms
DATA
The
DATA
where
Statement
statement
has
the
form
S. is a
I
The primary purpose
3.
141592653589793 instead required.
Giving With ceives
Consider written through array
Here, to to practice
of
the
its
using a
must
C(O) C(l) . 1243549945 C(2)
etc.
the give depend
data
variabl
the
longer
PI a value
DATA
statement
value
another
power
the
constants.
be
initial
0
.2447786631
DATA
"initial"
on
loading
dictates
at
exampl e
statement
values
that
set
specification
e-I i st/constant-I i st/
of
the
DATA
at
every
appearance,
form
of
the
with a
DATA
statement
the
value
execution
series
ized
and
such
time.
that
profits
expansion.
But
constants
each
time
can
to
variables
disallows
initialization
be
of
statement
constant.
is
assigned
even
cannot
into
used
to
that
restarting
the
form
is to
the
variable
This
also
is somewhat
when
more from
The
efficient
be
subscripted,
the
routine
great
advantage.
are
going
the
be
done
give
names
to
PI
can
be
simplifies modifying
different
the
program is
the
use
of
way
to
program this in FORTRAN is with a
and
using
assignment
It is
to
be
changed. program with
once
executable
constants:
given
from
giving
loaded;
the
DATA
the
timing
statements,
not
recommended
This
it
has
changed
statements,
for
that
value
the
it a value with
statement:
of
causes
example,
with a
program,
the
the
routine
such
that
proper
these
e.g.,
instead
if
with
assignment
An ARCTAN
as:
initialization
values.
with assignment
DATA
a more
an
is
the
of
statement
accurate
assignment
statement,
DO
adversely
DATA
Good
referring
function
statement
of
programming
to and used value
statement.
PI
loop,
stepping
affected
the
program
statements.
re-
can
be
rr as
is
be
if
an
used
The
effect
set,
in
DA
is
equival
X =
A = 7
L = .
ALPHA = 0
except
Variable
DATA
Variable
A
DATA
scripted
of
the
order
TAX,
ent
3.5
TRUE.
that
the
and
variable
arrays.
the
DATA
listed.
A,
L/3.
to
the
DATA
constant
List
list is
It may
statement
For
example,
5,
7, •
TRU
assignment
statement
lists in
similar
not
contain
is
to
initialize the
statement
E./ , ALPHA/O/
statements
is
not
executable;
DATA
statement
to
an
input
list
implied
the
variables
its assignments
may
be
constructed
(see
Chapter
DO
loops. Subscripts must
6),
in
in
each
take
as
described
that
it
data
place
may
be
set
to
upon
in
the
contain
integers.
the
values
loading.
following two
scalars
of
the
sections.
or
subscripted
constants
or
in
the
unsub-
DATA
Statement
77
OAT A Constant
List
[
A DATA
where
the
constant
C.
are
either
J
c
r*c
where
c
is a signed
is
is
The
constant
may
also
following
1.
Integer,
2.
Logical
3.
literal
is variable characters, a complex
be
rules
broken
may
used.
apply
real,
constants
constants
up on a
(see
list
is
of
the
constants
or
unsigned
an
unsigned
to
be
be
The
double
"Storage
any
in DATA
may
integer
repeated.
of
the
type
of
precision
may
be
be
used
character-by-character
Allocation variable, 8 characters,
form
or
repeated
constant
repeat
forms
described
the
constant
statements:
and
complex
expressed as .
with
any
Statements"
groups
of
count,
in
must
TRUE.
type
basis
of
constants
an
appropriate
whose
Chapter
be
the
same
variables
and.
FALSE.
of
variable,
and
depends
earlier
and a double
value
2,
as
may
although
in this
in
the
following
type
(nonzero)
including
the
type
be
initialized
or
abbreviated
on
the
chapter).
complex
forms:
(see
below).
indicates
literal
constants.
of
the
variable
with
as T and
integer
is
recommended. A literal
nu~ber
of
That
variable,
the
constants
words
is,
an
16
characters.
number
integer
of
Hexadecimal
that
it
of
those
F.
of
storage
variable
times
is
initializing.
types.
occupied
the
group
constants
constant
by
the
requires
The
4
I
I
!
Variable acters
4.
Numeric
initialize
5.
Hexadecimal
the
As
The maximum
ized.
If
the
number
digits
is
items
will
be
initialized
in
any
literal
constant
and
logical
successive
constants
character Z followed
0123456789ABCDEF
an
example,
The following list shows the maximum number
Type
of
Variable
LOGICAL INTEGER REAL REAL*8 COMPLEX 16 COMPLEX*16
of
digits
less
than
the
the
number
is
maximum,
constants list items
may
by from 1
hexadecimal
of
digits
greater
as
required
to
fill
the
last
may
not
be
used for more
or
successive
be
used
to
initialize
to
32
hexadecimal
constant
allowed
Maximum number Hexadecimal
than
the
hexadecimal
ZBOD
in a
Digits
8 8 8
16
32
maximum,
zeros
to
use up
variable
elements
hexadecimal
any
represents
of
the
are
supplied
used,
of
type
of
leftmost
the
than
an
of
digits.
the
constant
digits
characters it
will
be
one
variable
array
appearing
variable.
These
bit
string
depends
for
each
hexadecimal
to
the
left.
specified.
filled
out
list
as
a list
The form
digits
are
101100001101.
on
the
variable
digits
If
there
are
with
trailing
item;
one
literal
item.
of a hexadecimal
type
of
variable
type:
are
truncated;
insufficient
blanks.
constant
const.ant is
being
if
the
char-
may
initial-
number
of
78
DA
T A
Statement
The
following
INTEGER MM(3)
COMPLEX
DATA
The
above
examples
C1,
C2
MM/ABCDEF
DATA
statement
illustrate
1
,
IGH
causes
some
of
1
/,
C1,C2/(17.8,
the
following
the
features
-4.0),
assignments
described
(17.8,
-4.0)
to
above:
be
made:
MM(l)
MM(2) MM(3) C1 C2
The
constant
Dummy labeled
Placement
The
following
or
subprogram when using
1.
All program.
2.
Declaration
4HABCD 2HEF 2HGH (17.8, (17.8,
list must
variables
COMMON
and
and
rules
declaration
statements
subprogram IMPLICIT type
statements DIMENSION COMMON EQUIVALENCE EXTERNAL
DA
T A
statements
NAME
LIST
-4.0)
-4.0)
completely
variables
may
be
Order
govern
FLAG.
statements
declaration
statement
statements
statements
statements
statements
statements
satisfy
in
blank
initialized,
of
Declaration
the
placement
must
appear
(if
present) should
statement
the
variable
COMMON but
only
in a BLOCK DATA subprogram.
Statements
and
order
prior
to
appear
list
and
cannot
of
appearance
the
appearance
in
the
there
be
initialized
following
may
not
of
declaration
of
the
order
be
with
first
within
any
remaining
the
DATA
statements
executable
a program:
unused
statement.
within
statement
constants.
Variables
a main program
within
in
a
Failure
3.
Identifiers values statements.
4.
Identifiers initialization initialized
to
follow
that
specified
appearing
specified
by
this
appear
within
means
order
both
the
in
within
of
one
may
type
type
result
in
type
statementi
statements
the
type
or
more
in
one
statements
they
within
statementi
DATA
statements
or more
compiler
and
in
EQUIVALENCE
may
be
a BLOCK DATA subprogram may
all
identifiers
(or
diagnostic
initialized
left
uninitialized).
Placement
messages.
statements
by
one
or
within
a BLOCK DATA subprogram must
and
may not
more
not
Order
have
subsequent
have
values
of
Declaration
initial
DATA
for
data
data-
be
Statements
79
A
complete
program
as
described
Main
set
of
program
consists
in
of
this
Programs
units
one
main program
section,
or
may
8.
PROGRAMS
executed
together
and
all
required
be
preprogrammed
AND
SUBPROGRAMS
as a single
subprograms. Subprograms may
and
job
is
contained
called
in
the
an
run-time
executable
be
or
program. An
defined
system
by
libraries.
executable
the
programmer,
A main one
Main
Once in
the
Subprograms
Subprograms
and
[
program
of
the
a
FUNCTION a SUBROUTINE a BLOCK DATA
programs may
an
main
subroutines.t
Functions
Statement
FUNCTION
Basic
Subrouti nes
is
following
executable
program.
are
programs
functions
external
comprised
statements,
statement
statement
statement
contain
These may
subprograms
functions
any
program has
which
of a set
and
statement
been
may
be
further
of
FLAG
statements,
the
last
of
which
except a FUNCTION,
loaded,
be
classified
called
execution
by
other
as
is
an
of
programs;
follows:
the
first
of
which
END
statement.
SUBROUTINE, ENTRY,
the
program
they
begins
fall
(other
into
with
the
than
the
two
comment
or
BLOCK DATA
first
executable
broad
classes
lines)
cannot
statement
of
functions
be
statement.
SUBROUTINE
[
A
function Subroutines library
Statement
Statement the
form
where
tThe BLOCK DATA subprogram,
80
Program
functions
l'
f(d
f is d.
is
I
e is
is
referenced
are
Functions
functions
d2, d3,
the the an
arithmetic
and
subroutines
by
referenced
and
subroutines
are
functions
•••
, d
n)
= e
name
of
the
identifier
Subprograms
of or
the
appearance
with CALL
are
that
function
a dummy
logical
which
of
its
statements
included
can
scalar
expression
in FLAG. These
be
defined
variable
is
neither a function
identifier
and
do
in
(see
within
not
necessarily
a singl e
below)
nor a
an
expression
return a value
are
described
expression. A statement
subroutine,
at
is
and
the
also
returns a
end
provided
(see
of
value
Chapter
this
chapter.
function
(see
(see
Chapter
5).
A number
definition
Chapter
2). of
has
7).
A
statement scalars; e should this
would
fined
Examples:
F(X)
EI(THETA) = CMPLX(COS(THETA), SIN(THETA))
AVG(PT,
Since
same
as
X,
and expression the
same
ment
function
The
statement
does
not,
A
statement
definitions
function
they
cannotbedummy
contain
be a recursive
functions.
at
must
least
one definition.
= A * X ** 2 + B * X + C
NUM,
TOT) = 3 *(PT +
each
di is
merely
a dummy
the
names
of
other
there
is
another
refers
name
is
dummies using
function
it
will
function
must
precede
variable
to
the
dummy. The onl y
that
they
itself
acquire
may
all
have
at I east
arrays
or
subprograms (see
reference
variables
will
both
explicit
is
typed
implicit
be
referenced
executabl e statements
NUM)/TOT
and
in
in
the
have
(or
like
type
to
References
does
the program
implicit)
(see
only
one
dummy
each
not
actually
program.
relation the
same
any
other
"Implicit
within
argument.
"Arguments
dummy. The
to
other
identifier
statement
+ 1
exist,
the
Note,
however,
called
X,
then
between a statement
type.
This
enables
type
statements.
identifier:
Declarations"
the
program
in
the
program
Statement
and
functions
names
the
appearance
it
may
in
unit
in
which
Dummies" in
f may
of
statement
that
if a statement
function
the
programmer
appear
Chapter
in
which
they
function
not
appear
may
be
of X within
dummy
in
an
explicit
7).
it
is
defined.
appear.
dummi es
this
chapter).
in
made
onl y
function
function
and
to
declare
are
the
expression,
to
previousl y de-
dummies may
dummy is
the
statement
any
other
the
type
statement;
Statement
treated
The
quantity
types
function
onl y
as
expression
since
be
the
named
function
with
of
state-
if
it
[
FUNCTION
Functions
grams
are
or
where
f
d.
I
type
Subprograms
that
cannot
be
defined
introduced
is
the
is a dummy
in
this
INTEGER
REAL
DOUBLE PRECISION
identifier
chapter.
is
an
by a
argument
optional
FUNCTION
of
type
in
a singl e
the
function.
of
any
specification,
statement
statement,
of
the
of
forms
which
COMPLEX
LOGICAL
DOUBLE COMPLEX
may
the
form
(except
may
be
defined
asterisk),
be
any
of
the
as
FUNCTION
described
following/
subprograms.
in
"Arguments
and
These
Dummies
subpro-
ll
later
Every
FUNCTION
FUNCTION
A
FUNCTION
statement
FUNCTION.
tSee
in a FUNCTION
also
"Optional
subprogram must
subprogram,
subprogram must
Size
with
Specifications"
have
certain
contain
subprogram;
at
least
restrictions
at
least
i.
e.,
it
in
Chapter
one
(see
one
RETURN
should
dummy.
"Arguments
be
the
7.
Values
statement. A RETURN
last
may
and
Dummies").
statement
be
assigned
executed
to
dummies
statement
for
each
within
should
execution
Subprograms
be
the
the
of
last
the
81
The
identifier
statement, a DO control
of the function must be assigned a
variablef the
statement) within the subprogram.
variable
value
on the
at
left
least
side of
once
in the subprogram as the argument of a
an
arithmetic
statement, or
in
an
input list
CALL
(READ
Within the function the should be assigned a one
assigned to its
A FUNCTION subprogram may
TION
statement, or a
identifier
value
identifier
BLOCK
during
prior to the
contain
DATA
FUNCTION statement examples:
INTEGER FUNCTION DIFFEQ REAL
FUNCTION IOU
FUNCTION
EXTRCT
LOGICAL FUNCTION
(W,
(N,A,
VERDAD(E,
FUNCTION subprogram examples:
COMPLEX FUNCTION GAMMA COMPLEX
Z
M = 1
GAMMA = Z
DO 5 J =
N,
10
M = M * J
of a FUNCTION subprogram each
execution
execution
any
of
of a
FORTRAN
the function.
RETURN
statement
statement.
(R,
S,
N)
X,
Y, Z
1,
Z2)
B,
C,
V)
F,
G,
H,
P)
(Z, N)
is
treated
The
statement.
except
as though it were a
value
returned for a FUNCTION
scalar
a SUBROUTINE statement,
variable
is
another
and
the last
FUNC-
5 GAMMA = GAMMA * (Z + J)
GA,V"VA
...:.
M * N + Z / GAMtv'A
RETURN
END
SUBROUTINE
SUBROUTINE subprogramsr like
Subprograms
FUNCTION subprogramsr are
self-contained
programmed procedures. Unlike
FUNCTIONS, however SUBROUTINE subprograms do not have values associated with them and
enced
in
an
expression. Instead,
SUBROUTINE subprograms begin with a SUBROUTINE statement
,
SUBROUTINE p(d
,
d
1
2
d
,.·.,
3
SUBROUTINE
dn}
subprograms
are
accessed
of
the
form
by
CALL
statements (see
or
SUBROUTINE p
where
p
is
the
identifier
is a dummy
d.
I
Note
that
while a FUNCTION must have
A SUBROUTINE subprogram must the
last statement in a SUBROUTINE subprogram (that is, it should be the last statement
of
the SUBROUTINE).
of
the subroutine
argument of
contain
Elny
of the
forms
described in IIArguments
at
least one dummy, a
at
least one
RETURN
SUBROUTINE
statement; a
and
Dummies
need have none.
RETURN
statement should be logically
ll
later
executed
may
Chapter
in this
for
not be
chapter.
each
refer-
5).
execution
A SUBROUTINE subprogram may return values to the
in
COMMON
storage. I
82 Subprograms
calling
program
by
assigning values to the d. or to variables
A SUBROUTINE
ROUTINE
arguments
in
[
Arguments
statement, to
the
SUBROUTINE
subprogram
return
va
and
Dummies
and/or
lues
to
program.
may
contain
a BLOCK DATA
the
ca
Iling
any
program.
FORTRAN
statement.
The SUBROUTINE
statements
The SUBROUTINE
except a FUNCTION
name
subprogram
must
not
appear
statement,
may use
in
one
any
another or
other
SUB-
more
of
statement
its
Dummy Both
FUNCTION
however,
indicate
age
is
reserved
any
of
the
a
scalar
an
an
an
a
statement
a
constant
a
subprogram
A dummy
a
scalar
arguments
while a FUNCTION
the
following:
array
array
expression
itself
provide
and
type,
for
variable
element
name
label
of
any
name
may
variable
SUBROUTINE subprograms
number, it;
it
type
be
a means
and
is
only a name
(including
classified
of
must
have
sequence
within
passing
at
of
used
literal)
the
information
may
least
one.
subprogram
to
identify
subprogram
between a subprogram
have
dummy
arguments.
Dummies
arguments.
an
as
argument
one
of
are
merely
A dummy
in
the
IIformal
the
calling
following:
and
the
program
A SUBROUTINE
ll
parameters
does
not
actually
program.
need
and
exist,
An
that not
are
and
argument
ca
have
used
no may
lied
any,
it.
to
stor-
be
[
Table
an
array
a
subprogram
an
asterisk
8,
below,
Argument
scalar
expression statement array
I
iteral
subprogram
correspondence
tA
denoting a statement
indicates
or
array
label
name
constant
name
Table
element
of
the
8.
this
labe
permissible
Permissible
kind
may
I
kinds
of
correspondence
Correspondences
scalar
yes yes yes no
t
yes
t
yes no no
not
be
entirely
meaningful
between
Between
array
t
no no no yes yes
an
Arguments
Dummy
subprogram
(see
"Dummy Arraysll).
argument
and
Dummies
no no
no no yes
and
a dummy.
asterisk
no no yes no no no
Arguments
and
Dummies
83
A
statement
where (as
opposed
&k
k is
label
the to
an
argument
actual
integer
is
written
statement
constant).
label
as
and
the
ampersand
distinguishes
the
construct
as a statement
label
argument
Within a subprogram, fier
with
certain
restrictions;
COMMON
EQUIVALENCE
DATA
NAME
LIST
The
reason
for
the
as a scalar,
implicit
In
general,
situation
an
array,
and
explicit
dummies must
is in
error
COMPLEX C
LOGICA.L L
X = F (C,
Reversing would
eliminate
the
L)
order
the
a dummy may
namely,
above
restriction
or
a subprogram
classifications
agree
because
the
FUNCTION
LOGICAL
COMPLEX
of
either
the
error
in
this
be
dummies may
is
identifier
(see
in
type
types
of
LL
CC
arguments
example.
used
in
much
that
dummies
occurs
"Classification
with
the
the
arguments
F (LL,
CC)
in
the
the
same
not
appear
do
not
in
the
of
arguments
and
calling
reference
way
as
in
the
actually
same
manner
Identifiers"
to
which
the
dummies
any
other
following
exist.
in
Chapter
they
do
or
the
scalar,
types
Furthermore,
as
with
other
7).
correspond.
not
agree.
dummies
array,
of
statements:
classification
(actual)
For
in
the
or
subprogram
identifiers,
example,
FUNCTION
of
a dummy
the
following
statement
identi-
in both
There
are
two
exceptions
i.
A
statement
2.
A SUBROUTINE
All
arithmetic
then
placed
argument
(this
is passed (this is
NOTE:
All
number passed
name
or
logical
in a temporary
action
is
referred
constants
to a constant
Dummy Scalars
Dummy
are
Dummy
A dummy subprogram array).
not
Arrays
scalars
declared
argument
(the
A dummy
are
single
(implicitly
may
fact
array
The subprogram assumes
actual
array
and
calculates
to
the
rul e
as
(as
opposed
expressions
storage
referred
are
in
to
as
passed by
the
calling
to
IIcail
valued
or
explicitly)
be
defined
that a calling
does
not
that
the
argument
subscripts
of
an
argument
to a
appearing
location.
as
"call
by
name;
sequence,
entities
as
an
argument
actually
from
type
correspondence:
has no
FUNCTION
by
value").
name
II).
therefore,
that
that
correspond
to
be
arrays
array,
by
is
an
occupy
supplied
that
location.
as
The
the array
any
in
type.
name) has no
actual
address
For al!
if
the
constant
to a
or
subprograms
presence
does
storage,
the
calling
arguments
of
that
other
called
will
be
single
of
not
in
it
statement
type.
in
the
temporary
arguments
subprogram changed.
element
are
treated
its
identifier
itself
merely
identifies
calling
storage
in
define
defines
program
location
the
actual
stores
into
Obviously,
the
calling
as
scalars.
in
any
array
the
corresponding
an
area
the
first (or base)
are
first
evaluated
is
then
passed
address
a dummy this is not
of
the
argument
corresponding
recommended.
program. Dummies
declaration
within
dummy to
in
the
calling
program.
element
as
be
of
and
the
that
the
an
an
84
Arguments
and
Dummies
Normal! necessary,
y, a dummy
however,
array
and
is
given
useful
the
same
operations
dimensions
can
often
as
the
be
performed
argument
by
array
making
to
which
them
it
corresponds.
different.
For
This is
example,
not
DIMENSION
CALL OUT
In
this
case, elements to
the
Arguments
secutive in
the
A(l,6)
the
first
CALL OUT(A)
dummy
that
string
the
example
CALL FOR('PHILIP MORRIS')
following
M(l)
= 4HPHIL
M(2) = 4HIP-bM M(3) = 4H ORRI M(4) = 4HSb'h6 M(5) is
A(lO,
(A(l,6))
the
1-dimensional
through
element
array B would
of
the
are
literal
of
characters
correspondences
undefined
10)
dummy
A(lO,
10)).
array,
correspond
constants
in memory,
hold:
and
should
SUBROUTINE OUT
DIMENSION
array B corresponds
if
the
to
are
not
However,
calling
the
normally
be
since
statement
first
half
and
its
starting
SUBROUTINE FOR(M) DIMENSION
referenced
(B)
B(50)
an
of
the
received
to
array
were
array
by
dummy
location
M (5)
the
last
name
used
A.
arrays. A literal
is passed
half
of
without
as
the
the
2-dimensional
subscripts
constant
argument
as
an
is
address.
array
argument
stored
For
A (i. e.,
refers
as a con­instance,
where"b boundary than For this
If
element For of be
Adjustable Dimensions
Since to program in scalar array
represents
(multiple
one
word
reason,
an
array
of
example,
the
array
taken
in
a dummy
allocate
variables
each
DIMENSION
= SUM(P,
X Y =
SUM(Q,
the
of
per
elementt (e.g.,
integer
corresponds the
array.
if
the
calling
other
than
creating
array
storage
the
time
for
normal
rather the
subprogram is
P(lO,
10,5)
9,3)
character
four
arrays
to
This is
the
correspondences
does
them.
manner.
than
5),
blank.
characters).
are
recommended.
something
true
whether
argument
first el
ement
not
actually Therefore,
Instead,
by
constants.
called.
Q(9,
3)
double
that
is a
of
occupy
Literal
Therefore,
precision)
is
not
an
the
calling
scalar
and
wi
II
correspond
this
nature
any
the
dimensions
any
or
all
This
permits
The
following
FUNCTION DIMENSION
constants
passing such a
may
result
array
or a literal
argument
the
dummy is
to
whatever
since
they
storage,
of
a dummy
the
dimensions
the
calling
statements
SUM
R(N,
are
fill
in
is
may
its
dimensions
(R,
M)
ed
out
constant
dummy
constant,
an
array
an
array,
happens
depend
array
of
a dummy
program
demonstrate
N,
M)
with
trail
to
a dummy
elements
the
and
the
references
to
be
upon a
are
used
do
not
array
to
supply
adjustable
ing
of a type
that
are
latter
will
dummy is
in
stored
particular
only
have
to
may
the
blanks
to
that
only
partially
correspond
not,
the
subprogram
near
the
implementation.
to
locate
be
defined
be
specified
dimensions
dimensions:
the
nearest
occupies
or
vice
scalar.
its
elements,
within
by dummy
of
to
to
the
word
more
defined.
the
first
versa.
elements
Care
not
the
sub-
dummy
must
tSee
"Allocation
of
Variable
Types"
in
Chapter
7.
Arguments
and
Dummies
85
Only scalars. be
When the
[
the is
Dummy Subprograms
a dummy
The
changed.
running subprogram range
of
done.
array
variables
in
the
is
entered,
the
array.
can
be
used
"debug"
If
given
adjustable
as
adjustable
mode (see
and
subscripted
a
one-dimensional
dimensions,
dimensions
Chapter
elements
dummy
9)
may
the
of
array
and be
size
of a variably
the
array is
the
dimensions
referenced
are
checked
dimensioned
must
elsewhere
dimensioned
to
make
with
size
be
in
1 no
specified
the
subprogram
array
sure
that
subscript
by
is
calculated
the
dummy
but
subscript
range
integer
should
each
is in
checking
not
time
[
A dummy
that the specified "Classification
Example:
A
it
Library
FLAG special are
subprogram
can
do
so.
The dummy
calling
subprogram may
program.
as
the
argument.
of
Identifiers"
EXTERNAL
A
=
DIFF(SIN,
B = DIFF(SQRT, DSQRT, Y)
(The
be
SIN,
programmer
identifier,
classified
Subprograms
includes a number
also
machine
provided.
codes
must
correspond
name
merely
Therefore, a calion
A dummy
in
Chapter
DSIN,
SQRT, DSQRT
DSIN,
X)
must
provide
to
be
passed
as a scalar
for
of
them.
variable}.
library
Most
to
an
argument
serves
to
identify a closed
a dummy
subprogram
subprogram
is
classified
7).
the
functions
as
an
subprograms. These
of
argument,
the
library
SIN,
that
is a subprogram
subprogram
is
actually a calion
in
the
same
FUNCTION
DOUBLE
DIFF
= DABS(F(Z) - DF(DBLE(Z)))
RETURN
END
DSIN,
must
previously
are
specially
subprograms
DIFF(F, DF, Z)
PRECISION
SQRT,
and
recognized
are
functions,
DSQRT.)
appear
name,
manner
DF
in
and
it
whose
the
as
any
an
EXTERNAL
by
the
although
is
the
only
actual
subprogram
other
compiler;
several
kind
location
subprogram
is
whose
statement
which
uti
lity
of
dummy
defined
name
(see
{otherwise,
generates
subroutines
by is
Basic
External
The
basic
a
special
implicit
Table
9 lists
Function", to
clarify
Additional
In
addition
EXIT
Form:
CALL EXIT
[ The
86
effect
Library
Functions
external
type
typing
the
library
is
Subprograms
that
rules.
the
function
it
is
not
definition
to
the
identical
function
Subprograms
functions
is
known
The
necessari
of
to
subprograms
to
the
compiler.
arguments
subprograms
Iy
the
formula
function.
listed
in
that
of
the
evaluate
to
these
provided
Table
STOP
commonly
This
type
functions
by
FLAG.
that
is
actually
9,
the
following
statement.
used
mathematical
is
not
necessarily
must
have
the
When a formula
used in
subprograms
the
same
proper
type,
is shown in
implementing
are
supplied
functions.
as
the
as
shown in
the
function;
in
These subprograms
type
it
would
Table
the
column
the
it
FLAG
"Definition
is
library:
acquire
9.
intended
have
by
of
only
Intrinsic
Names
Number
Arguments
of
Table
Type
of
Argument
9.
Intrinsic
Type Result
and
of
Basic
External
Definition
Functions
of
Function
ABS
ACOS
AIMAG
AINT
ALOG ALOG10 AMAX1
AMAXO
AMIN1
AMINO
AMOD
ASIN
N ~ 2
N
~
N~2
N ~ 2
2
Real Real
Complex
Real
Real Real Real
2
Integer
Real
Integer
Real
Real
Real
Real
Real
Real
Real Real Real
Real
Real
Real
Real
Real
Absolute Arc
CACOS. Imaginary
plex) Integer
truncated) Natural
Common
Maximum
verted
Maximum
verted
Minimum
verted
Minimum
verted Arg1 (mod
i. Function
Arc
CASIN.
cosine
expressed
arg
e.,
sine
value.
part
logarithm
logarithm
value.
to
and
value.
to
and
value.
to
and value.
to
and
arg2 *AINT(arg1/arg
-
1 the
undefined
in
in
radians.
part
of
.
compared
compared
compared
compared
arg2)'
sign
radians.
For
of
argument
as a real
argument
(base
(base
All
All
All
All
Evaluated
is
the
if
complex,
For
complex,
(zero
value.
(fractional
e).
10).
arguments
as
real
arguments
as
integer
arguments
as
real
arguments
as
integer
same
as
arg2 = O.
For
complex,
see
values.
values.
as
)
2
arg1 .
if
are
are
values.
are
are
values.
CABS.
see
not
com-
part
con-
con-
con-
con-
see
ATAN }
{
ATAN2
CABS
CACOS
CASIN
CATAN
CCOS
1,2
Real
Complex
Complex
Complex
Complex
Complex
Real
Real
Complex
Complex
Complex
Complex
Arctangent arg2 = abscissa assumed arg1/arg2
-
1T<
see
CATAN.
Complex
CABS(x
Complex
=
Complex
=
Complex
= u +
-
-1T<US1T.
Complex
= (e
in
1.
Resul t
quadrant
R S
1T.
absolute
+ iy)
arc
-i . CLOG(Z arc
-i . CLOG(i arctangent.
iv
= -
CLOG(l -iZ)),
cosine.
iZ
+ e
radians.
(x).
ATAN(O,O) =
cosine.
If
(R)
allocated
value
=.y
x
Arg1 =
arg2
is
arctangent
(i.
e., modulus).
2
+
y2
CACOS(Z)
+ CSQRT(Z2 - 1))
sine.
CASIN(Z)
. Z + CSQRT(l - Z2))
CATAN(Z)
~
(CLOG(l + iZ)
allocated
CCOS(Z)
-iZ)/2.
ordinate
is
not
in
O.
present,
the
For
such
(y),
of
range
complex,
that
Library
Subprograms
87
Table 9.
Intrinsic
and
Basic
External
Functions
(cont.)
r
Intrinsi c Names
CCOSH
CDABS
CDACOS
CDASIN
CDATAN
CDBLE
CDC as
CDCOSH
CDEXP
CDLOG
Number Arguments I Argument
1
1
1
1
1
1
1
1
1
1
of
Type
of
Complex
Complex*16
Complex*16
Complex*16
Complex*16
Complex
Complex*16 Complex*16
Complex*16
Complex*16
Complex*16
Type
I
of
Result
Complex Complex
Real*8
Complex*16
Complex*16
Complex*16
Complex*16
Complex*16
C-omplex* 16
Complex*16
I
Definition
Double See
Double
Double
Double
Converts
Double
Double CCOSH.
Double
Double
See
hyperbolic
Z
= (e + e
complex
CABS.
complex
complex
complex
complex
complex
complex
complex
complex
CLOG.
of
Function
-Z
cosine.
)/2.
absolute
arc
cosine.
arc
sine.
arc
tangent.
to
double
cosine.
hyperbolic
exponential.
natural
logarithm
CCOSH(Z)
value
See
See
See
complex.
See
CCOS.
cosine.
See
(modulus).
CACOS.
CASIN.
CATAN.
See
CEXP.
(base
e).
CDSIN
CDSINH
CDSQRT
CDTAN
CDTANH
CEXP
CLOG
CMPLX
CONJG
COS
1
1
1
1
1
I
1
1
2 Real
1
1 Real
Complex*16
Complex*16
Complex*16
Complex*16
Complex*16
I
Complex
Complex
Complex
Complex*16
Complex*16
Complex*16
Complex*16
Complex*16
Complex
Complex
Complex
Complex
Real
Double
Double
rC'
\.....)lI
Double
Double
Double
CTANH.
Complex
Complex
a
Converts plex
Complex
Cosine
see
complex
complex
rio.
II
I
....
n.
complex
complex
complex
exponential
CEXP(x + iy)
EXP(x) . (COS(y) + i .
=
natural
CLOG(Z) = CLOG(x
+ iv =
such
two
noncomplex
conjugate.
of
angle
In
that
CMPLX(x,y) = x +
= u
/located
number.
CCOS.
sine.
See
CSIN.
hyperbolic
square
root.
tangent.
hyperbolic
logarithm
(e **
See
arg).
(base e)
+ iy)
Izi
+ i . ATAN (y,x)
-IT
<
v:s
numbers
CONJG(x
in
radians.
sine.
See
CTAN.
tangent.
SIN(y)).
IT
iy.
+ iy)
For
complex,
See
CSQRT.
See
I
to a com-
=x-iy.
COSH
CSIN
88
Library Subprograms
1
1
Real Real
Complex
Complex
Hyperbolic
Complex
= (e i Z _ e
cosine.
sine.
CSIN(Z)
-i
Z) /
For
(2i).
complex,
see
CCOSH.
Table
9.
Intrinsic
and
Basic External
Functions
(cont.)
Intrinsic Names
CSINH
CSNGL
CSQRT
CTAN
CTANH
DABS
DACOS
DASIN
Number Arguments
1
1
1
of
1
1
1
1
1
Type
Type
of
Argument
Complex Complex
Complex*16
Complex
Complex
Complex
Real*8
Real*8
Real*8
of
Result
Complex
Complex
Complex Complex
Complex
Real*8
Real*8
Real*8
Definition
Complex
=
Converts
Complex
= u +
that
=
_ ( i Z
- e
Complex CTANH(Z) = CSINH(Z)/CCOSH(Z)
= (e - e ) / e + e
Double
Double
Double
of
Function
hyperbolic
Z
(e
u
CSIN(Z) / CCOS(Z)
-Z
- e ) double
square
.
IV
= e ,
~
O.
tangent.
-e
hyperbolic
Z
-Z
precision
precision
precision
sine.
/2.
complex
root.
(In Z)
/2
CTAN(Z)
-i
Z) / . ( i Z + - i Z)
lee.
tangent.
Z
absolute
arc
cosine
arc
sine
CSINH(Z)
to
complex.
CSQRT(z)
allocated
-Z ).
value.
in
in
radians.
radians.
such
{DATAN }
DATAN2
DBLE
DCMPLX
DCONJG
DCOS DCOSH DDIM
DEXP DFLOAT
DIM
DIMAG
DINT
DLOG
1,2
1
2 Real*8
1
1 1 2
1 Real*8 1
2 Real Real
1
1
1
Real*8
Real
Complex*16
Real*8 Real*8 Real*8
Integer
Complex*16
Real*8 Real*8
Real*8
Real*8
Real*8
Complex*16
Complex*16
Real*8 Real*8 Real*8
Real*8 Real*8
Real*8
Real*8
Double See
Argument precision.
Converts double
Double
Double Double Double
See
Double
Argument Same integer
Positive
precision
ATAN.
two
complex
complex
precision precision
precision
DIM.
precision
as
DBLE,
arguments.
difference.
converted
converted
= x - min
Imaginary ment,
Integer a
double
Double (base
part
expressedasadouble
part
precision
precision
e).
arctangent
to a val
noncomplex
number.
conjugate.
consine hyperbolic positive
exponential
to
but
generally
(x,y).
of a double
of
the
argument value.
natural
in
ue
numbers See
See
of
angle
cosine.
difference.
double
DIM (x,y)
complex precisionvalue.
expressed
logarithm
radians.
with
to
CMPLX.
CONJG.
in
(e **
arg).
precision.
used
with
double
a
radians.
argu-
as
Library Subprograms
89
Table
9.
Intrinsic
and
Basic E;I(ternal
Functions
(cont.)
r
Intrinsic
Names
DLOG10
DMAXl
DMINl
DMOD
DREAL
DSIGN
DSIN 1
DSINH
I
I
Number
Arguments
1
N:::2
N:::2
2
1
2
1
of
Type Argument
I
1*8
Rea
Real*8
Real*8
Real*8
Complex*16
Real*8
Real*8
Real*8
of
I
I
Type Resuit
Real*8
Real*8
Real*8
Real*8
Real*8
Real*8
Real*8
Real*8
of
Definition
I
Double (base
Double ments double
Double ments double
Double See
Real expressed
Double sign positive.
Double
Double
precision
10).
precision
are
precision
precision
are
precision
precision
AMOD
part
precision
of
arg
precision
precision
of
Function
common
maximum
converted
values.
minimum
converted
values.
arg
•.
of a double
as a double
magnitude
If
arg
.
2
sine
hyperbolic
to
and
to
and
(mod
1
complex
precision
is
zero,
2
of
logarithm
value.
compared
value.
compared
arg2).
argument,
of
the
angle
sine.
value.
argl
sign is
in
radians.
All
All
with
argu-
as
argu-
as
DSQRT
DTAN
DTANH
EXP
FLOAT 1
I
lABS 1
lAND
ICOMPL
IDIM 2
IDINT
IEOR
IEXCLR
1
1
1
1 Real
2
1
1
N
:::
2
:::
2
N
Real*8
Rea!*8 Rea!*8
Real*8
Integer
Integer
Integer
Integer
Integer Integer
Real*8
Integer
Integer
I
I
,
Real*8
Real*8
Real
Real
Integer
Integer
Integer
Integer
Integer
Integer
Double
[)nllhlp
I
-
---.-
I
Double
Exponential see
CEXP.
Argument
Integer
Logical
Logical INOT.
Integer
= j -
Argument
Logical
Logical
IEOR.
precision
nrpric;inn
1-·--'-'-"
precision
(e **
converted
absolute
AND
(extract).
NOT
(lis
positive
MIN(j,k).
converted
EOR
(exclusive
EOR
(exclusive
square
root
(positive
tnnnpnt
·_··v-···
hyperboli c tangent.
value.
difference.
..
arg).
For
complex,
to a real
complement).
to
an
integer
OR).
OR).
value.
IDIM(j,k)
Same
Same
value.
as
value).
as
INOT
{INT}
IFIX
90
library
Subprograms
1
1 Real
Integer
Integer
Integer
Logical
Argument
NOT
(lis
converted
complement).
to
an
integer
va
lue.
Intri nsi c Names
Number
Arguments
of
Table
Type
Argument
9.
of
Intrinsic
and
Type Result
Basic
of
External
Functions
Definition
(cont.)
of
Function
lOR
ISA
ISC
ISIGN
ISL
MAX
MAX
MINO
2
2
2
2
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Logical
Integer arithmetically in the
Integer circularly arg2' right.
Integer
If
is
2
0
1
N ~ 2
Integer
Integer
Real
Integer
Integer
Integer
Integer
Integer
Integer
logically arg2' right.
Integer
Integer
Integer converted
arg2'
right.
arg2
not
OR
(merge).
shift
arithmetic.
If
arg
shift
circular.
the
If
arg2
magnitude
is
zero,
converted
shift
logical.
the
number
If
arg2 is-
maxi
mum
maximum
minimum
to
and
the
number
negative,
is
2
number is
negative,
of
the
sign IS
to
integer
negative,
val
value.
value.
compared
Arg1 is
Arg1 is
of
bits
g
) with sign
ar
Arg1 is
of
bits
ue.
All
of
bits
the
shifted
specified
the
shift is
positive.
.
shifted
specified
the
shift is
arguments
in
integer.
shifted specified
shift is
left
in
to
of
arg2'
Arg2
left
in
to
are
left
to
the
the
MINl
MOD
REAL
SIGN
SIN
SINH
SNGL
SQRT
TAN
TANH
N
2
1
2
~
2
Real
Integer
Complex
Real
Real
Real
Real*8
Real
Real
Real
Integer
Integer
Real Real
Real
Real
Real
Real
Real
Real
Integer converted precision.
Arg1 (mod
where
i.
Function Real Magnitude
arg2 is
Sine see
Hyperbolic CSINH.
Argument (single)
Square see
Tangent see
Hyperbolic CTANH.
minimum
argl -arg2 * [arg1/arg2J
the
e.,
the
part
zero,
of
angle
CSIN.
precision.
root
CSQRT.
of
CTAN
value.
to
and
compared
arg2)'
brackets
sign is
is of a complex
converted
the
undefined
of
arg
1
the
sign is
in
radians.
cosine.
(positive
angle
in
tangent.
Evaluated
with sign
All
indi
cate
same
as
if
arg2 = O.
number.
positive.
For
complex,
to a value
va
lue).
radians.
For
complex,
arguments
in
double
as
integer
arg1'
of
arg2'
For
complex,
with
For
For
are
part;
If
see
real
complex,
complex,
see
li
brary
Subprograms
91
SLITET -Sense
Form:
where
[
CALL
n
SLITET
is
an
Light Test
(n,v)
integer
constant
or
scalar
variable
specifying
whi
ch
sense
light
is
to
be
tested
(1
:s n :s
4).
[
v is
Sense
light
stored.
SLITE -Set
Form:
where
If
OVERFL -
Form:
where
If
flow Overflow
Following
CALL
n is
n is 0,
a
all
CALL OVERFL
floating
condition
an
n is
Sense
SLITE
an
sense
Floating
is
an
overflow
exists,
and
underflow
integer
tested.
the
Light
(n)
integer
lights
Overflow
(s)
integer
variable
If
the
test,
constant
will
variable
has
occurred,
s is set
are
in
sense
the
sense
or
be
turned
Test
into
to
3.
defined
which
light
light
scalar
which
s is The
in
the
the
is
on,
will
variable
Offi
if
will
set
to
machine
Sigma
result
the
be
n is
be
1 i
if
of
the
value
turned
(O:s n :s
1,2,3,
stored
no
overflow
is
left
in a
computer
test
wi
1 will
off.
4).
or 4,
the
result
no
reference
II
be
stored.
be
stored
the
corresponding
of
the
condition overflow
manual.
in
Vi
if
it
test.
exists,
s is set
(underflow)
is
off,
sense
light
to
condition
the
2.
value
2 will
will
be
turned
If
a
floating
following
the
be
on.
under-
test.
[
92
DVCHK -
Form:
CALL DVCH K
where
This is
another
library
Divide
Check
(s)
is
an
integer
entry
Subprograms
variable
to
the
into
OVERFL subprogram
which
will
be
stored
described
the
result
above.
of
the
test.
FLAG
operates
tion
or
combined
This is
one
programs.
under
compilation
of
FLAG's most
control
of
the
and
execution
attractive
Sigma
features,
9.
OPERATIONS
5/7
Batch Processing
is a simple
together
procedure
with
its foci
Monitor
requiring
lity
(BPM).
the
for
Preparing
preparation
rapid
compi
a FLAG job for
of
a few
control
lation
and
execution
compila-
cards.
of
The user has a number
on
the
FLAG
control
Running a FLAG
Figures 3 ASSIGN,
BPM
the
The
different
ted
data
FLAG
The
Every FLAG job must
and 4 later
EOD,
arrange
FLAG
control
ASSIGN
from
if
M:SI
were
indications
card,
FLAG
Control
and
for
the
card
cards
the
standard
not assigned
could
is
available
Card
Job
shown in
of
convenient
card.
in this
FIN
cards
computer
required
ones
be
read
in
be
preceded
Option
chapter
shown in
operator
for his job.
the
examples
provided
to
the
from
the
Sigma
processing
codes
are
show
sample
the
to
insert
are
at
card
reader.
magnetic
5/7
Batch Processing
by a FLAG
options
explained
deck
examples
these
necessary
his
installation.
tape
control
at
setups for
control
That is,
or
disc.
card.
his-
later
are
standard
only
if
the
Detailed
Monitor
Its format is
disposal,
in
this
compiling
cards in
the
programmer
The
source
program
Reference
all
of
which
chapter
BPM
information
the
program
decks
in
and
control
FLAG
together
can
Table
executing
cards.
deck,
requires
decks
on
all
Manual
be
controlled
10.
FLAG jobs. The
Many
installations
the
programmer
file
or
I/o
and
EOD
with
their
control
(SDS 90
cards,
09
by
option
supplying
device
cards
would
appropriate
except
54).
codes
JOB,
using
only
assignments
be
omit-
end-of-
the
The
exclamation
it
may
begin
of
the
program.
fault.
one
blank
only
that
DEFAULT
When
the
successively
will stantially
Once
FLAG has
each
subjob.
:FLAG
On
this
on
every standard! account
not
actually
If
option
column.
the
indicates
BJ
reduces
[(account
card
:FLAG
FLAG
number,
mark must
in
any
Option
codes
list
of
option
compile
the
read
Figure 5
the
characters
card
option name,
entered
be
placed
column
(The options
which
code
after
codes
are
are
given,
brackets
is
not
options
is
specified
and
execute
processing
the
BJ
option
illustrates
number, name)]
:FLAG must
if
the
AC
option
codes
are
and
the
on
the
card.)
in column
the!
character.
not
requiredi
they
must
be
around
the
option required.) are
in
on
time
required
code
how
the
[,option1,option2,.·.
valid
list
of
The
effect
the
! FLAG
any
number
on
the!
:FLAG
appear
has
been
on a :FLAG
option
codes
1.
The FLAG
The
if
none
separated
list shown
option
unless
their
card,
of
separate
for
each
FLAG
card
is
in columns
specified
card
indicate
control
optioni
are
are
specified,
by commas,
above
codes
are
complementary
FLAG
FLAG programs,
program in
card
it
expects
used in
,optionnJ
1-5.
on
the
except
only
batch
option
and
must
given
enters
the
processing.
The
user's ! FLAG for
NOBJ,
that
these
command
codes
FLAG
wi
the
first
not
be
in
Table
options
the
batch
job
stream.
to
find a :FLAG
account
card;
AC,
items
is
usually
that
control
II perform
code
must
entered
10. In have
been
job mode.
or
IIsubjobs". Use
card
Format
number
otherwise
and
are
they
NOAC.
not
begun
in column 2, though
processing
certain
be
preceded
on
the
card:
Table
10,
selected.
In
this mode, FLAG
immediately
of
the
and
name
are
(The
required;
and
operations
by
they
the
notation
of
this
option
:FLAG
card
are
required
optional.
brackets
the
brackets
execution
by
de-
at
least
indicate
sub-
preceding
is
All
around
are
Operations
93
r
Any
The work deck.
The
I/O
source
but
batch
unit
number assignments in
program
:EOD
job
deck
is
preferred.)
stream is
terminated
for
each
subjob must be
If
no
data
by
effect
the
when
is
present,
first!
the
batch
separated
the
control
job
from its
:EOD
card
encountered
run
card
is
started
data
is
by
still
remain in
an
:EOD
required
(other
than
effect
card.
to
terminate
:EOD).
for
all
subjobs.
(An IEOD
the
card
source
will
also
program
Option
DB NODB
GO
NOGO
LS NOLS BC
NOBC
LO
NOLO
AD
NOAD
CX
NOCX
M,!l
Code
Meaning The program The program is Note
generated
too
large
The program is
detected When
checking Note
executed A
printed
No
I isting
FLAG will (EOD)
the
series will
This
option compiled followed by vents
FLAG will
end-of-data A
machine-language
mat similar
No
machine-language
All
REAL ables, analyzing
No
"automatic
Source
and
will
Source FLAG.
(Where!!.. One
segment consists other variables
tenths ample, 2/10
is
is
compiled not
that
use
of
for
the
to
run
executed
during
compilation
of
the
that
if
neither
unless
listing
of
the
compile
indication,
be
is
mainly
as a
unit
an
it
from assuming
terminate
indicator.
to a Meta-Symbol
variables,
constants, and functions
the
improvement in
card-images
be
compiled
card-images
(DEFAULT)
is a digit
segment
of
that
the
available
M8
specifies
to
be used for
contains
were
Table 10. FLAG
and
compi led in
the
DB
option
program
with
compilation.
is
source
one
of
source
until two
executed,
but
EOD
(typically
"debug"
when
finished,
program
GO
nor
or
more serious errors
the
FORTRAN
statements
a series
of
successive if
intended
have
been
record.
"end-of-program"
compilation
(DEFAULT)
I isting
of
I isting
constants,
double
precision"
containing
by FLAG.
containing
1 through
of
the
noninitialized
the
machine
initialized
memory
that
8/10
the
program
Option
executed
"debug" will
may
compilation
the
NOGO
source
appropriate.
for use
The
the
listing.
is
and
are
accuracy
an
an
9)
in a
are
of
in
mode.
cause
30
to
be
able
program is
without
produced.
execution.
are
statements
is
produced. programs,
end-of-data
where
stored on
BC
option
upon
encountering
instructions
functions implicitly
that
is
invoked.
X in column
X in column 1 will
FLAG
divides
instructions
DATA
to
be
memory
code
and
Codes
"debug"
substantially
40%
specified,
have
when a
variables
statement.
used for
is
mode.
(DEFAULT)
more),
to
run
without
is finished,
not
executed.
the
been
detected
in
the
source
each
followed by a
indications
a main program
magnetic
code
(DEFAUL n
are
results from
tape,
alerts
single
an
generated
implicitly
COMPLEX*16. This
(DEFAUL n
1,
wi
II
have
be
total
available
that
generated
The!!..
the
noninitial
to
be
used for non
initialized
more
machine
and
that
it.
whether
This
compiled
during
program
and
and
FLAG
EOD
is
IEOD
card
by FLAG
REAL
double
the X replaced
treated
aie
used iii
for
the
value
initial
variables.
instructions
some programs
or not errors
option
program will still
compilation.
is
produced.
single
are
encountered.
subprograms
therefore
to
this
condition
encountered.
or
some
is
produced
*8;
all
option
precision
as comment cards by
memory
ized
into
the
program and also
specifies
data
ized
This
that
have
allows
syntax
(DEFAUL
end-of-data
are
each
program
other
in a
COMPLEX
is
useful for
calculations.
by a
two segments.
piogiam. The
how many area. variables
option
need not
to
been
Then
to
and
single
space,
any
For
and
be
are
be
n
be
is
pre-
for-
vari-
ex-
be
94 Running a FLAG
Job
Table
10. FLAG
Option
Codes
(cont.)
Option
M.!J.
(cont
BJ
NOBJ
AC
NOAC TL = sss
PL=ppp
PS
Code
.)
=nnn
Meaning specified
size Error ARRAYS
PROGRAM
DICTIONARY OVERFLOW
The Enter
the! Run
Punch
used,
No
Set may run. This
Set will
Note
BJ
low. limit
Set that
statement. The remainder
vqriables. tion variables
When
compilation structions gram of
NOGO is possible the
unless FLAG
allocation
Message
TOO
default
"batch
FLAG
in
standard
separate
should accounting time
limit for
page
limit for
be
allowed.
that
option,
Furthermore,
that
may
program
may
be
of
memory
is
attempting
are
and
initialized
the
NOGO
is
PS
option
indicates
problem
LARGE
TOO
option
job" mode. A sub job
control
(nonbatch)
accounting
appear
records
time
if
either
the
value
be
size used
The
PS
size.
given
using
stored
compilation,
not
specified.
to
run
set
LARGE
is
M7.
card.
on
wi
current
includes
current
the
TL
specified
the
specified
for
current
to
hold
option
The
at
the
to
run
the
NOGO into variable
the
program,
equal
has
the!
limit
end
very
to
occurred:
All
subsequent
mode.
records for
FLAG
II
be
punched
job or
compilation
job
or
or
PL
is used
specified
on a
job
the
program
of
avai!able
is
similar
actual
of
the
large
and
memory,
area.
is
correct
If
the
and
the
indicated
by
one
Action
increase
decrease
increase
beginning
(DEFAULT)
control
subjob,
subjob,
option
subjob's
or
sub job,
and any
to
amount
source
programs, M9
hence
The
actual
the
of
the
following
to
Take
n
error
-n
n
with
a :FLAG
subjobs must
each
subjob in
card
for sub jobs. (DEFAULT)
where
and
execution.
where
appears
as
the
default
on a ! FLAG
:FLAG
where
variables
memory
the
Mn
option
of
memory used by
program
it
options.
substantially
actual
and
is
the
total
size
program should
size
of
the
that
initiates
sss
is
the
ppp is
on a
!FLAG
limit for
control
control
nnnn is
vIi!!
be
but
listing.
is
sometimes a
When
program
same as
is less
the
program
also
begin
batch.
number
the
number
card.
the
that
used
allows
NOGO less memory
size,
the
than
be
submitted
messages
card
the
control
each
card
number
were
to
hold the
the
good
is
which
size
the
and
must
immediately
with
:FLAG
The AC batch
of
seconds
of
output
card
of
the
becomes
of
initialized
for more program
idea
specified
is
needed is
of
the
available
again,
initialized
that
a memory
follow
cards.
option,
run.
that
subjobs
the
words
noninitia!ized
accurate
and
to
listed
program when
that
the
pages
also
maximum
of
memory
in a
initialized
make
no
machine
for
the
at
the
total
size,
this
time
variable
when
that
has
that
DATA
alloca-
the
job
the fol-
first
in­pro­end
it with area.
Job
Setup
Figure 3 shows beginning SHERROD,
As
previously
quired The!
lowing gram regardless machine-language
The! of
the
and
end-of-program
source
Examples
of
a new job
and
nonstandard
FLAG
card
the
FLAG command
to
be
compi led
of
errors
FLAG
card
deck
to
deck
and
the
deck
the
job has
explained,
assignments.
summons
(GO),
statements
is
followed
the
compiler.
could
its
terminating!
setup
to
and
BPM,
priority
the
the
are executed produce
by
be
required
and
specifies
1.
!ASSIGN
FLAG
compiler
explained
in
a listing
generated
the
source
If
the
source
indicated
EOD
for
compiling
card
(with assignment codes) would
in
Table
"debug
of
by
the
program
program
by some
card
would
that
the
to
begin
10. Briefly,
ll
mode (DB),
the
source
compi
deck,
did
other
be
and
executing a single
job
is
compilation
execute
program
ler
(LO).
in turn
not
require a data
terminator
omitted
to
be
run
of
the
the
codes
the
statements
followed
such as a ! FIN
if
M:SI
were
program. The
under
account
be
source
shown
program when compi
(LS),
by
an
deck,
not
number 1234,
present
assigned
only
program. The
in
the
example
and
produce
! EOD
card
the!
EOD
card
or a new
to
!JOB
if
card
the
the
option
lation
a listing
which
card
Job
card
signals
the
user
programmer
codes
request
is
finished
indicates
could
!JOB
reader.
Setup
the
of
be
card.
Examples 95
the
is
re-
fol-
pro-
the
the
omitted
end
The
Loading...