New Reply

Memory storage of multidimensional arrays in fortran 90

 
Share Thread
Oct17-10, 08:01 AM   #1
 

Memory storage of multidimensional arrays in fortran 90


Hello,

I think i heard somewhere that a multidimensional array in fortran 90 may be stored non-contiguously in memory. Is this true? Even if it the size was known at compile time?

If your answer is it depends on a compiler, what about ifort and gfortran?
PhysOrg.com science news on PhysOrg.com

>> New language discovery reveals linguistic insights
>> US official: Solar plane to help ground energy use (Update)
>> Four microphones, computer algorithm enough to produce 3-D model of simple, convex room
Oct19-10, 06:24 AM   #2
 
OK, after some investigation, I found that fortran 90, unlike fortran 77 (and C) does not impose a storage implementation on the arrays. But, according to some people, in all implementations at least the first index is contiguous. What is certainly not contiguous are subarrays chosen with a stride of course (A(1:50:10)), though when used as an argument they are usually copied to a contiguous temporary. The pointers to such arrays are also not contiguous.
If arrays are defined with a simple format, e.g. A(10,20,30), they are, in most (all?) cases contiguous.

Any further comments or clarifications would be welcome.
New Reply

Tags
arrays, fortran, memory

Similar Threads for: Memory storage of multidimensional arrays in fortran 90
Thread Forum Replies
pointers and multidimensional arrays in C Programming & Comp Sci 2
Fortran IO of 3D arrays Programming & Comp Sci 7
multidimensional arrays in C Programming & Comp Sci 18
storage of sparse matrices fortran/C or growing arrays Programming & Comp Sci 0