Consider the matrix A:
Figure 12: Visualisation of the array a
The PRINT statements in the following program
PROGRAM Owt IMPLICIT NONE INTEGER, DIMENSION(3,3) :: A = RESHAPE((/1,2,3,4,5,6,7,8,9/)) PRINT*, 'Array element =',a(3,2) PRINT*, 'Array section =',a(:,1) PRINT*, 'Sub-array =',a(:2,:2) PRINT*, 'Whole Array =',a PRINT*, 'Array Transp''d =',TRANSPOSE(a) END PROGARM Owt
produce on the screen,
Array element = 6 Array section = 1 2 3 Sub-array = 1 2 4 5 Whole Array = 1 2 3 4 5 6 7 8 9 Array Transposed = 1 4 7 2 5 8 3 6 9
Return to corresponding overview page