integer::N
real*8,allocatable,dimension(:,:)::a,b,c,y,f,d
allocate(f(n,2))
allocate(y(n,2))
allocate(a(n,n))
allocate(b(n,n))
allocate(c(n,n))
allocate(d(n,1))
f(:,1)=y(:,2) !dy1/dt=y2
f(:,2)=matmul(a,(-matmul(b,y(:,2))-matmul(c,y(:,1))+d)) !dy2/dt=a*(-b*y2-c*y1+d)The shapes of the array expressions do not conform.[f]
fcode 发表于 2016-2-8 12:44
f(:,2) 改为 f(:,2:2) 就好了
f(:,:) 和 f 是二维数组
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |