HP Fortran Programmer's Reference (September 2007)

I/O and file handling
Syntax of I/O statements
Chapter 8 223
The following restrictions apply to the use of arrays in input and output:
Sections of character arrays that specify vector-valued subscripts cannot be used as
internal files.
An assumed-size array cannot be referenced as a whole array in an input or output list.
The following restrictions apply to the use of structures and records in input and output:
All components of the structure or fields of the record must be accessible within the
scoping unit that contains the data transfer statement.
Every component of the structure or field of the record is written.
A structure in an I/O list must not contain a pointer that is an ultimate component—that
is, the last component in a variable reference. In the expression
a
%
b
%
c
,
a
and
b
can be
pointers, but not
c
.
Implied-DO loop
An implied-DO loop consists of a list of data elements to be read, written, or initialized, and a
set of indexing parameters. The syntax of an implied-DO loop in an I/O statement is:
(
list
,
index
=
init
,
limit
[,
step
])
where
list
is an I/O list, which can contain other implied-DO loops.
index
is an integer variable that controls the number of times the elements in
list
are read or written. The use of real variables is supported but
obsolescent.
init
is an expression that is the initial value assigned to
index
at the start of the
implied-DO loop.
limit
is an expression that is the termination value for
index
.
step
is an expression by which
index
is incremented or decremented after each
execution of the DO loop.
step
can be positive or negative. Its default value is
1.
Inner loops can use the indexes of outer loops.
The implied-DO loop acts like a DO construct. The range of the implied-DO loop is the list of
elements to be input or output. The implied-DO loop can transfer a list of data elements that
are valid for a write operation.
index
is assigned the value of
init
at the start of the loop.
Execution continues in the same manner as for DO loops (see “DO construct” on page 141).