02.07.2014 Views

Intel(R) Fortran Language Reference (online version)

Intel(R) Fortran Language Reference (online version)

Intel(R) Fortran Language Reference (online version)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8 <strong>Intel</strong> <strong>Fortran</strong> <strong>Language</strong> <strong>Reference</strong><br />

PROGRAM TEST<br />

INTEGER C, D, E(20,20)<br />

CALL SUB_1<br />

...<br />

CONTAINS<br />

SUBROUTINE SUB_1<br />

...<br />

END SUBROUTINE SUB_1<br />

END PROGRAM TEST<br />

! Specification part<br />

! Executable part<br />

! Internal subprogram<br />

See Also<br />

Building Applications for details on the default name for a main program<br />

Modules and Module Procedures<br />

A module contains specifications and definitions that can be used by one or more program units.<br />

For the module to be accessible, the other program units must reference its name in a USE<br />

statement, and the module entities must be public.<br />

A module takes the following form:<br />

MODULE name<br />

[specification-part]<br />

[CONTAINS<br />

module-subprogram<br />

[module-subprogram]...]<br />

END [MODULE [name]]<br />

name<br />

Is the name of the module.<br />

specification-part<br />

Is one or more specification statements, except for the following:<br />

• ENTRY<br />

• FORMAT<br />

• AUTOMATIC (or its equivalent attribute)<br />

• INTENT (or its equivalent attribute)<br />

• OPTIONAL (or its equivalent attribute)<br />

• Statement functions<br />

8-4

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

Saved successfully!

Ooh no, something went wrong!