Re: suggestions for restricted sharing of variables
In article <jqdt8i$kco$1@speranza.aioe.org>, dpb <none@non.net>
wrote:
> On 6/2/2012 1:45 PM, Ron Shepard wrote:
> ...
>
> > ... a file can have several modules within it. I usually put
> > these small modules like this up at the top of the file, so the
> > compiler sees the definition before it sees the USE statements, but I
> > don't think most compilers care where they occur....
>
> They have to be such that the source of the module has been compile by
> the time the compiler hits the USE statement or the compile will fail
> (or use a potentially out-of-date .mod file).
I encountered this long ago with the first f90 compilers that I
used, but I think that modern compilers will scan through the file
and compile things in the right order regardless. Mostly out of
habit however, I still write code with the modules first, and USE
statements later. If there are compilers that require this, then
this module order is indeed more of a requirement than an esthetic
choice.
In any case, all of this is certainly compiler dependent and outside
the scope of the fortran language standard itself.
$.02 -Ron Shepard
|