Fortran 90 Pointer Type
A Fortran 90 pointer type allows you to point to scalar or array types. The debugger displays pointer types as type,pointer, which is the same syntax used in Fortran 90 to create a pointer variable.
For example, a pointer to a rank 1 deferred shape array of real data is displayed in the Variable Window as:
Type: real(:),pointer
To view the data instead of the pointer variable, dive on the value.
Note: If you are using the IBM xlf compiler, TotalView cannot determine the rank of the array from the debugging information. In this case, the type of a pointer to an array appears as "type(...),pointer". The actual rank is filled in when you dive through the pointer to look at the data.
The value of the pointer is displayed as the address of the data to which the pointer points. This address is not necessarily the array element with the lowest address.
TotalView implicitly handles slicing operations that set up a pointer or assumed shape subroutine argument so that indices and values it displays in a Variable Window are the same as you would see in the Fortran code.
For example:
integer, dimension(10), target :: ia
integer, dimension(:), pointer :: ip
do i = 1,10
ia(i) = i
end do
ip => ia(10:1:-2)
After diving through the ip pointer, TotalView displays the window shown in the following figure:
Fortran 90 Pointer Value
|
Notice that the address displayed is not that of the array's base. Since the array's stride is negative, succeeding array elements are at lower absolute addresses. Consequently, the address displayed is that of the array element having the lowest index (which may not be the first displayed element if you used a slice to display the array with reversed indices).