(j3.2006) Intrinsic modules

Dick Hendrickson dick.hendrickson
Sat Nov 21 18:08:54 EST 2009

On Sat, Nov 21, 2009 at 2:06 PM, Craig Dedo <craig at ctdedo.com> wrote:

> Van and Everyone Else:
>        No, there is no way to tell a compiler to prefer intrinsic modules
> to nonintrinsic modules of the same names.  In fact, such behavior would
> directly contradict the normative text of the Fortran 2003 standard and the
> current draft.  The relevant text is in section 11.2.1 in Fortran 2003
> (03-007) [254:8-10] and section 11.2.2p3 in the current draft (09-007r3)
> [273:27-28].
> [Begin quote]
> A use-stmt without a module-nature provides access either to an intrinsic
> or
> to a nonintrinsic module. If the module-name is the name of both an
> intrinsic and a nonintrinsic module, the nonintrinsic module is accessed.
> [End of quote]
>        Obviously, any change in this preference rule would create a
> backwards incompatibility with Fortran 2003.
I don't think it's obvious that a compiler switch is "non-standard".  When
the text refers to a "nonintrinsic module" it must be mean a module that is
available for the current compilation; not any or all modules in the world.
The standard doesn't specify how the compilation environment is set up;
compilers routinely have some sort of switch to specify the module search
path(s).   So a switch like


is simply a (verbose) way to specify the module search path to the
compiler.  It makes FRED unavailable to the compiler (much like del FRED*,
only somewhat more reversible)  and the intrinsic module will be selected.
There's no rule that says all of the .mod files in the current directory
must be selected.

Dick Hendrickson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20091121/563f1bd9/attachment.htm>

More information about the J3 mailing list