在 Fortran 中将列附加到数组的有效方法?

efficient way to append a column to an array in Fortran?

假设我有一个数组 A(n,m) 和一个数组 B(n)。我想创建一个数组 C(n,m+1),其中前 m 列是 A 中的列,最后一列是 B

在 Fortran 中执行此操作的最佳方法是什么?最好的意思是效率更高(耗时更少)

谢谢!

试试这个

C(1:n,1:m) = A(1:n,1:m)
C(1:n,m+1) = B(1:n)