谁来帮我看看这段fortran程序哪些地方有错,有30 errors 这是一段自适应过滤法的程序。
FORTRANCOMPUTERPROGRAMFORADAPTIVEFILTERINGM=NUMREROFDATA,N=NUMBEROFWEIGHTSK=NUMBEROFF...
FORTRAN COMPUTER PROGRAM
FOR ADAPTIVE FILTERING
M= NUMRER OF DATA , N=NUMBER
OF WEIGHTSK = NUMBER OF
FORECASTS
F = FORECAST , E = ERROR , AE = MEAN ABSOLUTE ERROR(MAE)
DIMENSION Y(180),Y1(180),W(12)
AE(200)
WRITE (5,10)
FORMAT(1X ,’PLEASE GIVE M ,N,K, IF’)
READ(5,1)M,N K ,IF
FORMAT(413)
CALL OPEN (9,ZXP45678ZZZ,2)
DO 2 I = 1,M
READ(9,3) Y(I)
FORMAT (F12.4)
END FILE 9
FM = M
FN = N
FK = 0.0
DO 101 I = 1,M
Y1(I) = Y(I)
DO 102 I = 1,N
J1 = I
J2 = I+1
BIG = Y1(I)
DO 103 J = J2,M
IF (BIG,GE YI(J)) GO TO 103
BIG = Y1(J)
J1 = J
CONTINUE
Y1(J1) = Y1(I)
Y1(I) = BIG
FK = FK+Y1(I)*Y1(I)
FK = (1,0/FK )/10.0
WRITE(5,200) FK
FORMAT (1X,‘F K =‘, F18.15)
IF (IE NE 0) GO TO 110
DO 4 I = 1,N
W(I) = 1.0/FN
N1 = N+1
DO 5 I = 1,200
E1 = 0.0
DO 6 I1 = N1,M
F = 0.0
DO 7 I2 = 1,N
I5 = I1-I2
F = F+W(12)*Y(I5)
E = Y(I1)-F
DO 8 I2 = 1,N
I6 = I1-I2
W(I2) = W(I2)+2.0*FK*E*Y(I6)
E1 = E1+ABS(E)
AE(I) = E1/(FM-FN)
IF (I. LT.2 ) GO TO 5
IF(AE(I)-AE(I-1)GT1.0/1000.0)
GO TO 40
IE (AE(I-1)-AE(I) . LT 1.0/1000.0) GOTO 20
CONTINUE
WRITE(5,21)
FORMAT (1X,’CYCLE MAE’)
J = I-10
IF (J.LT.1) J=1
DO 22 L =J,I
WRITE(5,23) L ,AE(L)
FORMAT (1X,I4,10X ,F15.5)
WRITE(5,24)
FORMAT(IX,’PARAMTERTS OF ADAPTIVE FILTERING MODEL:’)
DO 25 I = 1,N
WRITE(5,26)I,W(I)
FORMAT (1X/I3,F15.5)
WRITE(5,27)
FORMAT(1X,’PERIOD FORECAST:’)
K1 = M+1
K2 = M+K
DO 30 I = K1,K2
F = 0.0
DO 31 I1 = 1,N
I7 = I-I1
F = F+W(I1)*Y(I7)
WRITE(5,32) I, F
EORMAT (1X,I3,F15.5)
Y(I) = F
GO TO 50
WRITE (5,120)
FORMAT (1X,’PLEASE GIVE INITILA WEIGHT VALUES:‘/)
DO 111 I = 1,N
READ(5,112) W(I)
FORMAT (F14.8)
GO TO 11
J = I-5
IF (J.LT.1) J=1
WRITE (5,21)
DO 41 L = J,I
WRITE (5,23) L,AE(L)
WRITE (5,42)
FORMAT (1X,‘THE ADAPTIVE FILTERING PROCESS NOT CONVERGE’)
STOP
END 展开
FOR ADAPTIVE FILTERING
M= NUMRER OF DATA , N=NUMBER
OF WEIGHTSK = NUMBER OF
FORECASTS
F = FORECAST , E = ERROR , AE = MEAN ABSOLUTE ERROR(MAE)
DIMENSION Y(180),Y1(180),W(12)
AE(200)
WRITE (5,10)
FORMAT(1X ,’PLEASE GIVE M ,N,K, IF’)
READ(5,1)M,N K ,IF
FORMAT(413)
CALL OPEN (9,ZXP45678ZZZ,2)
DO 2 I = 1,M
READ(9,3) Y(I)
FORMAT (F12.4)
END FILE 9
FM = M
FN = N
FK = 0.0
DO 101 I = 1,M
Y1(I) = Y(I)
DO 102 I = 1,N
J1 = I
J2 = I+1
BIG = Y1(I)
DO 103 J = J2,M
IF (BIG,GE YI(J)) GO TO 103
BIG = Y1(J)
J1 = J
CONTINUE
Y1(J1) = Y1(I)
Y1(I) = BIG
FK = FK+Y1(I)*Y1(I)
FK = (1,0/FK )/10.0
WRITE(5,200) FK
FORMAT (1X,‘F K =‘, F18.15)
IF (IE NE 0) GO TO 110
DO 4 I = 1,N
W(I) = 1.0/FN
N1 = N+1
DO 5 I = 1,200
E1 = 0.0
DO 6 I1 = N1,M
F = 0.0
DO 7 I2 = 1,N
I5 = I1-I2
F = F+W(12)*Y(I5)
E = Y(I1)-F
DO 8 I2 = 1,N
I6 = I1-I2
W(I2) = W(I2)+2.0*FK*E*Y(I6)
E1 = E1+ABS(E)
AE(I) = E1/(FM-FN)
IF (I. LT.2 ) GO TO 5
IF(AE(I)-AE(I-1)GT1.0/1000.0)
GO TO 40
IE (AE(I-1)-AE(I) . LT 1.0/1000.0) GOTO 20
CONTINUE
WRITE(5,21)
FORMAT (1X,’CYCLE MAE’)
J = I-10
IF (J.LT.1) J=1
DO 22 L =J,I
WRITE(5,23) L ,AE(L)
FORMAT (1X,I4,10X ,F15.5)
WRITE(5,24)
FORMAT(IX,’PARAMTERTS OF ADAPTIVE FILTERING MODEL:’)
DO 25 I = 1,N
WRITE(5,26)I,W(I)
FORMAT (1X/I3,F15.5)
WRITE(5,27)
FORMAT(1X,’PERIOD FORECAST:’)
K1 = M+1
K2 = M+K
DO 30 I = K1,K2
F = 0.0
DO 31 I1 = 1,N
I7 = I-I1
F = F+W(I1)*Y(I7)
WRITE(5,32) I, F
EORMAT (1X,I3,F15.5)
Y(I) = F
GO TO 50
WRITE (5,120)
FORMAT (1X,’PLEASE GIVE INITILA WEIGHT VALUES:‘/)
DO 111 I = 1,N
READ(5,112) W(I)
FORMAT (F14.8)
GO TO 11
J = I-5
IF (J.LT.1) J=1
WRITE (5,21)
DO 41 L = J,I
WRITE (5,23) L,AE(L)
WRITE (5,42)
FORMAT (1X,‘THE ADAPTIVE FILTERING PROCESS NOT CONVERGE’)
STOP
END 展开
展开全部
错误好多啊……
GO TO 20,改为GOTO 20,去掉空格
IF是关键字,不能用来做变量
FORMAT要有行号
用""引用输出,不是‘’这个
WRITE (5,10)向文件5按格式10输出,文件5要先打开,格式10要对应一个
10 format(……)
……
GO TO 20,改为GOTO 20,去掉空格
IF是关键字,不能用来做变量
FORMAT要有行号
用""引用输出,不是‘’这个
WRITE (5,10)向文件5按格式10输出,文件5要先打开,格式10要对应一个
10 format(……)
……
追问
能详细帮我把这个编译一下吗,我不懂这个语言
追答
因为你前面几行我也看不懂,另外程序要处理的问题也不懂,所以也没法帮你修改
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-05-30
展开全部
是从什么地方copy来的吧?前面几列的标号丢失,必须先补上,才知道程序是否能运行
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询