Intel® Fortran Compiler 17.0 Developer Guide and Reference

Closing Files: CLOSE Statement

Usually, any external file opened should be closed by the same program before it completes. The CLOSE statement flushes any output buffers and disconnects the unit and its external file. You must specify the unit number (UNIT specifier) to be closed.

You can also specify:

To delete a file when closing it:

If you opened an external file and did an inquire by unit, but do not like the default value for the ACCESS specifier, you can close the file and then reopen it, explicitly specifying the ACCESS desired.

Typically, it is not necessary to close preconnected units. Internal files are neither opened nor closed.