Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

array allocation

martymike
Beginner
224 Views

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

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