运行fortran出现数组越界,请问如何解决?
报错显示:forrt1:sever<161>:ProgramException-arrayboundsexceeded详细程序如下(第161行在下面已标出):LETSLO...
报错显示:
forrt1: sever <161>: Program Exception - array bounds exceeded
详细程序如下(第161行在下面已标出):
LETS LOOK AT WHAT WE HAVE SO FAR.
C
WRITE(11,064)
IF(ICHOOSE.EQ.2) WRITE(11,071)
IF(ICHOOSE.EQ.1) WRITE(11,070)
WRITE(11,050) COOL,FINALT,TSTART,BULKC,T1,T2,T3,T4,TRETT,IGEN
WRITE(11,051) E,L,R,N,DR,DC
WRITE(11,064)
WRITE(11,054) CRIM,CCORE
WRITE(11,072)
DO 120 I=1,N
J=INT((I+8)/10.0)
IF(I.GT.R) J=INT((I+7)/10.0)
SAVE(J)=C1(I)
120 CONTINUE
JMAX=J
WRITE(11,053) (SAVS(J),J=1,JMAX)
CALL AREA(AREAC)
DT=0.5*DXCSQ/DC
C
C BEGIN MAIN LOOP
C
1000 CONTINUE
LOOP=LOOP+1
LOOP5=5*INT(LOOP/5.0)
LOOP25=25*INT(LOOP/25)
C
c save old values for this cycle
C
AREACOLD=AREAC
DROLD=DR
DCOLD=DC
OLDRATE2=RATE2
C INCREMENT VALUES BY ONE TIME STEP
DT=STEP*DT
TOTLT=TOTLT+DT
TEMP=TSTART-TOTLT*COOLRTE
CALL PHASE(TEMP,CRIM,CCORE)
CALL DIFFUS(TEMP,DR,DC)
CALL NEWPROFILE
C
C CALCULATE MOVEMENT OF BOUNDARY
C
SUN1=SUN(1)
SUN2=SUN(2)
DE=(AREACOLD-E*SUN2-(L-E)*SUN1)/(SUN2-SUN1)
RATE2=(0.5/(CCORE-CRIM))*((DR/DXR)*(3.0*CRIM-4.0*C1(LL)+C1(R-2))
&+(DC/DXC)*(3.0*CCORE-4.0*C1(MM)+C1(R+2)))
DE2=(RATE2+OLDRATE2)*DT/2
IF(MASS.NE.0) DE=DE2
C
C
E=E+DE
DXC=(L-E)/FLOAT(N-R)
DXR=E/FLOAT(R-2)
DXCSQ=DXC**2
DXRSQ=DXR**2
RATE=DE/DT
CALL AREA(AREAC)
C
C DECIDE WHETHER TO PRINT BEFORE NEXT CYCLE
C
IF(TEMP.LE.T1) IWRITE1=IWRITE1+1
IF(IWRITE1.EQ.1) GOTO 200
IF(TEMP.LE.T2) IWRITE2=IWRITE2+1
IF(IWRITE2.EQ.1) GOTO 200
IF(TEMP.LE.T3) IWRITE3=IWRITE3+1
IF(IWRITE3.EQ.1) GOTO 200
IF(TEMP.LE.T4) IWRITE4=IWRITE4+1
IF(IWRITE4.EQ.1) GOTO 200
IF(TEMP.LE.FINALT) GOTO 200
IF(TOTLT.GE.TRETT) GOTO 200
IF(LOOP.GE.IGEN) GOTO 200
IF(E.GE.L) GOTO 200
IF(E.LE.0.0) GOTO 200
IF(LOOP.LE.2) GOTO 200
IF(LOOP.EQ.LOOP25) GOTO 200
159 IF(LOOP.GT.25) GOTO 200
160 IF(LOOP.EQ.LOOP5) GOTO 200
161 GOTO 1000
162 200 CONTINUE
163 WRITE(11,064)
164 WRITE(11,059) LOOP,RATE,DE,E,DT,TOTLT,TEMP
WRITE(11,060) DXR,DXC,DR,DC
WRITE(11,006) DE2
WRITE(11,074) C1(1),C1(2),C1(3),C1(R-2),C1(R-1)
WRITE(11,054) CRIM,CCORE
WRITE(11,075) C1(R+1),C1(R+2),C1(N-1),C1(N)
WRITE(11,072)
DO 250 I=1,N
J=INT((I+8)/10.0)
IF(I.GT.R) J=INT((I+7)/10.0)
SAVE(J)=C1(I)
250 CONTINUE
JMAX=J
WRITE(11,053) (SAVE(J),J=1,JMAX)
IF(TEMP.LE.FINALT) GOTO 300
IF(TOTLT.GE.TRETT) GOTO 300
IF(LOOP.GE.IGEN) GOTO 300
IF(E.GE.L) GOTO 300
IF(E.LE.0.0) GOTO 300
GOTO 1000
300 CONTINUE
WRITE(11,064)
WRITE(11,073)
WRITE(11,064)
WRITE(11,053) (C1(M),M=2,LL)
WRITE(11,054) CRIM,CCORE
WRITE(11,053) (C1(M),M=MM,N)
CALL EXIT
END 展开
forrt1: sever <161>: Program Exception - array bounds exceeded
详细程序如下(第161行在下面已标出):
LETS LOOK AT WHAT WE HAVE SO FAR.
C
WRITE(11,064)
IF(ICHOOSE.EQ.2) WRITE(11,071)
IF(ICHOOSE.EQ.1) WRITE(11,070)
WRITE(11,050) COOL,FINALT,TSTART,BULKC,T1,T2,T3,T4,TRETT,IGEN
WRITE(11,051) E,L,R,N,DR,DC
WRITE(11,064)
WRITE(11,054) CRIM,CCORE
WRITE(11,072)
DO 120 I=1,N
J=INT((I+8)/10.0)
IF(I.GT.R) J=INT((I+7)/10.0)
SAVE(J)=C1(I)
120 CONTINUE
JMAX=J
WRITE(11,053) (SAVS(J),J=1,JMAX)
CALL AREA(AREAC)
DT=0.5*DXCSQ/DC
C
C BEGIN MAIN LOOP
C
1000 CONTINUE
LOOP=LOOP+1
LOOP5=5*INT(LOOP/5.0)
LOOP25=25*INT(LOOP/25)
C
c save old values for this cycle
C
AREACOLD=AREAC
DROLD=DR
DCOLD=DC
OLDRATE2=RATE2
C INCREMENT VALUES BY ONE TIME STEP
DT=STEP*DT
TOTLT=TOTLT+DT
TEMP=TSTART-TOTLT*COOLRTE
CALL PHASE(TEMP,CRIM,CCORE)
CALL DIFFUS(TEMP,DR,DC)
CALL NEWPROFILE
C
C CALCULATE MOVEMENT OF BOUNDARY
C
SUN1=SUN(1)
SUN2=SUN(2)
DE=(AREACOLD-E*SUN2-(L-E)*SUN1)/(SUN2-SUN1)
RATE2=(0.5/(CCORE-CRIM))*((DR/DXR)*(3.0*CRIM-4.0*C1(LL)+C1(R-2))
&+(DC/DXC)*(3.0*CCORE-4.0*C1(MM)+C1(R+2)))
DE2=(RATE2+OLDRATE2)*DT/2
IF(MASS.NE.0) DE=DE2
C
C
E=E+DE
DXC=(L-E)/FLOAT(N-R)
DXR=E/FLOAT(R-2)
DXCSQ=DXC**2
DXRSQ=DXR**2
RATE=DE/DT
CALL AREA(AREAC)
C
C DECIDE WHETHER TO PRINT BEFORE NEXT CYCLE
C
IF(TEMP.LE.T1) IWRITE1=IWRITE1+1
IF(IWRITE1.EQ.1) GOTO 200
IF(TEMP.LE.T2) IWRITE2=IWRITE2+1
IF(IWRITE2.EQ.1) GOTO 200
IF(TEMP.LE.T3) IWRITE3=IWRITE3+1
IF(IWRITE3.EQ.1) GOTO 200
IF(TEMP.LE.T4) IWRITE4=IWRITE4+1
IF(IWRITE4.EQ.1) GOTO 200
IF(TEMP.LE.FINALT) GOTO 200
IF(TOTLT.GE.TRETT) GOTO 200
IF(LOOP.GE.IGEN) GOTO 200
IF(E.GE.L) GOTO 200
IF(E.LE.0.0) GOTO 200
IF(LOOP.LE.2) GOTO 200
IF(LOOP.EQ.LOOP25) GOTO 200
159 IF(LOOP.GT.25) GOTO 200
160 IF(LOOP.EQ.LOOP5) GOTO 200
161 GOTO 1000
162 200 CONTINUE
163 WRITE(11,064)
164 WRITE(11,059) LOOP,RATE,DE,E,DT,TOTLT,TEMP
WRITE(11,060) DXR,DXC,DR,DC
WRITE(11,006) DE2
WRITE(11,074) C1(1),C1(2),C1(3),C1(R-2),C1(R-1)
WRITE(11,054) CRIM,CCORE
WRITE(11,075) C1(R+1),C1(R+2),C1(N-1),C1(N)
WRITE(11,072)
DO 250 I=1,N
J=INT((I+8)/10.0)
IF(I.GT.R) J=INT((I+7)/10.0)
SAVE(J)=C1(I)
250 CONTINUE
JMAX=J
WRITE(11,053) (SAVE(J),J=1,JMAX)
IF(TEMP.LE.FINALT) GOTO 300
IF(TOTLT.GE.TRETT) GOTO 300
IF(LOOP.GE.IGEN) GOTO 300
IF(E.GE.L) GOTO 300
IF(E.LE.0.0) GOTO 300
GOTO 1000
300 CONTINUE
WRITE(11,064)
WRITE(11,073)
WRITE(11,064)
WRITE(11,053) (C1(M),M=2,LL)
WRITE(11,054) CRIM,CCORE
WRITE(11,053) (C1(M),M=MM,N)
CALL EXIT
END 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询