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

.<br />

.<br />

end module<br />

This compiler command:<br />

i<strong>for</strong>t -c a.f90<br />

generates the following files:<br />

• test.mod<br />

• test.o<br />

• payroll.mod<br />

• payroll.o<br />

The .mod files contain the necessary in<strong>for</strong>mation regarding the modules that<br />

have been defined in the program a.f90.<br />

If the program does not contain a module, no .mod file is generated. For<br />

example, test2.f90 does not contain any modules. This compiler command:<br />

i<strong>for</strong>t -c test2.f90<br />

produces just an object file, test2.o.<br />

For another example, assume that file1.f90 contains one or more modules<br />

and file2.f90 contains one or more program units that access these modules<br />

with the USE statement. The sources can be compiled and linked by this<br />

command:<br />

i<strong>for</strong>t file1.f90 file2.f90<br />

Working with Multi-Directory Module Files<br />

For an example of managing modules when the .mod files could be produced in<br />

different directories, assume that the program mod_def.f90 resides in directory<br />

/usr/yourdir/test/t, and this program contains a module defined as<br />

follows:<br />

file: mod_def.f90<br />

module definedmod<br />

.<br />

.<br />

.<br />

end module<br />

The compiler command:<br />

17

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

Saved successfully!

Ooh no, something went wrong!