【发布时间】:2014-04-14 08:46:51
【问题描述】:
为什么这里的 ifort 和 gfortran 有不同的行为?使用 ifort 编译返回 false,使用 gfortran 返回 true。我之前在自己的代码中遇到过这个问题,并决定改用子例程,但最近的一个问题让我质疑这种行为。
function allocateArray(size)
integer, allocatable, dimension(:) :: allocateArray
integer size
allocate(allocateArray(size))
end function allocateArray
从主程序
integer, allocatable, dimension(:) :: a
a = allocateArray(10)
print *, allocated(a)
【问题讨论】:
标签: fortran gfortran intel-fortran