02.07.2014 Views

Intel(R) Fortran Compiler for Linux* Systems User's Guide Volume I ...

Intel(R) Fortran Compiler for Linux* Systems User's Guide Volume I ...

Intel(R) Fortran Compiler for Linux* Systems User's Guide Volume I ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Intel</strong>® <strong>Fortran</strong> <strong>Compiler</strong> <strong>for</strong> <strong>Linux*</strong> <strong>Systems</strong> <strong>User's</strong> <strong>Guide</strong> <strong>Volume</strong> I: Building<br />

Applications<br />

• Add records sequentially by using multiple WRITE statements, close the<br />

file, and then open it again with ORGANIZATION= ' SEQUENTIAL ' and<br />

ACCESS= ' SEQUENTIAL ' (or ACCESS= ' DIRECT ' if the sequential file<br />

has fixed-length records).<br />

Sequential Access<br />

Sequential access transfers records sequentially to or from files or I/O devices<br />

such as terminals. You can use sequential I/O with any type of supported file<br />

organization and record type.<br />

If you select sequential access mode <strong>for</strong> files with sequential or relative<br />

organization, records are written to or read from the file starting at the beginning<br />

of the file and continuing through it, one record after another. A particular record<br />

can be retrieved only after all of the records preceding it have been read; new<br />

records can be written only at the end of the file.<br />

Direct Access<br />

Direct access transfers records selected by record number to and from either<br />

sequential files stored on disk with a fixed-length record type or relative<br />

organization files.<br />

If you select direct access mode, you can determine the order in which records<br />

are read or written. Each READ or WRITE statement must include the relative<br />

record number, indicating the record to be read or written.<br />

You can directly access a sequential disk file only if it contains fixed-length<br />

records. Because direct access uses cell numbers to find records, you can enter<br />

successive READ or WRITE statements requesting records that either precede<br />

or follow previously requested records. For example, the first of the following<br />

statements reads record 24; the second reads record 10:<br />

READ (12,REC=24) I<br />

READ (12,REC=10) J<br />

Limitations of Record Access by File Organization<br />

and Record Type<br />

You can use both access modes on sequential and relative files. However, direct<br />

access to a sequential organization file can only be done if the file resides on<br />

disk and contains fixed-length records.<br />

158

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!