C     MASTER INDEX                                                       INDEX
C$    PROGRAM INDEX(INPUT,OUTPUT,TAPE1=INPUT,TAPE3=OUTPUT)               INDEX
C     REVISION NO. 0                                         PROGRAM NO. INDEX
C                                                                        INDEX
C      PROGRAM INDEX--2      REVISED JULY 1,1965                         INDEX
      COMMON INF(1254),EL(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
      NCUT=0                                                             INDEX
      NI=0                                                               INDEX
      XLAMDA=0                                                           INDEX
      YLAMDA=0                                                           INDEX
      DENSTY=0                                                           INDEX
      FORMWT=0                                                           INDEX
      TETBLK=0                                                           INDEX
      ETEST=0                                                            INDEX
      NOCUBE=0                                                           INDEX
      NOHEX=0                                                            INDEX
      NOTET=0                                                            INDEX
      NONO=0                                                             INDEX
      WRITE(3,10)                                                        INDEX
10    FORMAT(22H0PROGRAM INDEX ENTERED)                                  INDEX
1     FORMAT (5I10)                                                      INDEX
      READ (1,1) (INF(I),I=1,1254)                                       INDEX
      WRITE(3,11)                                                        INDEX
11    FORMAT(12H0MATRIX READ)                                            INDEX
      CONTINUE                                                           INDEX
C     GENERATE THE L LIST OF ALL LL                                      INDEX
      DO 2 I=1,30                                                        INDEX
2     EL(I)=(I-1)*(I-1)                                                  INDEX
3     CONTINUE                                                           INDEX
      CALL INPUT                                                         INDEX
      WRITE(3,12)                                                        INDEX
12    FORMAT(15H0INPUT COMPLETED)                                        INDEX
      CONTINUE                                                           INDEX
      IF (NOCUBE) 5,4,5                                                  INDEX
4     CONTINUE                                                           INDEX
      CALL CUBIC                                                         INDEX
5     CONTINUE                                                           INDEX
      CALL HEXTET                                                        INDEX
      IF (NONO) 3,6,3                                                    INDEX
6     CONTINUE                                                           INDEX
      CALL ORTHO                                                         INDEX
      GO TO 3                                                            INDEX
      END                                                                INDEX
      SUBROUTINE INPUT                                                   INDEX
      COMMON INF(1254),EL(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
1     FORMAT (20A4)                                                      INDEX
2     FORMAT (7F10.3)                                                    INDEX
3     FORMAT (I5,6F10.5,4I1)                                             INDEX
      WRITE(3,16)                                                        INDEX
16    FORMAT(14H0INPUT ENTERED)                                          INDEX
      READ (1,1) NAME                                                    INDEX
      WRITE (3,17)                                                       INDEX
17    FORMAT(10H0NAME READ)                                              INDEX
      READ (1,3) NCUT,XLAMDA,YLAMDA,ETEST,TETBLK,FORMWT,DENSTY,NOCUBE,NO INDEX
     1HEX,NOTET,NONO                                                     INDEX
      IF (ETEST) 5,4,5                                                   INDEX
4     ETEST=0.0005                                                       INDEX
5     CONTINUE                                                           INDEX
C                                                                        INDEX
C                                                                        INDEX
C     ETEST IS THE PROBABLE EXPERIMENTAL ERROR IN THE DATA.  IF UNKNOWN, INDEX
C     LEAVE ETEST BLANK AND PROGRAM WILL SET ETEST=.0005.     IF UNCER-  INDEX
C     TAIN, GUESS LOW.  E.G. IF ERROR IS ABOUT .00025, SET ETEST=.0002.  INDEX
C     NO SOLUTION WILL BE PRINTED FOR E LESS THAN ETEST.                 INDEX
C                                                                        INDEX
C                                                                        INDEX
C     TETBLK WILL PREVENT THE PROGRAM FROM PRODUCING A TETRAGONAL        INDEX
C     INDEXING UNLESS NO HEXAGONAL INDEXING HAS BEEN FOUND.  IN THE      INDEX
C     LATTER CASE THE TETRAGONAL CASE WILL BE TRIED IN SPITE OF THE      INDEX
C     BLOCK.  IF A TETRAGONAL INDEXING IS NOT DESIRED, PUT A POSITIVE    INDEX
C     DECIMAL NUMBER, E.G. .5 IN COLUMNS 36 TO 45 OF THE CUT NUMBER      INDEX
C     CARD. OTHERWISE LEAVE THAT SPACE BLANK.                            INDEX
C                                                                        INDEX
C                                                                        INDEX
C     XLAMDA IS THE UNRESOLVED WAVELENGTH AND YLAMDA IS THE WAVELENGTH   INDEX
C     OF THE K-ALPHA-1 RADIATION.                                        INDEX
C                                                                        INDEX
C                                                                        INDEX
      IF (XLAMDA) 6,6,7                                                  INDEX
6     XLAMDA=1.5418                                                      INDEX
      YLAMDA=1.54051                                                     INDEX
7     CONTINUE                                                           INDEX
      RATIO=YLAMDA/XLAMDA                                                INDEX
C                                                                        INDEX
C                                                                        INDEX
C     IF NO WAVELENGTHS ARE READ IN THE PROGRAM USES THOSE OF COPPER.    INDEX
C                                                                        INDEX
      DO 8 I=1,22000,7                                                   INDEX
      J=I+6                                                              INDEX
      READ (1,2) (TWOTH(K),K=I,J)                                        INDEX
      WRITE(3,25)                                                        INDEX
25    FORMAT(11H0TWOTH READ)                                             INDEX
      IF (ABS(TWOTH(I))+ABS(TWOTH(I+1))+ABS(TWOTH(I+2))+ABS(TWOTH(I+3))+ INDEX
     1ABS(TWOTH(I+4))+ABS(TWOTH(I+5))+ABS(TWOTH(J))) 8,9,8               INDEX
8     CONTINUE                                                           INDEX
9     DO 10 J=1,7                                                        INDEX
      N=I-J                                                              INDEX
      IF (TWOTH(N)) 11,10,11                                             INDEX
10    CONTINUE                                                           INDEX
11    NI=MIN0(N,150)                                                     INDEX
      IF (NCUT) 14,14,12                                                 INDEX
12    DO 13 I=1,NCUT                                                     INDEX
      S(I)=(RATIO**2)*SIN(TWOTH(I)*8.726646E-03)**2                      INDEX
      S2SQ(I)=SIN(TWOTH(I)*1.745329E-02)**2                              INDEX
13    CONTINUE                                                           INDEX
14    NKUT=NCUT+1                                                        INDEX
      DO 15 I=NKUT,NI                                                    INDEX
      S(I)=SIN(TWOTH(I)*8.726646E-03)**2                                 INDEX
      S2SQ(I)=SIN(TWOTH(I)*1.745329E-02)**2                              INDEX
15    CONTINUE                                                           INDEX
      MARK=8                                                             INDEX
      RETURN                                                             INDEX
      END                                                                INDEX
      SUBROUTINE SORTAC (A,N)                                            INDEX
      DIMENSION A(528)                                                   INDEX
      COMMON INF(1254),EL(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
      NN=N-1                                                             INDEX
      DO 3 I=1,NN                                                        INDEX
      K=I+1                                                              INDEX
      DO 2 J=K,N                                                         INDEX
      IF (A(J)-A(I)) 1,2,2                                               INDEX
1     TEMP=A(I)                                                          INDEX
      A(I)=A(J)                                                          INDEX
      A(J)=TEMP                                                          INDEX
2     CONTINUE                                                           INDEX
3     CONTINUE                                                           INDEX
      RETURN                                                             INDEX
      END                                                                INDEX
      SUBROUTINE FETCH (N,L)                                             INDEX
      COMMON INF(1254),EL(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
      DIMENSION L(9)                                                     INDEX
      IF (N-1254) 3,3,1                                                  INDEX
1     DO 2 I=1,9                                                         INDEX
2     L(I)=0                                                             INDEX
      RETURN                                                             INDEX
3     IL=INF(N)                                                          INDEX
      IL1=IL/262144                                                      INDEX
      IL2=IL/512-IL1*512                                                 INDEX
      IL3=IL-IL1*262144-IL2*512                                          INDEX
      L(1)=IL1/64                                                        INDEX
      L(2)=IL1/8-L(1)*8                                                  INDEX
      L(3)=IL1-L(1)*64-L(2)*8                                            INDEX
      L(4)=IL2/64                                                        INDEX
      L(5)=IL2/8-L(4)*8                                                  INDEX
      L(6)=IL2-L(4)*64-L(5)*8                                            INDEX
      L(7)=IL3/64                                                        INDEX
      L(8)=IL3/8-L(7)*8                                                  INDEX
      L(9)=IL3-L(7)*64-L(8)*8                                            INDEX
      DO 4 I=1,9                                                         INDEX
4     L(I)=L(I)-1                                                        INDEX
      RETURN                                                             INDEX
      END                                                                INDEX
      SUBROUTINE CUBIC                                                   INDEX
      COMMON INF(1254),EL(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
      DIMENSION YHAT(150), R(150), C(150), B(150,2), A(999), OMIT(175),  INDEX
     1BE(175)                                                            INDEX
      WRITE (3,1)                                                        INDEX
1     FORMAT (1H0,'ENTERING SUBROUTINE CUBIC')                           INDEX
2     FORMAT (I5,F15.2,F20.5,3F25.5)                                     INDEX
3     FORMAT (1X,46H THE NUMBER OF FORMULA UNITS PER UNIT CELL IS ,      INDEX
     1F10.2)                                                             INDEX
4     FORMAT (52X,8HOBSERVED,16X,10HCALCULATED/4X,1HI,6X,9HTWO THETA,    INDEX
     18X,12HCALCULATED N,7X,44HSINE SQUARED THETA       SINE SQUARED THE INDEX
     2TA ,15X, 10HDIFFERENCE)                                            INDEX
5     FORMAT (77H THE CRYSTAL HAS BEEN INDEXED IN THE CUBIC SYSTEM WITH  INDEX
     1A LATTICE CONSTANT OF ,F7.4,35H ANGSTROMS,BUT IN VIEW OF THE LARGE INDEX
     2/41H ERROR THIS INDEXING IS PROBABLY INVALID./66H AN ESTIMATE OF T INDEX
     3HE STANDARD DEVIATION OF THE LATTICE CONSTANT IS ,F8.6///)         INDEX
6     FORMAT (10H0 ERROR IS,F9.4//)                                      INDEX
7     FORMAT (1H1//24X,20A4///)                                          INDEX
      DO 8 I=1,125                                                       INDEX
      OMIT(I)=8*I-1                                                      INDEX
8     CONTINUE                                                           INDEX
      DO 9 I=1,31                                                        INDEX
      OMIT(I+125)=4*(8*I-1)                                              INDEX
9     CONTINUE                                                           INDEX
      DO 10 I=1,7                                                        INDEX
      OMIT(I+156)=16*(8*I-1)                                             INDEX
10    CONTINUE                                                           INDEX
      DO 11 I=1,2                                                        INDEX
      OMIT(I+163)=64*(8*I-1)                                             INDEX
11    CONTINUE                                                           INDEX
      DO 16 I=1,164                                                      INDEX
      IF (OMIT(I)-OMIT(I+1)) 16,16,12                                    INDEX
12    KB=OMIT(I)                                                         INDEX
      OMIT(I)=OMIT(I+1)                                                  INDEX
      OMIT(I+1)=KB                                                       INDEX
      JB=I                                                               INDEX
13    IF (JB-1) 16,16,14                                                 INDEX
14    IF (OMIT(JB)-OMIT(JB-1)) 15,16,16                                  INDEX
15    KB=OMIT(JB)                                                        INDEX
      OMIT(JB)=OMIT(JB-1)                                                INDEX
      OMIT(JB-1)=KB                                                      INDEX
      JB=JB-1                                                            INDEX
      GO TO 13                                                           INDEX
16    CONTINUE                                                           INDEX
      I=0                                                                INDEX
      DO 20 J=1,165                                                      INDEX
      N=I+1                                                              INDEX
      DO 19 I=N,999                                                      INDEX
      Z=FLOAT(I)                                                         INDEX
      IF (Z-OMIT(J)) 17,18,17                                            INDEX
17    A(I)=I                                                             INDEX
      GO TO 19                                                           INDEX
18    A(I)=0.0000                                                        INDEX
      GO TO 20                                                           INDEX
19    CONTINUE                                                           INDEX
20    CONTINUE                                                           INDEX
      E=0.2                                                              INDEX
      U=0.0                                                              INDEX
      V=0.0                                                              INDEX
      YLE=E                                                              INDEX
      NB=500                                                             INDEX
      LGO=1                                                              INDEX
      L=1                                                                INDEX
      M=1                                                                INDEX
      MSW=0                                                              INDEX
      KAY=NI/2                                                           INDEX
21    K=(NI/2)-1                                                         INDEX
22    K=K+1                                                              INDEX
      N=A(K)                                                             INDEX
      I=(NI/2)-1                                                         INDEX
      J=(NI/2)-1                                                         INDEX
      IF (N) 23,22,23                                                    INDEX
23    IF (N-NB) 24,32,32                                                 INDEX
24    X=S(KAY)/FLOAT(N)                                                  INDEX
25    I=I+1                                                              INDEX
      IF (I-NI) 27,27,26                                                 INDEX
26    GO TO (37,47), LGO                                                 INDEX
27    C(I)=S(I)/X                                                        INDEX
28    J=J+1                                                              INDEX
      IF (J-999) 29,22,29                                                INDEX
29    IF (C(I)-A(J)-E) 30,30,28                                          INDEX
30    IF (C(I)-A(J)+E) 22,31,31                                          INDEX
31    B(I,1)=S(I)                                                        INDEX
      B(I,2)=A(J)                                                        INDEX
      GO TO 25                                                           INDEX
32    GO TO (33,42), M                                                   INDEX
33    IF (MSW+1) 34,35,34                                                INDEX
34    IF (MSW) 36,35,36                                                  INDEX
35    YLE=E                                                              INDEX
      E=E*2.                                                             INDEX
      MSW=-1                                                             INDEX
      GO TO 21                                                           INDEX
36    M=2                                                                INDEX
      GO TO 41                                                           INDEX
37    IF (MSW) 38,46,38                                                  INDEX
38    GO TO (39,44), L                                                   INDEX
39    IF (MSW-1) 40,46,40                                                INDEX
40    L=2                                                                INDEX
      MSW=1                                                              INDEX
41    U=AMIN1(E,YLE)                                                     INDEX
      V=AMAX1(E,YLE)                                                     INDEX
      E=(U+V)/2.                                                         INDEX
      YLE=E                                                              INDEX
      M=2                                                                INDEX
      L=2                                                                INDEX
      GO TO 21                                                           INDEX
42    U=E                                                                INDEX
      YLE=E                                                              INDEX
      E=(E+V)/2.                                                         INDEX
      YLE=E                                                              INDEX
      IF (V-U-0.05) 43,43,21                                             INDEX
43    E=V                                                                INDEX
      LGO=2                                                              INDEX
      GO TO 21                                                           INDEX
44    V=E                                                                INDEX
      IF (V-U-.05) 47,47,45                                              INDEX
45    E=(E+U)/2.                                                         INDEX
      GO TO 21                                                           INDEX
46    YLE=E                                                              INDEX
      E=E/2.                                                             INDEX
      MSW=1                                                              INDEX
      GO TO 21                                                           INDEX
47    SUMSQ=0.0                                                          INDEX
      DO 48 I=KAY,NI                                                     INDEX
48    SUMSQ=SUMSQ+(B(I,2)*B(I,2))                                        INDEX
      DNUM=0.0                                                           INDEX
      DO 49 I=KAY,NI                                                     INDEX
49    DNUM=DNUM+(B(I,1)*B(I,2))                                          INDEX
      AHAT=DNUM/SUMSQ                                                    INDEX
      SUM=0.0                                                            INDEX
      SUMSQ=0.                                                           INDEX
      DO 50 I=1,NI                                                       INDEX
      B(I,1)=S(I)                                                        INDEX
      B(I,2)=AINT((S(I)/AHAT)+.5)                                        INDEX
      YHAT(I)=AHAT*B(I,2)                                                INDEX
      R(I)=B(I,1)-YHAT(I)                                                INDEX
      SUM=SUM+R(I)**2                                                    INDEX
      SUMSQ=SUMSQ+B(I,2)**2                                              INDEX
50    CONTINUE                                                           INDEX
      DEGFRD=NI-1                                                        INDEX
      SIGMAA=SQRT(SUM/(DEGFRD*SUMSQ))                                    INDEX
      XLC=YLAMDA/(2.*SQRT(AHAT))                                         INDEX
      WRITE (3,7) NAME                                                   INDEX
      WRITE (3,6) E                                                      INDEX
      IF (FORMWT) 52,51,52                                               INDEX
51    ZNMBER=XLC**3*DENSTY*0.6023                                        INDEX
      GO TO 53                                                           INDEX
52    ZNMBER=XLC**3*DENSTY*0.6023/FORMWT                                 INDEX
53    WRITE (3,3) ZNMBER                                                 INDEX
      IF (E-.3) 54,54,55                                                 INDEX
54    WRITE (3,5) XLC,SIGMAA                                             INDEX
      GO TO 56                                                           INDEX
55    WRITE (3,5) XLC,SIGMAA                                             INDEX
56    WRITE (3,4)                                                        INDEX
      DO 59 I=1,NI                                                       INDEX
      LTMP=I+1                                                           INDEX
      IF (MOD(LTMP,40)) 58,57,58                                         INDEX
57    WRITE (3,7) NAME                                                   INDEX
      WRITE (3,4)                                                        INDEX
58    WRITE (3,2) (I,TWOTH(I),B(I,2),S(I),YHAT(I),R(I))                  INDEX
59    CONTINUE                                                           INDEX
      WRITE (3,60)                                                       INDEX
60    FORMAT (1H0,'EXITING FROM SUBROUTINE CUBIC')                       INDEX
      RETURN                                                             INDEX
      END                                                                INDEX
      SUBROUTINE HEXTET                                                  INDEX
C     PROGRAM TO DETERMINE CRYSTAL INDEXES, HEXAGONAL CASE               INDEX
      COMMON INT(1254),EL(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
      DIMENSION O(150), D(150), KA(150,2), ASTOR(25), CSTOR(25), FACTOR( INDEX
     125), C(150), DUM1(150,2), A(150,2), DUM2(155,2)                    INDEX
1     FORMAT (44X,9H OBSERVED,15X,10HCALCULATED/2X,1HI,4X,9HTWO THETA,   INDEX
     14X,8HHH+KK+HK,5X,2HLL,5X,18HSINE SQUARED THETA,5X,18HSINE SQUARED  INDEX
     2THETA,8X,10HDIFFERENCE//)                                          INDEX
2     FORMAT (44X,9H OBSERVED,15X,10HCALCULATED/2X,1HI,4X,9HTWO THETA,   INDEX
     14X,5HHH+KK,8X,2HLL,5X,18HSINE SQUARED THETA,5X,18HSINE SQUARED THE INDEX
     2TA,8X,10HDIFFERENCE//)                                             INDEX
3     FORMAT (1X,I3,F11.3,2I10,F20.5,F23.5,F20.5)                        INDEX
4     FORMAT (90H0THE FOLLOWING INDEXING IS ON THE BASIS OF THE TETRAGON INDEX
     1AL SYSTEM WITH THE ERROR LESS THAN ,F8.6)                          INDEX
5     FORMAT (89H0THE FOLLOWING INDEXING IS ON THE BASIS OF THE HEXAGONA INDEX
     1L SYSTEM WITH THE ERROR LESS THAN ,F8.6)                           INDEX
6     FORMAT (64H AN ESTIMATE OF THE STANDARD DEVIATION OF SINE SQUARED  INDEX
     1THETA IS ,F10.4/51H AN ESTIMATE OF THE STANDARD DEVIATION OF THETA INDEX
     2 IS ,F10.4/51H AN ESTIMATE OF THE STANDARD DEVIATION OF AZERO IS , INDEX
     3F10.4/51H AN ESTIMATE OF THE STANDARD DEVIATION OF CZERO IS ,F10.4 INDEX
     4/9H AHAT IS ,F10.6,2X,9H BHAT IS ,F10.6/31H0THE LATTICE CONSTANT A INDEX
     5ZERO IS ,F10.5,11H ANGSTROMS./31H0THE LATTICE CONSTANT CZERO IS ,F INDEX
     610.5,11H ANGSTROMS.//)                                             INDEX
7     FORMAT (36H0THE UNRESOLVED WAVELENGTH USED WAS ,F8.5,41H AND THE K INDEX
     1-ALPHA-ONE WAVELENGTH USED WAS ,F8.5/16H THE DENSITY IS ,F6.3,1H,, INDEX
     222H THE FORMULA WEIGHT IS,F8.3/21H, AND THE NUMBER IS  ,F6.3,1H.)  INDEX
8     FORMAT (11H0THE FIRST ,I3,53H LINES ARE UNRESOLVED. THE REST ARE K INDEX
     1-ALPHA-1 LINES. )                                                  INDEX
9     FORMAT (92H0THE PROGRAM IS UNABLE TO INDEX THE CRYSTAL ON A HEXAGO INDEX
     1NAL BASIS WITHIN THE MAXIMUM ERROR OF,F10.5)                       INDEX
10    FORMAT (93H0THE PROGRAM IS UNABLE TO INDEX THE CRYSTAL ON A TETRAG INDEX
     10NAL BASIS WITHIN THE MAXIMUM ERROR OF,F10.5)                      INDEX
11    FORMAT (64H0THE PROGRAM IS UNABLE TO INDEX THE CRYSTAL WITHIN THE  INDEX
     1ERROR OF ,F8.6)                                                    INDEX
      WRITE(3,201)                                                       INDEX
201   FORMAT(27H0ENTERING SUBROUTINE HEXTET)                             INDEX
12    FORMAT (1H1/24X,20A4//)                                            INDEX
      B1=0.0                                                             INDEX
      B2=0.0                                                             INDEX
      NSTOR=0                                                            INDEX
      NSTORE=0                                                           INDEX
      KKKK=0                                                             INDEX
C     GET SET FOR THE HEXAGONAL CASE.                                    INDEX
      R=1.0                                                              INDEX
      KT=1                                                               INDEX
C     GENERATE THE S LIST OF ALL HH+KK+HK                                INDEX
      TETBLK=NOTET                                                       INDEX
      IF (NOHEX) 121,13,121                                              INDEX
      WRITE(3,202)                                                       INDEX
202   FORMAT(10H0HEXAGONAL)                                              INDEX
13    I=0                                                                INDEX
      NAY=1                                                              INDEX
      KAY=1                                                              INDEX
      DO 15 M=1,32                                                       INDEX
      DO 14 K=1,M                                                        INDEX
      I=I+1                                                              INDEX
      ES(I)=(M-1)*(M-1)+(K-1)*(K-1)+KT*(M-1)*(K-1)                       INDEX
14    CONTINUE                                                           INDEX
15    CONTINUE                                                           INDEX
      DO 16 K=1,25                                                       INDEX
      ASTOR(K)=0.                                                        INDEX
      CSTOR(K)=0.                                                        INDEX
16    CONTINUE                                                           INDEX
      KSKIP=2                                                            INDEX
C     ORDER THE S LIST                                                   INDEX
      CALL SORTAC(ES,528)                                                INDEX
      LP=0                                                               INDEX
      DO 20 I=2,277                                                      INDEX
17    IF (ES(I-1)-ES(I)) 20,18,165                                       INDEX
18    LP=LP+1                                                            INDEX
      M=529-LP                                                           INDEX
      DO 19 J=I,M                                                        INDEX
      ES(J-1)=ES(J)                                                      INDEX
19    CONTINUE                                                           INDEX
      GO TO 17                                                           INDEX
20    CONTINUE                                                           INDEX
C     OMMANDS 594 TO 3 DELETE DUPLICATE INTEGERS.                        INDEX
      NES=277                                                            INDEX
      NEL=30                                                             INDEX
      B=1.0                                                              INDEX
      DO 21 I=2,NI                                                       INDEX
      D(I)=ABS(S(I)-S(I-1))                                              INDEX
      B=AMIN1(B,D(I))                                                    INDEX
21    CONTINUE                                                           INDEX
C      B IS THE MINIMUM DIFFERENCE BETWEEN S(I) AND S(I+1).              INDEX
22    E=.49*B                                                            INDEX
C     OMMANDS   TO HERE FIX THE MAXIMUM ERROR E                          INDEX
      YLE=4.*E                                                           INDEX
      KAT=0                                                              INDEX
C     KAT IS INCREASED BY 1 WHEN WE FAIL TO INDEX THE CRYSTAL.           INDEX
      NOD=0                                                              INDEX
      IGO=1                                                              INDEX
C     THE VALUE OF IGO DETERMINES WHETHER THE ERROR IS BEING DECREASED   INDEX
C     OR IS FIXED.                                                       INDEX
23    KAP=0                                                              INDEX
C     KAP IS INCREASED BY 1 EACH ITERATION.                              INDEX
      IF (KAT) 24,24,28                                                  INDEX
C     KAT=1 MEANS THE MINIMUM ERROR HAS BEEN DETERMINED AND THE          INDEX
C     PROGRAM IS NOW FINDING ALL SOLUTIONS FOR THAT FIXED ERROR.         INDEX
24    GO TO (25,26), IGO                                                 INDEX
25    E=YLE/2.0                                                          INDEX
      IF (E-ETEST) 90,90,26                                              INDEX
26    MI=1                                                               INDEX
27    MI=MI+1                                                            INDEX
      IF (MI-5) 29,29,90                                                 INDEX
28    NOD=NOD+1                                                          INDEX
      IF (NOD-5) 36,36,90                                                INDEX
29    NUT=1                                                              INDEX
      MUT=0                                                              INDEX
      KUP=1                                                              INDEX
      LUP=1                                                              INDEX
      KQ=MI-1                                                            INDEX
30    KU=MI                                                              INDEX
      KV=0                                                               INDEX
31    KV=KV+1                                                            INDEX
      IF (KV-KQ) 32,32,54                                                INDEX
32    KX=0                                                               INDEX
33    KX=KX+1                                                            INDEX
      IF (KX-KQ) 35,35,34                                                INDEX
34    GO TO (31,54), KUP                                                 INDEX
35    KY=0                                                               INDEX
36    KY=KY+1                                                            INDEX
      IF (KY-KQ) 38,38,37                                                INDEX
37    GO TO (33,54), LUP                                                 INDEX
38    GO TO (39,40,41,42,43,44,45,46,47,48,49,50,51,52,53), NUT          INDEX
39    IE=KU                                                              INDEX
      JE=KV                                                              INDEX
      NE=KX                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
40    IE=KV                                                              INDEX
      JE=KU                                                              INDEX
      NE=KX                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
41    IE=KX                                                              INDEX
      JE=KV                                                              INDEX
      NE=KU                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
42    IE=KV                                                              INDEX
      JE=KX                                                              INDEX
      NE=KY                                                              INDEX
      KE=KU                                                              INDEX
      GO TO 58                                                           INDEX
43    IE=KU                                                              INDEX
      JE=KV                                                              INDEX
      NE=KX                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
44    IE=KX                                                              INDEX
      JE=KU                                                              INDEX
      NE=KY                                                              INDEX
      KE=KV                                                              INDEX
      GO TO 58                                                           INDEX
45    IE=KU                                                              INDEX
      JE=KX                                                              INDEX
      NE=KV                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
46    IE=KX                                                              INDEX
      JE=KY                                                              INDEX
      NE=KU                                                              INDEX
      KE=KV                                                              INDEX
      GO TO 58                                                           INDEX
47    IE=KX                                                              INDEX
      JE=KU                                                              INDEX
      NE=KV                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
48    IE=KU                                                              INDEX
      JE=KX                                                              INDEX
      NE=KY                                                              INDEX
      KE=KV                                                              INDEX
      GO TO 58                                                           INDEX
49    IE=KU                                                              INDEX
      JE=KV                                                              INDEX
      NE=KX                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
50    IE=KU                                                              INDEX
      JE=KV                                                              INDEX
      NE=KY                                                              INDEX
      KE=KX                                                              INDEX
      GO TO 58                                                           INDEX
51    IE=KU                                                              INDEX
      JE=KY                                                              INDEX
      NE=KV                                                              INDEX
      KE=KX                                                              INDEX
      GO TO 58                                                           INDEX
52    IE=KY                                                              INDEX
      JE=KU                                                              INDEX
      NE=KV                                                              INDEX
      KE=KX                                                              INDEX
      GO TO 58                                                           INDEX
53    IE=KU                                                              INDEX
      JE=KV                                                              INDEX
      NE=KX                                                              INDEX
      KE=KY                                                              INDEX
      GO TO 58                                                           INDEX
54    NUT=NUT+1                                                          INDEX
      IF (NUT-14) 55,55,27                                               INDEX
55    MUT=MUT+1                                                          INDEX
      GO TO (30,30,30,56,32,32,32,32,32,57,35,35,35,53), MUT             INDEX
56    KUP=2                                                              INDEX
      GO TO 32                                                           INDEX
57    LUP=2                                                              INDEX
      GO TO 35                                                           INDEX
58    T=ES(IE)*EL(KE)-ES(NE)*EL(JE)                                      INDEX
C                                                                        INDEX
C     OMMANDS 9  THROUGH 76 COUNT THROUGH ALL 2X2 MATRICES WITH ENTRIES  INDEX
C     THAN MI+2                                                          INDEX
C                                                                        INDEX
C     T IS THE COEFFICIENT DETERMINANT                                   INDEX
C     IF T=0. WE HAVE DEPENDENCE                                         INDEX
      KAN=KAY+NAY                                                        INDEX
C     X AND Y ARE DETERMINED FROM LINES KAY AND KAN.                     INDEX
      IF (T) 70,59,70                                                    INDEX
C     OMMANDS 101 THROUGH 109 CHECK FOR DEPENDENCE                       INDEX
59    IF (ES(IE)) 61,60,61                                               INDEX
60    IF (EL(JE)) 64,36,64                                               INDEX
61    IF (ES(NE)) 62,63,62                                               INDEX
62    SA=ES(IE)/ES(NE)                                                   INDEX
      GO TO 67                                                           INDEX
63    SA=0.0                                                             INDEX
      GO TO 67                                                           INDEX
64    IF (EL(KE)) 65,66,65                                               INDEX
65    SA=EL(JE)/EL(KE)                                                   INDEX
      GO TO 67                                                           INDEX
66    SA=0.0                                                             INDEX
67    IF (SA-(S(KAY)/S(KAN))-0.001) 68,36,36                             INDEX
68    IF (SA-(S(KAY)/S(KAN))+0.001) 36,36,69                             INDEX
69    NAY=NAY+1                                                          INDEX
      IF (KAY+NAY-NI) 22,22,95                                           INDEX
70    X=(S(KAY)*EL(KE)-S(KAN)*EL(JE))/T                                  INDEX
      IF (X-.001) 36,36,71                                               INDEX
71    Y=(S(KAN)*ES(IE)-S(KAY)*ES(NE))/T                                  INDEX
      IF (Y-.001) 36,36,72                                               INDEX
72    KP=0                                                               INDEX
73    NND=0                                                              INDEX
C     NND=0 UNTIL WE FIND AN ACCEPTABLE SET OF INDICES AT COMMANDS 244   INDEX
C     AND FOLLOWING.                                                     INDEX
      OLDDE=1.1                                                          INDEX
      KP=KP+1                                                            INDEX
C     KP IS THE NUMBER OF THE REFLECTION CURRENTLY BEING INDEXED         INDEX
      YLE=E                                                              INDEX
      IF (KP-4) 75,75,74                                                 INDEX
74    KP=4                                                               INDEX
      GO TO 98                                                           INDEX
75    NR=0                                                               INDEX
76    NR=NR+1                                                            INDEX
      IF (NR-NES) 77,77,85                                               INDEX
77    IF (X*ES(NR)-S(KP)-E) 78,78,85                                     INDEX
78    NS=0                                                               INDEX
79    NS=NS+1                                                            INDEX
      IF (NS-NEL) 80,80,76                                               INDEX
80    C(KP)=X*ES(NR)+Y*EL(NS)                                            INDEX
C     ~KP< IS THE CALCULATED SINE SQUARED THETA TO COMPARE WITH THE      INDEX
C     OBSERVED SINE SQUARED THETA.                                       INDEX
      IF (C(KP)-S(KP)-E) 81,81,76                                        INDEX
81    IF (C(KP)-S(KP)+E) 79,82,82                                        INDEX
82    DE=ABS(S(KP)-C(KP))                                                INDEX
      IF (OLDDE-DE) 79,79,83                                             INDEX
83    IF (KP-1) 86,86,87                                                 INDEX
84    A(KP,1)=B1                                                         INDEX
      A(KP,2)=B2                                                         INDEX
C     WE ACCEPT THE TWO INDICES ES(NR) AND EL(NS) SO GO INCREASE KP      INDEX
C     BY 1 AND TRY TO INDEX THE NEXT REFLECTION.                         INDEX
      GO TO 73                                                           INDEX
85    IF (NND) 36,36,84                                                  INDEX
86    B1=ES(NR)                                                          INDEX
      B2=EL(NS)                                                          INDEX
      OLDDE=DE                                                           INDEX
      NND=1                                                              INDEX
      GO TO 79                                                           INDEX
C     OMMAND 244 STORES THE CURRENT BEST SELECTION OF INDICES FOR LINE K INDEX
87    IF (A(KP-1,1)-ES(NR)) 86,88,86                                     INDEX
88    IF (A(KP-1,2)-EL(NS)) 86,89,86                                     INDEX
C     OMMANDS 246 AND 247 AVOID DUPLICATE SETS OF INDICES.               INDEX
89    GO TO 79                                                           INDEX
90    KAT=KAT+1                                                          INDEX
      IF (KAT-1) 91,91,92                                                INDEX
91    E=2.*E                                                             INDEX
      KSKIP=1                                                            INDEX
C     OMMANDS 250 AND 260 ACKNOWLEDGE THE FIRST UNSUCCESSFUL E AND SET T INDEX
C     PROGRAM TO FIND AND PRINT ALL SOLUTIONS OBTAINABLE FOR THE LAST    INDEX
C     SUCCESSFUL E.                                                      INDEX
      IGO=2                                                              INDEX
      GO TO 26                                                           INDEX
92    IF (KT) 93,93,121                                                  INDEX
C     KT=0 IS THE TETRAGONAL CASE, KT=1 IS THE HEXAGONAL CASE.           INDEX
93    IF (KAT-1) 91,91,94                                                INDEX
94    IF (KKKK) 163,163,164                                              INDEX
95    XKT=KT                                                             INDEX
      IF (XKT-0.5) 97,97,96                                              INDEX
96    WRITE (3,12) NAME                                                  INDEX
      WRITE (3,9) E                                                      INDEX
      GO TO 121                                                          INDEX
C                                                                        INDEX
C     OMPLETE FAILURE FOR HEXAGONAL CASE.  GO TO TETRAGONAL CASE.        INDEX
C                                                                        INDEX
97    WRITE (3,12) NAME                                                  INDEX
      WRITE (3,10) E                                                     INDEX
      GO TO 164                                                          INDEX
C                                                                        INDEX
C          COMPLETE FAILURE FOR BOTH CASES.                              INDEX
C                                                                        INDEX
C                                                                        INDEX
C     OMMANDS 600 TO 628 PREPARE FOR LEAST SQUARES CALCULATION OF        INDEX
C     AHAT AND BHAT.                                                     INDEX
98    ESIX=S(1)*A(1,1)+S(2)*A(2,1)+S(3)*A(3,1)                           INDEX
      ESIY=S(1)*A(1,2)+S(2)*A(2,2)+S(3)*A(3,2)                           INDEX
      YX=A(1,1)*A(1,2)+A(2,1)*A(2,2)+A(3,1)*A(3,2)                       INDEX
      YI=A(1,2)**2+A(2,2)**2+A(3,2)**2                                   INDEX
      XI=A(1,1)**2+A(2,1)**2+A(3,1)**2                                   INDEX
99    ESIX=ESIX+S(KP)*A(KP,1)                                            INDEX
      ESIY=ESIY+S(KP)*A(KP,2)                                            INDEX
      YX=YX+A(KP,1)*A(KP,2)                                              INDEX
      YI=YI+A(KP,2)**2                                                   INDEX
      N=45                                                               INDEX
      XI=XI+A(KP,1)**2                                                   INDEX
100   AHAT=(ESIX*YI-ESIY*YX)/(XI*YI-YX**2)                               INDEX
      BHAT=(ESIY-YX*AHAT)/YI                                             INDEX
C     AHAT AND BHAT ARE THE LEAST SQUARES ESTIMATES OF A AND C IN THE    INDEX
C     EQUATION S(I)=A*ES(I)+C*EL(I)                                      INDEX
      IF (KP-NI) 101,125,125                                             INDEX
C                                                                        INDEX
C     OMMAND 628 ASKS IF WE ARE DONE.  IF NOT, COMMANDS 629 THROUGH 690  INDEX
C     THE REST OF THE REFLECTIONS.                                       INDEX
C                                                                        INDEX
101   KP=KP+1                                                            INDEX
      ND=0                                                               INDEX
      OLDDE=1.1                                                          INDEX
      IR=0                                                               INDEX
102   IR=IR+1                                                            INDEX
C     OMMAND 657 SAYS THIS IS THE FIRST ATTEMPT TO INDEX THIS REFLECTION INDEX
      IF (IR-NES) 104,104,103                                            INDEX
103   IF (ND) 165,111,117                                                INDEX
C     OMMAND 667 ASKS IF WE FAILED TO INDEX THIS REFLECTION YES,YES,NO   INDEX
104   IS=0                                                               INDEX
105   IS=IS+1                                                            INDEX
      IF (IS-NEL) 106,106,102                                            INDEX
106   C(KP)=AHAT*ES(IR)+BHAT*EL(IS)                                      INDEX
      IF (C(KP)-S(KP)-E) 109,109,107                                     INDEX
107   IF (EL(IS)) 165,108,102                                            INDEX
108   IF (ND) 165,111,117                                                INDEX
109   IF (C(KP)-S(KP)+E) 105,110,110                                     INDEX
110   DE=ABS(S(KP)-C(KP))                                                INDEX
      IF (OLDDE-DE) 105,105,113                                          INDEX
C                                                                        INDEX
C     WE ASK IF THE NEW SET OF INDICES IS BETTER THAN THE PREVIOUS SET.  INDEX
C                                                                        INDEX
111   IF (KAP) 165,36,36                                                 INDEX
C     IS THIS THE FIRST ITERATION                                        INDEX
112   B1=ES(IR)                                                          INDEX
      B2=EL(IS)                                                          INDEX
      OLDDE=DE                                                           INDEX
      ND=1                                                               INDEX
      GO TO 105                                                          INDEX
C     OMMAND 686 STORES PRESENT BEST INDICES AS B1 AND B2.               INDEX
113   IF (KP-1) 112,112,114                                              INDEX
114   IF (A(KP-1,1)-ES(IR)) 112,115,112                                  INDEX
115   IF (A(KP-1,2)-EL(IS)) 112,116,112                                  INDEX
C     OMMANDS 687 AND 688 CHECK FOR DUPLICATE SETS OF INDICES.           INDEX
116   GO TO 105                                                          INDEX
117   A(KP,1)=B1                                                         INDEX
      A(KP,2)=B2                                                         INDEX
C     OMMAND 690 ACCEPTS B1 AND B2 AS THE BEST SET OF INDICES FOR LINE K INDEX
      IF (KAP) 99,99,118                                                 INDEX
C     IS THIS THE FIRST ITERATION YES,YES,NO                             INDEX
118   IF (KP-NI) 101,119,119                                             INDEX
119   ESIX=0.                                                            INDEX
      ESIY=0.                                                            INDEX
      YX=0.                                                              INDEX
      YI=0.                                                              INDEX
      XI=0.                                                              INDEX
      DO 120 L=1,NI                                                      INDEX
      ESIX=ESIX+S(L)*A(L,1)                                              INDEX
      ESIY=ESIY+S(L)*A(L,2)                                              INDEX
      YX=YX+A(L,1)*A(L,2)                                                INDEX
      YI=YI+A(L,2)**2                                                    INDEX
      XI=XI+A(L,1)**2                                                    INDEX
120   CONTINUE                                                           INDEX
      X=AHAT                                                             INDEX
      Y=BHAT                                                             INDEX
      GO TO 100                                                          INDEX
C     OMMANDS 692 TO 693 PERFORM ALL LEAST SQUARES FITS EXCEPT THE FIRST INDEX
121   KT=0                                                               INDEX
      NSTOR=0                                                            INDEX
      KSKIP=2                                                            INDEX
      R=0.8660255                                                        INDEX
      IF (TETBLK) 13,13,164                                              INDEX
C     OMMAND 702 BRANCHES THE PROGRAM INTO THE TETRAGONAL CASE.          INDEX
C                                                                        INDEX
122   IF (KAP-5) 123,123,126                                             INDEX
C     IS THIS THE SIXTH ITERATION NO,NO,YES                              INDEX
123   U=ABS(X-AHAT)                                                      INDEX
      V=ABS(Y-BHAT)                                                      INDEX
      IF (U+V-.002) 126,126,124                                          INDEX
124   X=AHAT                                                             INDEX
      Y=BHAT                                                             INDEX
      GO TO 101                                                          INDEX
125   KAP=KAP+1                                                          INDEX
C     THE PROGRAM ADVANCES TO 706 UPON SUCCESSFULLY INDEXING THE CRYSTAL INDEX
      KP=0                                                               INDEX
      IF (KAP-1) 101,101,122                                             INDEX
126   DO 127 K=1,NI                                                      INDEX
      O(K)=AHAT*A(K,1)+BHAT*A(K,2)                                       INDEX
127   CONTINUE                                                           INDEX
C     O(K) IS THE CALCULATED SINE SQUARED THETA.                         INDEX
      DO 128 K=1,NI                                                      INDEX
      D(K)=S(K)-O(K)                                                     INDEX
128   CONTINUE                                                           INDEX
      SIGMA=0.                                                           INDEX
      SIGTH=0.                                                           INDEX
      DO 129 I=1,NI                                                      INDEX
      SIGMA=SIGMA+D(I)**2                                                INDEX
      SIGTH=SIGTH+((D(I)**2)/S2SQ(I))                                    INDEX
129   CONTINUE                                                           INDEX
      SIGMA=SIGMA/FLOAT(NI-2)                                            INDEX
      SIGMA=SQRT(SIGMA)                                                  INDEX
      SIGTH=SIGTH/FLOAT(NI-2)                                            INDEX
      SIGTH=SQRT(SIGTH)*57.2957795                                       INDEX
      SIGHAT=YI*(SIGTH**2)/(XI*YI-YX**2)                                 INDEX
      SIGHBT=XI*SIGHAT/YI                                                INDEX
      SIGHAT=SQRT(SIGHAT)                                                INDEX
      SIGHBT=SQRT(SIGHBT)                                                INDEX
C     OMMANDS FOLLOWING 731 CALCULATE THE VARIOUS STANDARD DEVIATIONS.   INDEX
      AZERO=YLAMDA*R/SQRT(3.0*AHAT)                                      INDEX
      CZERO=YLAMDA/(2.*SQRT(BHAT))                                       INDEX
      GO TO (130,144), KSKIP                                             INDEX
130   ASTORE=AZERO                                                       INDEX
      CSTORE=CZERO                                                       INDEX
      DO 132 I=1,25                                                      INDEX
      DO 131 K=1,20                                                      INDEX
      FACTOR(K)=SQRT(ES(K))                                              INDEX
      IF (ABS(ASTORE-FACTOR(K)*ASTOR(I))-0.001) 133,133,131              INDEX
131   CONTINUE                                                           INDEX
132   CONTINUE                                                           INDEX
133   CONTINUE                                                           INDEX
      DO 135 I=1,25                                                      INDEX
      DO 134 K=1,20                                                      INDEX
      FACTOR(K)=SQRT(EL(K))                                              INDEX
      IF (ABS(CSTORE-FACTOR(K)*CSTOR(I))-0.001) 162,162,134              INDEX
134   CONTINUE                                                           INDEX
135   CONTINUE                                                           INDEX
      IF (KT) 165,136,142                                                INDEX
136   CONTINUE                                                           INDEX
      DO 138 I=1,25                                                      INDEX
      DO 137 K=1,20                                                      INDEX
      FACTOR(K)=K                                                        INDEX
      IF (ABS(ASTORE-FACTOR(K)*CSTOR(I))-.001) 139,139,137               INDEX
137   CONTINUE                                                           INDEX
138   CONTINUE                                                           INDEX
      GO TO 142                                                          INDEX
139   CONTINUE                                                           INDEX
      DO 141 I=1,25                                                      INDEX
      DO 140 K=1,20                                                      INDEX
      FACTOR(K)=K                                                        INDEX
      IF (ABS(CSTORE-FACTOR(K)*ASTOR(I))-.001) 162,162,140               INDEX
140   CONTINUE                                                           INDEX
141   CONTINUE                                                           INDEX
142   CONTINUE                                                           INDEX
      NSTOR=NSTOR+1                                                      INDEX
      ASTOR(NSTOR)=ASTORE                                                INDEX
      CSTOR(NSTOR)=CSTORE                                                INDEX
      IF (NSTOR-25) 143,143,121                                          INDEX
143   CONTINUE                                                           INDEX
144   CONTINUE                                                           INDEX
C                                                                        INDEX
C     ONCE THE MINIMUM ERROR HAS BEEN DETERMINED, THE COMMANDS FROM      INDEX
C     721 TO 727 WILL ELIMINATE SOLUTIONS WHICH ARE MULTIPLES OF         INDEX
C     PREVIOUSLY ACCEPTED SOLUTIONS FOR THAT ERROR.                      INDEX
C                                                                        INDEX
      SIGAZO=AZERO*SIGHAT/(2.*AHAT)                                      INDEX
      SIGCZO=CZERO*SIGHBT/(2.*BHAT)                                      INDEX
      DO 145 I=1,NI                                                      INDEX
      KA(I,1)=A(I,1)                                                     INDEX
      KA(I,2)=A(I,2)                                                     INDEX
145   CONTINUE                                                           INDEX
      WRITE (3,12) NAME                                                  INDEX
      IF (KT-1) 146,147,147                                              INDEX
C     WAS THIS CASE HEXAGONAL OR TETRAGONAL                              INDEX
146   WRITE (3,4) E                                                      INDEX
      KK=1                                                               INDEX
      KKK=1                                                              INDEX
      VOLUME=AZERO*CZERO*AZERO                                           INDEX
      GO TO 148                                                          INDEX
147   WRITE (3,5) E                                                      INDEX
      KK=2                                                               INDEX
      KKK=2                                                              INDEX
      VOLUME=AZERO*AZERO*CZERO*0.866026                                  INDEX
148   CONTINUE                                                           INDEX
      IF (FORMWT) 149,149,150                                            INDEX
149   ZNMBER=0.0                                                         INDEX
      GO TO 153                                                          INDEX
150   CONTINUE                                                           INDEX
      IF (FORMWT) 152,151,152                                            INDEX
151   ZNMBER=VOLUME*DENSTY*0.6023                                        INDEX
      GO TO 153                                                          INDEX
152   ZNMBER=VOLUME*DENSTY*0.6023/FORMWT                                 INDEX
153   CONTINUE                                                           INDEX
      WRITE (3,7) XLAMDA,YLAMDA,DENSTY,FORMWT,ZNMBER                     INDEX
      WRITE (3,8) NCUT                                                   INDEX
      WRITE (3,6) SIGMA,SIGTH,SIGAZO,SIGCZO,AHAT,BHAT,AZERO,CZERO        INDEX
      GO TO (154,155), KK                                                INDEX
154   WRITE (3,2)                                                        INDEX
      GO TO 156                                                          INDEX
155   WRITE (3,1)                                                        INDEX
156   DO 161 I=1,NI                                                      INDEX
      ICHK=I+6                                                           INDEX
      IF (MOD(ICHK,36)) 160,157,160                                      INDEX
157   WRITE (3,12) NAME                                                  INDEX
C     OMMANDS 770 TO 771 COUNT THE LINES TO A PAGE SO YOU DO             INDEX
C     NOT WRITE OVER THE FOLD.                                           INDEX
      GO TO (158,159), KKK                                               INDEX
158   WRITE (3,2)                                                        INDEX
      GO TO 160                                                          INDEX
159   WRITE (3,1)                                                        INDEX
160   WRITE (3,3) (I,TWOTH(I),KA(I,1),KA(I,2),S(I),O(I),D(I))            INDEX
161   CONTINUE                                                           INDEX
      CALL DATE(CLNDR)                                                   INDEX
      CALL TIME(CLOCK)                                                   INDEX
      WRITE (3,200)CLNDR,CLOCK                                           INDEX
200   FORMAT(7H DATED  ,A8,4H AT ,A8,6H HOURS)                           INDEX
162   CONTINUE                                                           INDEX
      KKKK=KKKK+1                                                        INDEX
      GO TO 23                                                           INDEX
163   WRITE (3,12) NAME                                                  INDEX
      WRITE (3,11) E                                                     INDEX
164   RETURN                                                             INDEX
165   WRITE (3,166)                                                      INDEX
166   FORMAT (1H0,75HSOMETHING IS WRONG IN HEXTET. GO BACK TO GET MORE D INDEX
     1ATA AND TRY ANOTHER CASE)                                          INDEX
      RETURN                                                             INDEX
      END                                                                INDEX
      SUBROUTINE ORTHO                                                   INDEX
C     PROGRAM TO DETERMINE CRYSTAL INDEXES, ORTHORHOMBIC CASE.           INDEX
      COMMON INT(1254),SQ(60),TWOTH(150),NAME(20),S2SQ(150),ES(600),S(15 INDEX
     10),NCUT,XLAMDA,YLAMDA,NI,ETEST,TETBLK,DENSTY,FORMWT,NOCUBE,NOHEX,N INDEX
     2OTET,NONO                                                          INDEX
      DIMENSION AH(150), AK(150), AL(150), ESS(150), C(150), DE(150), KA INDEX
     1H(150), KAL(150), K9(9), STOREA(30), STOREB(30), STOREC(30), KAK(1 INDEX
     250)                                                                INDEX
1     FORMAT (40X,8HOBSERVED,11X,10HCALCULATED/2X,1HI,3X,9HTWO THETA,3X, INDEX
     12HHH,3X,2HKK,3X,2HLL,5X,38HSINE SQUARED THETA  SINE SQUARED THETA, INDEX
     25X,10HDIFFERENCE//)                                                INDEX
2     FORMAT (1H1/1X,20A4/93H THE FOLLOWING INDEXING IS ON THE BASIS OF  INDEX
     1THE ORTHORHOMBIC SYSTEM WITH THE ERROR LESS THAN  ,F8.6/31H THE LA INDEX
     2TTICE CONSTANT AZERO IS ,F10.5,11H ANGSTROMS./31H THE LATTICE CONS INDEX
     3TANT BZERO IS ,F10.5/11H ANGSTROMS./31H THE LATTICE CONSTANT CZERO INDEX
     4 IS ,F10.5,11H ANGSTROMS.)                                         INDEX
3     FORMAT (57H0THE PROGRAM FINDS NO SOLUTION FOR VALUES OF E LESS THA INDEX
     1N ,E15.6///)                                                       INDEX
4     FORMAT (1X,I3,F12.5,3I5,F17.5,F20.5,F18.5)                         INDEX
5     FORMAT (36H0THE UNRESOLVED WAVELENGTH USED WAS ,F8.5,41H AND THE K INDEX
     1-ALPHA-ONE WAVELENGTH USED WAS ,F8.5/16H THE DENSITY IS ,F6.3,22H  INDEX
     2THE FORMULA WEIGHT IS,F8.3,21H, AND THE NUMBER IS  ,F6.2,1H.)      INDEX
6     FORMAT (11H0THE FIRST ,I3,53H LINES ARE UNRESOLVED. THE REST ARE K INDEX
     1-ALPHA-1 LINES. )                                                  INDEX
7     FORMAT (52H AN ESTIMATE OF THE STANDARD DEVIATION OF THETA IS  ,F1 INDEX
     10.5/65H AN ESTIMATE OF THE STANDARD DEVIATION OF SINE SQUARED THET INDEX
     2A IS  ,F10.5/51H AN ESTIMATE OF THE STANDARD DEVIATION OF AZERO IS INDEX
     3 ,F10.5/51H AN ESTIMATE OF THE STANDARD DEVIATION OF BZERO IS ,F10 INDEX
     4.5/51H AN ESTIMATE OF THE STANDARD DEVIATION OF CZERO IS ,F10.5//) INDEX
8     FORMAT (31HOERROR. PROBABLY CUBIC CRYSTAL.//)                      INDEX
9     FORMAT (1H1//24X,20A4//)                                           INDEX
      WRITE(3,100)                                                       INDEX
100   FORMAT(25H0SUBROUTINE ORTHO ENTERED)                               INDEX
      KKKK=0                                                             INDEX
      I=40                                                               INDEX
      J=41                                                               INDEX
      K=42                                                               INDEX
      L=43                                                               INDEX
      M=44                                                               INDEX
      N=45                                                               INDEX
      LE=46                                                              INDEX
      ME=47                                                              INDEX
      NE=48                                                              INDEX
      KIT=0                                                              INDEX
      KAT=0                                                              INDEX
      IGO=1                                                              INDEX
      NOD=0                                                              INDEX
      MAY=NI                                                             INDEX
      B=1.0                                                              INDEX
      DO 10 II=2,NI                                                      INDEX
      B=AMIN1(B,ABS(S(II)-S(II-1)))                                      INDEX
10    CONTINUE                                                           INDEX
      E=.99*B                                                            INDEX
      EMAX=E/2.                                                          INDEX
      E=32.*EMAX                                                         INDEX
C     OMMAND 230 AND FOLLOWING COMMANDS FIX THE MAXIMUM ERROR            INDEX
      KAN=1                                                              INDEX
      KS=1                                                               INDEX
C     KS=1 WILL START THE VALUE OF K AT 1 SO THE PROGRAM DOES NOT LOOK   INDEX
C     FOR THE 0,0,0 LINE.                                                INDEX
      JAN=KAN                                                            INDEX
      NAN=JAN+1                                                          INDEX
C     X,Y, AND Z WILL BE DETERMINED FROM REFLECTIONS KAN,JAN, AND NAN.   INDEX
      JAN=JAN+1                                                          INDEX
      NAN=NAN+1                                                          INDEX
11    IF (KIT) 12,12,16                                                  INDEX
C     IF KIT=1 WE SEEK ALL SOLUTIONS FOR A FIXED ERROR                   INDEX
12    GO TO (13,14), IGO                                                 INDEX
13    E=E/2.0                                                            INDEX
      KSKIP=1                                                            INDEX
      NSTORE=0                                                           INDEX
      IF (E-ETEST) 19,19,14                                              INDEX
14    DO 62 IT=1,1255                                                    INDEX
      CALL FETCH(IT,K9)                                                  INDEX
      DO 15 ICK=1,9                                                      INDEX
      SQ(ICK+39)=K9(ICK)**2                                              INDEX
15    CONTINUE                                                           INDEX
      GO TO 21                                                           INDEX
16    NOD=NOD+1                                                          INDEX
      IF (NOD-20) 62,62,99                                               INDEX
17    KIT=KIT+1                                                          INDEX
      IF (KIT-1) 18,18,62                                                INDEX
18    IGO=2                                                              INDEX
      KSKIP=2                                                            INDEX
      GO TO 14                                                           INDEX
19    IF (KIT) 20,20,17                                                  INDEX
20    E=E*2.                                                             INDEX
      GO TO 17                                                           INDEX
C     THIS FIXES THE ERROR AND SEEKS ALL SOLUTIONS                       INDEX
21    D=SQ(I)*(SQ(M)*SQ(NE)-SQ(N)*SQ(ME))-SQ(J)*(SQ(L)*SQ(NE)-SQ(N)*SQ(L INDEX
     1E))+SQ(K)*(SQ(L)*SQ(ME)-SQ(M)*SQ(LE))                              INDEX
C     D IS THE COEFFICIENT DETERMINANT                                   INDEX
      IF (D) 39,22,39                                                    INDEX
22    RANK=SQ(I)*SQ(L)+SQ(J)*SQ(M)+SQ(K)*SQ(N)                           INDEX
      IF (RANK) 62,62,23                                                 INDEX
23    RANK=SQ(I)*SQ(LE)+SQ(J)*SQ(ME)+SQ(K)*SQ(NE)                        INDEX
      IF (RANK) 62,62,24                                                 INDEX
C                                                                        INDEX
C     OMMANDS 501 AND 502 REJECT ROWS WITH ALL ENTRIES ZERO.             INDEX
C                                                                        INDEX
24    U=S(KAN)*(SQ(M)*SQ(NE)-SQ(N)*SQ(ME))-S(JAN)*(SQ(J)*SQ(NE)-SQ(K)*SQ INDEX
     1(ME))+S(NAN)*(SQ(J)*SQ(N)-SQ(K)*SQ(M))                             INDEX
      IF (U) 62,25,62                                                    INDEX
25    V=SQ(I)*(S(JAN)*SQ(NE)-S(NAN)*SQ(N))-S(KAN)*(SQ(L)*SQ(NE)-SQ(N)*SQ INDEX
     1(LE))+SQ(K)*(S(NAN)*SQ(L)-S(JAN)*SQ(LE))                           INDEX
      IF (V) 62,26,62                                                    INDEX
26    W=SQ(I)*(S(NAN)*SQ(M)-S(JAN)*SQ(ME))-SQ(J)*(S(NAN)*SQ(L)-S(JAN)*SQ INDEX
     1(LE))+S(KAN)*(SQ(L)*SQ(ME)-SQ(M)*SQ(LE))                           INDEX
      IF (W) 62,29,62                                                    INDEX
C                                                                        INDEX
C     OMMANDS 505 THROUGH 507 REJECT INCONSISTENT EQUATIONS.             INDEX
C                                                                        INDEX
27    NAN=NAN+1                                                          INDEX
      IF (NAN-5) 14,14,28                                                INDEX
28    JAN=JAN+1                                                          INDEX
      NAN=JAN+1                                                          INDEX
      IF (NAN-5) 14,14,96                                                INDEX
29    IF (SQ(I)) 30,36,30                                                INDEX
30    A22=SQ(M)-SQ(J)*SQ(L)/SQ(I)                                        INDEX
      A32=SQ(ME)-SQ(LE)*SQ(J)/SQ(I)                                      INDEX
      A23=SQ(N)-SQ(K)*SQ(L)/SQ(I)                                        INDEX
      A33=SQ(NE)-SQ(K)*SQ(LE)/SQ(I)                                      INDEX
      IF (A32**2+A33**2) 31,34,31                                        INDEX
31    IF (A22**2+A23**2) 32,35,32                                        INDEX
32    CONTINUE                                                           INDEX
      B=-A23/A22                                                         INDEX
      A=-(SQ(K)-B*SQ(J))/SQ(I)                                           INDEX
      GO TO 33                                                           INDEX
33    IF (ABS(A*S(1)+B*S(2)+1.*S(3))-0.001) 27,27,62                     INDEX
34    IF (ABS(SQ(LE)/SQ(I)-S(3)/S(1))-.001) 27,27,62                     INDEX
35    IF (ABS(SQ(L)/SQ(I)-S(2)/S(1))-.001) 27,27,62                      INDEX
36    IF (SQ(J)) 37,38,37                                                INDEX
37    KOLDI=I                                                            INDEX
      KOLDL=L                                                            INDEX
      KOLDLE=LE                                                          INDEX
      I=J                                                                INDEX
      L=M                                                                INDEX
      LE=ME                                                              INDEX
      J=KOLDI                                                            INDEX
      M=KOLDL                                                            INDEX
      ME=KOLDLE                                                          INDEX
      GO TO 30                                                           INDEX
38    KOLDI=I                                                            INDEX
      KOLDL=L                                                            INDEX
      KOLDLE=LE                                                          INDEX
      I=K                                                                INDEX
      L=N                                                                INDEX
      LE=NE                                                              INDEX
      K=KOLDI                                                            INDEX
      N=KOLDL                                                            INDEX
      NE=KOLDLE                                                          INDEX
      GO TO 30                                                           INDEX
C                                                                        INDEX
C     OMMANDS 510 TO 526 PERFORM AN ANALYSIS OF ALL DEPENDENT CASES.     INDEX
C                                                                        INDEX
39    X=S(KAN)*(SQ(M)*SQ(NE)-SQ(N)*SQ(ME))-S(JAN)*(SQ(J)*SQ(NE)-SQ(K)*SQ INDEX
     1(ME))+S(NAN)*(SQ(J)*SQ(N)-SQ(K)*SQ(M))                             INDEX
      X=X/D                                                              INDEX
      IF (X-.001) 62,62,40                                               INDEX
40    Y=SQ(I)*(S(JAN)*SQ(NE)-S(NAN)*SQ(N))-S(KAN)*(SQ(L)*SQ(NE)-SQ(N)*SQ INDEX
     1(LE))+SQ(K)*(S(NAN)*SQ(L)-S(JAN)*SQ(LE))                           INDEX
      Y=Y/D                                                              INDEX
      IF (Y-.001) 62,62,41                                               INDEX
41    Z=SQ(I)*(S(NAN)*SQ(M)-S(JAN)*SQ(ME))-SQ(J)*(S(NAN)*SQ(L)-S(JAN)*SQ INDEX
     1(LE))+S(KAN)*(SQ(L)*SQ(ME)-SQ(M)*SQ(LE))                           INDEX
      Z=Z/D                                                              INDEX
      IF (Z-.001) 62,62,42                                               INDEX
42    JAY=0                                                              INDEX
43    JAY=JAY+1                                                          INDEX
C     JAY IS THE NUMBER OF THE REFLECTION BEING INDEXED                  INDEX
      MD=0                                                               INDEX
      NR=0                                                               INDEX
      OLDDE=1.1                                                          INDEX
44    NR=NR+1                                                            INDEX
      IF (NR-20) 45,45,49                                                INDEX
45    NS=0                                                               INDEX
46    NS=NS+1                                                            INDEX
      IF (NS-20) 47,47,44                                                INDEX
47    NT=0                                                               INDEX
48    NT=NT+1                                                            INDEX
      IF (NT-20) 50,50,46                                                INDEX
49    IF (MD) 62,62,61                                                   INDEX
C                                                                        INDEX
C         MD NON-ZERO MEANS AT LEAST ONE ACCEPTABLE SET OF INDICES HAVE  INDEX
C         BEEN FOUND FOR REFLECTION JAY.                                 INDEX
50    C(JAY)=X*SQ(NR)+Y*SQ(NS)+Z*SQ(NT)                                  INDEX
C     ~JAY< IS THE CALCULATED SINE SQUARED THETA                         INDEX
      IF (C(JAY)-S(JAY)-E) 54,54,51                                      INDEX
51    IF (X*SQ(NR)+Y*SQ(NS)-S(JAY)-E) 46,52,52                           INDEX
52    IF (X*SQ(NR)-S(JAY)-E) 44,53,53                                    INDEX
53    IF (MD) 62,62,61                                                   INDEX
C     WERE THERE SOLUTIONS FOR THIS X,Y, AND Z  NO,NO,YES                INDEX
54    IF (C(JAY)-S(JAY)+E) 48,55,55                                      INDEX
C     OMMAND 557 ASKS IF THIS IS A SOLUTION NO,YES,YES.                  INDEX
55    DEE=ABS(C(JAY)-S(JAY))                                             INDEX
      IF (OLDDE-DEE) 48,48,56                                            INDEX
C     THIS COMMAND ASKS IF THIS SET OF INDICES IS BETTER THAN ALL        INDEX
C     PREVIOUS SOLUTIONS NO, NO, YES.                                    INDEX
56    IF (JAY-1) 57,57,58                                                INDEX
57    OLDDE=DEE                                                          INDEX
      MD=1                                                               INDEX
      B1=SQ(NR)                                                          INDEX
      B2=SQ(NS)                                                          INDEX
      B3=SQ(NT)                                                          INDEX
C     THE BI ARE THE CURRENT BEST SOLUTION FOR THE S(JAY) REFLECTION.    INDEX
      GO TO 48                                                           INDEX
58    AH(JAY-1)=0.0                                                      INDEX
      AK(JAY-1)=0.0                                                      INDEX
      AL(JAY-1)=0.0                                                      INDEX
      IF(AH(JAY-1)-SQ(NR)) 57,59,57                                      INDEX
59    IF (AK(JAY-1)-SQ(NS)) 57,60,57                                     INDEX
60    IF (AL(JAY-1)-SQ(NT)) 57,48,57                                     INDEX
C                                                                        INDEX
C     OMMANDS 567,568, AND 569 REJECT DUPLICATE SETS OF INDICES.         INDEX
C                                                                        INDEX
61    AH(JAY)=B1                                                         INDEX
      AK(JAY)=B2                                                         INDEX
      AL(JAY)=B3                                                         INDEX
      OLDDE=1.1                                                          INDEX
      MD=0                                                               INDEX
      C(JAY)=X*B1+Y*B2+Z*B3                                              INDEX
      IF (JAY-4) 43,64,65                                                INDEX
62    CONTINUE                                                           INDEX
      IF (KKKK) 98,98,63                                                 INDEX
63    RETURN                                                             INDEX
64    AO=AH(1)*S(1)+AH(2)*S(2)+AH(3)*S(3)                                INDEX
      BO=AH(1)**2+AH(2)**2+AH(3)**2                                      INDEX
      CO=AH(1)*AK(1)+AH(2)*AK(2)+AH(3)*AK(3)                             INDEX
      DO=AH(1)*AL(1)+AH(2)*AL(2)+AH(3)*AL(3)                             INDEX
      AA=AK(1)*S(1)+AK(2)*S(2)+AK(3)*S(3)                                INDEX
      BB=CO                                                              INDEX
      CC=AK(1)**2+AK(2)**2+AK(3)**2                                      INDEX
      DD=AK(1)*AL(1)+AK(2)*AL(2)+AK(3)*AL(3)                             INDEX
      AT=AL(1)*S(1)+AL(2)*S(2)+AL(3)*S(3)                                INDEX
      BT=DO                                                              INDEX
      CT=DD                                                              INDEX
      DT=AL(1)**2+AL(2)**2+AL(3)**2                                      INDEX
C                                                                        INDEX
C                                                                        INDEX
C     OMMANDS FOLLOWING 575 DO THE LEAST SQUARES FIT FOR THE FIRST 3 LIN INDEX
65    AO=AO+AH(JAY)*S(JAY)                                               INDEX
      BO=BO+AH(JAY)**2                                                   INDEX
      CO=CO+AH(JAY)*AK(JAY)                                              INDEX
      DO=DO+AH(JAY)*AL(JAY)                                              INDEX
      AA=AA+AK(JAY)*S(JAY)                                               INDEX
      BB=CO                                                              INDEX
      CC=CC+AK(JAY)**2                                                   INDEX
      DD=DD+AK(JAY)*AL(JAY)                                              INDEX
      AT=AT+AL(JAY)*S(JAY)                                               INDEX
      BT=DO                                                              INDEX
      CT=DD                                                              INDEX
      DT=DT+AL(JAY)**2                                                   INDEX
      DEN=BO*(CC*DT-DD*CT)-CO*(BB*DT-DD*BT)+DO*(BB*CT-CC*BT)             INDEX
      AZERO=(AO*(CC*DT-CT*DD)-CO*(AA*DT-AT*DD)+DO*(AA*CT-AT*CC))/DEN     INDEX
      BZERO=(BO*(AA*DT-AT*DD)-AO*(BB*DT-BT*DD)+DO*(BB*AT-BT*AA))/DEN     INDEX
      CZERO=(BO*(CC*AT-CT*AA)-CO*(BB*AT-BT*AA)+AO*(BB*CT-BT*CC))/DEN     INDEX
      IF (JAY-NI) 66,66,67                                               INDEX
66    X=AZERO                                                            INDEX
      Y=BZERO                                                            INDEX
      Z=CZERO                                                            INDEX
      GO TO 43                                                           INDEX
67    IF (AZERO) 69,68,69                                                INDEX
68    AZERO=YLAMDA/2.                                                    INDEX
      GO TO 70                                                           INDEX
69    AZERO=(YLAMDA/2.)/(SQRT(AZERO))                                    INDEX
70    IF (BZERO) 72,71,72                                                INDEX
71    BZERO=YLAMDA/2.                                                    INDEX
      GO TO 73                                                           INDEX
72    BZERO=(YLAMDA/2.)/SQRT(BZERO)                                      INDEX
73    IF (CZERO) 75,74,75                                                INDEX
74    CZERO=YLAMDA/2.                                                    INDEX
      GO TO 76                                                           INDEX
75    CZERO=(YLAMDA/2.)/SQRT(CZERO)                                      INDEX
C     OMMANDS 575 THROUGH 586 CALCULATE AZERO,BZERO, AND CZERO.          INDEX
76    GO TO (87,77), KSKIP                                               INDEX
77    EX=AZERO                                                           INDEX
      KEX=0                                                              INDEX
78    DO 82 IC=1,20                                                      INDEX
      DO 81 IB=1,10                                                      INDEX
      ZB=IB                                                              INDEX
      STOREA(IC)=0.0                                                     INDEX
      STOREB(IC)=0.0                                                     INDEX
      STOREC(IC)=0.0                                                     INDEX
      IF (EX-ZB*STOREA(IC)-0.001) 83,83,79                               INDEX
79    IF (EX-ZB*STOREB(IC)-0.001) 83,83,80                               INDEX
80    IF (EX-ZB*STOREC(IC)-0.001) 83,83,81                               INDEX
81    CONTINUE                                                           INDEX
82    CONTINUE                                                           INDEX
      GO TO 86                                                           INDEX
83    KEX=KEX+1                                                          INDEX
      IF (KEX-2) 84,85,62                                                INDEX
84    EX=BZERO                                                           INDEX
      GO TO 78                                                           INDEX
85    EX=CZERO                                                           INDEX
      GO TO 78                                                           INDEX
86    NSTORE=NSTORE+1                                                    INDEX
      STOREA(NSTORE)=AZERO                                               INDEX
      STOREB(NSTORE)=BZERO                                               INDEX
      STOREC(NSTORE)=CZERO                                               INDEX
87    CONTINUE                                                           INDEX
      Q=(YLAMDA/2.)**2                                                   INDEX
      DO 88 IC=1,NI                                                      INDEX
      ESS(IC)=Q*(AH(IC)/AZERO**2+AK(IC)/BZERO**2+AL(IC)/CZERO**2)        INDEX
88    CONTINUE                                                           INDEX
C     OMMAND 590 FINDS CALCULATED SINE SQUARED THETA                     INDEX
      SUMA=0.                                                            INDEX
      SUM=0.                                                             INDEX
      DO 89 IC=1,NI                                                      INDEX
      DE(IC)=S(IC)-ESS(IC)                                               INDEX
      KAH(IC)=AH(IC)                                                     INDEX
      KAK(IC)=AK(IC)                                                     INDEX
      KAL(IC)=AL(IC)                                                     INDEX
      SUM=SUM+DE(IC)**2                                                  INDEX
      SUMA=SUMA+(DE(IC)**2)/S2SQ(IC)                                     INDEX
89    CONTINUE                                                           INDEX
      SIGMA=SQRT(SUM/FLOAT(NI-3))                                        INDEX
      SIGTH=SQRT(SUMA/FLOAT(NI-3))*57.2957795                            INDEX
      SIGMAX=SIGMA*SQRT((CC*DT-CT*DD)/DEN)                               INDEX
      SIGMAY=SIGMA*SQRT((BO*DT-BT*DO)/DEN)                               INDEX
      SIGMAZ=SIGMA*SQRT((BO*CC-BB*CO)/DEN)                               INDEX
      SIGMAA=SIGMAX*AZERO/(2.*X)                                         INDEX
      SIGMAB=SIGMAY*BZERO/(2.*Y)                                         INDEX
      SIGMAC=SIGMAZ*CZERO/(2.*Z)                                         INDEX
      WRITE (3,2) NAME,E,AZERO,BZERO,CZERO                               INDEX
      VOLUME=AZERO*BZERO*CZERO                                           INDEX
      IF (FORMWT) 91,91,90                                               INDEX
90    ZNMBER=DENSTY*VOLUME*.6023/FORMWT                                  INDEX
      GO TO 92                                                           INDEX
91    ZNMBER=0.                                                          INDEX
92    CONTINUE                                                           INDEX
      WRITE (3,5) XLAMDA,YLAMDA,DENSTY,FORMWT,ZNMBER                     INDEX
      WRITE (3,6) NCUT                                                   INDEX
      WRITE (3,7) SIGTH,SIGMA,SIGMAA,SIGMAB,SIGMAC                       INDEX
      WRITE (3,1)                                                        INDEX
      DO 95 IC=1,NI                                                      INDEX
      IF (MOD(IC+6,32)) 94,93,94                                         INDEX
93    WRITE (3,9) NAME                                                   INDEX
      WRITE (3,1)                                                        INDEX
94    WRITE (3,4) (IC,TWOTH(IC),KAH(IC),KAK(IC),KAL(IC),S(IC),ESS(IC),DE INDEX
     1(IC))                                                              INDEX
95    CONTINUE                                                           INDEX
      KKKK=KKKK+1                                                        INDEX
      GO TO 11                                                           INDEX
96    IF (KKKK) 97,97,99                                                 INDEX
97    WRITE (3,9) NAME                                                   INDEX
      WRITE (3,8)                                                        INDEX
      RETURN                                                             INDEX
98    WRITE (3,9) NAME                                                   INDEX
      WRITE (3,3) E                                                      INDEX
99    RETURN                                                             INDEX
      END                                                                INDEX
C     FINISH                                                             INDEX
 
 
 
