next up previous contents
Next: Array Conformance Up: Arrays Previous: Array Terminology

 

Declarations

So long as the value of lda is knowngif, the following are valid:

    REAL, DIMENSION(100)       :: R
    REAL, DIMENSION(1:10,1:10) :: S
    REAL                       :: T(10,10)
    REAL, DIMENSION(-10:-1)    :: X
    INTEGER, PARAMETER :: lda = 5
    REAL, DIMENSION(0:lda-1)   :: Y
    REAL, DIMENSION(1+lda*lda,10) :: Z

The above example demonstrates:

Now try this question gif

Return to corresponding overview page gif 

Consider the following declarations,

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

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

The arrays can be visualised as below:

  figure7284
Figure 8: Visualisation of Arrays

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

Now try this question gif

Return to corresponding overview page gif


next up previous contents
Next: Array Conformance Up: Arrays Previous: Array Terminology

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