HP Fortran Programmer's Reference (September 2007)

I/O and file handling
Syntax of I/O statements
Chapter 8222
Simple data elements
In a read operation, the simple data element specifies a variable, which can include:
A scalar
An array
An array element or section
A character substring
A structure
A component of a structure
A record
A field of a record
A pointer
In a write operation, the simple data element can include any variable that is valid for a read
operation, plus most expressions. Note that, if the expression includes a function reference,
the function must not itself perform I/O.
The output list in the following PRINT statement contains two simple list elements, a variable
named radius and an expression formed from radius:
99 FORMAT('Radius = ', F10.2, 'Area = ', F10.2)
PRINT 99, radius, 3.14159*radius**2
The next READ statement contains three simple elements: a character substring (name(1:10)),
a variable (id), and an array name (scores):
88 FORMAT(A10,I9,10I5)
READ(5, 88) name(1:10), id, scores
If an array name is used as a simple data element in the I/O list of a WRITE statement, then
every element in the array will be displayed. If a format specification is also used, then the
format will be reused if necessary to display every element. For example, the following code
INTEGER :: i(10) = (/1,2,3,4,5,6,7,8,9,10/)
88 FORMAT(' N1:',I5, ' N2:',I5, ' N3:',I5)
PRINT 88, i
will output the following:
N1: 1 N2: 2 N3: 3
N1: 4 N2: 5 N3: 6
N1: 7 N2: 8 N3: 9
N1: 10 N2: