Intel fortran-80 Laptop User Manual


 
FORTRAN-SO
6.3.1.2
Input
List
The
list 'in-list' in the
READ
statement identifies the items whose values are
to
be
read.
An
item in
an
input
list must be a variable name,
array
name,
or
array
element
name.
If
an
array
name
is
listed, the entire
array
is
read in
normal
array
element
ordering sequence. The
name
of
an
assumed-size
dummy
array
must
not
appear
in
the input list.
6.3.1.3 Implied-DO List
An
implied-DO list embedded in the
READ
statement allows a range
of
subscripts
to
be used for input list
array
elements.
For
example,
half
the items in
an
array
can be
read without specifying each individual
array
element to be read. The
format
of
the
implied-DO list
is
(in-list, var =
el,
e2, e3)
where
'var,
el,
e2, and e3' have the same interpretation as for the
DO
statement
(section 4.2.2)
and
'in-list'
is
a list
of
input
items as described above. The list 'in-list'
may also contain additional
implied-DO lists.
For
READ
statements, the
DO
variable
'var'
must not
appear
as
an
item in 'in-list.'
Example:
CREAD
ONLY
THE ODD ELEMENTS IN ARRAY 'TABLE'
DIMENSION TABLE(60)
READ
(2,
20)
(TABLE(N), N =
1,59,2)
20
FORMAT
...
6.3.2 WRITE
Statement
The
WRITE
statement
outputs
data
to
a specified unit.
The
format
of
the
WRITE
statement
is
WRITE
(ctl-list)
[out-list]
where
ctl-list
out-list
is
a list
of
control
information
specifiers
is
a list
of
the
data
to be written
The control
information
list
is
the
same as for the
READ
statement (section 6.3.1.1
and
following subsections) except
that
no
END
specifer
is
allowed. The
output
list
'out-list'
is
defined in the same
manner
as the 'in-list'
portion
of
the
READ
state-
ment, including the
implied-DO
option
(sections 6.3.1.2
and
6.3.1.3).
Like input list items,
an
output
list item
may
be a variable name,
array
name,
or
ar-
ray element name. An
output
list item
may
also be
an
expression, including
an
ex-
pression involving
operators
or
enclosed in parentheses.
Examples:
WRITE (6,120) PNAME, AVG
120 FORMAT
...
WRITE (6,120,IOSTAT= ERRFLG, ERR=2000)
&PNAME +
I,
AVG + I
120 FORMAT
...
DIMENSION PNAME(25), AVG(25)
C WRITE DOUBLE COLUMN PRINTOUT
OF
FIRST ITEMS
OF
C EACH ARRAY
WRITE (6,120)(PNAME(K), AVG(K),
K=1,
10)
120 FORMAT
(1X,
A,
5X, F4.3)
Input/Output
6-13