SPREAD(3f)

DESCRIPTION
Replicates a SOURCE array NCOPIES times along a specified dimension DIM.

STANDARD
Fortran 95 and later

CLASS
Transformational function

SYNTAX
RESULT = SPREAD(SOURCE, DIM, NCOPIES)

ARGUMENTS

SOURCE Shall be a scalar or an array of any type and a rank less than seven. DIM Shall be a scalar of type INTEGER with a value in the range from 1 to n+1, where n equals the rank of SOURCE. NCOPIES Shall be a scalar of type INTEGER.

RETURN VALUE
The result is an array of the same type as SOURCE and has rank n+1 where n equals the rank of SOURCE.

EXAMPLE
          PROGRAM test_spread
            INTEGER :: a = 1, b(2) = (/ 1, 2 /)
            WRITE(*,*) SPREAD(A, 1, 2) ! "1 1"
            WRITE(*,*) SPREAD(B, 1, 2) ! "1 1 2 2"
          END PROGRAM

SEE ALSO
UNPACK

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).