用FORTRAN穷举法GO TO语句中,循环数最大是多少?

来源:百度知道 编辑:UC知道 时间:2024/06/15 19:45:10
do 10 i=1,1E+10,1
so=front*(2*i)**(b)+k*(2*i)**(c)
d=so-strain
if (abs(d).le.1e-1)then
cyc=i
ianquancyc=i/5
write(1,'("NF=",f12.2)') cyc
write(1,'("ianquanNF=",i12)') ianquancyc
write(1,'("strain=",e12.5)') strain
write(1,'("so=",e12.5)') so
write(1,'("d=",e12.5)') d
goto 100
endif
10 continue
100 continue

上面是我程序的一小部分,当i超过1E10时就会出现warning: An arithmetic error occurred while evaluating constant or constant expression do 10 i=1,1E+10,1
只要小于这个数就没问题,但是我需要至少1E20才够大,如何解决这个问题,谢谢!!!



在程序的开头重新定义一下i,加入(fortran90和95的方法):
integer(kind=8)::i

另:在你别外重复提的同一个问题也答了。
http://zhidao.baidu.com/question/22036888.html