Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

array allocation

martymike
Beginner
511 Views

will an allocation statement produce contiguous memory? If not, is this something controllable?

0 Kudos
2 Replies
Andrew_Smith
New Contributor III
454 Views
Yes it will be contigous
0 Kudos
jimdempseyatthecove
Black Belt
404 Views

Be aware of Fortran's array indexing:

    ALLOCATE(array(100,100))

    ...

    value = array(I,J)

The next location in array's memory is array(I+1,J).

IOW the left most index is stride-1, the second (from left) index is stride-size(left most index).

This indexing order is reverse of what you find in C/C++.

Jim Dempsey

 

0 Kudos
Reply