      SUBROUTINE ELBOW(                                                 00073930
     $ID,PROP1,PROP2,PROP3,PROP4,PROP5,PROP6,PROP7,PROP8,               00073940
     $LM,S,RF,XM,SA,SF,TEMPD                                            00073950
     $,KK1,KK2,KK3,KK4,KK5,KK6,KK7,KK8,IX,IA,NEL,NUMNP,NDMX,NSMX,MXDF   00073960
     $,MMA)                                                             00073970
      IMPLICIT REAL*8(A-H,O-Z)                                          00073980
      REAL*8  ID,LM                                                     00073990
      REAL*8MODUE                                                       00074000
      COMMON/AMB/GRAV,REFT,JROT                                         00074070
      COMMON/ELPAR/ZDUM(14),NDUM,MBAND,MDUM(8),N2P,N3P,NMRI,NTRI,N1P    00074080
     & ,NRELPA(43)                                                      R0074081
      COMMON A(1)                                                       00074090
      COMMON/PREP/WDM(2),KSKIP,RRPREP(8)                                R0074100
      COMMON/MASS/LMASS                                                 00074110
      COMMON/ELTEMP/TAVG,RRELTE(102)                                    R0074120
      COMMON/QTSARG/ALFAV,E,XNU,XKP,T,NODE,NLE,R,THERM,P,AREA,XMI,WALL, 00074130
     $DOUT,XMAS,FEF(12,5),FEFC(18,5),F(6,6),B(6,6),H(6,6),DC(3,3),LSKIP 00074140
     & ,NRQTSA(1437)                                                    R0074141
      COMMON/JUNK/NI(3),I,X1(3),X2(3),X3(3),QQ(3,3),Q(3,3),FAC(5)       00074150
     &,FN(4),FTH(4),RRJUNK(185)                                         R0074160
      COMMON /CG/ SCG(4),RRCG(2)                                        R0074170
      DIMENSION IX(13),IA(100)                                          R0074010
      DIMENSION LM(1),S(MXDF,MXDF),RF(MXDF,KK6),XM(MXDF,MMA),           00074020
     $SA(NSMX,MXDF),                                                    00074030
     $SF(NSMX,KK6),TEMPD(NDMX,KK6),ID(NUMNP,3)                          00074040
      DIMENSION PROP3(KK3),PROP5(KK5,7),PROP6(KK6,7),PROP2(KK2,7)       00074050
      DIMENSION PROP8(KK8,6)                                            00074060
      NLE=NEL                                                           00074180
      DO 100 I=1,3                                                      00074190
      IF(IX(I).LE.0.OR.IX(I).GT.NUMNP) GO TO 110                        00074200
  100 NI(I)=IX(I)                                                       00074210
      MEL=IX(9)                                                         00074220
      NTH=IX(10)                                                        00074230
      NPR=IX(11)                                                        00074240
      NSEC=IX(12)                                                       00074250
      KSEC=0                                                            00074260
      IF(MEL.LT.1.OR.MEL.GT.KK2) GO TO 110                              00074270
      IF(NTH.LT.1.OR.NTH.GT.KK3) GO TO 110                              00074280
      IF(NPR.GT.KK5) GO TO 110                                          00074290
      IF(NSEC.EQ.0 .OR. NSEC.EQ.99)KSEC=1                               00074300
      IF(NSEC.EQ.0 .OR. NSEC.EQ.99)GO TO 130                            00074310
      IF(NSEC.GE.1.AND.NSEC.LE.KK8)GO TO 130                            00074320
      WRITE(6,120)NEL                                                   00074330
      KSEC=1                                                            00074340
      GO TO 130                                                         00074350
  110 WRITE(6,120)NEL                                                   00074360
  120 FORMAT(/20X,45HA BEAM, THICKNESS, PRESSURE, OR MATERIAL TYPE,     00074370
     $52H OR BEAM SECTION PROPERTY WAS REQUESTED FOR ELEMENT ,I5/       00074380
     $20X,22HAND WAS NOT AVAILABLE.///)                                 00074390
      KSKIP=1                                                           00074400
      RETURN                                                            00074410
  130 WALL=PROP3(NTH)                                                   00074420
      P=0.0                                                             00074430
      IF(NPR.GT.0) P=PROP5(NPR,1)                                       00074440
      MAT=PROP2(MEL,1)                                                  00074450
      AREA=PROP2(MEL,2)                                                 00074460
      PI=3.14159265                                                     00074470
      DOUT=AREA/WALL/PI+WALL                                            00074480
      ROUT = DOUT * 0.5                                                 00074490
      RIN = ROUT - WALL                                                 00074500
      ROUT2 = ROUT**2                                                   00074510
      RIN2 = RIN**2                                                     00074520
        PSTR=P*PI*RIN2/AREA                                             00074530
      XMI = 0.25* PI* (ROUT2**2 - RIN2**2)                              00074540
      DUM2 = 1.333333333333* (ROUT2* ROUT - RIN2* RIN)                  00074550
      DUM3 = (ROUT2 + RIN2) * WALL                                      00074560
      IF(DUM3.LT.1.0E-8) STOP 701                                       00074570
      ALFAV = DUM2/ DUM3                                                00074580
      MSEC=NSEC                                                         00074590
      IF(KSEC.EQ.1)MSEC=1                                               00074600
      C2P=PROP8(MSEC,1)/XMI                                             00074610
      C2N=PROP8(MSEC,2)/XMI                                             00074620
      C3P=PROP8(MSEC,3)/XMI                                             00074630
      C3N=PROP8(MSEC,4)/XMI                                             00074640
      Q22=PROP8(MSEC,5)/XMI                                             00074650
      Q33=PROP8(MSEC,6)/XMI                                             00074660
      IF(C2N.EQ.0.)C2N=C2P                                              00074670
      IF(C3P.EQ.0.)C3P=C2P                                              00074680
      IF(C3N.EQ.0.)C3N=C3P                                              00074690
      IF(Q33.EQ.0.)Q33=Q22                                              00074700
      IF(PROP2(MEL,3).LE.0.0) ALFAV=0.0                                 00074710
      IF(MAT.GT.18.AND.NTRI.EQ.0) GO TO 110                             00074720
      IF(MAT.GT.18) GO TO 140                                           00074730
      E=MODUE(TAVG,MAT)                                                 00074740
      XNU=PRATO(TAVG,MAT)                                               00074750
      THERM=ALPHZM(TAVG,MAT)                                            00074760
      DEN=DENS(TAVG,MAT)/1728.                                          00074770
      GO TO 150                                                         00074780
  140 CALL MATEV(MAT,NMRI,NTRI,TAVG,E,XNU,THERM,DEN,A(N1P),A(N2P),A(N3P)00074790
     $,NEL)                                                             00074800
  150 CONTINUE                                                          00074810
      XWGT=DEN*AREA                                                     00074820
      XMAS=XWGT/GRAV                                                    00074830
      NODE=NI(1)                                                        00074840
      TOL=.1*WALL                                                       00074850
      ND=12                                                             00074860
      NS=18                                                             00074870
      DO 160 I=1,3                                                      00074880
      CALL UNPKID(ID,NUMNP,W,X1(I),1,NI(1),I)                           00074890
      CALL UNPKID(ID,NUMNP,W,X2(I),1,NI(2),I)                           00074900
  160 CALL UNPKID(ID,NUMNP,W,X3(I),1,NI(3),I)                           00074910
        IF(JROT.EQ.0) GO TO 165                                         00074920
        CALL CENT(X1(1),X1(2),FN(1),FN(2))                              00074930
        CALL CENT(X2(1),X2(2),FN(3),FN(4))                              00074940
        FTH(1)= FN(2)                                                   00074950
        FTH(2)=-FN(1)                                                   00074960
        FTH(3)= FN(4)                                                   00074970
        FTH(4)=-FN(3)                                                   00074980
165     CONTINUE                                                        00074990
      DO 170 I=1,6                                                      00075000
      CALL UNPKID(ID,NUMNP,LM(I),W,2,NI(1),I)                           00075010
  170 CALL UNPKID(ID,NUMNP,LM(I+6),W,2,NI(2),I)                         00075020
      CALL BENDDC(NEL,X1,X2,X3,RADIUS,DC,T    ,TOL,PI,KSKIP)            00075030
      IF(KSKIP.EQ.1) RETURN                                             00075040
      RM=(DOUT-WALL)*0.5                                                00075050
      IF(RM.LT.1.0E-8) WRITE(6,180)                                     00075060
  180 FORMAT(/20X, 33HWALL THICKNESS= OUTSIDE DIAMETER./)               00075070
      IF(RM.LT.1.0E-8) CALL CLOSE                                       00075080
      HZ=WALL*RADIUS/RM**2                                              00075090
      DUM=6.0*P/E/HZ                                                    00075100
      DUM2=(RADIUS/WALL)**1.33333333333                                 00075110
      DUM= 1.0+DUM* DUM2                                                00075120
      XKP=(1.65/HZ)/DUM                                                 00075130
      IF(XKP.LT.1.0) XKP=1.0                                            00075140
      R=RADIUS                                                          00075150
      LSKIP=KSKIP                                                       00075160
      CALL BENDKS(S,XM,SA,MXDF,NSMX,MMA)                                00075170
      KSKIP=LSKIP                                                       00075180
      IF(KSKIP.EQ.1) RETURN                                             00075190
      IF(KSEC.EQ.1)GO TO 190                                            00075200
      DO 185 J=1,12                                                     00075210
      SA(19,J)= SA(1,J)/AREA                                            00075220
      SA(20,J)= SA(2,J)*Q33                                             00075230
      SA(21,J)= SA(3,J)*Q22                                             00075240
      SA(22,J)= SA(5,J)*C3P                                             00075250
      SA(23,J)=-SA(5,J)*C3N                                             00075260
      SA(24,J)=-SA(6,J)*C2P                                             00075270
      SA(25,J)= SA(6,J)*C2N                                             00075280
      SA(26,J)= SA(7,J)/AREA                                            00075290
      SA(27,J)= SA(8,J)*Q33                                             00075300
      SA(28,J)= SA(9,J)*Q22                                             00075310
      SA(29,J)= SA(11,J)*C3P                                            00075320
      SA(30,J)=-SA(11,J)*C3N                                            00075330
      SA(31,J)=-SA(12,J)*C2P                                            00075340
      SA(32,J)= SA(12,J)*C2N                                            00075350
      SA(33,J)= SA(13,J)/AREA                                           00075360
      SA(34,J)= SA(14,J)*Q33                                            00075370
      SA(35,J)= SA(15,J)*Q22                                            00075380
      SA(36,J)= SA(17,J)*C3P                                            00075390
      SA(37,J)=-SA(17,J)*C3N                                            00075400
      SA(38,J)=-SA(18,J)*C2P                                            00075410
      SA(39,J)= SA(18,J)*C2N                                            00075420
  185 CONTINUE                                                          00075430
  190 CONTINUE                                                          00075440
      DO 260 IR=1,10,3                                                  00075450
      IRS = IR-1                                                        00075460
      DO 250 IC=IR,10,3                                                 00075470
      ICS = IC-1                                                        00075480
      DO 200 I=1,3                                                      00075490
      II = IRS+I                                                        00075500
      DO 200 J=1,3                                                      00075510
      JJ = ICS+J                                                        00075520
      Q(I,J) = S(II,JJ)                                                 00075530
  200 CONTINUE                                                          00075540
      DO 220 I=1,3                                                      00075550
      DO 220 J=1,3                                                      00075560
      QQ(I,J) = 0.0                                                     00075570
      DO 210 KN=1,3                                                     00075580
      QQ(I,J) = QQ(I,J) + Q(I,KN)* DC(J,KN)                             00075590
  210 CONTINUE                                                          00075600
  220 CONTINUE                                                          00075610
      DO 240 I=1,3                                                      00075620
      II = IRS+I                                                        00075630
      DO 240 J=1,3                                                      00075640
      JJ = ICS+J                                                        00075650
      S(II,JJ) = 0.0                                                    00075660
      DO 230 KN=1,3                                                     00075670
      S(II,JJ) = S(II,JJ) + DC(I,KN)* QQ(KN,J)                          00075680
  230 CONTINUE                                                          00075690
  240 CONTINUE                                                          00075700
  250 CONTINUE                                                          00075710
  260 CONTINUE                                                          00075720
      DO 270 I=1,12                                                     00075730
      DO 270 J=I,12                                                     00075740
      S(J,I) = S(I,J)                                                   00075750
  270 CONTINUE                                                          00075760
        II=1                                                            00075770
        IF(JROT.EQ.1) II=3                                              00075780
        FAC(1)=0.0                                                      00075790
        FAC(2)=0.0                                                      00075800
      DO 380 LC=1,KK6                                                   00075810
        DO 290 I=II,3                                                   00075820
      FAC(I)=0.0                                                        00075830
      DO 280 J=1,3                                                      00075840
  280 FAC(I) = FAC(I) + DC(J,I)*PROP6(LC,J+4)                           00075850
      FAC(I)= FAC(I)* XWGT                                              00075860
  290 CONTINUE                                                          00075870
      FAC(5)=PROP6(LC,1)                                                00075880
      FAC(4)=0.0                                                        00075890
      TOPT=PROP6(LC,2)                                                  00075900
      IF(TOPT.EQ.1.0) FAC(4)=(TEMPD(1,LC)+TEMPD(2,LC))/2.0-REFT         00075910
      IF(TOPT.EQ.2.0) FAC(4)=PROP6(LC,3)-REFT                           00075920
      DO 310 I=1,ND                                                     00075930
      RF(I,LC) = 0.0                                                    00075940
      DO 300 J=1,5                                                      00075950
      RF(I,LC) = RF(I,LC) - FEF(I,J)* FAC(J)                            00075960
  300 CONTINUE                                                          00075970
  310 CONTINUE                                                          00075980
      DO 350 IR=1,10,3                                                  00075990
      IRS = IR-1                                                        00076000
      DO 320 I=1,3                                                      00076010
      J = IRS+I                                                         00076020
  320 Q(I,1) = RF(J,LC)                                                 00076030
      DO 340 M=1,3                                                      00076040
      J = IRS+M                                                         00076050
      RF(J,LC) = 0.0                                                    00076060
      DO 330 KN=1,3                                                     00076070
      RF(J,LC) = RF(J,LC) + DC(M,KN) * Q(KN,1)                          00076080
  330 CONTINUE                                                          00076090
  340 CONTINUE                                                          00076100
  350 CONTINUE                                                          00076110
      DO 370 I=1,NS                                                     00076120
      SF(I,LC)=0.0                                                      00076130
      DO 360 J=1,5                                                      00076140
  360 SF(I,LC) = SF(I,LC) +FEFC(I,J)* FAC(J)                            00076150
  370 CONTINUE                                                          00076160
      IF(KSEC.EQ.1)GO TO 380                                            00076170
      SF(19,LC)=-SF(1,LC)/AREA                                          00076180
      SF(20,LC)= 0.0                                                    00076190
      SF(21,LC)= 0.0                                                    00076200
      SF(20,LC)= SF( 2,LC)*Q33                                          00076210
      SF(21,LC)= SF( 3,LC)*Q22                                          00076220
      SF(22,LC)=-SF(5,LC)*C3P                                           00076230
      SF(23,LC)= SF(5,LC)*C3N                                           00076240
      SF(24,LC)= SF(6,LC)*C2P                                           00076250
      SF(25,LC)=-SF(6,LC)*C2N                                           00076260
      SF(26,LC)= SF(7,LC)/AREA                                          00076270
      SF(27,LC)= 0.0                                                    00076280
      SF(28,LC)= 0.0                                                    00076290
      SF(27,LC)= SF( 8,LC)*Q33                                          00076300
      SF(28,LC)= SF( 9,LC)*Q22                                          00076310
      SF(29,LC)= SF(11,LC)*C3P                                          00076320
      SF(30,LC)=-SF(11,LC)*C3N                                          00076330
      SF(31,LC)=-SF(12,LC)*C2P                                          00076340
      SF(32,LC)= SF(12,LC)*C2N                                          00076350
      SF(33,LC)= SF(13,LC)/AREA                                         00076360
      SF(34,LC)= 0.0                                                    00076370
      SF(35,LC)= 0.0                                                    00076380
      SF(34,LC)= SF(14,LC)*Q33                                          00076390
      SF(35,LC)= SF(15,LC)*Q22                                          00076400
      SF(36,LC)= SF(17,LC)*C3P                                          00076410
      SF(37,LC)=-SF(17,LC)*C3N                                          00076420
      SF(38,LC)=-SF(18,LC)*C2P                                          00076430
      SF(39,LC)= SF(18,LC)*C2N                                          00076440
        SF(19,LC)=SF(19,LC)+PSTR*FAC(5)                                 00076450
        SF(26,LC)=SF(26,LC)+PSTR*FAC(5)                                 00076460
        SF(33,LC)=SF(33,LC)+PSTR*FAC(5)                                 00076470
  380 CONTINUE                                                          00076480
      NS=39                                                             00076490
      IF(KSEC.EQ.1)NS=18                                                00076500
      XMCG=XM(1,1)                                                      00076510
      DO 390 I=1,2                                                      00076520
      NPNT=IX(I)                                                        00076530
      SCG(4)=SCG(4)+XMCG                                                00076540
      DO 390 J=1,3                                                      00076550
      CALL UNPKID(ID,NUMNP,W,CORD,1,NPNT,J)                             00076560
  390 SCG(J)=SCG(J)+XMCG*CORD                                           00076570
        IF(JROT.EQ.0) GO TO 410                                         00076580
        DO 400 I=1,2                                                    00076590
        DO 400 J=1,KK6                                                  00076600
        FAC(1)=PROP6(J,5)                                               00076610
        FAC(2)=PROP6(J,6)                                               00076620
      IRK=1                                                             00076630
      IF(LMASS.EQ.1)IRK=I                                               00076640
        RF(I,J)=RF(I,J)+FAC(1)*FN(I)*XM(I,IRK)+FAC(2)*FTH(I)*XM(I,IRK)  00076650
      IRK=1                                                             00076660
      IF(LMASS.EQ.1)IRK=I+6                                             00076670
400     RF(I+6,J)=RF(I+6,J)+FAC(1)*FN(I+2)*XM(I+6,IRK)                  00076680
     $  +FAC(2)*FTH(I+2)*XM(I+6,IRK)                                    00076690
410     CONTINUE                                                        00076700
      CALL WRITET(MBAND,NDIF,9,ND,NS,LM,SA)                             00076710
      RETURN                                                            00076720
      END                                                               00076730
      SUBROUTINE BENDDC(NEL,X1,X2,X3,R,A,THETA,TOL,PI,KSKIP)            00023170
      IMPLICIT REAL*8 (A-H,O-Z)                                         00023180
      DIMENSION X1(3),X2(3),X3(3),A(3,3),B(3)                           00023190
  100 A(1,2) = X3(1)-X1(1)                                              00023200
      A(2,2) = X3(2)-X1(2)                                              00023210
      A(3,2) = X3(3)-X1(3)                                              00023220
      D1C = 0.0                                                         00023230
      DO 110 K=1,3                                                      00023240
  110 D1C = D1C + A(K,2)**2                                             00023250
      D1C=  DSQRT(D1C)                                                  00023260
      IF(D1C.GT.1.0E-8) GO TO 140                                       00023270
  120 KSKIP=1.0                                                         00023280
      WRITE(6,130)NEL                                                   00023290
  130 FORMAT (/20X, 17HERROR ON ELEMENT ,I5/)                           00023300
      RETURN                                                            00023310
  140 DUM=1.0/D1C                                                       00023320
      DO 150 K=1,3                                                      00023330
  150 A(K,2) = A(K,2)* DUM                                              00023340
      B(1) = X3(1)-X2(1)                                                00023350
      B(2) = X3(2)-X2(2)                                                00023360
      B(3) = X3(3)-X2(3)                                                00023370
      D2C = 0.0                                                         00023380
      DO 160 K=1,3                                                      00023390
  160 D2C = D2C + B(K)**2                                               00023400
      D2C=  DSQRT(D2C)                                                  00023410
      IF(D2C.LT.1.0E-8) GO TO 120                                       00023420
      R=(D1C+D2C)/2.0                                                   00023430
      DUM= DABS(D1C-D2C)                                                00023440
      D2C=0.05*R                                                        00023450
      IF(DUM.GT.D2C) GO TO 120                                          00023460
  170 A(1,3) = A(2,2)*B(3) - A(3,2)*B(2)                                00023470
      A(2,3) = A(3,2)*B(1) - A(1,2)*B(3)                                00023480
      A(3,3) = A(1,2)*B(2) - A(2,2)*B(1)                                00023490
      DUM = 0.0                                                         00023500
      DO 180 K=1,3                                                      00023510
  180 DUM = DUM + A(K,3)**2                                             00023520
      DUM=  DSQRT(DUM)                                                  00023530
      IF(DUM.LT.1.0E-8)GO TO 120                                        00023540
      DUM=1.0/DUM                                                       00023550
      DO 190 K=1,3                                                      00023560
  190 A(K,3) = A(K,3) * DUM                                             00023570
      CHORD = 0.0                                                       00023580
      DO 200 K=1,3                                                      00023590
  200 CHORD = CHORD + (X2(K)-X1(K))**2                                  00023600
      CHORD =  DSQRT (CHORD)                                            00023610
      IF(CHORD.LT.1.0E-8) GO TO 120                                     00023620
  210 A(1,1) = A(2,2)*A(3,3) - A(3,2)*A(2,3)                            00023630
      A(2,1) = A(3,2)*A(1,3) - A(1,2)*A(3,3)                            00023640
      A(3,1) = A(1,2)*A(2,3) - A(2,2)*A(1,3)                            00023650
      DUM = 0.5*CHORD/R                                                 00023660
      THETA= 2.0* DARSIN(DUM)                                           00023670
      IF(THETA.LT.1.0E-8.OR .THETA.GT.PI) GO TO 120                     00023680
      RETURN                                                            00023690
      END                                                               00023700
      SUBROUTINE BENDKS(S,XM,SA,MXDF,NSMX,MMA)                          00023710
      IMPLICIT REAL*8(A-H,O-Z)                                          00023720
      DIMENSION S(MXDF,MXDF),SA(NSMX,MXDF),XM(MXDF,MMA)                 00023730
      COMMON/MASS/LMASS                                                 00023740
      COMMON /QTSARG/ ALFAV,E,XNU,XKP,T,NODE,NEL,R,THERM,               00023750
     $P,AREA,XMI,WALL,DOUT,XMAS,FEF(12,5),FEFC(18,5),F(6,6),B(6,6),     00023760
     $H(6,6),DC(3,3),KSKIP,I,COL(6),RRQTSA(712)                         R0023770
      NPAR=1                                                            00023780
      NPAR=0                                                            00023790
      AXIAL = 1.0                                                       00023800
      XKAP = ALFAV                                                      00023810
      XK0 = XKP                                                         00023820
      XK1 = XKP                                                         00023830
      RE = 1.0/E                                                        00023840
      XNU1 = 1.0+XNU                                                    00023850
      RA = AXIAL*R*RE/AREA                                              00023860
      RV = XKAP*XNU1*R*RE/AREA                                          00023870
      RT = 0.5*XNU1*R*RE/XMI                                            00023880
      RB0 = 0.5*XK0*R*RE/XMI                                            00023890
      RB1 = XK1*R*RE/XMI                                                00023900
      R2 = R**2                                                         00023910
      ST =  DSIN(T)                                                     00023920
      CT =  DCOS(T)                                                     00023930
      S2T=  DSIN(2.0*T)                                                 00023940
      C2T=  DCOS(2.0*T)                                                 00023950
      T2 = T**2                                                         00023960
      DO 100 I=1,6                                                      00023970
      DO 100 K=I,6                                                      00023980
      F(I,K) = 0.0                                                      00023990
  100 CONTINUE                                                          00024000
      F(1,1) = F(1,1) + 0.25*RA*(2.0*T+S2T)                             00024010
      F(2,2) = F(2,2) + 0.25*RA*(2.0*T-S2T)                             00024020
      F(1,2) = F(1,2) + 0.50*RA* ST**2                                  00024030
      F(1,1) = F(1,1) + 0.5*RV*(2.0*T-S2T)                              00024040
      F(2,2) = F(2,2) + 0.5*RV*(2.0*T+S2T)                              00024050
      F(3,3) = F(3,3) + 2.0*RV* T                                       00024060
      F(1,2) = F(1,2) -     RV* ST**2                                   00024070
      F(3,3) = F(3,3) + 0.5*RT*R2*(6.0*T+S2T-8.0*ST)                    00024080
      F(4,4) = F(4,4) + 0.5*RT*   (2.0*T+S2T)                           00024090
      F(5,5) = F(5,5) + 0.5*RT*   (2.0*T-S2T)                           00024100
      F(3,4) = F(3,4) +     RT*R *(ST-T*CT)                             00024110
      F(3,5) = F(3,5) +     RT*R *(2.0-2.0*CT-T*ST)                     00024120
      F(4,5) = F(4,5) + 0.5*RT*   (1.0-C2T)                             00024130
      F(1,1) = F(1,1) + 0.25*RB1*R2*(2.0*T*(2.0+C2T)-3.0*S2T)           00024140
      F(2,2) = F(2,2) + 0.25*RB1*R2*(2.0*T*(2.0-C2T)+3.0*S2T-8.0*ST)    00024150
      F(3,3) = F(3,3) + 0.50*RB0*R2*(2.0*T-S2T)                         00024160
      F(4,4) = F(4,4) + 0.50*RB0*   (2.0*T-S2T)                         00024170
      F(5,5) = F(5,5) + 0.50*RB0*   (2.0*T+S2T)                         00024180
      F(6,6) = F(6,6) +      RB1*T                                      00024190
      F(1,2) = F(1,2) + 0.25*RB1*R2*(1.0+3.0*C2T+2.0*T*S2T-4.0*CT)      00024200
      F(1,6) = F(1,6) -      RB1*R *(ST-T*CT)                           00024210
      F(2,6) = F(2,6) +      RB1*R *(T*ST+CT-1.0)                       00024220
      F(3,4) = F(3,4) +      RB0*R *(ST-T*CT)                           00024230
      F(3,5) = F(3,5) -      RB0*R *T*ST                                00024240
      F(4,5) = F(4,5) - 0.50*RB0*   (1.0-C2T)                           00024250
      DO 110 I=1,6                                                      00024260
      DO 110 K=I,6                                                      00024270
      F(K,I) = F(I,K)                                                   00024280
  110 CONTINUE                                                          00024290
      IF(NPAR    .LT.1) GO TO 120                                       00024300
      WRITE (6,560)                                                     00024310
      WRITE (6,570) ((F(I,K),K=1,6),I=1,6)                              00024320
  120 CONTINUE                                                          00024330
      DO 180  N=1,6                                                     00024340
      IF( DABS(F(N,N)).GT.1.D-20) GO TO 140                             00024350
      WRITE(6,130)NEL                                                   00024360
  130 FORMAT(/20X, 30HFLEXIBILITY MATRIX OF ELEMENT ,I5, 12HIS SINGULAR.00024370
     $/)                                                                00024380
      KSKIP=1                                                           00024390
      RETURN                                                            00024400
  140 D=1.0/F(N,N)                                                      00024410
      DO 150 J=1,6                                                      00024420
  150 F(N,J)=-F(N,J)*D                                                  00024430
      DO 170 I=1,6                                                      00024440
      IF(N.EQ.I) GO TO 170                                              00024450
      DO 160 J=1,6                                                      00024460
      IF(N.EQ.J) GO TO 160                                              00024470
      F(I,J)= F(I,J) +F(I,N)*F(N,J)                                     00024480
  160 CONTINUE                                                          00024490
  170 F(I,N)= F(I,N)*D                                                  00024500
      F(N,N)=D                                                          00024510
  180 CONTINUE                                                          00024520
      IF(NPAR    .LT.1) GO TO 190                                       00024530
      WRITE (6,580)                                                     00024540
      WRITE (6,590) ((F(I,K),K=1,6),I=1,6)                              00024550
  190 CONTINUE                                                          00024560
      DO 200 I=1,6                                                      00024570
      DO 200 K=1,3                                                      00024580
      B(I,K) = 0.0                                                      00024590
  200 CONTINUE                                                          00024600
      RA = 0.125*RA*R                                                   00024610
      B(1,1) = B(1,1) +     RA*(2.0*T2-C2T+1.0)                         00024620
      B(2,2) = B(2,2) +     RA*(2.0*T2+C2T-1.0)                         00024630
      B(1,2) = B(1,2) +     RA*(2.0*T-S2T)                              00024640
      B(2,1) = B(2,1) +     RA*(2.0*T-S2T)                              00024650
      RV = 0.25*RV*R                                                    00024660
      B(1,1) = B(1,1) +     RV*(2.0*T2+C2T-1.0)                         00024670
      B(2,2) = B(2,2) +     RV*(2.0*T2-C2T+1.0)                         00024680
      B(3,3) = B(3,3) + 4.0*RV*T2                                       00024690
      B(1,2) = B(1,2                                                    00024700
     *) -     RV*(2.0*T-S2T)                                            00024710
      B(2,1) = B(2,1) -     RV*(2.0*T-S2T)                              00024720
      RT = RT*R2                                                        00024730
      B(3,3) = B(3,3) + 0.5*RT*R*(1.0+2.0*T2-4.0*T*ST-C2T)              00024740
      B(4,3) = B(4,3) +     RT*  (2.0-2.0*CT-T*ST)                      00024750
      B(5,3) = B(5,3) +     RT*  (T*(2.0+CT)-3.0*ST)                    00024760
      RB0 = RB0*R2                                                      00024770
      RB1 = RB1*R2                                                      00024780
      B(1,1) = B(1,1) + 0.125*RB1*R*(7.0+2.0*T2+9.0*C2T+4.0*T*S2T       00024790
     $                               -16.0*CT)                          00024800
      B(2,2) = B(2,2) + 0.125*RB1*R*(1.0+2.0*T2-9.0*C2T-4.0*T*S2T       00024810
     $                               +8.0*(CT-T*ST))                    00024820
      B(3,3) = B(3,3) + 0.500*RB0*R*(3.0+C2T-4.0*CT)                    00024830
      B(1,2) = B(1,2) + 0.125*RB1*R*(9.0*S2T-4.0*T*(C2T+2.0*CT)-6.0*T)  00024840
      B(2,1) = B(2,1) + 0.125*RB1*R*(9.0*S2T-4.0*T*C2T-24.0*ST+10.0*T)  00024850
      B(4,3) = B(4,3) +       RB0*  (2.0-2.0*CT-T*ST)                   00024860
      B(5,3) = B(5,3) -       RB0*  (ST-T*CT)                           00024870
      B(6,1) = B(6,1) -       RB1*  (2.0-2.0*CT-T*ST)                   00024880
      B(6,2) = B(6,2) +       RB1*  (2.0*ST-T-T*CT)                     00024890
      DO 210 I=1,6                                                      00024900
      B(I,4) = 0.0                                                      00024910
  210 CONTINUE                                                          00024920
      DUM = R*THERM                                                     00024930
      B(1,4) = DUM*ST                                                   00024940
      B(2,4) = DUM*(1.0-CT)                                             00024950
      DO 220 I=1,6                                                      00024960
      B(I,5) = 0.0                                                      00024970
  220 CONTINUE                                                          00024980
      RM = (DOUT-WALL)*0.5                                              00024990
      KK = 1                                                            00025000
      GO TO (230,240),KK                                                00025010
  230 CONTINUE                                                          00025020
      DUM = 3.14159265*RM**4*P*T                                        00025030
      DUM = 0.5*DUM*RE/XMI                                              00025040
      DU2 = RM/R                                                        00025050
      BTA = DUM*(2.0-2.0*XNU + (3.0+1.5*XNU)*DU2**2)                    00025060
      GO TO 250                                                         00025070
  240 CONTINUE                                                          00025080
      DU2 = R/RM                                                        00025090
      DUM = P*RM*0.5*RE/WALL                                            00025100
      DU3 = 1.0 + DUM*(1.0-XNU*(2.0*DU2-1.0)/(DU2-1.0))                 00025110
      BTA = DU3/(1.0 + DUM*(2.0-XNU))                                   00025120
      BTA = T*(1.0-BTA)                                                 00025130
  250 CONTINUE                                                          00025140
      DUM = R/T*BTA                                                     00025150
      B(1,5) = DUM*(ST-T*CT)                                            00025160
      B(2,5) = DUM*(1.0-CT-T*ST)                                        00025170
      B(6,5) =-BTA                                                      00025180
      DUM = 0.5* P* RM* RE* (1.0-2.0*XNU)* R/ WALL                      00025190
      B(1,5) = B(1,5) + DUM* ST                                         00025200
      B(2,5) = B(2,5) + DUM* (1.0-CT)                                   00025210
      IF(NPAR    .LT.1) GO TO 260                                       00025220
      WRITE (6,600)                                                     00025230
      WRITE (6,610) ((B(I,K),K=1,5),I=1,6)                              00025240
  260 CONTINUE                                                          00025250
      DO 270 I=1,6                                                      00025260
      DO 270 K=1,6                                                      00025270
      H(I,K) = 0.0                                                      00025280
  270 CONTINUE                                                          00025290
      DO 280 K=1,6                                                      00025300
      H(K,K) =-1.0                                                      00025310
  280 CONTINUE                                                          00025320
      H(4,3) =-R*(1.0-CT)                                               00025330
      H(5,3) = R* ST                                                    00025340
      H(6,1) =-H(4,3)                                                   00025350
      H(6,2) =-H(5,3)                                                   00025360
      DO 290 K=1,6                                                      00025370
      DO 290 I=K,6                                                      00025380
      S(K+6,I+6) = F(K,I)                                               00025390
  290 CONTINUE                                                          00025400
      DO 310 IR=1,6                                                     00025410
      DO 310 IC=1,6                                                     00025420
      S(IR,IC+6) = 0.0                                                  00025430
      DO 300 IN=1,6                                                     00025440
      S(IR,IC+6) = S(IR,IC+6) + H(IR,IN)* F(IN,IC)                      00025450
  300 CONTINUE                                                          00025460
  310 CONTINUE                                                          00025470
      DO 330 IR=1,6                                                     00025480
      DO 330 IC=IR,6                                                    00025490
      S(IR,IC) = 0.0                                                    00025500
      DO 320 IN=1,6                                                     00025510
      S(IR,IC) = S(IR,IC) + S(IR,IN+6)* H(IC,IN)                        00025520
  320 CONTINUE                                                          00025530
  330 CONTINUE                                                          00025540
      DO 340 I=1,12                                                     00025550
      DO 340 K=I,12                                                     00025560
      S(K,I) = S(I,K)                                                   00025570
  340 CONTINUE                                                          00025580
      IF(NPAR    .LT.1) GO TO 350                                       00025590
      WRITE (6,620)                                                     00025600
      WRITE (6,630) ((S(I,J),J=1,6 ),I=1,12)                            00025610
      WRITE (6,630) ((S(I,J),J=7,12),I=1,12)                            00025620
  350 CONTINUE                                                          00025630
      DO 370 I=1,5                                                      00025640
      DO 370 J=1,12                                                     00025650
      FEF(J,I) = 0.0                                                    00025660
      DO 360 K=1,6                                                      00025670
      FEF(J,I) = FEF(J,I) - S(J,K+6)* B(K,I)                            00025680
  360 CONTINUE                                                          00025690
  370 CONTINUE                                                          00025700
      FEF(1,1) = FEF(1,1) - R*T                                         00025710
      FEF(6,1) = FEF(6,1) + R2*(T-ST)                                   00025720
      FEF(2,2) = FEF(2,2) - R*T                                         00025730
      FEF(6,2) = FEF(6,2) - R2*(1.0-CT)                                 00025740
      FEF(3,3) = FEF(3,3) - R*T                                         00025750
      FEF(4,3) = FEF(4,3) - R2*(T-ST)                                   00025760
      FEF(5,3) = FEF(5,3) + R2*(1.0-CT)                                 00025770
      IF(NPAR    .LT.1) GO TO 380                                       00025780
      WRITE (6,640)                                                     00025790
      WRITE (6,650) ((FEF(I,J),J=1,5),I=1,12)                           00025800
  380 CONTINUE                                                          00025810
      DUM = 0.5*R*T*XMAS                                                00025820
      IF(LMASS.EQ.1) GO TO 391                                          00025830
      DO 390 K=1,3                                                      00025840
      XM(K,1)   = DUM                                                   00025850
      XM(K+6,1) = DUM                                                   00025860
      XM(K+3,1) = 0.0                                                   00025870
      XM(K+9,1) = 0.0                                                   00025880
  390 CONTINUE                                                          00025890
      GO TO 395                                                         00025900
  391 CONTINUE                                                          00025910
      DO 392 K=1,12                                                     00025920
      DO 392 J=1,12                                                     00025930
  392 XM(K,J)=0.0E0                                                     00025940
      DO 393 K=1,3                                                      00025950
      XM(K,K)=DUM                                                       00025960
      XM(K+6,K+6)=DUM                                                   00025970
  393 CONTINUE                                                          00025980
  395 CONTINUE                                                          00025990
      DO 400 I=1,5                                                      00026000
      DO 400 K=1,6                                                      00026010
      FEFC(K,I) = -FEF(K,I)                                             00026020
  400 CONTINUE                                                          00026030
      DO 420 I=1,5                                                      00026040
      DO 410 K=1,4,3                                                    00026050
      FEFC(K+12,I) =  CT* FEF(K+6,I) + ST* FEF(K+7,I)                   00026060
      FEFC(K+13,I) = -ST* FEF(K+6,I) + CT* FEF(K+7,I)                   00026070
      FEFC(K+14,I) =      FEF(K+8,I)                                    00026080
  410 CONTINUE                                                          00026090
  420 CONTINUE                                                          00026100
      S12T =  DSIN(0.5*T)                                               00026110
      C12T =  DCOS(0.5*T)                                               00026120
      DX   = R*(ST-S12T)                                                00026130
      DY   = R*(C12T-CT)                                                00026140
      DO 430 I=1,5                                                      00026150
      XM10 = FEF(10,I) + FEF(9,I)* DY                                   00026160
      XM11 = FEF(11,I) - FEF(9,I)* DX                                   00026170
      FEFC( 7,I) =  C12T* FEF(7,I) + S12T* FEF(8,I)                     00026180
      FEFC( 8,I) = -S12T* FEF(7,I) + C12T* FEF(8,I)                     00026190
      FEFC( 9,I) =  FEF(9,I)                                            00026200
      FEFC(10,I) =  C12T* XM10     + S12T* XM11                         00026210
      FEFC(11,I) = -S12T* XM10     + C12T* XM11                         00026220
  430 FEFC(12,I) =  FEF(12,I) - FEF(7,I)* DY + FEF(8,I)* DX             00026230
      DDX = R*(2.0*(C12T-CT)/T - S12T)                                  00026240
      DDY = R*(2.0*(S12T-ST)/T + C12T)                                  00026250
      DUM = R*T*0.5                                                     00026260
      FEFC( 7,1) = FEFC( 7,1) + C12T* DUM                               00026270
      FEFC( 8,1) = FEFC( 8,1) - S12T* DUM                               00026280
      FEFC(12,1) = FEFC(12,1) - DDY * DUM                               00026290
      FEFC( 7,2) = FEFC( 7,2) + S12T* DUM                               00026300
      FEFC( 8,2) = FEFC( 8,2) + C12T* DUM                               00026310
      FEFC(12,2) = FEFC(12,2) + DDX * DUM                               00026320
      FEFC( 9,3) = FEFC( 9,3) + DUM                                     00026330
      XM10 =  DDY* DUM                                                  00026340
      XM11 = -DDX* DUM                                                  00026350
      FEFC(10,3) = FEFC(10,3) + C12T* XM10 + S12T* XM11                 00026360
      FEFC(11,3) = FEFC(11,3) - S12T* XM10 + C12T* XM11                 00026370
      IF(NPAR    .LT.1) GO TO 440                                       00026380
      WRITE (6,660)                                                     00026390
      WRITE (6,670) ((FEFC(I,J),J=1,5),I=1,18)                          00026400
  440 CONTINUE                                                          00026410
      DO 470 K1=1,10,3                                                  00026420
      NRS = K1-1                                                        00026430
      DO 470 K2=1,10,3                                                  00026440
      NCS = K2-1                                                        00026450
      DO 460 IR=1,3                                                     00026460
      NR = NRS+IR                                                       00026470
      DO 460 IC=1,3                                                     00026480
      NC = NCS+IC                                                       00026490
      SA(NR,NC) = 0.0                                                   00026500
      DO 450 IN=1,3                                                     00026510
      N = NCS+IN                                                        00026520
      SA(NR,NC) = SA(NR,NC) - S(NR,N)* DC(IC,IN)                        00026530
  450 CONTINUE                                                          00026540
  460 CONTINUE                                                          00026550
  470 CONTINUE                                                          00026560
      H(1,1) = CT                                                       00026570
      H(1,2) = ST                                                       00026580
      H(2,1) =-ST                                                       00026590
      H(2,2) = CT                                                       00026600
      H(3,3) = 1.0                                                      00026610
      DO 500 K1=7,10,3                                                  00026620
      NRS = K1-1                                                        00026630
      DO 490 IR=1,3                                                     00026640
      NR = NRS+IR                                                       00026650
      DO 490 IC=1,12                                                    00026660
      SA(NR+6,IC) = 0.0                                                 00026670
      DO 480 IN=1,3                                                     00026680
      N = NRS+IN                                                        00026690
      SA(NR+6,IC) = SA(NR+6,IC) - H(IR,IN)* SA(N,IC)                    00026700
  480 CONTINUE                                                          00026710
  490 CONTINUE                                                          00026720
  500 CONTINUE                                                          00026730
      H(1,1) =  C12T                                                    00026740
      H(1,2) =  S12T                                                    00026750
      H(2,1) = -S12T                                                    00026760
      H(2,2) =  C12T                                                    00026770
      H(3,3) =  1.0                                                     00026780
      DO 510 I=1,3                                                      00026790
      DO 510 K=1,3                                                      00026800
  510 H(I+3,K+3) = H(I,K)                                               00026810
      H(4,3) =  DY* C12T - DX* S12T                                     00026820
      H(5,3) = -DY* S12T - DX* C12T                                     00026830
      H(6,1) = -DY                                                      00026840
      H(6,2) =  DX                                                      00026850
      DO 540 IC=1,12                                                    00026860
      DO 520 N=1,6                                                      00026870
  520 COL(N) = SA(N+6,IC)                                               00026880
      DO 540 IR=1,6                                                     00026890
      SA(IR+6,IC) = 0.0                                                 00026900
      DO 530 IN=1,6                                                     00026910
      SA(IR+6,IC) = SA(IR+6,IC) - H(IR,IN)* COL(IN)                     00026920
  530 CONTINUE                                                          00026930
  540 CONTINUE                                                          00026940
      IF(NPAR    .LT.1) GO TO 550                                       00026950
      WRITE (6,680)                                                     00026960
      WRITE (6,690) ((SA(I,J),J=1, 6),I=1,18)                           00026970
      WRITE (6,690) ((SA(I,J),J=7,12),I=1,18)                           00026980
  550 CONTINUE                                                          00026990
  560 FORMAT (/// 24H NODE FLEXIBILITY MATRIX, // 1X)                   00027000
  570 FORMAT ( 1X / (6E20.8) )                                          00027010
  580 FORMAT (/// 22H NODE STIFFNESS MATRIX, // 1X)                     00027020
  590 FORMAT ( 1X / (6E20.8) )                                          00027030
  600 FORMAT (/// 42H FREE NODE DISPLACEMENTS  (5 MEMBER LOADS), // 1X) 00027040
  610 FORMAT (1X / (5E20.8) )                                           00027050
  620 FORMAT (23H1LOCAL STIFFNESS MATRIX, // 1X)                        00027060
  630 FORMAT (// (/6E15.6) )                                            00027070
  640 FORMAT (// 17H0FIXED END FORCES, // 1X)                           00027080
  650 FORMAT (5E20.8)                                                   00027090
  660 FORMAT (// 43H0STRESS CORRECTIONS DUE TO FIXED END FORCES, // 1X) 00027100
  670 FORMAT (5E20.8)                                                   00027110
  680 FORMAT (//35H0STRESS-DISPLACEMENT TRANSFORMATION, / 1X)           00027120
  690 FORMAT (/// (6E20.8) )                                            00027130
      RETURN                                                            00027140
      END                                                               00027150
        FUNCTION DARSIN(X)                                              00052020
        IMPLICIT REAL*8(A-H,O-Z)                                        00052030
        Y=DSQRT(1.-X*X)                                                 00052040
        Z=X/Y                                                           00052050
        DARSIN=DATAN(Z)                                                 00052060
        RETURN                                                          00052070
        END                                                             00052080
