c******d 发帖数: 906 | 1 系统是win7 64bit
VS2008+IVF 11.1
定义了一个递增数组p
根据条件,先对p分配大小, allocate p(:)
然后在loop中对一个subroutine 传递p(i),所有的p值是不变的
简化程序如下
allocate (p(j))
loop1: do i=1,j
call MYSUB(p(i),xx,xx,xx)
end do loop1
用IA-32 IVF compiler,在loop到最后的p(i)时,p中有几个数值被冲掉
用IA-64 compiler就没有问题
想仔细请教一下怎么去分析解决这个问题
先谢过 | j**f 发帖数: 28 | 2 Your code looks fine. Your problem maybe comes from other part of your code
, for example your MYSUB(p(i),xx,xx,xx) can do trick things.
How do you know your p(i) have been changed? Do you print out p(i) before
or after
calling MYSUB(p(i),xx,xx,xx)? If you are sure the value have been changed
after you call MYSUB(p(i),xx,xx,xx), certainly the problem is in your MYSUB(
p(i),xx,xx,xx) instead of allocatable array problem.
I assumed your j is in the range of 32bit integer.
【在 c******d 的大作中提到】 : 系统是win7 64bit : VS2008+IVF 11.1 : 定义了一个递增数组p : 根据条件,先对p分配大小, allocate p(:) : 然后在loop中对一个subroutine 传递p(i),所有的p值是不变的 : 简化程序如下 : allocate (p(j)) : loop1: do i=1,j : call MYSUB(p(i),xx,xx,xx) : end do loop1
|
|