|  | 
| n2 函数里 n2=(1+dcos(x4_)+dcos(x3_-x4_))*(dsin(x3_*r3+x4_*r4))+(dsin(x3_-x4_)-dsin(x4_))*(dcos(x3_*r3+x4*r4))
 
 是否应该为
 n2=(1+dcos(x4_)+dcos(x3_-x4_))*(dsin(x3_*r3+x4_*r4))+(dsin(x3_-x4_)-dsin(x4_))*(dcos(x3_*r3+x4_*r4))
 
 另外,如果楼主有一个好的调试器,对于数组越界可以事半功倍。
 
 比如我的编译器(IVF+VS)就会直接提示
 
 forrtl: severe (408): fort: (3): Subscript #2 of the array AD has value 0 whichis less than the lower bound of 1
 中断以后就会发现在 825 行
 if(ad(l1,l3)+ad(l2,l4)+ad(l1,l4)==3)then
 此处的 L3 = 0,而 ad 从 1 开始。所以越界。
 
 至于 L3 为何为 0 ,你需要继续向前追索原因。(由于算法不熟悉,别人较难帮忙)
 | 
 |