Include files are brought into a program with the #include preprocessor directive or a Fortran INCLUDE statement.
Directories are searched for include files in this order:
Directory of the source file that contains the include
Directories specified by the -Idir options
Current working directory
Directories specified with the FPATH environment variable
The locations of directories to be searched are known as the include file path. More than one directory can be specified in the include file path.
A module (.mod) file is specified in a program by a USE statement. Module files can be located in multiple directories.
Directories are searched for .mod files in this order:
Directory of the source file that contains the USE statement
Directories specified by the -module path option
Directories specified by the -Idir option
Current working directory
Directories specified with the FPATH environment variable
You can use the -Idir option to indicate the location of include files and module files.
To prevent the compiler from searching the default path specified by the FPATH environment variable, use the -X option.
You can specify these options in the configuration file, ifort.cfg, or on the command line.
For example, to direct the compiler to search the path /alt/include instead of the default path, use the following command line:
ifort -X -I /alt/include newmain.f