In a message dated 2/9/99 2:04:38 PM Pacific Standard Time,
[log in to unmask] writes:
<< I started off coding in f90 thinking that modules
were the replacement for COMMON, in that they represented static storage. >>
COMMON doesn't necessarily represent static storage, although the vast
majority of implementations, particulary those based on the usual C 'extern
struct' do it that way. Thus, there may be differences between
implementations in the behavior of programs where a COMMON block is not either
declared in the main program or designated as a SAVEd COMMON. I've used f77
systems where a COMMON block was allocated dynamically upon entry to a
subroutine which used it, not to mention the very old scheme where a COMMON
became defined when read in from an overlay.
So, I wouldn't be surprised to see implementation dependence in your example,
using MODULE. Putting the USE in the main program also would eliminate this
dependence, with no apparent negative aspects.
program testy
call thing1
call thing2
end
My remaining question is whether the problem of allocating MODULE arrays as
efficiently as COMMON arrays (alignment etc.) is generally insoluble.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|