The answer depends on how the array is being used. If it is a scratch
work space that is used locally within various subroutines (accessed
through a COMMON block) then it might be better to get rid of the
existing array and common block, and instead use local automatic arrays
in the subroutines for the local work space.
Cheers,
Bill
Greenberg, Naomi wrote:
> I have a legacy code that statically allocates a very large
> 1-dimensional workspace array and then equivalences it to a
> 2-dimensional array of the same size because some subroutines require
> this workspace to be divided into 3 different parts. I want to convert
> the array to be dynamically-allocated, but I still need a way to address
> it both as buf(i) and buf2(i,j). Array reshaping seems to create a
> second array of a different shape, passing the values of the first array
> to the second. I want them to share memory space. Any suggestions
> would be helpful!
>
>
>
> /Naomi Greenberg/
>
> Member of the Reseearch Staff
>
>
>
> RIverside Research Institute
>
> 156 William Street
>
> New York, N.Y. 10038
>
>
>
> (212) 502-1718 (phone)
>
> (212) 502-1729 (fax)
>
> [log in to unmask]
>
>
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4745 (20100105) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
|