主题:各位大虾,小弟的程序出不来....麻烦帮忙诊断下~·先谢谢啦!
我用的是FORTRAN常用算法程序中的[color=FF0000]全区间积分的定步长欧拉算法[/color]
编好后 却运行部起来,...各位大虾,帮我看下,先谢谢啦~~ 等你们回帖哦~~
子程序:SUBROUTINE GERL1(T,Y,M,H,N,Z,F,D)
DIMENSION Y(M),Z(M,N),D(M)
DOUBLE PRECISION Y,Z,D,T,H,X
DO 10 I=1,M
Z(I,1)=Y(I)
DO 50 J=2,N
X=T+(J-2)*H
CALL F(X,Y,M,D)
DO 20 I=1,M
Y(I)=Z(I,J-1)+H*D(I)
X=T+(J-1)*H
CALL F(X,Y,M,D)
DO 30 I=1,M
D(I)=Z(I,J-1)+H*D(I)
DO 40 I=1,M
Y(I)=(Y(I)+D(I))/2.0
Z(I,J)=Y(I)
CONTINUE
CONTINUE
RETURN
END
DEBUG是这样的:
Compiling Fortran...
D:\shiyan007\xm123\GELR1.F90
D:\shiyan007\xm123\GELR1.F90(9) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 20 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(13) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 30 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(13) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 30 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 40 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 40 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 40 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: An unterminated block exists.
DO 40 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(13) : Error: An unterminated block exists.
DO 30 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(9) : Error: An unterminated block exists.
DO 20 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(6) : Error: An unterminated block exists.
DO 50 J=2,N
^
D:\shiyan007\xm123\GELR1.F90(4) : Error: An unterminated block exists.
DO 10 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(4) : Error: This label is undefined. [10]
DO 10 I=1,M
---^
D:\shiyan007\xm123\GELR1.F90(9) : Error: This label is undefined. [20]
DO 20 I=1,M
----^
D:\shiyan007\xm123\GELR1.F90(13) : Error: This label is undefined. [30]
DO 30 I=1,M
----^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This label is undefined. [40]
DO 40 I=1,M
----^
D:\shiyan007\xm123\GELR1.F90(6) : Error: This label is undefined. [50]
DO 50 J=2,N
---^
Error executing df.exe.
GELR1.OBJ - 16 error(s), 0 warning(s)
编好后 却运行部起来,...各位大虾,帮我看下,先谢谢啦~~ 等你们回帖哦~~
子程序:SUBROUTINE GERL1(T,Y,M,H,N,Z,F,D)
DIMENSION Y(M),Z(M,N),D(M)
DOUBLE PRECISION Y,Z,D,T,H,X
DO 10 I=1,M
Z(I,1)=Y(I)
DO 50 J=2,N
X=T+(J-2)*H
CALL F(X,Y,M,D)
DO 20 I=1,M
Y(I)=Z(I,J-1)+H*D(I)
X=T+(J-1)*H
CALL F(X,Y,M,D)
DO 30 I=1,M
D(I)=Z(I,J-1)+H*D(I)
DO 40 I=1,M
Y(I)=(Y(I)+D(I))/2.0
Z(I,J)=Y(I)
CONTINUE
CONTINUE
RETURN
END
DEBUG是这样的:
Compiling Fortran...
D:\shiyan007\xm123\GELR1.F90
D:\shiyan007\xm123\GELR1.F90(9) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 20 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(13) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 30 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(13) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 30 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 40 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 40 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure. [I]
DO 40 I=1,M
-------^
D:\shiyan007\xm123\GELR1.F90(15) : Error: An unterminated block exists.
DO 40 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(13) : Error: An unterminated block exists.
DO 30 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(9) : Error: An unterminated block exists.
DO 20 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(6) : Error: An unterminated block exists.
DO 50 J=2,N
^
D:\shiyan007\xm123\GELR1.F90(4) : Error: An unterminated block exists.
DO 10 I=1,M
^
D:\shiyan007\xm123\GELR1.F90(4) : Error: This label is undefined. [10]
DO 10 I=1,M
---^
D:\shiyan007\xm123\GELR1.F90(9) : Error: This label is undefined. [20]
DO 20 I=1,M
----^
D:\shiyan007\xm123\GELR1.F90(13) : Error: This label is undefined. [30]
DO 30 I=1,M
----^
D:\shiyan007\xm123\GELR1.F90(15) : Error: This label is undefined. [40]
DO 40 I=1,M
----^
D:\shiyan007\xm123\GELR1.F90(6) : Error: This label is undefined. [50]
DO 50 J=2,N
---^
Error executing df.exe.
GELR1.OBJ - 16 error(s), 0 warning(s)