arjenmarkus <
arjen.m...@gmail.com> wrote:
> Fortran 2003 introduced the concept of intrinsic modules.
> What I would like to know is what exactly is the difference
> with an ordinary module.
Well, the biggest difference is that an ordinary module has to do things
that can be done in principle by "ordinary" Fortran. They don't have to
be actually written in Fortran, but they do have to look as though they
might be (that's my informal wording instead of specific words of the
standard).
An intrinsic module, on the other hand, can have effects on the compiler
that could not be implemented in Fortran source code. The two intrinsic
modules you mentioned don't do anything particularly wierd like that,
but IEEE_features does. IEEE_features is a bit.... strange.... in that
you never actually *DO* anything useful with the things that you access
from it. Their action depends only on whether or not they are accessed
instead of on then doing anything with the accessed things. They are
somewhat like compiler switches.
> Here is the context:
...
> Put more succinctly: is my assumption right that the intrinsic
> keyword is only necessary to ensure that a haphazard user defined
> module of the same is NOT used?
Yes. You never *HAVE* to specify the intrinsic keyword; it isn't what
makes a module intrinsic.
I find it a bit inconsistent that the default for intrinsic versus
non-intrinsic modules is the opposite of that for intrinsic versus
non-intrinsic procedures.
If there is both an intrinsic and a non-intrinsic procedure of the same
name, then lacking any intructions to the compiler about which one is
meant, you get the intrinsic one. (That only applies to non-intrinsic
external procedures because non-external ones always come with
"instructions to the compiler" of one form or other; namely, they are
either in the source code of the current scope or accessed via USE).
But if there is both an intrinsic and a non-intrinsic module of the same
name, then lacking any instructions to the compiler, you get the
non-intrinsic one.
There was probably a reason for this inconsistency. I was probably even
there when the reason was advanced, but I don't recall what it was (or
whether I agreed with it).
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain