I/O combinations on external files are:
Allowed |
Not Allowed |
---|---|
Sequential unformatted Sequential formatted Sequential list-directed Sequential NAMELIST Direct unformatted Direct formatted |
Direct-access, list-directed I/O Direct-access, NAMELIST I/O NAMELIST I/O on internal files Unformatted, internal I/O |
The following table shows combinations of I/O form, access mode, and physical file types.
Table 5-1 Summary of f77 Input and Output
Kind of I/O |
Access Mode: |
||
---|---|---|---|
Form |
File Type |
Sequential |
Direct |
Formatted |
Internal |
The file is a character variable, substring, array, or array element. @ |
The file is a character array; each record is one array element. |
External |
Only formatted records of same or variable length. |
Only formatted records, all the same length. |
|
Unformatted |
Internal |
Not allowed. |
Not allowed. |
External |
Contains only unformatted records. |
READ: Gets one logical record at a time. WRITE: Unfilled part of record is undefined. |
|
List-directed |
Internal |
READ: Reads characters until EOF or I/O list is satisfied.
WRITE: Writes records until list is satisfied. @ |
Not allowed. |
External |
Uses standard formats based on type of variable and size of element. Blanks or commas are separators. Any columns. |
Not allowed. |
|
NAMELIST |
Internal |
Not allowed. |
Not allowed. |
External |
READ: Reads records until it finds $groupname in columns 2-80. Then reads records searching for names in that group, and stores data in those variables. Stops reading on $ or eof.
WRITE: Writes records showing the group name and each variable name with value. |
Not allowed. |
Avoid list-directed internal writes. The number of lines and items per line varies with the values of items.