Re: Efficient way to pass different shaped arrays?
- From: harper@xxxxxxxxxxxxx (John Harper)
- Date: 30 Jun 2006 15:12:42 +1200
In article <YpydneFV4JVFwTnZnZ2dnUVZ_r-dnZ2d@xxxxxxxxxxx>,
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:
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?
(snip)>
I would say both [that and another suggestion] are pretty ugly, though.
True! IMHO that use of MERGE is an extension to f95 that's OK in
f2003. BTW, both g95 -std=f95 and Sun f95 -ansi allow it, printing
T 666. 666. 666.
with this program:
REAL:: d(3,0:0) = 333.0
CALL B(d,.TRUE.)
END
SUBROUTINE B(array,X)
LOGICAL X
REAL,INTENT(INOUT)::array(MERGE(3,28,X),0:MERGE(0,10001,X))
array = 2*array
PRINT "(L2,(3F5.0))",X,array
END SUBROUTINE B
Presumably Andy and Sun don't want to spend time implementing something
they'd just have to take out again from their f2003 compilers.
-- John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@xxxxxxxxx phone (+64)(4)463 5341 fax (+64)(4)463 5045
.
- References:
- Efficient way to pass different shaped arrays?
- From: Peter
- Re: Efficient way to pass different shaped arrays?
- From: glen herrmannsfeldt
- Re: Efficient way to pass different shaped arrays?
- From: John Harper
- Re: Efficient way to pass different shaped arrays?
- From: glen herrmannsfeldt
- Efficient way to pass different shaped arrays?
- Prev by Date: Re: removing blanks from a file
- Next by Date: Re: Random Numbers
- Previous by thread: Re: Efficient way to pass different shaped arrays?
- Next by thread: Re: Efficient way to pass different shaped arrays?
- Index(es):
Relevant Pages
|