Print

Print


David,

With out seeing more of the problem I would declare a data structure and
then use it to make an array.  Then make the subroutine accept the same data
structure.  Modules are handy for this and so are includes.

snippet example

type probe_node
   real radius
   real theta
   real value
   integer flag
end type probe_node

type (probe_node), dimension(100) :: arrayofnodes

! Fill arrayofnodes somehow

call suba(arrayofnodes(3))
end
!
subroutine suba(anode)
! Warning code missing.   Need to declare the type(prode_node) somehow
type(probe_node) :: anode

rad = anode%radius

end subroutine suba

This is not exactly correct code, but it should give you enough to go on.

Rod Failing
> -----Original Message-----
> From: David Byrne [SMTP:[log in to unmask]]
> Sent: Wednesday, May 01, 2002 11:10
> To:   [log in to unmask]
> Subject:      Array Dimension Limits
>
> List Members:
>
> I'm bumping up against the f90 limit on the number of
> dimensions in an array (7) and wonder if anyone has
> suggestions for avoiding this.
>
> I would like to be able to store the values of a function
> in an array where the coordinates of a point in the array
> correspond to the arguments of the function.
> Unfortunately, my function has more than seven arguments.
>
> My most recent attempt to deal with this involved storing
> the function values in a vector instead of an array.  I wrote a
> little routine that converts the arguments of the function
> to a scalar corresponding to the right element of the
> array.  However, I use this function so often that when running a
> profiler, I discovered the
> program spends 60% of the time in this little routine.  So
> this approach won't work.
>
> I wonder whether it's possible to work around the seven dimension
> limit by writing a derived type.
>
> Any suggestions on the issue would be very much appreciated.
>
> David Byrne
> University of Virginia Economics
> [log in to unmask]