早教吧 育儿知识 作业答案 考试题库 百科 知识分享

急求fortran大神帮忙,编译出现Theshapesofthearrayexpressionsdonotconform.[U]ubroutineInit(U,dx,dy)implicitdoubleprecision(a-h,o-z)common/Gdef/Gama,Pi,Jx,Jy,dLx,dLy,TT,Sfdimension::U(Jx+1,Jy+1,4)u=3.0v=0.0rou=1.0p=0.71429dx=dLx/

题目详情
急求fortran大神帮忙,编译出现The shapes of the array expressions do not conform. [U]
ubroutine Init(U,dx,dy)
implicit double precision (a-h,o-z)
common/G_def/Gama,Pi,Jx,Jy,dLx,dLy,TT,Sf
dimension ::U(Jx+1,Jy+1,4)
u=3.0
v=0.0
rou=1.0
p=0.71429
dx=dLx/Jx
dy=dLy/Jy
do i=2,Jx/4
do j=1,Jy
U(i,j,1)=rou
U(i,j,2)=rou*u
U(i,j,3)=rou*v
U(i,j,4)=p/(Gama-1.0)+rou*(u*u+v*v)/2.0
end do
end do
do i=Jx/4+1,Jx
do j=Jy/5+1,Jy
U(i,j,1)=rou
U(i,j,2)=rou*u
U(i,j,3)=rou*v
U(i,j,4)=p/(Gama-1.0)+rou*(u*u+v*v)/2.0
end do
end do
▼优质解答
答案和解析
U和u一样,fortran不分大小写的,最后几行都是数等于数组,所以错了