[問題] 求助 The shapes of the array expressio
我的程式是這樣
DISPERSION PROGRAM
C 1-D, EXPLICIT SCHEME
real C(182),F(182),CN(182),E(182),ZNDA
+DX,DT,K
integer INDX
c DIMENSION
C OPEN (5, FILE='A5.DAT', STATUS='NEW')
OPEN (6, FILE='A6.OUT', STATUS='OLD')
C READ(5,*) DX, DT, K
DX=1.0
DT=1.0
K=0.1
WRITE(6,*) INDX, I, DX, DT, K
INDX=0
20 DO 40,I=1,9
C(I)=0
40 CONTINUE
C(5)=10
DX=1.0
DT=1.0
K=0.1
ZNDA=K*DT/(DX)**2
A=-ZNDA
110 B=1+2*ZNDA
C=-ZNDA
130 WRITE(*,*)"t=",INDX
INDX=INDX+1
E(2)=0
F(2)=C(1)
DO 210, I=3,9
D=C(I)
E(I)=-C/(A*E(I-1)+B)
F(I)=(D-A*F(I-1))/(A*E(I-1)+B)
210 CONTINUE
220 DO 250,I=1,7
J=9-I
CN(J)=E(J+1)*C(J+1)+F(J+1)
250 CONTINUE
DO 280,I=1,9
C(I)=CN(I)
280 CONTINUE
cc WRITE(*,*)"t=",INDX
290 IF(MOD (INDX+60,60).NE.0)GO TO 220
WRITE(1,*)(C(I),I=2,8)
310 IF(INDX.LT.1440)GO TO 110
STOP
END
按ctrl+f7之後~
它說有錯誤 如下
--------------------Configuration: 1DIS - Win32 Debug--------------------
Compiling Fortran...
E:\1DIS3\1DIS.FOR
E:\1DIS3\1DIS.FOR(39) : Error: The shapes of the array expressions do not
conform. [E]
E(I)=-C/(A*E(I-1)+B)
------^
Error executing df.exe.
1DIS.OBJ - 1 error(s), 0 warning(s)
想請問是否我沒定義E(I)才會出現這種錯誤??
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.230.83.253
※ 文章網址: http://www.ptt.cc/bbs/Fortran/M.1417453388.A.543.html
推
12/02 12:46, , 1F
12/02 12:46, 1F
→
12/02 15:06, , 2F
12/02 15:06, 2F
→
12/02 20:08, , 3F
12/02 20:08, 3F
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章