next up previous contents
Next: Declarations Up: Arrays Previous: Arrays

 

Array Terminology

Examples of declarations:

    REAL, DIMENSION(15)       :: A
    REAL, DIMENSION(-4:0,0:2) :: B
    REAL  :: C(5,3), D(0:4,0:2) ! Shorthand

The above are explicit-shape arrays.

Terminology:

Explicit-shape arrays can have symbolic bounds so long as they are initialisation expressions -- evaluatable at compile time.

Now try this question gif

 

Consider the following declarations,

    REAL, DIMENSION(15)       :: A
    REAL, DIMENSION(-4:0,0:2) :: B
    REAL  :: C(5,3), D(0:4,0:2) ! Shorthand

Individual array elements are denoted by subscripting the array name by an INTEGER, for example, A(7) tex2html_wrap_inline22718 element of A, or C(3,2), 3 elements down, 2 across.

The arrays can be visualised as below:

  figure6661
Figure 1: Visualisation of Arrays

The first dimension runs up and down the page and the second dimensions runs across the page.


next up previous contents
Next: Declarations Up: Arrays Previous: Arrays

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996
Not for commercial use.