06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

B <strong>Intel</strong> <strong>Fortran</strong> <strong>Language</strong> <strong>Reference</strong><br />

DEFINE FILE u(m, n, U, asv) [, u(m, n, U, asv)] . . .<br />

u<br />

Is a scalar integer constant or variable that specifies the logical unit number.<br />

m<br />

Is a scalar integer constant or variable that specifies the number of records in the file.<br />

n<br />

Is a scalar integer constant or variable that specifies the length of each record in 16-bit words (2<br />

bytes).<br />

U<br />

Specifies that the file is unformatted (binary); this is the only acceptable entry in this position.<br />

asv<br />

Is a scalar integer variable, called the associated variable of the file. At the end of each direct<br />

access I/O operation, the record number of the next higher numbered record in the file is assigned<br />

to asv. The asv must not be a dummy argument.<br />

Rules and Behavior<br />

The DEFINE FILE statement specifies that a file containing m fixed-length records, each<br />

composed of n 16-bit words, exists (or will exist) on the specified logical unit. The records in the<br />

file are numbered sequentially from 1 through m.<br />

A DEFINE FILE statement does not itself open a file. However, the statement must be executed<br />

before the first direct access I/O statement referring to the specified file. The file is opened when<br />

the I/O statement is executed.<br />

If this I/O statement is a WRITE statement, a direct access sequential file is opened, or created if<br />

necessary.<br />

If the I/O statement is a READ or FIND statement, an existing file is opened, unless the specified<br />

file does not exist. If a file does not exist, an error occurs.<br />

The DEFINE FILE statement establishes the variable asv as the associated variable of a file. At<br />

the end of each direct access I/O operation, the <strong>Fortran</strong> I/O system places in asv the record number<br />

of the record immediately following the one just read or written.<br />

The associated variable always points to the next sequential record in the file (unless the<br />

associated variable is redefined by an assignment, input, or FIND statement). So, direct access I/O<br />

statements can perform sequential processing on the file by using the associated variable of the file<br />

as the record number specifier.<br />

B-2

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

Saved successfully!

Ooh no, something went wrong!