たとえば、次のコード:
program sandbox
implicit none
real, dimension(2, 2) :: p
p = reshape((/ 1, 3, 2, 4 /), shape(p))
print *, spread(P, 2, 2)
end program sandbox
この配列を返します:
1 1 2 2
3 3 4 4
しかし、私はこれを返すようにしようとしています」
1 2 1 2
3 4 3 4
これは可能spread
ですか?実際には、次のような行列を生成する可能性があるため、一般化する必要があります
1 2 1 2 1 2 1 2
3 4 3 4 3 4 3 4
コンパイル時にわからない他の変数に依存します。