513981387 发表于 2019-4-12 11:54:33

数组问题

1、主程序module中设置可变数组iedge(:,:)
2、在子程序read grid 中分配数组规模为 iedge(4,nedges),其中nedges=15688
3、在另一个子程序中进行循环,如下:
      do i=1,nedges
            a=iedge(1,i)
       end do

然后就报错,提示如下:
forrtl: severe (408): fort: (3): Subscript #2 of the array IEDGE has value -858993460 which is less than the lower bound of 1

我调试的时候输出了iedge的列维数和nedges的维数,是相等的,都是15688

请问各位,我这个问题出在哪里?

513981387 发表于 2019-4-12 12:10:31

好吧我找到错误了
是我瞎了
1写成了i

fcode 发表于 2019-4-12 22:50:19

:-)这种错误很尬
页: [1]
查看完整版本: 数组问题