FORTRAN调试时出问题了,高手能否帮一下忙如何修改 20
最近用G95调试程序时出现错误:PROGRAMldcl.txt1Error:Non-numericcharacterinstatementlabelat(1)和PROGR...
最近用G95调试程序时出现错误:PROGRAM ldcl.txt
1
Error: Non-numeric character in statement label at (1)
和PROGRAM ldcl.txt
1
Error: Unclassifiable statement at (1)
因为我是新手不知道该怎么修改程序,请高手指教谢谢
$debug
PROGRAM ldcl.txt
CHARACTER FNAME1*12,FNAME2*12,bt*40
dimension ax(30)
write(*,101)
101 format(1x,//' Input the title:'\)
read (*,102) bt
102 format(bn,a40)
WRITE(*,30)
30 FORMAT(//1X,' Input inputing-filename:'\)
READ(*,40)FNAME1
40 FORMAT(BN,A12)
WRITE(*,45)
45 FORMAT(/1X,' Input outputing-filename:'\)
READ(*,40)FNAME2
OPEN(5,FILE=FNAME1)
OPEN(6,FILE=FNAME2,STATUS='NEW')
write(6,103) bt
103 format(1x,/' ',a40)
do 50 i=1,30
kk=i-1
read(5,*,end=60)ax(i)
if(ax(i).eq.99999.0) goto 60
50 continue
60 axx=abs((ax(kk)-ax(1))*0.05)
i1=0
i2=0
v1=0.0
v2=0.0
open(7,file='l.txt',status='new')
write(7,*)kk
do 70 i=1,kk
write(7,*)ax(i)
w1=ax(i)-ax(1)
w2=ax(i)-ax(kk)
调试是没问题了,但程序只输出文件名,无法计算啊 展开
1
Error: Non-numeric character in statement label at (1)
和PROGRAM ldcl.txt
1
Error: Unclassifiable statement at (1)
因为我是新手不知道该怎么修改程序,请高手指教谢谢
$debug
PROGRAM ldcl.txt
CHARACTER FNAME1*12,FNAME2*12,bt*40
dimension ax(30)
write(*,101)
101 format(1x,//' Input the title:'\)
read (*,102) bt
102 format(bn,a40)
WRITE(*,30)
30 FORMAT(//1X,' Input inputing-filename:'\)
READ(*,40)FNAME1
40 FORMAT(BN,A12)
WRITE(*,45)
45 FORMAT(/1X,' Input outputing-filename:'\)
READ(*,40)FNAME2
OPEN(5,FILE=FNAME1)
OPEN(6,FILE=FNAME2,STATUS='NEW')
write(6,103) bt
103 format(1x,/' ',a40)
do 50 i=1,30
kk=i-1
read(5,*,end=60)ax(i)
if(ax(i).eq.99999.0) goto 60
50 continue
60 axx=abs((ax(kk)-ax(1))*0.05)
i1=0
i2=0
v1=0.0
v2=0.0
open(7,file='l.txt',status='new')
write(7,*)kk
do 70 i=1,kk
write(7,*)ax(i)
w1=ax(i)-ax(1)
w2=ax(i)-ax(kk)
调试是没问题了,但程序只输出文件名,无法计算啊 展开
展开全部
PROGRAM ldcltxt
CHARACTER FNAME1*12,FNAME2*12,bt*40
dimension ax(30)
write(*,101)
101 format(1x,//' Input the title:'\)
read (*,102) bt
102 format(bn,a40)
WRITE(*,30)
30 FORMAT(//1X,' Input inputing-filename:'\)
READ(*,40)FNAME1
40 FORMAT(BN,A12)
WRITE(*,45)
45 FORMAT(/1X,' Input outputing-filename:'\)
READ(*,40)FNAME2
OPEN(5,FILE=FNAME1)
OPEN(6,FILE=FNAME2,STATUS='NEW')
write(6,103) bt
103 format(1x,/' ',a40)
do 50 i=1,30
kk=i-1
read(5,*,end=60)ax(i)
if(ax(i).eq.99999.0) goto 60
50 continue
60 axx=abs((ax(kk)-ax(1))*0.05)
i1=0
i2=0
v1=0.0
v2=0.0
open(7,file='l.txt',status='new')
write(7,*)kk
do 70 i=1,kk
write(7,*)ax(i)
w1=ax(i)-ax(1)
70 w2=ax(i)-ax(kk)
end
CHARACTER FNAME1*12,FNAME2*12,bt*40
dimension ax(30)
write(*,101)
101 format(1x,//' Input the title:'\)
read (*,102) bt
102 format(bn,a40)
WRITE(*,30)
30 FORMAT(//1X,' Input inputing-filename:'\)
READ(*,40)FNAME1
40 FORMAT(BN,A12)
WRITE(*,45)
45 FORMAT(/1X,' Input outputing-filename:'\)
READ(*,40)FNAME2
OPEN(5,FILE=FNAME1)
OPEN(6,FILE=FNAME2,STATUS='NEW')
write(6,103) bt
103 format(1x,/' ',a40)
do 50 i=1,30
kk=i-1
read(5,*,end=60)ax(i)
if(ax(i).eq.99999.0) goto 60
50 continue
60 axx=abs((ax(kk)-ax(1))*0.05)
i1=0
i2=0
v1=0.0
v2=0.0
open(7,file='l.txt',status='new')
write(7,*)kk
do 70 i=1,kk
write(7,*)ax(i)
w1=ax(i)-ax(1)
70 w2=ax(i)-ax(kk)
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询