Memory storage of multidimensional arrays in fortran 90

  • Fortran
  • Thread starter vacuum
  • Start date
  • #1
26
0
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?
 

Answers and Replies

  • #2
26
0
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.
 

Related Threads on Memory storage of multidimensional arrays in fortran 90

  • Last Post
Replies
6
Views
6K
Replies
4
Views
235
Replies
3
Views
5K
  • Last Post
Replies
2
Views
7K
Replies
1
Views
3K
  • Last Post
Replies
18
Views
10K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
3K
Replies
13
Views
1K
Replies
3
Views
5K
Top