      SUBROUTINE RELESE(ASA,P14,KRLX,MXDF,NEL,NNS,RF,LLL)               00204370
        IMPLICIT REAL*8(A-H,O-Z)                                        00204380
        DIMENSION ASA(MXDF,MXDF),P14(21,1),RF(MXDF,1)                   00204390
        IF(KRLX.LE.0)RETURN                                             00204400
        LL=LLL                                                          00204410
        IF(LL.LE.0)LL=1                                                 00204420
        MXZ=NNS*6                                                       00204430
        DO 300 I=1,KRLX                                                 00204440
        M=P14(1,I)                                                      00204450
        IF(M.NE.NEL)GO TO 300                                           00204460
        DO 200 J=1,NNS                                                  00204470
        NOLD=P14(J+1,I)                                                 00204480
        DO 190 K=1,6                                                    00204490
        KK=7-K+6*(J-1)                                                  00204500
        NEW=(NOLD/10)*10                                                00204510
        L=NOLD-NEW                                                      00204520
        IF(L.EQ.0) GO TO 190                                            00204530
        RRK=ASA(KK,KK)                                                  00204540
        IF(RRK.EQ.0.)GO TO 190                                          00204550
        DO 110 II=1,MXZ                                                 00204560
        IF(II.EQ.KK)GO TO 110                                           00204570
        AR=ASA(II,KK)/RRK                                               00204580
        DO 90 IL=1,LL                                                   00204590
90      RF(II,IL)=RF(II,IL)-AR*RF(KK,IL)                                00204600
        DO 100 JJ=1,MXZ                                                 00204610
        IF(JJ.EQ.KK)GO TO 100                                           00204620
        ASA(II,JJ)=ASA(II,JJ)-ASA(KK,JJ)*AR                             00204630
100     CONTINUE                                                        00204640
110     CONTINUE                                                        00204650
        DO 120 II=1,MXZ                                                 00204660
        DO 115 IL=1,LL                                                  00204670
115     RF(KK,IL)=0.                                                    00204680
        ASA(II,KK)=0.                                                   00204690
120     ASA(KK,II)=0.                                                   00204700
190     NOLD=NOLD/10                                                    00204710
200     CONTINUE                                                        00204720
300     CONTINUE                                                        00204730
        RETURN                                                          00204740
        END                                                             00204750
      SUBROUTINE STRETR (T,X,Y,Z,CM,SA,H,RHOM,XM,NNS,MXDF,NSMX)         00278800
      IMPLICIT REAL*8 (A-H,O-Z)                                         00278810
      DIMENSION   T(3,3),X(1),Y(1),Z(1),CM(3,3),SA(NSMX,MXDF),XM(1)     00278820
      COMMON/JUNK/DUM(157),AM3,AAA,X4,XO,AM4,XYJ,Y1,YO,XX,X1,Y2,AC,AM1, 00278830
     $S,X2,Y3,AM2,R,X3,Y4,NM1,L,JS,I,KA,J,K,NRJUNK(93)                  R0278840
      COMMON/MASS/LMASS                                                 00278850
      COMMON / TRASH /                                                  00278860
     $            V(3,3),XY(3,2),A(12,12),        AA(12,12),ABC(9,9),   00278870
     $            S1(3,9),S2(3,9),S3(3,12),MM(12),AM(4),RRTRAS(6)       R0278880
      COMMON/QTSARG/ZDZ(15),HM,RRQTSA(984)                              R0278890
      ZER=0.0E+00                                                       00278900
      NM1=NNS-1                                                         00278910
      DO 110 I=1,NM1                                                    00278920
      V(I,1)=X(I+1)-X(1)                                                00278930
      V(I,2)=Y(I+1)-Y(1)                                                00278940
  110 V(I,3)=Z(I+1)-Z(1)                                                00278950
      DO 120 I=1,NM1                                                    00278960
      DO 120 J=1,2                                                      00278970
      XY(I,J)=0.                                                        00278980
      DO 120 K=1,3                                                      00278990
  120 XY(I,J)=XY(I,J)+V(I,K)*T(J,K)                                     00279000
      AC=0.25*H*RHOM                                                    00279010
      XO=(XY(1,1)+XY(2,1))/3.                                           00279020
      YO=(XY(1,2)+XY(2,2))/3.                                           00279030
      AM1=   -XO*XY(1,2)                                                00279040
      AM2=(0.5*(XY(1,1)+XY(2,1))-XO)*(XY(2,2)-XY(1,2))                  00279050
      AM3=  XO* XY(2,2)                                                 00279060
      AM(1)=AC*(AM1+AM3)                                                00279070
      AM(2)=AC*(AM1+AM2)                                                00279080
      AM(3)=AC*(AM2+AM3)                                                00279090
      IF(NNS.LT.4) GO TO 130                                            00279100
      XO=(XY(1,1)+XY(2,1)+XY(3,1))/4.0                                  00279110
      YO=(XY(1,2)+XY(2,2)+XY(3,2))/4.0                                  00279120
      AM1=XY(1,1)*YO-XO*XY(1,2)                                         00279130
      AM2=(XY(1,1)-XO)*(XY(2,2)-YO)-(XY(2,1)-XO)*(XY(1,2)-YO)           00279140
      AM3=(XY(2,1)-XO)*(XY(3,2)-YO)-(XY(3,1)-XO)*(XY(2,2)-YO)           00279150
      AM4=XO*XY(3,2)-XY(3,1)*YO                                         00279160
      AM(1)=AC*(AM1+AM4)                                                00279170
      AM(2)=AC*(AM1+AM2)                                                00279180
      AM(3)=AC*(AM2+AM3)                                                00279190
      AM(4)=AC*(AM3+AM4)                                                00279200
  130 CONTINUE                                                          00279210
      IF(LMASS.EQ.1) GO TO 145                                          00279220
      DO 140 L=1,NNS                                                    00279230
      XX=AM(L)                                                          00279240
      L61=6*(L-1)                                                       00279250
      DO 140 J=1,3                                                      00279260
      JS=L61+J                                                          00279270
      JS3=JS+3                                                          00279280
      XM(JS)=XX                                                         00279290
  140 XM(JS3)=0.0                                                       00279300
      GO TO 155                                                         00279310
  145 IRK=6*NNS                                                         00279320
      DO 150 L=1,NNS                                                    00279330
      XX=AM(L)                                                          00279340
      L61=6*(L-1)                                                       00279350
      DO 150 J=1,3                                                      00279360
      JS=L61+J                                                          00279370
      JS3=JS+3                                                          00279380
      JSS=(JS-1)*IRK+JS                                                 00279390
      JSS3=(JS3-1)*IRK+JS3                                              00279400
      XM(JSS)=XX                                                        00279410
  150 XM(JSS3)=0.0E0                                                    00279420
  155 CONTINUE                                                          00279430
      S=0.5                                                             00279440
      R=0.5                                                             00279450
      IF(HM.LE.0.0E0) GO TO 185                                         00279460
      CALL QVSET(ZER,S1,54)                                             00279470
      AAA=(XY(2,1)-XY(1,1))* XY(1,2) - XY(1,1)*(XY(2,2)-XY(1,2))        00279480
      S1(1,1)= (XY(2,2)-XY(1,2))/AAA                                    00279490
      S1(1,3)= -XY(2,2)/AAA                                             00279500
      S1(1,5)=  XY(1,2)/AAA                                             00279510
      S1(2,2)=(-XY(2,1)+XY(1,1))/AAA                                    00279520
      S1(2,4)=  XY(2,1)/AAA                                             00279530
      S1(2,6)= -XY(1,1)/AAA                                             00279540
      IF(NNS.LT.4) GO TO 160                                            00279550
      XYJ=XY(1,1)*XY(3,2)-XY(3,1)*XY(1,2)+(XY(1,1)*(XY(2,2)-XY(3,2))    00279560
     $ -(XY(2,1)-XY(3,1))*XY(1,2))*S-((XY(1,1)-XY(2,1))*XY(3,2)         00279570
     $ -XY(3,1)*(XY(1,2)-XY(2,2)))*R                                    00279580
      X1=XY(1,2)-XY(3,2)-(XY(2,2)-XY(3,2))*S-(XY(1,2)-XY(2,2))*R        00279590
      X2=XY(3,2)+(XY(2,2)-XY(3,2))*S-XY(3,2)*R                          00279600
      X3=-XY(1,2)*S+XY(3,2)*R                                           00279610
      X4=-XY(1,2)+XY(1,2)*S+(XY(1,2)-XY(2,2))*R                         00279620
      Y1=-XY(1,1)+XY(3,1)+(XY(2,1)-XY(3,1))*S+(XY(1,1)-XY(2,1))*R       00279630
      Y2=-XY(3,1)-(XY(2,1)-XY(3,1))*S+XY(3,1)*R                         00279640
      Y3=XY(1,1)*S-XY(3,1)*R                                            00279650
      Y4=XY(1,1)-XY(1,1)*S-(XY(1,1)-XY(2,1))*R                          00279660
      S1(1,1)=X1/XYJ                                                    00279670
      S1(1,3)=X2/XYJ                                                    00279680
      S1(1,5)=X3/XYJ                                                    00279690
      S1(1,7)=X4/XYJ                                                    00279700
      S1(2,2)=Y1/XYJ                                                    00279710
      S1(2,4)=Y2/XYJ                                                    00279720
      S1(2,6)=Y3/XYJ                                                    00279730
      S1(2,8)=Y4/XYJ                                                    00279740
  160 CONTINUE                                                          00279750
      S1(3,1)=S1(2,2)                                                   00279760
      S1(3,2)=S1(1,1)                                                   00279770
      S1(3,3)=S1(2,4)                                                   00279780
      S1(3,4)=S1(1,3)                                                   00279790
      S1(3,5)=S1(2,6)                                                   00279800
      S1(3,6)=S1(1,5)                                                   00279810
      S1(3,7)=S1(2,8)                                                   00279820
      S1(3,8)=S1(1,7)                                                   00279830
      DO 180 I=1,3                                                      00279840
      DO 180 J=1,8                                                      00279850
      DO 170 K=1,3                                                      00279860
  170 S2(I,J)=S2(I,J)+CM(I,K)*S1(K,J)                                   00279870
  180 CONTINUE                                                          00279880
  185 H=H/2.0E0                                                         00279890
      IF(HM.LE.0.0E0) GO TO 195                                         00279900
      DO 190 L=1,4                                                      00279910
      KA=2*(L-1)+1                                                      00279920
      KA1=KA+1                                                          00279930
      L61=6*(L-1)                                                       00279940
      DO 190 I=1,3                                                      00279950
      DO 190 J=1,3                                                      00279960
      JS=L61+J                                                          00279970
  190 SA(I,JS)=S2(I,KA)*T(1,J)+S2(I,KA1)*T(2,J)                         00279980
  195 CONTINUE                                                          00279990
      CALL QVSET(ZER,A,288)                                             00280000
      DO 210 I=1,NM1                                                    00280010
      J=3*I+1                                                           00280020
      A(1,J)=1.                                                         00280030
      A(2,J)=XY(I,1)                                                    00280040
      A(3,J)=XY(I,2)                                                    00280050
      A(4,J)=XY(I,1)*XY(I,1)                                            00280060
      A(5,J)=XY(I,1)*XY(I,2)                                            00280070
      A(6,J)=XY(I,2)*XY(I,2)                                            00280080
      A(7,J)=A(4,J)*XY(I,1)                                             00280090
      A(8,J)=XY(I,1)*A(6,J)+XY(I,2)*A(4,J)                              00280100
      A(9,J)=XY(I,2)*A(6,J)                                             00280110
      A(8,J+1)=2*A(5,J)+A(4,J)                                          00280120
      A(9,J+1)=3*A(6,J)                                                 00280130
      A(8,J+2)=-A(6,J)-2*A(5,J)                                         00280140
      A(3,J+1)=1.0                                                      00280150
      A(5,J+1)=XY(I,1)                                                  00280160
      A(6,J+1)=2.0*XY(I,2)                                              00280170
      A(2,J+2)=-1.0                                                     00280180
      A(4,J+2)=-2.0*XY(I,1)                                             00280190
      A(5,J+2)=-XY(I,2)                                                 00280200
      A(7,J+2)=-3.0*XY(I,1)*XY(I,1)                                     00280210
      IF(NNS.LT.4) GO TO 210                                            00280220
      A(8,J)=A(5,J)*XY(I,1)                                             00280230
      A(9,J)=A(5,J)*XY(I,2)                                             00280240
      A(10,J)=A(6,J)*XY(I,2)                                            00280250
      A(11,J)=XY(I,1)*XY(I,1)*XY(I,1)*XY(I,2)                           00280260
      A(12,J)=XY(I,1)*XY(I,2)*XY(I,2)*XY(I,2)                           00280270
      A(8,J+1)=XY(I,1)*XY(I,1)                                          00280280
      A(9,J+1)=2.0*XY(I,1)*XY(I,2)                                      00280290
      A(10,J+1)=3.0*XY(I,2)*XY(I,2)                                     00280300
      A(11,J+1)=XY(I,1)*XY(I,1)*XY(I,1)                                 00280310
      A(12,J+1)=3.0*XY(I,1)*XY(I,2)*XY(I,2)                             00280320
      A(8,J+2)=-2.0*XY(I,1)*XY(I,2)                                     00280330
      A(9,J+2)=-XY(I,2)*XY(I,2)                                         00280340
      A(11,J+2)=-3.0*XY(I,1)*XY(I,1)*XY(I,2)                            00280350
      A(12,J+2)=-XY(I,2)*XY(I,2)*XY(I,2)                                00280360
  210 CONTINUE                                                          00280370
      A(1,1)=1.0                                                        00280380
      A(3,2)=1.0                                                        00280390
      A(2,3)=-1.0                                                       00280400
      DO 220 I = 1, 9                                                   00280410
      DO 220 J = 1, 9                                                   00280420
  220 ABC(I,J) = A(I,J)                                                 00280430
      IF(NNS.EQ.3)                                                      00280440
     $CALL INVERT (ABC,AA,9,9,MM)                                       00280450
      IF(NNS.EQ.4)                                                      00280460
     $CALL INVERT (A,AA,12,12,MM)                                       00280470
      IF(NNS.GT.3) GO TO 240                                            00280480
      DO 230 I=1,9                                                      00280490
      DO 230 J=1,9                                                      00280500
  230 A(I,J)=ABC(I,J)                                                   00280510
  240 CALL QVSET(ZER,S1,90)                                             00280520
      S1(1,1)=2.0                                                       00280530
      S1(1,4)=6.0*XO                                                    00280540
      S1(1,5)=2.0*YO                                                    00280550
      S1(2,3)=2.0                                                       00280560
      S1(2,5)=2*XO                                                      00280570
      S1(2,6)=6*YO                                                      00280580
      S1(3,5)=4*(XO+YO)                                                 00280590
      S1(3,2)=2.0                                                       00280600
      IF(NNS.LT.4) GO TO 260                                            00280610
      S1(1,8)=6.0*XO*YO                                                 00280620
      S1(2,6)=2.0*XO                                                    00280630
      S1(2,7)=6.0*YO                                                    00280640
      S1(2,9)=6.0*XO*YO                                                 00280650
      S1(3,5)=4.0*XO                                                    00280660
      S1(3,6)=4.0*YO                                                    00280670
      S1(3,8)=6.0*XO*XO                                                 00280680
      S1(3,9)=6.0*YO*YO                                                 00280690
      S1(2,5)=0.0                                                       00280700
  260 DO 280 I=1,3                                                      00280710
      DO 280 J=1,9                                                      00280720
      DO 270 K=1,3                                                      00280730
  270 S2(I,J)=S2(I,J)+CM(I,K)*S1(K,J)                                   00280740
  280 S2(I,J)=-S2(I,J)*H                                                00280750
      DO 290 I=1,3                                                      00280760
      DO 290 J=1,12                                                     00280770
      DO 290 K=1,9                                                      00280780
  290 S3(I,J)=S3(I,J)+S2(I,K)*A(J,3+K)                                  00280790
      DO 300 L=1,4                                                      00280800
      KA=3*(L-1)+1                                                      00280810
      KA1=KA+1                                                          00280820
      KA2=KA+2                                                          00280830
      L61=6*(L-1)                                                       00280840
      DO 300 I=1,3                                                      00280850
      I3=I+3                                                            00280860
      DO 300 J=1,3                                                      00280870
      JS=L61+J                                                          00280880
      SA(I3,JS)=S3(I,KA)*T(3,J)                                         00280890
      JS=JS+3                                                           00280900
      SA(I3,JS)=S3(I,KA1)*T(1,J)+S3(I,KA2)*T(2,J)                       00280910
  300 CONTINUE                                                          00280920
      RETURN                                                            00280930
      END                                                               00280940
      SUBROUTINE INVERT (A,C,NN,N,M)                                    00121940
      IMPLICIT REAL*8 (A-H,O-Z)                                         00121950
      DIMENSION A(1),M(1),C(1)                                          00121960
      DO 100 I=1,NN                                                     00121970
  100 M(I)=-I                                                           00121980
      DO 230 I=1,NN                                                     00121990
      D=0.0                                                             00122000
      DO 160 L=1,NN                                                     00122010
      IF (M(L)) 110,110,160                                             00122020
  110 J=L                                                               00122030
      DO 150 K=1,NN                                                     00122040
      IF (M(K)) 120,120,140                                             00122050
  120 IF( DABS(D)- DABS(A(J))) 130,130,140                              00122060
  130 LD=L                                                              00122070
      KD=K                                                              00122080
      D=A(J)                                                            00122090
  140 J=J+N                                                             00122100
  150 CONTINUE                                                          00122110
  160 CONTINUE                                                          00122120
      TEMP=-M(LD)                                                       00122130
      M(LD)=M(KD)                                                       00122140
      M(KD)=TEMP                                                        00122150
      L=LD                                                              00122160
      K=KD                                                              00122170
      DO 170 J=1,NN                                                     00122180
      C(J)=A(L)                                                         00122190
      A(L)=A(K)                                                         00122200
      A(K)=C(J)                                                         00122210
      L=L+N                                                             00122220
  170 K=K+N                                                             00122230
      D=1.0/D                                                           00122240
      NR=(KD-1)*N+1                                                     00122250
      NH=NR+N-1                                                         00122260
      DO 180 K=NR,NH                                                    00122270
  180 A(K)=A(K)*D                                                       00122280
      L=1                                                               00122290
      DO 220 J=1,NN                                                     00122300
      IF (J-KD) 200,190,200                                             00122310
  190 L=L+N                                                             00122320
      GO TO 220                                                         00122330
  200 DO 210 K=NR,NH                                                    00122340
      A(L)=A(L)-C(J)*A(K)                                               00122350
  210 L=L+1                                                             00122360
  220 CONTINUE                                                          00122370
      C(KD)=-1.0                                                        00122380
      J=KD                                                              00122390
      DO 230 K=1,NN                                                     00122400
      A(J)=-C(K)*D                                                      00122410
  230 J=J+N                                                             00122420
      DO 260 I=1,NN                                                     00122430
      L=0                                                               00122440
  240 L=L+1                                                             00122450
      IF(M(L)-I) 240,250,240                                            00122460
  250 K=(L-1)*N+1                                                       00122470
      J=(I-1)*N+1                                                       00122480
      M(L)=M(I)                                                         00122490
      M(I)=I                                                            00122500
      DO 260 L=1,NN                                                     00122510
      TEMP=A(K)                                                         00122520
      A(K)=A(J)                                                         00122530
      A(J)=TEMP                                                         00122540
                                                                        00122550
       J=J+1                                                            00122560
  260 K=K+1                                                             00122570
      RETURN                                                            00122580
      END                                                               00122590
        FUNCTION IZO(NZO)                                               00122600
        IZO=NZO                                                         00122610
        IF(NZO.LE.0)IZO=1                                               00122620
        RETURN                                                          00122630
        END                                                             00122640
