主题:程序编译通过,运行却中断,急求解决办法
本人新手,最近下了一段fortran77的程序,是产生湍流的,通过cvf编译,没有错误和警告,运行时却提示:
forrt1:severe(24):end-of-file during read,unit1... 产生的文件fort.1里只有一句: OUTPUT LU=?
好像是程序只执行到前几行就停止了,求教到底哪里出问题了?
部分源程序如下,完整程序见附件
PROGRAM FTURB
INTEGER*4 N1M,N2M,N3M
DIMENSION LABL(10)
COMPLEX X(512),Y(512)
COMMON N1M,N2M,N3M,INPUT,ICART
INPUT=1
ICART=34
ROOT2=SQRT(2.)
WRITE(INPUT,9999)
9999 FORMAT(11HOUTPUT LU=?)
READ(INPUT,9998)LUOUT
9998 FORMAT(I4)
WRITE(INPUT,9997)
9997 FORMAT(7HN1MAX=?)
READ(INPUT,9998)N1MAX
WRITE(INPUT,9996)
9996 FORMAT(7HN2MAX=?)
READ(INPUT,9998)N2MAX
WRITE(INPUT,9995)
9995 FORMAT(7HN3MAX=?)
READ(INPUT,9998)N3MAX
WRITE(INPUT,9994)
9994 FORMAT(5HFS1=?)
READ(INPUT,9993)FS1
9993 FORMAT(F10.0)
WRITE(INPUT,9992)
9992 FORMAT(5HFS2=?)
READ(INPUT,9993)FS2
WRITE(INPUT,9991)
9991 FORMAT(5HFS3=?)
READ(INPUT,9993)FS3
WRITE(INPUT,9986)
9986 FORMAT(38H ENTER VELOCITY COMPONENT (1, 2, OR 3))
READ(1,9985) II
9985 FORMAT(I1)
N1M=N1MAX
N2M=N2MAX
N3M=N3MAX
MREC=N1MAX*N2MAX*N3MAX/32
MREC=N1M*N2M*N3M/32
WRITE(1,8887)MREC
8887 FORMAT(7HMAXREC=,I7,25H ENTER FILE TO BE OPENED)
READ(1,8886)(LABL(I),I=1,10)
8886 FORMAT(10A2)
OPEN(ICART,FILE=LABL,IOSTAT=IOS,STATUS='NEW',
* ERR=99,RECL=256,
* FORM='UNFORMATTED',ACCESS='DIRECT',MAXREC=MREC)
DF1=FS1/FLOAT(N1MAX)
DF2=FS2/FLOAT(N2MAX)
DF3=FS3/FLOAT(N3MAX)
N1D2=N1MAX/2
N2D2=N2MAX/2
N3D2=N3MAX/2
DDDF=DF1*DF2*DF3
X1MAX=FLOAT(N1MAX)
X2MAX=FLOAT(N2MAX)
X3MAX=FLOAT(N3MAX)
FFF=FS1*FS2*FS3
SIGXK=SQRT(X1MAX*X2MAX*X3MAX/2.)/FFF
P=PHIU(0.,0.,0.,II)
SUM=P
H=SQRT(FFF*P)
X(1)=SIGXK*ROOT2*H*CMPLX(GRAN(),0. )
ps:源程序前几行里有语句:DEMENSION LBUF(128) CALL LGBUF(LBUF,128),是扩展I/O缓存用的,因为cvf里不认,所以被我删了,是不是因为这个呢?
forrt1:severe(24):end-of-file during read,unit1... 产生的文件fort.1里只有一句: OUTPUT LU=?
好像是程序只执行到前几行就停止了,求教到底哪里出问题了?
部分源程序如下,完整程序见附件
PROGRAM FTURB
INTEGER*4 N1M,N2M,N3M
DIMENSION LABL(10)
COMPLEX X(512),Y(512)
COMMON N1M,N2M,N3M,INPUT,ICART
INPUT=1
ICART=34
ROOT2=SQRT(2.)
WRITE(INPUT,9999)
9999 FORMAT(11HOUTPUT LU=?)
READ(INPUT,9998)LUOUT
9998 FORMAT(I4)
WRITE(INPUT,9997)
9997 FORMAT(7HN1MAX=?)
READ(INPUT,9998)N1MAX
WRITE(INPUT,9996)
9996 FORMAT(7HN2MAX=?)
READ(INPUT,9998)N2MAX
WRITE(INPUT,9995)
9995 FORMAT(7HN3MAX=?)
READ(INPUT,9998)N3MAX
WRITE(INPUT,9994)
9994 FORMAT(5HFS1=?)
READ(INPUT,9993)FS1
9993 FORMAT(F10.0)
WRITE(INPUT,9992)
9992 FORMAT(5HFS2=?)
READ(INPUT,9993)FS2
WRITE(INPUT,9991)
9991 FORMAT(5HFS3=?)
READ(INPUT,9993)FS3
WRITE(INPUT,9986)
9986 FORMAT(38H ENTER VELOCITY COMPONENT (1, 2, OR 3))
READ(1,9985) II
9985 FORMAT(I1)
N1M=N1MAX
N2M=N2MAX
N3M=N3MAX
MREC=N1MAX*N2MAX*N3MAX/32
MREC=N1M*N2M*N3M/32
WRITE(1,8887)MREC
8887 FORMAT(7HMAXREC=,I7,25H ENTER FILE TO BE OPENED)
READ(1,8886)(LABL(I),I=1,10)
8886 FORMAT(10A2)
OPEN(ICART,FILE=LABL,IOSTAT=IOS,STATUS='NEW',
* ERR=99,RECL=256,
* FORM='UNFORMATTED',ACCESS='DIRECT',MAXREC=MREC)
DF1=FS1/FLOAT(N1MAX)
DF2=FS2/FLOAT(N2MAX)
DF3=FS3/FLOAT(N3MAX)
N1D2=N1MAX/2
N2D2=N2MAX/2
N3D2=N3MAX/2
DDDF=DF1*DF2*DF3
X1MAX=FLOAT(N1MAX)
X2MAX=FLOAT(N2MAX)
X3MAX=FLOAT(N3MAX)
FFF=FS1*FS2*FS3
SIGXK=SQRT(X1MAX*X2MAX*X3MAX/2.)/FFF
P=PHIU(0.,0.,0.,II)
SUM=P
H=SQRT(FFF*P)
X(1)=SIGXK*ROOT2*H*CMPLX(GRAN(),0. )
ps:源程序前几行里有语句:DEMENSION LBUF(128) CALL LGBUF(LBUF,128),是扩展I/O缓存用的,因为cvf里不认,所以被我删了,是不是因为这个呢?