Intel® Fortran Compiler 17.0 Developer Guide and Reference

Specifying Default Pathnames and File Names

Intel® Fortran provides a number of ways of specifying all or part of a file specification (directory and file name). The following list uses the Linux* pathname /usr/proj/testdata as an example:

Examples of Applying Default Pathnames and File Names

For example, for an implied OPEN of unit number 3, Intel Fortran will check the environment variable FORT3. If the environment variable FORT3 is set, its value is used. If it is not set, the system supplies the file name fort.3.

In the following table, assume the current directory is /usr/smith and the I/O uses unit 1, as in the statement READ (1,100).

OPEN FILE value

OPEN DEFAULTFILE value

FORT1 environment variable value

Resulting pathname

not specified

not specified

not specified

/usr/smith/fort.1

not specified

not specified

test.dat

/usr/smith/test.dat

not specified

not checked

/usr/tmp/t.dat

/usr/tmp/t.dat

not specified

/tmp

not specified

/tmp/fort.1

not specified

/tmp

testdata

/tmp/testdata

not specified

/usr

lib/testdata

/usr/lib/testdata

file.dat

/usr/group

not checked

/usr/group/file.dat

/tmp/file.dat

not checked

not checked

/tmp/file.dat

file.dat

not specified

not checked

/usr/smith/file.dat

When the resulting file pathname begins with a tilde character (~), C-shell-style pathname substitution is used (regardless of what shell is being used), such as a top-level directory (below the root). For additional information on tilde pathname substitution, see csh(1).

Rules for Applying Default Pathnames and File Names

Intel Fortran determines the file name and the directory path based on certain rules. It determines a file name string as follows:

Once Intel Fortran determines the resulting file name string, it determines the directory (which optionally precedes the file name) as follows: