[問題] 新手想請教一個問題

看板Fortran作者 (不斷邁進!!)時間15年前 (2009/09/25 19:50), 編輯推噓1(107)
留言8則, 3人參與, 最新討論串1/1
請問各位板大 最近再寫一個程式的時候 想說每寫一段就COMPILE一下 COPILE 完出現了 Error: Syntax error, found END-OF-FILE when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX BYTE CHARACTER ... 請問這是什麼問題呢?! 在此先謝謝熱心的大家了~~!! 原程式如下 PROGRAM EX REAL E,M,Y,F,X,KB,KS,K1,K2,G,PI1,PI2,PIS,Y1,Y2,H,S1,S2,N1,N2,N3,KR1,KR2,Q1,Q2,QS REAL R11,R22,DT,NL,NJ,NI,L,AA,BB,W,W1,W2 INTEGER A(3,3) INTEGER I,J OPEN (2,FILE='EX.TXT') !fitting coefficients E,M,Y,F,X E = 2.145 M = 1 - 1/E Y = 0.5 F=5.3*(10**(-13)) X = 1 !elastic coefficients KB,KS,K1,K2,G KB = 8.33*(10**6) KS = 35*(10**9) K1 = 0.145*(10**6) K2 = 2.25*(10**9) G = 3.85*(10**6) !density PI1,PI2,PIS PI1 = 1.1 PIS = 2650 PI2 = 997 !viscosity Y1,Y2 Y1 = 18*(10**(-6)) Y2 = 0.001 !porosity H H = 0.45; S1 =0.1; S2 = 1-S1; IF (S1==0) THEN DPS=0 END IF IF (S1==1) THEN DPS=-1000000000000; ELSE DPS=(PI2*9.81/(M*E*X))*(((1-S1)**(-E/(E-1))-1)**((1-E)/E) )*((1-S1)**(-(2*E-1)/(E-1))); END IF N1 = KS*(1-H)-KB N2 = DPS*S1*(1-S1) N3 = N1*(K1*N2*S1+K1*K2+K2*N2*(1-S1))+(KS**2)*H*(K1*(1-S1)+N2+K2*S1) U11 = KS/N3*((1-H)*N1*(K1*K2+K1*N2*S1+K2*N2*(1-S1)) +KB*KS*H*(K1*(1-S1)+K2*S1+N2)) U12 = N1*KS*H*K1*S1*(K2+N2)/N3 U21 = N1*KS*H*K1*S1*(K2+N2)/N3 U13 = N1*KS*H*K2*(1-S1)*(K1+N2)/N3 U31 = N1*KS*H*K2*(1-S1)*(K1+N2)/N3 U22 = (K1*(S1**2)*H*(KS**2)*H*K2+K1*S1*(H**2)*N2*(KS**2)+K1*S1*H*K2*N1*N2*(1-S1))/N3 U23 = -K1*K2*H*S1*(1-S1)*(N1*N2-H*(KS**2))/N3 U32 = -K1*K2*H*S1*(1-S1)*(N1*N2-H*(KS**2))/N3 U33 = (K1*K2*(KS**2)*((1-S1) **2)*(H**2)+(KS**2)*N2*(H**2)*K2*(1-S1)+K1*S1*N1*N2*K2*(1-S1)*H)/N3 !inertiaL coupling AA11,AA12,AA22,A111 RS = 0.5*(1+1/H); AA11 = PI1*(S1)*H-RS*PI1*(S1)*H AA12 = -0.1*SQRT(((RS)**2)*PI1*PI2*(S1*H)*(S2*H)) AA21 = -0.1*SQRT(((RS)**2)*PI1*PI2*(S1*H)*(S2*H)) AA22 = PI2*(1-S1) *H-RS*PI2*(1-S1)*H A111 = U11+4/3*G !permeability KR1,KR2 KR1 = ((1-S2)**Y)*((1-(S2)**(1/M))**(2*M)) KR2 = ((S2)**Y)*((1-(1-(S2)**(1/M))**M)**2) T1 = KR1/Y1 T2 = KR2/Y2 !volume fraction Q1,Q2,QS Q1 = (S1)*H Q2 = (S2)*H QS = 1-Q1-Q2 !drag coefficients R11,R22 IF (KR1 == 0) THEN R11 = 0 ELSE R11 = -((Q1)**2)/(F*T1) END IF IF (KR2 == 0) THEN R22 = 0; ELSE R22 = -((Q2)**2)*Y2/(F*T2) END IF D=3*(U11+U12+U13)*U22*U33+3*(U12+U22+U23)*U13*U23+3*(U13+U23+U33)*U12*U23-3*(U11+U12+U13)*U23**2-3*(U12+U22+U23)*U12*U33-3*(U13+U23+U33)*U22*U13 C11 = (U22*U33-U23**2)/D C12 = (3*(U13+U23+U33)*U23-3*(U12+U22+U23)*U33)/D C13 = (3*(U12+U22+U23)*U23-3*(U13+U23+U33)*U22)/D C21 = (U13*U23-U12*U33)/D C22 = (3*(U11+U12+U13)*U33-3*(U13+U23+U33)*U13)/D C23 = (3*(U13+U23+U33)*U12-3*(U11+U12+U13)*U23)/D C31 = (U12*U23-U13*U22)/D C32 = (3*(U12+U22+U23)*U13-3*(U11+U12+U13)*U23)/D C33 = (3*(U11+U12+U13)*U22-3*(U12+U22+U23)*U12)/D !時間間隔 DT DT = 5*10**(-5); B11 =((PIS*QS-AA11-AA12-AA21-AA22) /(DT**2) -(R11+R22) /(2*DT) ) B12 =((AA11+AA21)/(DT**2)+(R11/(2*DT))) B13 =((AA12+AA22)/(DT**2)+R22/(2*DT)) B21 =((AA11+AA12)/DT**2+(R11/(2*DT))) B22 =((PI1*Q1-A11)/(DT**2)-(R11/(2*DT))) B23 =(-AA12/(DT**2)) B31 =((AA21+AA22)/(DT**2)+(R22/(2*DT))) B32 =(-AA21/(DT**2)) B33 =((PI2*Q2-AA22)/(DT**2)-(R22/(2*DT))) A(1,1)=B11*C11+B12*C21+B13*C31 A(1,2)=-Q1*(B11*C12+B12*C22+B13*C32) A(1,3)=-Q2*(B11*C13+B12*C23+B13*C33) A(2,1)= B21*C11+B22*C21+B23*C31 A(2,2)=-Q1*(B21*C12+B22*C22+B23*C32) A(2,3)=-Q2*(B21*C13+B22*C23+B23*C33) A(3,1)=B31*C11+B32*C21+B33*C31 A(3,2)=-Q1*(B31*C12+B32*C22+B33*C32) A(3,3)=-Q2*(B31*C13+B32*C23+B33*C33) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.77.176

09/26 10:21, , 1F
似乎式宣告的問題,如原PO宣告PIS,PI2是浮點數
09/26 10:21, 1F

09/26 10:23, , 2F
而程式裡面顯示的是整數 如 X=1 建議多個小數點應該就可以
09/26 10:23, 2F

09/26 10:24, , 3F
像X=1.0 PIS=2650.0 PI2=997.0
09/26 10:24, 3F

09/26 10:24, , 4F
XDDDD~試試吧 囧>
09/26 10:24, 4F

09/28 20:18, , 5F
謝謝樓上大大~但好像不是這個問題 QQ
09/28 20:18, 5F

09/28 21:04, , 6F
open沒有close, 沒有end program, 再看看會不會少了end if
09/28 21:04, 6F

09/28 21:28, , 7F
thx!!!! 因為我是一段一段跑~所以就沒有END PROGRAM~
09/28 21:28, 7F

09/28 21:28, , 8F
不過好像真的是因為這樣所以跑不出來~~感謝t大!!
09/28 21:28, 8F
文章代碼(AID): #1AlAvvC2 (Fortran)
文章代碼(AID): #1AlAvvC2 (Fortran)