Displaying Arrays
The declaration of an array can include a lower and upper bound separated by a colon (:).
For C or C++, the default lower bound is 0; for Fortran, it is 1. Further, C and C++ use brackets to define an array, while Fortran uses parentheses. In the following example, an array of ten integers is declared in C and then in Fortran:
int a[10];
integer a(10)
The elements of the array range from a[0] to a[9] in C, while the elements of the equivalent Fortran array range from a(1) to a(10).
When an array’s lower bound is the default, the UI displays only the extent (that is, the number of elements in the dimension). Consider the following Fortran array declaration:
integer a(1:7,1:8)
Since both dimensions of this array use Fortran’s default 1 lower bound, TotalView displays the data type using only the extent of each dimension, as follows:
integer(7,8)
If an array declaration doesn’t use the default lower bound, TotalView displays both the lower and upper bound for each dimension. For example, this Fortran array is displayed in TotalView the same way it is declared:
integer a(-1:5,2:10)