Clicky
Showing changes from revision #1 to #2:
(追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)
Replicates a source
array ncopies
times along a specified dimension dim
.
(削除) Fortran 95 and later (削除ここまで)(追記) Fortran 95 (追記ここまで)(追記) and later (追記ここまで)
Transformational function
result = 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
.The result is an array of the same type as source
and has rank n+1 where n equals the rank of source
.
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