<Syntax> |
|
|
|
USE [ [ , nature ] :: ] name [ , rename ]...
USE [ [ , nature ] :: ] name , ONLY: only-list
nature ::= INTRINSIC | NON_INTRINSIC
rename | ::= | local-name => remote-name |
| | | OPERATOR(local-operator) => OPERATOR(remote-operator) |
Both local-operator and remote-operator must be user-defined operators (e.g. “.FRED.”), not intrinsic operators (e.g. “+” or “.NE.”).
only-list ::= only-item [ , only-item ]...
only-item ::= name | OPERATOR ( operator ) | ASSIGNMENT (=) | rename
The syntax of operator is described on the INTERFACE OPERATOR statement page.
All USE statements must precede all the other declarations in a scoping unit.
|
|
|
|
|
|
<Semantics> |
|
|
|
The USE statement accesses public entities in a module.
Each rename in a USE statement establishes a local name for the entity from the module.
Multiple USE statements for a particular module are allowed, and all the renaming specified is effective.
If all USE statements for a particular module have the ONLY clause, only the listed entities are accessed.
In Fortran 2003, the user may distinguish between intrinsic modules (provided by the compiler)
and non-intrinsic modules.
If nature does not appear, and there are both an intrinsic module and a non-intrinsic module of that name available,
the non-intrinsic module will be used.
If nature does appear, only modules of the appropriate nature will be used.
Also in Fortran 2003, user-defined operators can be renamed on the USE statement.
|
|
|
|
|
|
<Related> |
|
|
|
END MODULE statement,
INTERFACE OPERATOR statement,
MODULE statement,
ONLY clause,
PRIVATE attribute,
PUBLIC attribute |
|
|