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
Current working directory
Directories specified by the -Idir (Linux and Mac OS) or /include (Windows) option
Directory specified by the -isystem option (Linux and Mac OS systems only)
Directories specified with the FPATH (Linux and Mac OS) or INCLUDE (Windows) environment variable
Standard system directories
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.
You can use the -Idir (Linux and Mac OS) or /include (Windows) option to indicate the location of include files (and also module files).
To prevent the compiler from searching the default path specified by the FPATH or the INCLUDE environment variable, use the -X or /noinclude 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 a specified path instead of the default path, use the following command line:
ifort -X -I/alt/include newmain.f (Linux and Mac OS)
ifort /noinclude /include:C:/Project2/include newmain.f (Windows)