阅读背景:

在子程序调用期间保持fortran中的数组限制

来源:互联网 

I have the following program

我有以下程序

module test
contains
   subroutine foo()
      integer, allocatable :: a(:)
      allocate(a(-5:5))
      call bar(a)
      print *, a
   end subroutine
   subroutine bar(a)
      integer, intent(out) :: a(:)
      a = 0 
      a(-4) = 3  ! here
      a(2) = 3   
   end subroutine
end module

program x
   use test
   call foo()
end program
module 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: