回 帖 发 新 帖 刷新版面

主题:求助,程序小问题,万分感激。。。

求助,感激涕零。。。
 下面程序没有语法错误,但运行时就是出现问题:问题截屏如附件图片
 ()
OccupyNumber=0
   if  (space(PPC_x+1,PPC_y,PPC_z) ==1) then
OccupyNumber=OccupyNumber+1
   end if
   if  (space(PPC_x-1,PPC_y,PPC_z) ==1) then
OccupyNumber=OccupyNumber+1
   end if
   if  (space(PPC_x,PPC_y+1,PPC_z) ==1) then
OccupyNumber=OccupyNumber+1
   end if
   if  (space(PPC_x,PPC_y-1,PPC_z) ==1) then
OccupyNumber=OccupyNumber+1
   end if
   if  (space(PPC_x,PPC_y,PPC_z-1) ==1) then
OccupyNumber=OccupyNumber+1
   end if
if  (OccupyNumber>=3) then 
 space(PPC_x,PPC_y,PPC_z)=1
goto 100
end if

回复列表 (共4个回复)

沙发

错误提醒是:forrt1:severe(161):program exception-array bounds exceeded
image          pc         routine        line        source
cxl.exe       004039BF   simulationTi    60          simulation.f90
...
...
应用程序发生异常unknown software exception(0xc000008c),位置为0x004039bf
。。。
。。。


有没有遇到这种情况的啊?求助。。。

板凳

如果你确定是这段的问题, 那就检查space数组是否越界了. 你没贴定义, 而且代码不完整. 不知道具体是不是这个变量.

3 楼


嗯,我只注意了数组上界,没有注意下界,呵呵。。


感激中。。。

4 楼


嗯,我只注意了上界,没有注意下界。

感激中。。。。

我来回复

您尚未登录,请登录后再回复。点此登录或注册