Re: Efficient way to pass different shaped arrays?



John Harper wrote:

(snip)

FORALL(I=1:100,J=1:100) A(I,J) = MERGE(1.0, 0.0, I==J)

OK, but can you do something like:

SUBROUTINE B(array,X)
LOGICAL X
REAL, DIMENSION(MERGE(3,28,X),0:MERGE(0,10001,X)),INTENT(INOUT)::array
to select the appropriate dimensions?

My previous suggestion would look something like

SUBROUTINE B(array,X)
INTEGER X
REAL, DIMENSION(3+25*(1/X),0:10001*(1/X)),INTENT(INOUT)::array

where X is either 1 or greater than 1 to select between (28,0:10001)
and (3,0:0).

I would say both are pretty ugly, though.

-- glen

.



Relevant Pages