FORTRAN Reference Manual

Introduction to File I/O in the HP NonStop
Environment
FORTRAN Reference Manual528615-001
5-29
List-Directed I/O
List-Directed Input
The form of the input field must be acceptable for the type of the input list item. Input
data consists of a string of values separated by one or more blanks, by a comma, or by
a slash (/). If the separator is a comma or a slash, it can be preceded and/or followed
by any number of blanks. The end of a record is treated as a blank character. Input
values must not contain embedded blanks nor span records except for character
values or complex numbers.
To repeat a value, enter an integer repeat constant followed by an asterisk and the
value to repeat. Do not use blanks in a repeat specification.
READ *, j, k
Input: 2*50 Value: 50 50
Table 5-8. Input Format in List-Directed I/O
Type Format
Integer Integer constant format.
Real Valid FORTRAN format for real or double precision numbers. If you omit the
decimal point, FORTRAN assumes that the decimal point is to the right of the
mantissa.
Complex Two real values, separated by a comma, and enclosed in parentheses. The
parentheses are not considered to be separators. You can omit the decimal
points in each of the components.
Character A string of characters enclosed by apostrophes. Use two adjacent
apostrophes with no intervening blanks to indicate an enclosed apostrophe.
You can continue a character constant from the end of one record to the
beginning of the next, for as many records as are needed.
You can read character values only into character arrays, character variables,
and substrings. If the string is shorter than the list item, FORTRAN left-
justifies and blank fills the string; if the string is longer than the list item,
FORTRAN truncates the rightmost characters; for example:
CHARACTER*11 title
READ *, title
Input: 'Quarterly Results'
Value: Quarterly R
Logical An optional period, followed by T or F, followed by optional characters which
do not include separators.