On Jun 7, 2004, at 7:12 PM, Aleksandar Donev wrote:
> Drew McCormack wrote:
>> vpoint => vertices(1:2,:)
>> area = calcArea( vpoint )
> I'll repeat the question again: What is the PROBLEM? You keep saying
> the
> compiler does something wrong without the actual error. There is still
> nothing wrong with the above code, you can pass any array (pointer or
> whatever) as an actual for a dummy array argument (in fact you can even
> pass an array element), and implicit interfaces are fine so long as the
> dummy is explicit-shape or assumed-size (F77 "style"). But extents must
> match, which may be what you are doing wrong (which would be a
> programming error, not a language question).
> Best,
> Aleks
>
No, this is a compiler problem, I am pretty sure, because I compile
regularly on numerous systems (maybe 5-6 compilers), and this only
seemed to pop up on the HP.
The 'error' is at runtime. The code compiles fine, but produces rubbish
at runtime. I have tracked it down to the dummy argument in the
function: it doesn't contain the data passed. Replacing the array
pointer with an actual array in the calling code corrects the problem.
So it seems from what people are saying that my assumption that the
code was valid is OK.
Incidentally, I have seen so many of these errors in f90 compilers over
the years. Anytime you pass an array slice, or an array pointer, or
some f90 array construction to an implicit interface "f77" function,
grief is not far away. You would think after 13 odd years of this that
these bugs would be ironed out by now, but they still occupy a large
portion of my time. Just in the last year I have had similar problems
on the HP, with IBMs XLF on Mac OS X, and with Intel's compiler.
Drew
---------------------------------------------------------
Drew McCormack
www.maniacalextent.com
|