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 />

The INQUIRE statement returns in<strong>for</strong>mation about a file and has three <strong>for</strong>ms:<br />

• Inquiry by unit<br />

• Inquiry by file name<br />

• Inquiry by output item list<br />

Inquiry by Unit<br />

An inquiry by unit is usually done <strong>for</strong> an opened (connected) file. An inquiry by<br />

unit causes the <strong>Intel</strong> <strong>Fortran</strong> RTL to check whether the specified unit is<br />

connected or not. One of the following occurs, depending on whether the unit is<br />

connected or not:<br />

If the unit is connected:<br />

• The EXIST and OPENED specifier variables indicate a true value.<br />

• The pathname and file name are returned in the NAME specifier variable<br />

(if the file is named).<br />

• Other in<strong>for</strong>mation requested on the previously connected file is returned.<br />

• Default values are usually returned <strong>for</strong> the INQUIRE specifiers also<br />

associated with the OPEN statement.<br />

• The RECL value unit <strong>for</strong> connected <strong>for</strong>matted files is always 1-byte units.<br />

For un<strong>for</strong>matted files, the RECL unit is 4-byte units, unless you specify the<br />

-assume byterecl option to request 1-byte units.<br />

If the unit is not connected:<br />

• The OPENED specifier indicates a false value.<br />

• The unit NUMBER specifier variable is returned as a value of -1.<br />

• Any other in<strong>for</strong>mation returned will be undefined or default values <strong>for</strong> the<br />

various specifiers.0<br />

For example, the following INQUIRE statement shows whether unit 3 has a file<br />

connected (OPENED specifier) in logical variable I_OPENED, the name (casesensitive)<br />

in character variable I_NAME, and whether the file is opened <strong>for</strong><br />

READ, WRITE, or READWRITE access in character variable I_ACTION:<br />

INQUIRE (3, OPENED=I_OPENED, NAME=I_NAME, ACTION=I_ACTION)<br />

Inquiry by File Name<br />

An inquiry by name causes the <strong>Intel</strong> <strong>Fortran</strong> RTL to scan its list of open files <strong>for</strong> a<br />

matching file name. One of the following occurs, depending on whether a match<br />

occurs or not:<br />

154

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

Saved successfully!

Ooh no, something went wrong!