我想使用一个数组 Ar(-3:3, 5),它是模块 global 中的一个可分配变量,并在一个子例程中分配它并在下一个子例程中访问它(参见下面的代码片段)。第二个子程序中的索引是从 -3 到 3 和从 1 到 5,还是我必须在子程序中指定?
module global
real, allocatable(:,:) :: Ar
end module global
subroutine allocateAr
use global
ALLOCATE(Ar(-3:3, 5))
end subroutine allocateAr
subroutine useAr
use global
Ar(-3,1)=3.0 !is this -3,1 here or do I have to use 1,1????
end subroutine useAr