SPREAD
— Add a dimension to an arrayRESULT = SPREAD(SOURCE, DIM, NCOPIES)
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 . |
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
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gfortran/SPREAD.html