主题:关于数组传递
********try1*********
program try1
implicit none
real::a1(2,2)
interface
subroutine sub1(a2)
real::a2(:,:)
end subroutine
end interface
a1(1:2,1:2)=0.0
call sub1(a1)
stop
end program
subroutine sub1(a2)
implicit none
real::a2(:,:)
return
end subroutine
*********try2************
program try2
implicit none
real::a1(2,2),b1(2,2)
interface
subroutine sub1(a2,b2)
real::a2(:,:),b2(:,:)
end subroutine
end interface
a1(1:2,1:2)=0.0
b1(1:2,1:2)=0.0
call sub1(a1,b1)
stop
end program
subroutine sub1(a2,b2)
implicit none
real::a2(:,:),b2(:,:)
return
end subroutine
请教try2就多传了一个数组为什么就错了呢?
program try1
implicit none
real::a1(2,2)
interface
subroutine sub1(a2)
real::a2(:,:)
end subroutine
end interface
a1(1:2,1:2)=0.0
call sub1(a1)
stop
end program
subroutine sub1(a2)
implicit none
real::a2(:,:)
return
end subroutine
*********try2************
program try2
implicit none
real::a1(2,2),b1(2,2)
interface
subroutine sub1(a2,b2)
real::a2(:,:),b2(:,:)
end subroutine
end interface
a1(1:2,1:2)=0.0
b1(1:2,1:2)=0.0
call sub1(a1,b1)
stop
end program
subroutine sub1(a2,b2)
implicit none
real::a2(:,:),b2(:,:)
return
end subroutine
请教try2就多传了一个数组为什么就错了呢?