Drew wrote:
> I can see that if I set a(10) in sub, that I will have an out of
bounds problem, but if I tried to set array(1), would > the compiler be
entitled to cause problems (according to the standard)? Is the compiler
obligued to make array(1)
> correspond to a in main, or is it just an error to pass a scalar for
an array with an explicit interface?
It is an error.
> (If so, why isn't my compiler flagging this as an error? I know... I
> should buy the cray compiler ;-) )
For example, here's what Intel Fortran says (once the error of the
module and variable having the same name is fixed):
t.f90(12) : Error: If the actual argument is scalar, the corresponding
dummy
argument shall be scalar unless the actual argument is an element of an
array that
is not an assumed-shape or pointer array, or a substring of such an
element.
[ARRAY]
call sub(a)
-----^
Steve Lionel
Software Products Development
Intel Corporation
Nashua, NH
|