主题:subroutine的参数为数组时报警
program main
implicit none
integer ::t=5
integer, allocatable::a(:)
allocate(a(t))
call sub(t,a)
end program
subroutine sub(c,aa)
implicit none
integer c,i
integer, allocatable::aa(:)
allocate(aa(c))
do i=1,c
aa(i)=2*i
end do
write(*,*) aa
end subroutine sub
提示:sub.f90(8) : Warning: In the call to SUB, actual argument #2 does not match the type and kind of 。。。。。。,是可以执行出结果,不知为什么报警了,请大侠们帮帮小弟吧,在此谢过了
implicit none
integer ::t=5
integer, allocatable::a(:)
allocate(a(t))
call sub(t,a)
end program
subroutine sub(c,aa)
implicit none
integer c,i
integer, allocatable::aa(:)
allocate(aa(c))
do i=1,c
aa(i)=2*i
end do
write(*,*) aa
end subroutine sub
提示:sub.f90(8) : Warning: In the call to SUB, actual argument #2 does not match the type and kind of 。。。。。。,是可以执行出结果,不知为什么报警了,请大侠们帮帮小弟吧,在此谢过了