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

Closing a File: CLOSE Statement<br />

Usually, any external file opened should be closed by the same program be<strong>for</strong>e it<br />

completes. The CLOSE statement disconnects the unit and its external file. You<br />

must specify the unit number (UNIT specifier) to be closed.<br />

You can also specify:<br />

• Whether the file should be deleted or kept (STATUS specifier)<br />

• Error handling in<strong>for</strong>mation (ERR and IOSTAT specifiers)<br />

To delete a file when closing it:<br />

• In the OPEN statement, specify the ACTION keyword (such as<br />

ACTION='READ'). Avoid using the READONLY keyword, because a file<br />

opened using the READONLY keyword cannot be deleted when it is<br />

closed.<br />

• In the CLOSE statement, specify the keyword STATUS='DELETE'.<br />

If you opened an external file and did an inquire by unit, but do not like the<br />

default value <strong>for</strong> the ACCESS specifier, you can close the file and then reopen it,<br />

explicitly specifying the ACCESS desired.<br />

There usually is no need to close preconnected units. Internal files are neither<br />

opened nor closed.<br />

Record Operations<br />

Record Operations Overview<br />

See these topics:<br />

Record I/O Statement Specifiers<br />

Record Access<br />

File Sharing<br />

Specifying the Initial Record Position<br />

Advancing and Nonadvancing Record I/O<br />

Record Transfer<br />

156

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

Saved successfully!

Ooh no, something went wrong!