Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program sandbox
- implicit none
- real, dimension(2, 2) :: p
- real, dimension(:, :), allocatable :: q
- integer i, n
- n = 3
- allocate(q(2, 2*n))
- print *, "p"
- p = reshape([1, 3, 2, 4], shape(p))
- do i=1, 2
- print *, p(i, :)
- end do
- print *, "spread"
- q = reshape(spread(transpose(p), 2, n), [2, 2*n], order=[2, 1])
- do i=1, 2
- print *, q(i, :)
- end do
- deallocate(q)
- end program sandbox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement