Intel fortran-80 Laptop User Manual


 
Defining Variables, Arrays,
And
Memory
3-12
where
'nlist'
is
a list
of
variable names,
array
names
or
array
element names.
The
lat-
ter
may
only be subscripted by integer
constants.
The
use
of
an
array
name
un-
qualified by a subscript
is
the same as a reference
to
the first element
of
the
array.
Function
names
and
the names
of
dummy
arguments
may
not
be listed.
Equivalenced items
may
have different
data
types,
although
this
is
not
recommend-
ed.
The
EQUIV
ALENCE
statement
does
no
type conversion.
Example:
INTEGER*
1,
ARRAY(3), LlST(6)
REAL
FPNUMB
EQUIVALENCE (ARRAY,LlST), (LlST(4),FPNUMB)
The
resulting
memory
allocation would be:
I A(1) I A(2) I A(3) I
ARRAY
LIST
L(1) I L(2) I L(3) I L(4) I
L(S)
I L(6) I
FPNUMB
I LOW I I HIGH I
The
EQUIV
ALENCE
statement
must not cause the same storage item
to
occur
more
than
once in a
memory
sequence,
nor
can
it
result
in
the splitting
of
a
memory
se-
quence.
Examples:
C
THE
FOLLOWING
EXAMPLES ARE
INVALID
DIMENSION ARRAY(3)
EQUIVALENCE (ARRAY(1),FPNUM B),(ARRAY(2),FPNUMB)
C
FPNUMB
OCCURS MORE
THAN
ONCE
IN
MEMORY
SEQUENCE
REAL TABLE(2), ROOTS(3)
EQU IV
ALENCE
(T
ABLE(1), ROOTS(1 )),(TABLE(2),
&ROOTS(3))
C MEMORY SEQUENCE IS SPLIT
3.4.2 COMMON Statement
Common
memory
blocks allow
data
and
memory
to be shared
throughout
an
entire
program.
The
COMMON
statement
defines
common
blocks
that
may
be either
named
or
unnamed
(that
is,
'blank').
The
format
of
the
COMMON
statement
is:
COMMON
[/[eb]!]
nlist
[[,]/ [eb]!
nlist]
...
where
cb
is
the
name
of
a
common
block.
nlist
is
a list
of
variable names,
array
names,
or
array
declarators.
Function
names
and
the
names
of
dummy
arguments
cannot
be
listed.
FORTRAN-80