求助……,关于一个平面杆系结构分析程序
PROGRAM PBSAP! C PLANE BAR STRUCTURE ANALYSIS PROGRAM
REAL KS
DIMENSION ID(100,3),EF(100,7),PJ(50,3),PE(50,4)
DIMENSION KD(100),KS(5000),PS(100),PF(100,6)
CHARACTER NAME*12
WRITE(*,10)
10 FORMAT(1X,22HINPUT DATA FILE NAME=>)
READ(*,*) NAME
OPEN(1,FILE=NAME,STATUS='OLD')
OPEN(2,FILE='PBO.DAT')
WRITE(*,1000)
WRITE(2,1000)
CALL INDATA(NJ,NE,NP,NF,ID,EF,PJ,PE)
CALL PTDATA(NJ,NE,NP,NF,ID,EF,PJ,PE)
CALL SETJID(NJ,NN,ID)
CALL SETKKD(NE,NN,LL,ID,EF,KD)
CALL TOTLKS(NE,ID,EF,KD,KS)
CALL TOTLPS(NP,NF,ID,EF,PJ,PE,PS)
CALL GAUSS3(NN,KD,KS,PS)
CALL INTEPF(NE,NF,ID,EF,PE,PS,PF)
CALL PTDPPF(NJ,NE,NN,LL,ID,PS,PF)
WRITE(*,2000)
WRITE(2,2000)
STOP
1000 FORMAT(//5X,30(1H.)/6X,1H.,57X,1H./6X,1H.,24X,9HP B S A P,24X,1H./6X,1H.,57X,1H./6X,1H.,10X,35HP L A N EB A RS T R U C T U R E,10X,1H./6X,1H.,57X,1H./6X,1H.,12X,30HA N A L Y S I SP R O G R A M,14X,1H./6X,1H.,57X,1H./5X,30(1H.)///)
2000 FORMAT(///22X,25H* * * * * E N D * * * * */)
END
SUBROUTINE INDATA(NJ,NE,NP,NF,ID,EF,PJ,PE)
DIMENSION ID(100,3),EF(100,7),PJ(50,3),PE(50,4)
READ(1,*) NJ,NE,NP,NF
DO 10N=1,NJ
READ(1,*) (ID(N,I),I=1,3)
10 CONTINUE
DO 20N=1,NE
READ(1,*) (EF(N,I),I=1,7)
20 CONTINUE
IF(NP.EQ.0)GOTO 40
DO 30N=1,NP
READ(1,*) (PJ(N,I),I=1,3)
30 CONTINUE
40 IF(NF.EQ.0)GOTO 60
DO 50N=1,NF
READ(1,*) (PE(N,I),I=1,4)
50 CONTINUE
60 RETURN
END
SUBROUTINE PTDATA(NJ,NE,NP,NF,ID,EF,PJ,PE)
DIMENSION ID(100,3),EF(100,7),PJ(50,3),PE(50,4)
WRITE(*,1000) NJ,NE,NP,NF
WRITE(2,1000) NJ,NE,NP,NF
WRITE(*,1100)
WRITE(2,1100)
DO 10N=1,NJ
WRITE(*,1200)N,(ID(N,I),I=1,3)
WRITE(2,1200)N,(ID(N,I),I=1,3)
10 CONTINUE
WRITE(*,1300)
WRITE(2,1300)
DO 20 N=1,NE
WRITE(*,1400) N,(INT(EF(N,I)),I=1,2),(EF(N,I),I=3,7)
WRITE(2,1400) N,(INT(EF(N,I)),I=1,2),(EF(N,I),I=3,7)
20 CONTINUE
IF(NP.EQ.0)GOTO 40
WRITE(*,1500)
WRITE(2,1500)
DO 30N=1,NP
WRITE(*,1600)(INT(PJ(N,I)),I=1,2),PJ(N,3)
WRITE(2,1600)(INT(PJ(N,I)),I=1,2),PJ(N,3)
30 CONTINUE
40 IF(NF.EQ.0) GOTO 60
WRITE(*,1700)
WRITE(2,1700)
DO 50N=1,NF
WRITE(*,1800)(INT(PE(N,I)),I=1,2),(PE(N,I),I=3,4)
WRITE(2,1800)(INT(PE(N,I)),I=1,2),(PE(N,I),I=3,4)
50 CONTINUE
60 RETURN
1000 FORMAT(/15X,40H* * * * * I N P U T D A T A * * * * *//5X,11HNODE NUMBER,16X,3HNE=,I3/5X,14HELEMENT NUMBER,13X,3HNE=,I3/5X,16HNODE LOAD NUMBER,11X,3HNP=,I3/5X,19HELEMENT LOAD NUMBER,8X,3HNF=,I3/)
1100 FORMAT(/5X,5(1H-),16HNODE INFORMATION,5(1H-)//3X,7HNODE NO,4X,5HX-DIR,3X,5HY-DIR,3X,5HQ-DIR/)
1200 FORMAT(5X,I2,8X,3(I2,6X))
1300 FORMAT(//5X,5(1H-),19HELEMENT INFORMATION,5(1H-)//1X,2HNO,3X,1HI,3X,1HJ,4X,6HLENGTH,7X,4HAREA,7X,6HMOMENT,6X,7HMODULUS,6X,5HANGLE/)
1400 FORMAT(1X,3(I2,2X),5(E10.4,2X))
1500 FORMAT(//5X,5(1H-),21HNODE LOAD INFORMATION,5(1H-)//3X,7HNODE NO,2X,14HLOAD - DIRECTION,4X,10HLOAD VALUS/)
1600 FORMAT(5X,I2,11X,I2,11X,F8.3)
1700 FORMAT(//5X,5(1H-),24HELEMENT LOAD INFORMATION,5(1H-)//1X,10HELEMENT NO,3X,9HLOAD TYPE,5X,10HLOAD VALUS,7X,13HLOAD DISTANCE/)
1800 FORMAT(5X,I2,10X,I2,10X,2(F8.3,11X))
END
SUBROUTINE SETJID(NJ,NN,ID)
DIMENSION ID(100,3)
NN=0
DO 50N=1,NJ
DO 40I=1,3
IF(ID(N,I)) 10,20,30
10 ID(N,I)=0
GOTO 40
20 NN=NN+1
ID(N,I)=NN
GOTO 40
30 NI=ID(N,I)
ID(N,I)=ID(NI,I)
40 CONTINUE
50 CONTINUE
RETURN
END
SUBROUTINE SETKKD(NE,NN,LL,ID,EF,KD)
DIMENSION ID(100,3),EF(100,7),KD(100),IJ(6)
KD(1)=1
DO 50N=2,NN
MA=0
DO 40M=1,NE
IE=EF(M,1)
JE=EF(M,2)
DO 10I=1,3
IJ(I)=ID(IE,I)
IJ(I+3)=ID(JE,I)
10 CONTINUE
NA=0
DO 20I=1,6
IF(N.EQ.IJ(I)) NA=1
20 CONTINUE
IF(NA.EQ.0) GOTO 40
DO 30I=1,6
IF(IJ(I).EQ.0) GOTO 30
NA=N-IJ(I)
IF(NA.GT.MA) MA=NA
30 CONTINUE
40 CONTINUE
KD(N)=KD(N-1)+MA+1
50 CONTINUE
LL=KD(NN)
RETURN
END
SUBROUTINE TOTLKS(NE,ID,EF,KD,KS)
REAL KS,KE
DIMENSION ID(100,3),EF(100,7)
DIMENSION KD(100),KS(5000),KE(6,6),IJ(6)
DO 40N=1,NE
CALL TOTLKE(N,EF,KE)
IE=EF(N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))+AE(4)*(P(3)/2+P(6))
IF(NF.EQ.0) GOTO 45
DO 40I=1,NF
ME=PE(I,1)
IF(ME.NE.N) GOTO 40
JT=PE(I,2)
EP=PE(I,3)
EA=PE(I,4)
EL=EF(N,3)
CALL SETEEP(JT,EP,EA,EL,P)
DO 30J=1,6
PF(N,J)=PF(N,J)+P(J)
30 CONTINUE
40 CONTINUE
45 PF(N,1)=-PF(N,1)
PF(N,3)=-PF(N,3)
PF(N,5)=-PF(N,5)
PF(N,6)=-PF(N,6)
50 CONTINUE
RETURN
END
SUBROUTINE PTDPPF(NJ,NE,NN,LL,ID,PS,PF)
DIMENSION ID(100,3),PS(100),PF(100,6),P(3)
WRITE(*,1000) NN,LL
WRITE(2,1000) NN,LL
DO 10N=1,NJ
WRITE(*,1100) N,(ID(N,I),I=1,3)
WRITE(2,1100) N,(ID(N,I),I=1,3)
10 CONTINUE
WRITE(*,1200)
WRITE(2,1200)
DO 30N=1,NJ
DO 20I=1,3
P(I)=0
IF(ID(N,I).EQ.0) GOTO 20
P(I)=PS(IID(N,I))
20 CONTINUE
WRITE(*,1300)N,(P(I),I=1,3)
WRITE(2,1300)N,(P(I),I=1,3)
30 CONTINUE
WRITE(*,1400)
WRITE(2,1400)
DO 40 N=1,NE
WRITE(*,1500)N,(PF(N,I),I=1,6)
WRITE(2,1500)N,(PF(N,I),I=1,6)
40 CONTINUE
RETURN
1000 FORMAT(//14X,41H* * * * * O U T P U TD A T A * * * * * //5X,17HDEGREE OF FREEDOM,10X,3HNN=,I3/5X,22HTOTAL STIFFNESS NUMBER,5X,3HLL=,I3//5X,5(1H-),29HNODE LOCATION VECATION VECTOR,5(1H-)//3X,7HNODE NO,4X,5HX-DIR,3X,5HY-DIR,3X,5HQ-DIR/)
1100 FORMAT(5X,I2,8X,3(I2,6X))
1200 FORMAT(//5X,5(1H-),17HNODE DISPLACEMENT,5(1H-)//3X,7HNODE NO,8X,6HX-DISP,12X,6HY-DISP,11X,8HROTATION/)
1300 FORMAT(5X,I2,7X,3(E14.8,4X))
1400 FORMAT(//5X,5(1H-),22HELEMENT INTERNAL FORCE,5(1H-)//1X,2HNO,5X,3HI-N,8X,3HI-Q,8X,3HI-M,8X,3HJ-N,8X,3HJ-Q,8X,3HJ-M/)
1500 FORMAT(1X,I2,1X,6(E10.4,1X))
END 刚才是全部的源程序,好像在SUBROUTINE INTEP里面有错误.
帮帮忙 :'( :'( :'(
清帮帮忙,拜托拉。 :lol
各位,我搞定拉,不用劳烦大家拉。
请帮我一下,你是怎么搞定的?求助!
朋友,你是怎么搞定的,我正好也在学习这一个程序,要不请将你的正确代码发我一份吧,coldmoonflower@163.com,先谢谢啊!!!
页:
[1]