C     SORT/ORDER                                                        SRT   1 
C     THE FOLLOWING SUBROUTINE CAN BE CHANGED TO SORT OR ORDER BY RE-   SRT   2 
C     MOVING THE APPROPRIATE CARD NAMING THE SUBROUTINE.  THIS FORTRAN  SRT   3 
C     IV SUBROUTINE (A N LOG(BASE 2) N) SORT WILL ORDER A SET OF FLOAT- SRT   4 
C     ING POINT NUMBERS FROM LOW TO HIGH (ISIM=0) OR FROM HIGH TO LOW   SRT   5 
C     (SIM=1) WITHOUT DISTURBING THE NUMBERS TO BE SORTED.  THE DIMEN-  SRT   6 
C     SION OF LIST SHOULD LIE BETWEEN 2 LOG (BASE 2) N AND N.   PRO-    SRT   7 
C     GRAMMED BY ARDEN/LINGOES, U. OF M. COMPUTING CENTER (10/18/67).   SRT   8 
C                                                                       SRT   9 
      SUBROUTINE SORT (ISW,NEL,DIST,ISIM,INDEX)                         SRT  10 
      SUBROUTINE ORDER (ISW,NEL,DIST,ISIM,INDEX)                        ORD  10 
      DIMENSION DIST(1), INDEX(1), LIST(200)                            SRT  11 
C                                                                       SRT  12 
      IF (ISW) 1,2,6                                                    SRT  13 
1     N=NEL                                                             SRT  14 
2     DO 3 J=1,N                                                        SRT  15 
3     INDEX(J)=J                                                        SRT  16 
      IF (ISIM) 5,4,5                                                   SRT  17 
4     ASSIGN 10 TO N1                                                   SRT  18 
      GO TO 6                                                           SRT  19 
5     ASSIGN 16 TO N1                                                   SRT  20 
6     I1=1                                                              SRT  21 
      IN=N                                                              SRT  22 
      LN=0                                                              SRT  23 
7     I=I1-1                                                            SRT  24 
      K=I                                                               SRT  25 
      DN=DIST(INDEX(IN))                                                SRT  26 
8     K=K+1                                                             SRT  27 
      DF=DIST(INDEX(K))                                                 SRT  28 
      IF (DF.NE.DN) GO TO 9                                             SRT  29 
      IF (K-IN) 8,18,18                                                 SRT  30 
9     J=IN+1                                                            SRT  31 
      AV=.5*ABS(DF-DN)+AMIN1(DF,DN)                                     SRT  32 
      IF (AV.EQ.AMAX1(DF,DN)) AV=AMIN1(DF,DN)                           SRT  33 
      GO TO N1, (10,16)                                                 SRT  34 
10    I=I+1                                                             SRT  35 
      IF (DIST(INDEX(I)).LE.AV) GO TO 10                                SRT  36 
11    J=J-1                                                             SRT  37 
      IF (DIST(INDEX(J)).GT.AV) GO TO 11                                SRT  38 
12    IF (I.GT.J) GO TO 13                                              SRT  39 
      ITEMP=INDEX(I)                                                    SRT  40 
      INDEX(I)=INDEX(J)                                                 SRT  41 
      INDEX(J)=ITEMP                                                    SRT  42 
      GO TO N1, (10,16)                                                 SRT  43 
13    IF (I.EQ.IN) GO TO 14                                             SRT  44 
      IF (J.EQ.I1) GO TO 15                                             SRT  45 
      LIST(LN+1)=J+1                                                    SRT  46 
      LIST(LN+2)=IN                                                     SRT  47 
      LN=LN+2                                                           SRT  48 
14    IN=I-1                                                            SRT  50 
      GO TO 7                                                           SRT  51 
15    I1=J+1                                                            SRT  52 
      GO TO 7                                                           SRT  53 
16    I=I+1                                                             SRT  54 
      IF (AV.LT.DIST(INDEX(I))) GO TO 16                                SRT  55 
17    J=J-1                                                             SRT  56 
      IF (AV.LT.DIST(INDEX(J))) GO TO 12                                SRT  57 
      GO TO 17                                                          SRT  58 
18    IF (LN) 19,20,19                                                  SRT  59 
19    IN=LIST(LN)                                                       SRT  60 
      I1=LIST(LN-1)                                                     SRT  61 
      LN=LN-2                                                           SRT  62 
      GO TO 7                                                           SRT  63 
20    RETURN                                                            SRT  64 
      END                                                               SRT  66-
C     EIGEN                                                             EGN   1 
C     EIGENVALUES AND NORMALIZED EIGENVECTORS OF A REAL SYMMETRIC MATRIXEGN   2 
C     PROGRAMMED BY GARBOW, ARGONNE, 1965 AND MODIFIED BY LINGOES, U OF EGN   3 
C     OF EIGENSYSTEM IS DETERMINED.                                     EGN   6 
C     EIGENVALUES ARE RETURNED IN VALU AND NORMALIZED EIGENVECTORS ARE  EGN   7 
C     STORED IN B.  NSUB IS ORDER OF MATRICES A AND B AND MSUB IS THE   EGN   8 
C     NUMBER OF ROOTS AND VECTORS DESIRED.                              EGN   9 
C                                                                       EGN  10 
      SUBROUTINE EIGEN (A,B,NSUB,VALU,MSUB,MD,T,DIAG,SUPERD,U,INDEX,V)  EGN  11 
C                                                                       EGN  12 
      DIMENSION A(MD,MD), B(MD,MD), VALU(1), T(MD,3), DIAG(1), SUPERD(1)EGN  13 
     1, U(1), INDEX(1), V(1)                                            EGN  14 
      EQUIVALENCE (I1,T1), (I2,T2), (TEMP,T0), (SUM,MATCH), (I,P),      EGN  15 
     1(DIV,SCALAR,TAU), (ANORM2,NORM), (VTEMP,VNORM2,VNORM)             EGN  16 
C                                                                       EGN  17 
C     INITIALIZATION                                                    EGN  18 
      N=NSUB                                                            EGN  19 
      M=MSUB                                                            EGN  20 
      NP1=N+1                                                           EGN  21 
      NM1=N-1                                                           EGN  22 
      E1=1.E-6                                                          EGN  23 
C     GENERATE IDENTITY MATRIX                                          EGN  24 
      DO 3 I=1,N                                                        EGN  25 
      DO 3 J=1,N                                                        EGN  26 
      IF (I-J) 2,1,2                                                    EGN  27 
1     B(I,J)=1.                                                         EGN  28 
      GO TO 3                                                           EGN  29 
2     B(I,J)=0.                                                         EGN  30 
3     CONTINUE                                                          EGN  31 
C     HOUSEHOLDER SIMILARITY TRANSFORMATION TO CO-DIAGONAL FORM         EGN  32 
C     REDUCE COLUMN OF MATRIX                                           EGN  33 
      DO 14 I=1,NM1                                                     EGN  34 
      IF (I-NM1) 4,13,4                                                 EGN  35 
4     I1=I+1                                                            EGN  36 
      I2=I1+1                                                           EGN  37 
      SUM=0.                                                            EGN  38 
      DO 5 J=I2,N                                                       EGN  39 
5     SUM=SUM+A(J,I)**2                                                 EGN  40 
      IF (SUM) 6,13,6                                                   EGN  41 
6     J=I1                                                              EGN  42 
      TEMP=A(J,I)                                                       EGN  43 
      SUM=SQRT(SUM+TEMP**2)                                             EGN  44 
      A(J,I)=-SIGN(SUM,TEMP)                                            EGN  45 
      U(J)=SQRT(1.+ABS(TEMP)/SUM)                                       EGN  46 
      DIV=SIGN(U(J)*SUM,TEMP)                                           EGN  47 
      DO 7 J=I2,N                                                       EGN  48 
7     U(J)=A(J,I)/DIV                                                   EGN  49 
      SCALAR=0.                                                         EGN  50 
      DO 9 J=I1,N                                                       EGN  51 
      V(J)=0.                                                           EGN  52 
      DO 8 K=I1,N                                                       EGN  53 
8     V(J)=V(J)+A(K,J)*U(K)                                             EGN  54 
      SCALAR=SCALAR+V(J)*U(J)                                           EGN  55 
9     CONTINUE                                                          EGN  56 
      SCALAR=SCALAR/2.                                                  EGN  57 
      DO 10 J=I1,N                                                      EGN  58 
      V(J)=V(J)-SCALAR*U(J)                                             EGN  59 
      DO 10 K=I1,J                                                      EGN  60 
      A(K,J)=A(K,J)-(U(K)*V(J)+U(J)*V(K))                               EGN  61 
      A(J,K)=A(K,J)                                                     EGN  62 
10    CONTINUE                                                          EGN  63 
C     SAVE ROTATION FOR LATER APPLICATION TO CO-DIAGONAL VECTORS        EGN  64 
      DO 12 K=2,N                                                       EGN  65 
      TEMP=0.                                                           EGN  66 
      DO 11 J=I1,N                                                      EGN  67 
11    TEMP=TEMP+U(J)*B(J,K)                                             EGN  68 
      DO 12 J=I1,N                                                      EGN  69 
      B(J,K)=B(J,K)-U(J)*TEMP                                           EGN  70 
12    CONTINUE                                                          EGN  71 
C     MOVE CO-DIAGONAL FORM ELEMENTS FOR ITERATIVE PROCEDURE            EGN  72 
13    J=I                                                               EGN  73 
      DIAG(I)=A(J,I)                                                    EGN  74 
      SUPERD(I)=A(J+1,I)                                                EGN  75 
14    CONTINUE                                                          EGN  76 
      DIAG(N)=A(N,N)                                                    EGN  77 
C     DETERMINE EIGENVALUES FROM STURM CHAIN OF CO-DIAGONAL MINORS      EGN  78 
C     CALCULATE NORM OF MATRIX AND INITIALIZE EIGENVALUE BOUNDS         EGN  79 
      ANORM2=DIAG(1)**2                                                 EGN  80 
      DO 15 L=2,N                                                       EGN  81 
      V(L-1)=SUPERD(L-1)**2                                             EGN  82 
      ANORM2=DIAG(L)**2+V(L-1)+V(L-1)+ANORM2                            EGN  83 
15    CONTINUE                                                          EGN  84 
      ANORM=SQRT(ANORM2)                                                EGN  85 
      DO 16 L=1,M                                                       EGN  86 
      VALU(L)=ANORM                                                     EGN  87 
      U(L)=-ANORM                                                       EGN  88 
16    CONTINUE                                                          EGN  89 
      EPS1=ANORM*E1                                                     EGN  90 
      IF (EPS1) 17,73,17                                                EGN  91 
C     CHOOSE NEW TRIAL VALUE WHILE TESTING BOUNDS FOR CONVERGENCE       EGN  92 
17    DO 35 L=1,M                                                       EGN  93 
      ITER=0                                                            EGN  94 
      VTEMP=EPS1                                                        EGN  95 
18    TAU=(VALU(L)+U(L))/2.                                             EGN  96 
      IF (ITER-10) 20,19,20                                             EGN  97 
19    VTEMP=VTEMP*10.                                                   EGN  98 
      ITER=0                                                            EGN  99 
20    IF (2.*(TAU-U(L))-VTEMP) 35,35,21                                 EGN 100 
C     DETERMINE SIGNS OF PRINCIPAL MINORS                               EGN 101 
21    MATCH=0                                                           EGN 102 
      ITER=ITER+1                                                       EGN 103 
      T2=0.                                                             EGN 104 
      T1=1.                                                             EGN 105 
      DO 30 L1=1,N                                                      EGN 106 
      P=DIAG(L1)-TAU                                                    EGN 107 
      IF (T2) 23,22,23                                                  EGN 108 
22    T1=SIGN(1.,T1)                                                    EGN 109 
23    IF (T1) 25,24,25                                                  EGN 110 
24    T0=-SIGN(1.,T2)                                                   EGN 111 
      T2=0.                                                             EGN 112 
      IF (V(L1-1)) 26,22,26                                             EGN 113 
25    T0=P-V(L1-1)*T2/T1                                                EGN 114 
      T2=1.                                                             EGN 115 
C     COUNT AGREEMENTS IN SIGN (ZERO CONSIDERED POSITIVE)               EGN 116 
26    IF (T0) 29,27,28                                                  EGN 117 
27    T2=T1                                                             EGN 118 
      IF (T2) 29,28,28                                                  EGN 119 
28    MATCH=MATCH+1                                                     EGN 120 
29    T1=T0                                                             EGN 121 
30    CONTINUE                                                          EGN 122 
C     ESTABLISH TIGHTER BOUNDS ON EIGENVALUES                           EGN 123 
      DO 34 L1=L,M                                                      EGN 124 
      IF (L1-MATCH) 33,33,31                                            EGN 125 
31    IF (VALU(L1)-TAU) 18,18,32                                        EGN 126 
32    VALU(L1)=TAU                                                      EGN 127 
      GO TO 34                                                          EGN 128 
33    U(L1)=TAU                                                         EGN 129 
34    CONTINUE                                                          EGN 130 
      GO TO 18                                                          EGN 131 
35    CONTINUE                                                          EGN 132 
C     EIGENVECTORS OF CO-DIAGONAL SYMMETRIC MATRIX -- INVERSE ITERATION EGN 133 
C     CHECK FOR REPEATED VALUE                                          EGN 134 
      DO 68 I=1,M                                                       EGN 135 
      IF (I-2) 37,36,36                                                 EGN 136 
36    IF (VALU(I-1)-VALU(I)-EPS1) 38,37,37                              EGN 137 
37    I1=-1                                                             EGN 138 
38    I1=I1+1                                                           EGN 139 
C     TRIANGULARIZE CO-DIAGONAL FORM AFTER EIGENVALUE SUBTRACTION       EGN 140 
      DO 43 L=1,N                                                       EGN 141 
      V(L)=EPS1                                                         EGN 142 
      T(L,2)=DIAG(L)-VALU(I)                                            EGN 143 
      IF (L-N) 40,39,40                                                 EGN 144 
39    T(L,3)=0.                                                         EGN 145 
      GO TO 43                                                          EGN 146 
40    T(L,3)=SUPERD(L)                                                  EGN 147 
      IF (T(L,3)) 42,41,42                                              EGN 148 
41    T(L,3)=EPS1                                                       EGN 149 
42    T(L+1,1)=T(L,3)                                                   EGN 150 
43    CONTINUE                                                          EGN 151 
      DO 50 J=1,N                                                       EGN 152 
      T(J,1)=T(J,2)                                                     EGN 153 
      T(J,2)=T(J,3)                                                     EGN 154 
      T(J,3)=0.                                                         EGN 155 
      VTEMP=ABS(T(J,1))                                                 EGN 156 
      IF (J-N) 46,44,46                                                 EGN 157 
44    IF (VTEMP) 50,45,50                                               EGN 158 
45    T(J,1)=EPS1                                                       EGN 159 
      GO TO 50                                                          EGN 160 
46    INDEX(J)=0                                                        EGN 161 
      IF (ABS(T(J+1,1))-VTEMP) 49,49,47                                 EGN 162 
47    INDEX(J)=1                                                        EGN 163 
      DO 48 K=1,3                                                       EGN 164 
      VTEMP=T(J,K)                                                      EGN 165 
      T(J,K)=T(J+1,K)                                                   EGN 166 
      T(J+1,K)=VTEMP                                                    EGN 167 
48    CONTINUE                                                          EGN 168 
49    VTEMP=T(J+1,1)/T(J,1)                                             EGN 169 
      U(J)=VTEMP                                                        EGN 170 
      T(J+1,2)=T(J+1,2)-VTEMP*T(J,2)                                    EGN 171 
      T(J+1,3)=T(J+1,3)-VTEMP*T(J,3)                                    EGN 172 
50    CONTINUE                                                          EGN 173 
      ITER=1                                                            EGN 174 
      IF (I1) 58,51,58                                                  EGN 175 
C     BACK SUBSTITUTE TO OBTAIN EIGENVECTOR                             EGN 176 
51    DO 52 L1=1,N                                                      EGN 177 
      L=NP1-L1                                                          EGN 178 
      V(L)=(V(L)-T(L,2)*V(L+1)-T(L,3)*V(L+2))/T(L,1)                    EGN 179 
52    CONTINUE                                                          EGN 180 
      GO TO (53,58), ITER                                               EGN 181 
C     PERFORM SECOND ITERATION                                          EGN 182 
53    ITER=2                                                            EGN 183 
54    DO 57 L=2,N                                                       EGN 184 
      IF (INDEX(L-1)) 55,56,55                                          EGN 185 
55    VTEMP=V(L-1)                                                      EGN 186 
      V(L-1)=V(L)                                                       EGN 187 
      V(L)=VTEMP                                                        EGN 188 
56    V(L)=V(L)-U(L-1)*V(L-1)                                           EGN 189 
57    CONTINUE                                                          EGN 190 
      GO TO 51                                                          EGN 191 
C     ORTHOGONALIZE VECTOR TO OTHERS ASSOCIATED WITH REPEATED ROOT      EGN 192 
58    IF (I1) 59,62,59                                                  EGN 193 
59    DO 61 L1=1,I1                                                     EGN 194 
      K=I-L1                                                            EGN 195 
      VTEMP=0.                                                          EGN 196 
      DO 60 J=1,N                                                       EGN 197 
60    VTEMP=VTEMP+A(J,K)*V(J)                                           EGN 198 
      DO 61 J=1,N                                                       EGN 199 
61    V(J)=V(J)-A(J,K)*VTEMP                                            EGN 200 
62    GO TO (54,63), ITER                                               EGN 201 
C     NORMALIZE VECTOR TO UNIT LENGTH                                   EGN 202 
63    VNORM2=0.                                                         EGN 203 
      SUM=0.                                                            EGN 204 
      DO 65 L=1,N                                                       EGN 205 
      IF (SUM-ABS(V(L))) 64,65,65                                       EGN 206 
64    SUM=ABS(V(L))                                                     EGN 207 
65    CONTINUE                                                          EGN 208 
      DO 66 L=1,N                                                       EGN 209 
      V(L)=V(L)/SUM                                                     EGN 210 
66    VNORM2=VNORM2+V(L)**2                                             EGN 211 
      VNORM=SQRT(VNORM2)                                                EGN 212 
      DO 67 J=1,N                                                       EGN 213 
67    A(J,I)=V(J)/VNORM                                                 EGN 214 
68    CONTINUE                                                          EGN 215 
C     ROTATION OF CO-DIAGONAL VECTORS INTO MATRIX EIGENVECTORS          EGN 216 
      DO 70 I=1,M                                                       EGN 217 
      DO 69 K=2,N                                                       EGN 218 
      U(K)=0.                                                           EGN 219 
      DO 69 J=2,N                                                       EGN 220 
69    U(K)=U(K)+B(J,K)*A(J,I)                                           EGN 221 
      DO 70 J=2,N                                                       EGN 222 
70    A(J,I)=U(J)                                                       EGN 223 
C     NORMALIZE LENGTH OF VECTORS TO EIGENVALUES AND STORE IN B(I,J)    EGN 224 
      DO 72 J=1,M                                                       EGN 225 
      IF (VALU(J)) 73,73,71                                             EGN 226 
71    VTEMP=SQRT(VALU(J))                                               EGN 227 
      DO 72 I=1,N                                                       EGN 228 
72    B(I,J)=A(I,J)*VTEMP                                               EGN 229 
73    RETURN                                                            EGN 230 
      END                                                               EGN 231-
C     PLOT                                                              PLT   1 
C     DYNAMIC DIMENSIONING PLOT SUBROUTINE (A.E.HENDRICKSON, 8/13/63, ASPLT   2 
C     MODIFIED BY LINGOES.)                                             PLT   3 
C                                                                       PLT   4 
      SUBROUTINE PLOT (A,IX,IY,IW,L1,L2,NV,NVAC,MD,ND)                  PLT   5 
      DIMENSION A(MD,ND), IX(1), IY(1), IW(1), L1(1), L2(1), FMT(58)    PLT   6 
      INTEGER BLANK                                                     PLT   7 
      DATA BLANK/4H    /,WORD1/4H A2,/,WORD2/4H I2,/                    PLT   8 
      DATA FMT(1)/4H(1H /,FMT(2)/4H,5X,/,FMT(3)/4HI5,2/                 PLT   9 
      DATA FMT(4)/4HX1H*/,FMT(5)/4H,   /,FMT(31)/4H1H*,/                PLT  10 
      DATA FMT(57)/4H1H*,/,FMT(58)/4HI4) /                              PLT  11 
C                                                                       PLT  12 
C     TAPE ASSIGNMENT                                                   PLT  13 
      JTAPE=6                                                           PLT  14 
      DO 1 I=1,10                                                       PLT  15 
      J=11-I                                                            PLT  16 
      L1(J)=-I*10                                                       PLT  17 
      K=I+10                                                            PLT  18 
1     L1(K)=I*10                                                        PLT  19 
      DO 2 I=1,25                                                       PLT  20 
      J=26-I                                                            PLT  21 
      L2(J)=I*4                                                         PLT  22 
      K=25+I                                                            PLT  23 
2     L2(K)=-I*4                                                        PLT  24 
      NFC=NVAC-1                                                        PLT  25 
      DO 18 I=1,NFC                                                     PLT  26 
      IP1=I+1                                                           PLT  27 
      DO 3 K=1,NV                                                       PLT  28 
3     IY(K)=((IFIX(A(K,I)*100.)+100)/4)                                 PLT  29 
      DO 18 J=IP1,NVAC                                                  PLT  30 
      DO 4 K=1,NV                                                       PLT  31 
4     IX(K)=50-((IFIX(A(K,J)*100.)+100)/4)                              PLT  32 
      WRITE (JTAPE,19) J,I,J,(L1(K),K=1,20)                             PLT  33 
      DO 17 KX=1,50                                                     PLT  34 
      DO 5 M=1,50                                                       PLT  35 
5     IW(M)=BLANK                                                       PLT  36 
      DO 11 L=1,NV                                                      PLT  37 
      IF (IX(L)-KX) 11,6,11                                             PLT  38 
6     IF (IY(L)-50) 7,7,8                                               PLT  39 
7     IF (IY(L)-1) 9,10,10                                              PLT  40 
8     IY(L)=50                                                          PLT  41 
      GO TO 10                                                          PLT  42 
9     IY(L)=1                                                           PLT  43 
10    N=IY(L)                                                           PLT  44 
      IW(N)=L                                                           PLT  45 
11    CONTINUE                                                          PLT  46 
      DO 13 K=1,25                                                      PLT  47 
      L=K+5                                                             PLT  48 
      IF (IW(K).EQ.BLANK) GO TO 12                                      PLT  49 
      FMT(L)=WORD2                                                      PLT  50 
      GO TO 13                                                          PLT  51 
12    FMT(L)=WORD1                                                      PLT  52 
13    CONTINUE                                                          PLT  53 
      DO 15 K=26,50                                                     PLT  54 
      L=K+6                                                             PLT  55 
      IF (IW(K).EQ.BLANK) GO TO 14                                      PLT  56 
      FMT(L)=WORD2                                                      PLT  57 
      GO TO 15                                                          PLT  58 
14    FMT(L)=WORD1                                                      PLT  59 
15    CONTINUE                                                          PLT  60 
      IF (KX-26) 17,16,17                                               PLT  61 
16    WRITE (JTAPE,20) I                                                PLT  62 
17    WRITE (JTAPE,FMT) L2(KX),(IW(L),L=1,50),L2(KX)                    PLT  63 
18    WRITE (JTAPE,21) (L1(K),K=1,20)                                   PLT  64 
      RETURN                                                            PLT  65 
C     *** FORMAT STATEMENTS ***                                         PLT  66 
C                                                                       PLT  67 
19    FORMAT (1H1,12HVECTOR PLOTS/1H ,6HVECTOR,I5,1X22HPLOTTED AGAINST VPLT  68 
     1ECTOR,I5,21X6HVECTOR/1H ,60XI4/1H0,11X10I5,2X1H*,I4,9I5/1H ,13X50(PLT  69 
     22H* ),1H*)                                                        PLT  70 
20    FORMAT (1H ,6HVECTOR,I3,4X50(2H* ),1H*)                           PLT  71 
21    FORMAT (1H ,13X50(2H* ),1H*/1H ,11X10I5,2X1H*,I4,9I5)             PLT  72 
      END                                                               PLT  73-
C     MXOUT                                                             MXT   1 
C     SUBROUTINE TO PRINT OUT COEFFICIENT MATRIX IN MATRIX FORM.        MXT   2 
C                                                                       MXT   3 
      SUBROUTINE MXOUT (R,N,ISW,MD)                                     MXT   4 
      DIMENSION R(MD,MD)                                                MXT   5 
C                                                                       MXT   6 
C     TAPE ASSIGNMENT                                                   MXT   7 
      JTAPE=6                                                           MXT   8 
      K=18                                                              MXT   9 
      I=N/K                                                             MXT  10 
      IF (N-I*K) 2,2,1                                                  MXT  11 
1     I=I+1                                                             MXT  12 
2     ITOTAL=(I*(I+1))/2                                                MXT  13 
      IPAGE=0                                                           MXT  14 
      I1=1-K                                                            MXT  15 
3     I1=I1+K                                                           MXT  16 
      I2=I1+K-1                                                         MXT  17 
      IF (I2-N) 5,5,4                                                   MXT  18 
4     I2=N                                                              MXT  19 
5     J1=1-K                                                            MXT  20 
6     J1=J1+K                                                           MXT  21 
      J2=J1+K-1                                                         MXT  22 
      IF (J2-N) 8,8,7                                                   MXT  23 
7     J2=N                                                              MXT  24 
8     IPAGE=IPAGE+1                                                     MXT  25 
      IF (ISW) 10,9,10                                                  MXT  26 
9     WRITE (JTAPE,19) IPAGE,ITOTAL,(J,J=J1,J2)                         MXT  27 
      GO TO 11                                                          MXT  28 
10    WRITE (JTAPE,20) IPAGE,ITOTAL,(J,J=J1,J2)                         MXT  29 
11    IF (J2-I2) 12,13,13                                               MXT  30 
12    ISWTCH=2                                                          MXT  31 
      GO TO 14                                                          MXT  32 
13    ISWTCH=1                                                          MXT  33 
14    DO 16 I=I1,I2                                                     MXT  34 
      GO TO (15,16), ISWTCH                                             MXT  35 
15    J2=I                                                              MXT  36 
16    WRITE (JTAPE,21) I,(R(I,J),J=J1,J2)                               MXT  37 
      GO TO (17,6), ISWTCH                                              MXT  38 
17    IF (I2-N) 3,18,18                                                 MXT  39 
18    RETURN                                                            MXT  40 
C     *** FORMAT STATEMENTS ***                                         MXT  41 
C                                                                       MXT  42 
19    FORMAT (1H1,36(1H ),47H   O R I G I N A L      C O E F F I C I E NMXT  43 
     1 T S,19(1H ),9HPAGE NO. ,I2,4H OF ,I2//12H0COLUMN =   ,18I6)      MXT  44 
20    FORMAT (1H1,36(1H ),47H     D E R I V E D      C O E F F I C I E NMXT  45 
     1 T S,19(1H ),9HPAGE NO. ,I2,4H OF ,I2//12H0COLUMN =   ,18I6)      MXT  46 
21    FORMAT (1H /8H0 ROW = ,I3,1H ,18(F6.2))                           MXT  47 
      END                                                               MXT  48-
