next up previous contents
Next: The RESHAPE Intrinsic Function Up: Arrays Previous: Array Inquiry Intrinsics

 

Array Constructors

Used to give arrays or sections of arrays specific values. For example,

    IMPLICIT NONE
    INTEGER                        :: i
    INTEGER, DIMENSION(10)         :: ints
    CHARACTER(len=5), DIMENSION(3) :: colours
    REAL, DIMENSION(4)             :: heights
    heights = (/5.10, 5.6, 4.0, 3.6/)
    colours = (/'RED  ','GREEN','BLUE '/)
    ! note padding so strings are 5 chars
    ints    = (/ 100, (i, i=1,8), 100 /)
     ...

For more information, click here gif

Now try this question gif


next up previous contents
Next: The RESHAPE Intrinsic Function Up: Arrays Previous: Array Inquiry Intrinsics

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.