- 积分
- 0
- 注册时间
- 2010-10-4
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2011-4-28 22:19:40
|
显示全部楼层
来自 美国
1# 苍山负雪
苍山负雪:
I have a same problem as you had. Do you mind taking a look?
I have a very simple program like the following. When I run this code under Visual Studio 2008 with Intel Fortran 11, it reports error of stack overflow. If I define array m as "integer m(512, 512)" but not "integer m(k(1),k(2))", the code works well. My system is Windows XP 32, and RAM is 1GB. It should not be the problem of memory. In addition, I had tried to change k(1) and k(2) to 500 but not 512 in main program. And the code works well too. I am so confused!
program test
IMPLICIT REAL(A-H, O-Z)
integer k(2)
common /index/ k
k(1) = 512
k(2) = 512
call dary
end program test
subroutine dary
IMPLICIT REAL(A-H, O-Z)
integer k(2)
common /index/ k
integer m(k(1),k(2))
m(1,1) = 2
write(*,*) m(1,1)
end subroutine dary |
|