gfortran编译Fortran数组问题

可能是IVF(inter visual fortran)比LF(lahey Fortran)编译器比较严格的原因

real :: A(L,M) = (/ 1,2,3,4,5,6,7,8,9,10,11,12 /)
real :: B(M,N) = (/ 1,2,3,4,5,6,7,8 /)

这种复制方式不正确,要用到reshape函数

integer :: a(2,4)=reshape([1,2,3,4,5,6,7,8],[2,4])
integer :: b(4,3)=reshape([1,2,3,4,5,6,7,8,9,10,11,12],[4,3])

posted @ 2016-01-13 14:39  人生不断学习  阅读(332)  评论(0编辑  收藏  举报