next up previous contents
Next: Input of Arrays Up: Arrays Previous: Array Sections

 

Printing Arrays

The conceptual ordering of array elements is useful for defining the order in which array elements are output. If A is a 2D array then:

    PRINT*, A

would produce output in Array Element Order:

    A(1,1), A(2,1), A(3,1), ..., A(1,2), A(2,2), ...

Sections of arrays can also be output, for example,

    PRINT*, A(::2,::2)

would produce:

    A(1,1), A(3,1), A(5,1), ..., A(1,3), A(3,3), A(5,3), ...

An array of more than one dimension is not formatted neatly, if it is desired that the array be printed out row-by-row (or indeed column by column) then this must be programmed explicitly.

This order could be changed by using intrinsic functions such as RESHAPE, TRANSPOSE or CSHIFT.


next up previous contents
Next: Input of Arrays Up: Arrays Previous: Array Sections

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.