[Fortran] 纯文本查看 复制代码
PROGRAM CBSAP
! STRUCTURAL ANALYSIS PROGRAM FOR CONTINUOUS BEAM
INTEGER NJ,IL,IR,NNE,I,J,K
REAL GC(20),GX(20),AMF(20,2),AM(20,2),P(21),AK(21,21),XG(20)
CHARACTER*80 TITLE
OPEN(2,FILE='CBSAP.IN')
OPEN(6,FILE='CBSAP.OUT')
READ(2,*)TITLE
WRITE(6,*)TITLE
READ(2,20)NJ,IL,IR
20 FORMAT(3I5)
WRITE(6,30)NJ,IL,IR
30 FORMAT(/3X,'NUMBER OF NODE='I2,5X,'BIND(L)='I1,2X,'BIND(R)='I1,3X,'1=FIXED 0=SIMPLY SUPPORTED')
NNE=NJ-1
READ(2,40)(GC(I),GX(I),(AMF(I,J),J=1,2),I=1,NNE)
40 FORMAT(4F10.3)
WRITE(6,50)(I,GC(I),GX(I),(AMF(I,J),J=1,2),I=1,NNE)
50 FORMAT(/3X,'NO.E',7X,'LENGHT',6X,'STIFFNESS',6X,'MOMENTENT(L)',6X,'MOMENT(R)'/(I5,4F15.4))
DO I=1,NNE
XG(I)=GX(I)/GC(I)
END DO
P(1)=-AMF(1,1)
P(NJ)=-AMF(NNE,2)
DO J=2,NNE
P(J)=-AMF(J-1,2)-AMF(J,1)
END DO
DO I=1,NJ
DO J=1,NJ
AK(I,J)=0
END DO
END DO
AK(1,1)=4.0*XG(1)
AK(NJ,NJ)=4.0*XG(NNE)
DO J=2,NNE
AK(J,J)=4.0*(XG(J-1)+XG(J))
END DO
DO J=2,NJ
AK(J,J-1)=2.0*XG(J-1)
AK(J-1,J)=2.0*XG(J-1)
END DO
IF(IL.EQ.1)THEN
AK(1,1)=1.0
AK(1,2)=0.0
AK(2,1)=0.0
P(1)=0.0
ELSE
END IF
IF(IR.EQ.0)THEN
AK(NJ,NJ)=1.0
AK(NNE,NJ)=0.0
AK(NJ,NNE)=0.0
P(NJ)=0.0
ELSE
END IF
DO K=1,NNE
DO I=K+1,NJ
C=AK(I,K)/AK(K,K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