主题:fortran求助,新手请求协助。
fortran读取数据到单元5就结束了,forrt1:severe(24):end-of-file during read,unit5,
我怀疑是读数据的问题,开头部分数据不能全读入,到单元5就终止了。
我输入,输出文件都有,但是输出文件只有部分输出
我把程序上传了,大神有时间给看看,万分感激
下面上图
http://image.keyan.cc/data/bcs/2015/0630/w145h3869417
http://image.keyan.cc/data/bcs/2015/0630/w146h3869417_1435648114_346.png
http://image.keyan.cc/data/bcs/2015/0630/w166h3869417_1435648129_349.png
http://image.keyan.cc/data/bcs/2015/0630/w110h3869417_1435648984_742.png
C----------FRAME.FOR---(FOR FRAME PROBLEMS)--------- DIMENSION LOC(3,2),IFIX(5),AREA(3),FINT(3),CX(4),CY(4), 1 F(12),FR(12),FE(3,6) COMMON NN,NE,ND,NFIX,E C--------------------------------------------- OPEN (5,FILE='F1.DAT',STATUS='OLD') OPEN (6,FILE='OUTF1.') READ(5,*)NN,NE,ND,NFIX,E WRITE(6,105) NN,NE,ND,NFIX,E 105 FORMAT(4X,'NN NE ND NFIX E'/4I5,E11.4) READ(5,*) (LOC(I,1),LOC(I,2),AREA(I),FINT(I),I=1,NE) WRITE(6,108) 108 FORMAT(/1X,'ELEMENT NODE1 NODE2 AREA FINT') WRITE(6,110)(I,LOC(I,1),LOC(I,2),AREA(I),FINT(I),I=1,NE) 110 FORMAT(1X,3I6,2E12.4) READ(5,*)(CX(J),CY(J),J=1,NN) WRITE(6,112) 112 FORMAT(/4X,'NODE X-COORD Y-COORD') WRITE(6,115) (J,CX(J),CY(J),J=1,NN) 115 FORMAT(4X,I3,3X,2E12.4) READ(5,*)(IFIX(K),K=1,NFIX) WRITE(6,118)(IFIX(K),K=1,NFIX) 118 FORMAT(/3X,'IFIX=',6I4) C-------------------------------------------------- CALL CST (LOC,IFIX,AREA,FINT,CX,CY,F,FR,FE) C--------------------------------------------------- WRITE(6,130) 130 FORMAT(/4X,'NODE',5X,'X-DISP',8X,'Y-DISP',9X,'THITA') WRITE(6,135)(I,F(3*I-2),F(3*I-1),F(3*I),I=1,NN) 135 FORMAT(2X,I5,3E15.6) WRITE(6,140) 140 FORMAT(/4X,'REACTION NODAL FORCES FROM THE EQUATIONS', 1 /4X,'NODE',5X,'X-LOAD',8X,'Y-LOAD',9X,'MOMENT') WRITE(6,145) (I,FR(3*I-2),FR(3*I-1),FR(3*I),I=1,NN) 145 FORMAT(2X,I5,3E15.6) WRITE(6,150) 150 FORMAT(/4X,'ELEMENT',4X,'AXI-F',7X,'SHEAR-Q',7X,'MOMENT-M') DO 10 I=1,NE 10 WRITE(6,155) I,FE(I,1),FE(I,2),FE(I,3),FE(I,4),FE(I,5),FE(I,6) 155 FORMAT(2X,I4,3E15.6/6X,3E15.6) STOP END C---------------------------------------------------- SUBROUTINE CST(LOC,IFIX,AREA,FINT,CX,CY,F,FR,FE) DIMENSION LOC(NE,2),IFIX(NFIX),AREA(NE),FINT(NE),CX(NN),CY(NN), 1 F(ND),FR(ND),FE(NE,6), 2 P1(3,6),P2(3,6),GK(12,12),GK1(12,12),AL(3),TT(3,6,6),BKL(3,6,6), 3 T(6,6),CSS(3),SNN(3),EK(6,6),EKL(6,6),EKK(3,6,6),XX(6),BA(6,6) COMMON NN,NE,ND,NFIX,E C------------------------------------------------------- DO 5 I=1,NE I1=LOC(I,1) I2=LOC(I,2) X12=CX(I2)-CX(I1) Y12=CY(I2)-CY(I1) AL(I)=SQRT(X12* *2+Y12* *2) CSS(I)=X12/AL(I) SNN(I)=Y12/AL(I) 5 CONTINUE C FOR CONCENTRAL FORCE,SET TO A NODE READ (5,*) NP,NVD IF (NP.EQ.0) GO TO 15 DO 10 II=1,NP READ (5,*) (I,F(3*I-2),F(3*I-1),F(3*I),I=2,4) 10 CONTINUE 15 CONTINUE C FOR VERTICAL DISTRIBUTED LOADING OF AN ELEMENT IF(NVD.EQ.0) GO TO 25 DO 20 II=1,NVD READ(5,*)IE,Q I1=LOC(IE,1) I2=LOC(IE,2) P1(IE,3*I1-1)=Q*AL(IE)/2. P1(IE,3*I1)=Q*AL(IE)* *2/12. P1(IE,3*I2-1)=Q*AL(IE)/2. P1(IE,3*I2)=-Q*AL(IE)* *2/12. 20 CONTINUE 25 CONTINUE C---------------------------------------------------- DO 30 I=1,ND DO 30 J=1,ND 30 GK(I,J)=0.0 C----------------------------------------------- DO 100 I=1,NE DO 35 J=1,6 DO 35 K=1,6 EKL(J,K)=0.0 EK(J,K)=0.0 35 T(J,K)=0.0 C------------------------------------------------ EAL=E*AREA(I)/AL(I) EIL1=E*FINT(I)/AL(I) EIL2=E*FINT(I)/AL(I)* *2 EIL3=E*FINT(I)/AL(I)* *3 EKL(1,1)=EAL EKL(2,2)=12.*EIL3 EKL(3,3)= 4.*EIL1 EKL(4,4)=EAL EKL(5,5)=12.*EIL3 EKL(6,6)=4.*EIL1 EKL(3,2)=6.*EIL2 EKL(4,1)=-EAL EKL(5,2)=-12.*EIL3 EKL(5,3)=-6.*EIL2 EKL(6,2)=6.*EIL2 EKL(6,3)=2.*EIL1 EKL(6,5)=-6.*EIL2 DO 50 II=1,5 DO 50 JJ=II+1,6 50 EKL(II,JJ)=EKL(JJ,II) DO 55 K=1,6 DO 55 L=1,6 EKK(I,K,L)=EKL(K,L) C WRITE (6,140) I,K L,EKL(K,L),EKK(I,K,L) 140 FORMAT(1X,'IKL,EK',3I4,2E12.5) 55 CONTINUE T(1,1)=CSS(I) T(1,2)=-SNN(I) T(2,1)=SNN(I) T(2,2)=CSS(I) T(3,3)=1. T(4,4)=CSS(I) T(4,5)=-SNN(I) T(5,4)=SNN(I) T(5,5)=CSS(I) T(6,6)=1. C---------------------------------------------------- DO 60 J=1,6 DO 60 K=1,6 TT(I,J,K)=T(J,K) 60 P2(I,J)=P2(I,J)+T(J,K)*P1(I,K) C------------------------------------------------------- DO 65 II=1,6 DO 65 J=1,6 BA(II,J)=0.0 DO 65 K=1,6 BA(II,J)=BA(II,J)+TT(I,II,K)*EKL(K,J) 65 CONTINUE EK(II,J)=0.0 DO 70 II=1,6 DO 70 J=1,6 DO 70 K=1,6 EK(II,J)=EK(II,J)+BA(II,K)*TT(I,J,K) 70 CONTINUE C WRITE(6,120) ((I,II,J,EK(II,J),TT(I,II,J),II=1,6),J=1,6) 120 FORMAT (1X,'I,II,J,EK,TT=',3I4,2E12.5) C-------------------------------------------------------------- DO 85 INODE=1,2 NODEI=LOC(I,INODE) DO 85 IDOFN=1,3 NROWS=(NODEI-1)*3+IDOFN NROWE=(INODE1-1)*3+IDOFN F(NROWS)=F(NROWS)+P2(I,NROWE) DO 85 JNODE=1,2 NODEJ=LOC(I,JNODE) DO 85 JDOFN=1,3 NCOLS=(NODEJ-1)*3+JDOFN NCOLE=(JNODE-1)*3+JDOFN 85 GK(NROWS,NCOLS)=GK(NROWS,NCOLS)+EK(NROWE,NCOLE) 100 CONTINUE DO 88 I=1,ND DO 88 J=1,ND 88 GK1(I,J)=GK(I,J) WRITE(6,160) 160 FORMAT(/4X,'nodal forces from applied loads', 1 /4X,'NODE',5X,'X-LOAD',8X,'Y-LOAD',9X,'MOMENT') WRITE (6,165) (I,F(3*I-2),F(3*I-1),F(3*I),I=1,NN) 165 FORMAT(2X,I5,3E15.6) C WRITE(6,170)((I,J,GK(I,J),J=1,ND),I=1,ND) 170 FORMAT (1X,'I,J,GK1',2I4,E12.5,2X,2I4,E12.5) C-------------------------------------------------------- DO 90 I=1,NFIX IX=IFIX(I) 90 GK(IX,IX)=GK(IX,IX)*1.0E15 C------------------------------------------------------------- CALL GAUSS(GK,F,ND) C-------------------------------------------------------------- DO 92 I=1,ND FR(I)=0.0 DO 94 J=1,ND 94 FR(I)=FR(I)+GK1(I,J)*F(J) 92 FR(I)=FR(I)-F(I) C--------------------------------------------------------------- DO 95 I=1,NE I1=LOC(I,1) I2=LOC(I,2) XX(1)=F(3*I1-2) XX(2)=F(3*I1-1) XX(3)=F(3*I1) XX(4)=F(3*I2-2) XX(5)=F(3*I2-1) XX(6)=F(3*I2) DO 96 J=1,6 DO 96 K=1,6 BKL(I,J,K)=0.0 DO 96 L=1,6 BKL(I,J,K)=BKL(I,J,K)+EKK(I,J,L)*TT(I,K,L) 96 CONTINUE DO 97 J=1,6 FE(I,J)=0.0 DO 97 K=1,6 FE(I,J)=FE(I,J)+BKL(I,J,K)*XX(K) 97 CONTINUE DO 98 J=1,6 98 FE(I,J)=FE(I,J)-P1(I,J) 95 CONTINUE RETURN END C--------------------GAUSS'S METHOD---------------------- SUBROUTINE GAUSS(A,B,N) DIMENSION A(N,N),B(N) DO 1 I=1,N I1=I+1 DO 10 J=I1,N 10 A(I,J)=A(I,J)/A(I,I) B(I)=B(I)/A(I,I) A(I,I)=1.0 DO 20 J=I1,N DO 30 M=I1,N 30 A(J,M)=A(J,M)-A(J,I)*A(I,M) 20 B(J)=B(J)-A(J,I)*B(I) 1 CONTINUE DO 40 I=N-1,1,-1 DO 50 J=I+1,N 50 B(I)=B(I)-A(I,J)*B(J) 40 CONTINUE RETURN END
http://image.keyan.cc/data/bcs/2015/0630/w149h3869417_1435649483_667.png