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
414 Views

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

0 Kudos
2 Replies
Andrew_Smith
New Contributor III
357 Views
Yes it will be contigous
jimdempseyatthecove
Black Belt
307 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

 

Reply