On 3 May 2004 at 09:35 PDT, Drew McCormack wrote:
>
> Is the following legal fortran 90?
>
>
> module A
> contains
> subroutine sub( array )
> real :: array(10)
> end subroutine
> end module
>
>
> program main
> use A
> real :: a, b(10), c(10,10)
> call sub(a)
> call sub(b)
> call sub(c)
> end program
>
>
> In other words, if you have an explicit interface, can you pass
> non-conforming arrays?
>
> Drew McCormack
No. Sorry I can't cite chapter and verse for you.
There are ways to get around this for specific compilers (e.g. Cray pointers)
but they should be used with *extreme* caution. In your example, you could
easily step out of bounds with the "call sub(a)" call.
Ted
--
Ted Stern Applications Group
Cray Inc. office: 206-701-2182
411 First Avenue South, Suite 600 cell: 206-383-1049
Seattle, WA 98104-2860 FAX: 206-701-2500
Frango ut patefaciam -- I break that I may reveal
(The Paleontological Society motto, equally apropos for debugging)
|