      PROGRAM ORDRIFL
C-----Compiled by PROFORT
C***********************************************************************
C*                       Program ORDRIFL                               *
C*                      by Mario Nardelli                              *
C*    Given an input file containing the reflections in the form:      *
C*               h k l   Fo   sigma(Fo)   (3I4,2F8.2)                  *
C* where Fo is the structure factor or the corrected intensity, on     *
C* request, the program checks for the Laue Class listing the couples  *
C* of equivalent reflections, with the sum of the structure factor     *
C* differences for each couple. Then collects the reflections in groups*
C* (h00, 0k0, 00l, 0kl, h0l, hk0, hkl) to make easier the analysis of  *
C* the systematic absences and gives, for each group, the sums of the  *
C* structure factors with the corresponding percentages and the numbers*
C* of reflections.                                                     *
C*    The program asks, interactively, the names of the input and      *
C* output files and the name of the compound. It asks also whether all *
C* data or only those with I>n*sigma(I) have to be considered, or if   *
C* only those of a spherical shell defined in terms of sin(theta)/     *
C* lambda and, in this case, it asks for the lattice constants and the *
C* limits of the sin(theta)/lambda shell.                              *
C*    On request, the lists of reflections compared for the Laue Class *
C* and those of the groups can be printed in the output, for ispection.*
C*    The maximum number of reflections is 10000 and if it is greater  *
C* than this value the analysis is carried out on the first 10000.     *
C*    It is important that the input file is closed by a  0 0 0        *
C* reflection.                                                         *
C***********************************************************************
      CHARACTER*1 TIT(80),QS
      CHARACTER*14 FILIN,FILOU
      CHARACTER*5 IT
      INTEGER HKL(3),NF(8),NF1(50),H(10000,3)
      DIMENSION ST(30),SDT(30),ST1(30),SDT1(30),FI(10000),SFI(10000),
     1 GR(6)
      COMMON/IOU/IN,IO
     1      /GRP1/C(3),A(3)
     2      /LAU/H,FI,SFI
     3      /GRP2/KKK
      IN=8
      IO=9
      CALL INOU
      WRITE(*,100)
100   FORMAT(' If you want to consider the reflections with ',
     1 'I>n*sigma(I)'/' key in the value of n (can be 0 or decimal)'/
     2 ' ?>')
      READ(*,*)AN
      WRITE(*,101)
101   FORMAT(' If you want to consider all the sphere of data, key in',
     1 ' 0'/' If only a spherical shell of sin(theta)/lambda has to ',
     2 'be considered, key in 1'/' ?>')
      READ(*,*)KK
      IF(KK.EQ.1)THEN
      WRITE(*,102)
102   FORMAT(' Key in the lattice constants: a,b,c,alpha,beta,',
     1 'gamma'/' ?>')
      READ(*,*)C,A
      CALL METEN(GR)
      WRITE(*,103)
103   FORMAT(' Key in the minimum and maximum values of sin(theta)/',
     1 'lambda'/' which define the spherical shell you want to ',
     2 'consider'/'?>')
      READ(*,*)SMIN,SMAX
      ENDIF
      KKK=0
      WRITE(*,117)
117   FORMAT(' Do you want the list of the reflections compared for ',
     1 'the Laue Class printed?'/' (Y/N), ?>')
      READ(*,'(A1)')QS
      IF(QS.EQ.'Y'.OR.QS.EQ.'y')KKK=1
      KK1=0
      WRITE(*,118)
118   FORMAT(' Do you want the list of the reflections of each group',
     1 ' printed? (Y/N)'/' ?>')
      READ(*,'(A1)')QS
      IF(QS.EQ.'Y'.OR.QS.EQ.'y')KK1=1
      DO 21 I=1,7
21    NF(I)=0
      NT=0
      DO 20 KD=10,16
      OPEN(UNIT=KD,FORM='FORMATTED',STATUS='SCRATCH')
20    REWIND(UNIT=KD)
1     READ(IN,104)HKL,F,SF
104   FORMAT(3I4,2F8.2)
      F=ABS(F)
      IF(HKL(1).EQ.0.AND.HKL(2).EQ.0.AND.HKL(3).EQ.0)GO TO 1000
      IF(F.LT.(AN*SF))GO TO 1
      IF(KK.EQ.0)GO TO 61
      CALL SNTL(HKL,GR,RQ)
      IF(RQ.LT.SMIN.OR.RQ.GT.SMAX)GO TO 1
61    NT=NT+1
      IF(NT.LE.10000)GO TO 62
      WRITE(IO,105)
105   FORMAT(/' The number of reflections is greater than 10000'/
     1 ' Only the first 10000 will be considered'/)
      NT=10000
      GO TO 1000
62    DO 40 I=1,3
40    H(NT,I)=HKL(I)
      FI(NT)=F
      SFI(NT)=SF
      IF(HKL(1).NE.0.AND.HKL(2).NE.0.AND.HKL(3).NE.0)THEN
      KD=16
      NF(7)=NF(7)+1
      GO TO 500
      ENDIF
      IF(HKL(1).EQ.0.AND.HKL(2).NE.0.AND.HKL(3).NE.0)THEN
      KD=13
      NF(4)=NF(4)+1
      GO TO 500
      ENDIF
      IF(HKL(1).NE.0.AND.HKL(2).EQ.0.AND.HKL(3).NE.0)THEN
      KD=14
      NF(5)=NF(5)+1
      GO TO 500
      ENDIF
      IF(HKL(1).NE.0.AND.HKL(2).NE.0.AND.HKL(3).EQ.0)THEN
      KD=15
      NF(6)=NF(6)+1
      GO TO 500
      ENDIF
      IF(HKL(1).NE.0.AND.HKL(2).EQ.0.AND.HKL(3).EQ.0)THEN
      KD=10
      NF(1)=NF(1)+1
      GO TO 500
      ENDIF
      IF(HKL(1).EQ.0.AND.HKL(2).NE.0.AND.HKL(3).EQ.0)THEN
      KD=11
      NF(2)=NF(2)+1
      GO TO 500
      ENDIF
      KD=12
      NF(3)=NF(3)+1
500   NF(8)=NF(8)+1
      WRITE(KD,104)HKL,F,SF
      GO TO 1
1000  DO 17 I=1,3
17    HKL(I)=0
      F=0.0
      SF=0.0
      DO 16 KD=10,16
16    WRITE(KD,104)HKL,F,SF
      DO 18 KD=10,16
18    REWIND(UNIT=KD)
C-----Check for the Laue class
      WRITE(*,106)
106   FORMAT(' Do you want to check for the Laue Class?'/
     1 ' If NO key in 0'/' If YES key in the number ',
     2 'corresponding to the Class of the following list:'//
     3 26X,'2/m  :   1'/26X,'mmm  :   2'/26X,'4/m  :   3'/
     4 26X,'4/mmm:   4'/26X,'-3   :   5'/26X,'-3m  :   6'/
     5 26X,'6/m  :   7'/26X,'6/mmm:   8'/26X,'m-3  :   9'/
     6 26X,'m-3m :  10'/)
      READ(*,*)NC
      IF(NC.EQ.0)GO TO 41
      SD1=0
      SD2=0
      NCP=0
      NFT=0
      SFTOT=0.0
      GO TO(42,43,44,45,46,47,48,49,50,51),NC
C-----Laue class 2/m
42    CALL SUB42(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class mmm
43    CALL SUB43(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class 4/m
44    CALL SUB44(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class 4/mmm
45    CALL SUB45(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class -3
46    CALL SUB46(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class -3m
47    CALL SUB47(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class 6/m
48    CALL SUB48(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class 6/mmm
49    CALL SUB49(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class m-3
50    CALL SUB50(NT,SD1,SD2,NCP,NFT,SFTOT)
      GO TO 99
C-----Laue class m-3m
51    CALL SUB51(NT,SD1,SD2,NCP,NFT,SFTOT)
      CALL SUB52(NT,SD1,SD2,NCP,NFT,SFTOT)
99    CONTINUE
      AVD1=SD1/NCP
      AVD2=SD2/NCP
      WRITE(IO,107)SD1,SD2,NCP,AVD1,AVD2
107   FORMAT(' The sum of the differences of intensities of',
     1 ' equivalent reflections is:'/F12.2,'(',F12.2,')  for',I12,
     2 ' couples of reflections.'/' The average difference is: ',
     3 F12.2,'(',F12.2,')')
41    CONTINUE
      DO 15 KD=10,16
      DO 37 I=1,30
      ST(I)=0.0
      SDT(I)=0.0
      ST1(I)=0.0
      SDT1(I)=0.0
      NF1(I)=0
37    NF1(I+20)=0
      IF(KD.EQ.10)IT='h 0 0'
      IF(KD.EQ.11)IT='0 k 0'
      IF(KD.EQ.12)IT='0 0 l'
      IF(KD.EQ.13)IT='0 k l'
      IF(KD.EQ.14)IT='h 0 l'
      IF(KD.EQ.15)IT='h k 0'
      IF(KD.EQ.16)IT='h k l'
      WRITE(IO,'(/14X,A5)')IT
19    READ(KD,104)HKL,F,SF
      IF(HKL(1).EQ.0.AND.HKL(2).EQ.0.AND.HKL(3).EQ.0)GO TO 29
      IF(KK1.EQ.1)WRITE(IO,'(3I4,F10.2,F8.2)')HKL,F,SF
      GO TO (22,23,24,25,26,27,28),(KD-9)
C==== h 0 0 reflections
C---- h=2n
22    IF(MOD(HKL(1),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- h=3n
      IF(MOD(HKL(1),3).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- h=4n
      IF(MOD(HKL(1),4).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- none
      ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      GO TO 19
C==== 0 k 0 reflections
C---- k=2n
23    IF(MOD(HKL(2),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- k=3n
      IF(MOD(HKL(2),3).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- k=4n
      IF(MOD(HKL(2),4).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- none
      ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      GO TO 19
C==== 0 0 l reflections
C---- l=2n
24    IF(MOD(HKL(3),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- l=4n
      IF(MOD(HKL(3),4).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- l=3n
      IF(MOD(HKL(3),3).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- l=6n
      IF(MOD(HKL(3),6).EQ.0)THEN
      ST(4)=ST(4)+F
      SDT(4)=SDT(4)+SF
      NF1(7)=NF1(7)+1
      ELSE
      ST1(4)=ST1(4)+F
      SDT1(4)=SDT1(4)+SF
      NF1(8)=NF1(8)+1
      ENDIF
C---- none
      ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      GO TO 19
C==== 0 k l reflections
C---- k=2n
25    IF(MOD(HKL(2),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- l=2n
      IF(MOD(HKL(3),2).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- k+l=2n
      IF(MOD((HKL(2)+HKL(3)),2).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- k+l=4n & k=2n & l=2n
      IF(MOD((HKL(2)+HKL(3)),4).EQ.0.AND.MOD(HKL(2),2).EQ.0.AND.
     1 MOD(HKL(3),2).EQ.0)THEN
      ST(4)=ST(4)+F
      SDT(4)=SDT(4)+SF
      NF1(7)=NF1(7)+1
      ELSE
      ST1(4)=ST1(4)+F
      SDT1(4)=SDT1(4)+SF
      NF1(8)=NF1(8)+1
      ENDIF
C---- k+l=3n
      IF(MOD((HKL(2)+HKL(3)),3).EQ.0)THEN
      ST(5)=ST(5)+F
      SDT(5)=SDT(5)+SF
      NF1(9)=NF1(9)+1
      ELSE
      ST1(5)=ST1(5)+F
      SDT1(5)=SDT1(5)+SF
      NF1(10)=NF1(10)+1
      ENDIF
C---- -k+l=3n
      IF(MOD((-HKL(2)+HKL(3)),3).EQ.0)THEN
      ST(6)=ST(6)+F
      SDT(6)=SDT(6)+SF
      NF1(11)=NF1(11)+1
      ELSE
      ST1(6)=ST1(6)+F
      SDT1(6)=SDT1(6)+SF
      NF1(12)=NF1(12)+1
      ENDIF
C---- k=2n & l=2n
      IF(MOD(HKL(2),2).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(7)=ST(7)+F
      SDT(7)=SDT(7)+SF
      NF1(13)=NF1(13)+1
      ELSE
      ST1(7)=ST1(7)+F
      SDT1(7)=SDT1(7)+SF
      NF1(14)=NF1(14)+1
      ENDIF
C---- none
      ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      GO TO 19
C==== h 0 l reflections
C---- h=2n
26    IF(MOD(HKL(1),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- l=2n
      IF(MOD(HKL(3),2).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- h+l=2n
      IF(MOD((HKL(1)+HKL(3)),2).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- h+l=4n & h=2n & l=2n
      IF(MOD((HKL(1)+HKL(3)),4).EQ.0.AND.MOD(HKL(1),2).EQ.0.AND.
     1 MOD(HKL(3),2).EQ.0)THEN
      ST(4)=ST(4)+F
      SDT(4)=SDT(4)+SF
      NF1(7)=NF1(7)+1
      ELSE
      ST1(4)=ST1(4)+F
      SDT1(4)=SDT1(4)+SF
      NF1(8)=NF1(8)+1
      ENDIF
C---- -h+l=3n
      IF(MOD((-HKL(1)+HKL(3)),3).EQ.0)THEN
      ST(5)=ST(5)+F
      SDT(5)=SDT(5)+SF
      NF1(9)=NF1(9)+1
      ELSE
      ST1(5)=ST1(5)+F
      SDT1(5)=SDT1(5)+SF
      NF1(10)=NF1(10)+1
      ENDIF
C---- h+l=3n
      IF(MOD((HKL(1)+HKL(3)),3).EQ.0)THEN
      ST(6)=ST(6)+F
      SDT(6)=SDT(6)+SF
      NF1(11)=NF1(11)+1
      ELSE
      ST1(6)=ST1(6)+F
      SDT1(6)=SDT1(6)+SF
      NF1(12)=NF1(12)+1
      ENDIF
C---- h=2n & l=2n
      IF(MOD(HKL(1),2).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(7)=ST(7)+F
      SDT(7)=SDT(7)+SF
      NF1(13)=NF1(13)+1
      ELSE
      ST1(7)=ST1(7)+F
      SDT1(7)=SDT1(7)+SF
      NF1(14)=NF1(14)+1
      ENDIF
C---- none
      ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      GO TO 19
C==== h k 0 reflections
C---- h=2n
27    IF(MOD(HKL(1),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- k=2n
      IF(MOD(HKL(2),2).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- h+k=2n
      IF(MOD((HKL(1)+HKL(2)),2).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- h+k=4n & h=2n & k=2n
      IF(MOD((HKL(1)+HKL(2)),4).EQ.0.AND.MOD(HKL(1),2).EQ.0.AND.
     1 MOD(HKL(2),2).EQ.0)THEN
      ST(4)=ST(4)+F
      SDT(4)=SDT(4)+SF
      NF1(7)=NF1(7)+1
      ELSE
      ST1(4)=ST1(4)+F
      SDT1(4)=SDT1(4)+SF
      NF1(8)=NF1(8)+1
      ENDIF
C---- h-k=3n
      IF(MOD((HKL(1)-HKL(2)),3).EQ.0)THEN
      ST(5)=ST(5)+F
      SDT(5)=SDT(5)+SF
      NF1(9)=NF1(9)+1
      ELSE
      ST1(5)=ST1(5)+F
      SDT1(5)=SDT1(5)+SF
      NF1(10)=NF1(10)+1
      ENDIF
C---- h=2n & k=2n
      IF(MOD(HKL(1),2).EQ.0.AND.MOD(HKL(2),2).EQ.0)THEN
      ST(7)=ST(7)+F
      SDT(7)=SDT(7)+SF
      NF1(13)=NF1(13)+1
      ELSE
      ST1(7)=ST1(7)+F
      SDT1(7)=SDT1(7)+SF
      NF1(14)=NF1(14)+1
      ENDIF
C==== h h 0 reflections
      IF(HKL(1).NE.HKL(2))GO TO 2
C---- h=2n
      IF(MOD(HKL(1),2).EQ.0)THEN
      ST(6)=ST(6)+F
      SDT(6)=SDT(6)+SF
      NF1(11)=NF1(11)+1
      ELSE
      ST1(6)=ST1(6)+F
      SDT1(6)=SDT1(6)+SF
      NF1(12)=NF1(12)+1
      ENDIF
C---- none
2     ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      GO TO 19
C==== h k l reflections
C---- h+k=2n
28    IF(MOD((HKL(1)+HKL(2)),2).EQ.0)THEN
      ST(1)=ST(1)+F
      SDT(1)=SDT(1)+SF
      NF1(1)=NF1(1)+1
      ELSE
      ST1(1)=ST1(1)+F
      SDT1(1)=SDT1(1)+SF
      NF1(2)=NF1(2)+1
      ENDIF
C---- h+l=2n
      IF(MOD((HKL(1)+HKL(3)),2).EQ.0)THEN
      ST(2)=ST(2)+F
      SDT(2)=SDT(2)+SF
      NF1(3)=NF1(3)+1
      ELSE
      ST1(2)=ST1(2)+F
      SDT1(2)=SDT1(2)+SF
      NF1(4)=NF1(4)+1
      ENDIF
C---- k+l=2n
      IF(MOD((HKL(2)+HKL(3)),2).EQ.0)THEN
      ST(3)=ST(3)+F
      SDT(3)=SDT(3)+SF
      NF1(5)=NF1(5)+1
      ELSE
      ST1(3)=ST1(3)+F
      SDT1(3)=SDT1(3)+SF
      NF1(6)=NF1(6)+1
      ENDIF
C---- h+k+l=2n
      IF(MOD((HKL(1)+HKL(2)+HKL(3)),2).EQ.0)THEN
      ST(4)=ST(4)+F
      SDT(4)=SDT(4)+SF
      NF1(7)=NF1(7)+1
      ELSE
      ST1(4)=ST1(4)+F
      SDT1(4)=SDT1(4)+SF
      NF1(8)=NF1(8)+1
      ENDIF
C---- -h+k+l=3n
      IF(MOD((-HKL(1)+HKL(2)+HKL(3)),3).EQ.0)THEN
      ST(5)=ST(5)+F
      SDT(5)=SDT(5)+SF
      NF1(9)=NF1(9)+1
      ELSE
      ST1(5)=ST1(5)+F
      SDT1(5)=SDT1(5)+SF
      NF1(10)=NF1(10)+1
      ENDIF
C---- h-k+l=3n
      IF(MOD((HKL(1)-HKL(2)+HKL(3)),3).EQ.0)THEN
      ST(6)=ST(6)+F
      SDT(6)=SDT(6)+SF
      NF1(11)=NF1(11)+1
      ELSE
      ST1(6)=ST1(6)+F
      SDT1(6)=SDT1(6)+SF
      NF1(12)=NF1(12)+1
      ENDIF
C---- h-k=3n
      IF(MOD((HKL(1)-HKL(2)),3).EQ.0)THEN
      ST(19)=ST(19)+F
      SDT(19)=SDT(19)+SF
      NF1(35)=NF1(35)+1
      ELSE
      ST1(19)=ST1(19)+F
      SDT1(19)=SDT1(19)+SF
      NF1(36)=NF1(36)+1
      ENDIF
C---- h+k=2n, k+l=2n
      IF(MOD((HKL(1)+HKL(2)),2).EQ.0.AND.MOD((HKL(2)+HKL(3)),2)
     1 .EQ.0)THEN
      ST(20)=ST(20)+F
      SDT(20)=SDT(20)+SF
      NF1(37)=NF1(37)+1
      ELSE
      ST1(20)=ST1(20)+F
      SDT1(20)=SDT1(20)+SF
      NF1(38)=NF1(38)+1
      ENDIF
C---- h+k=2n, k+l=2n, h+l=2n
      IF(MOD((HKL(1)+HKL(2)),2).EQ.0.AND.MOD((HKL(2)+HKL(3)),2)
     1 .EQ.0.AND.MOD((HKL(1)+HKL(3)),2).EQ.0)THEN
      ST(21)=ST(21)+F
      SDT(21)=SDT(21)+SF
      NF1(39)=NF1(39)+1
      ELSE
      ST1(21)=ST1(21)+F
      SDT1(21)=SDT1(21)+SF
      NF1(40)=NF1(40)+1
      ENDIF
C==== h h l reflections
      IF(HKL(1).NE.HKL(2))GO TO 38
C---- l=2n
      IF(MOD(HKL(3),2).EQ.0)THEN
      ST(7)=ST(7)+F
      SDT(7)=SDT(7)+SF
      NF1(13)=NF1(13)+1
      ELSE
      ST1(7)=ST1(7)+F
      SDT1(7)=SDT1(7)+SF
      NF1(14)=NF1(14)+1
      ENDIF
C---- h+l=2n
      IF(MOD((HKL(1)+HKL(3)),2).EQ.0)THEN
      ST(8)=ST(8)+F
      SDT(8)=SDT(8)+SF
      NF1(15)=NF1(15)+1
      ELSE
      ST1(8)=ST1(8)+F
      SDT1(8)=SDT1(8)+SF
      NF1(16)=NF1(16)+1
      ENDIF
C---- 2h+l=4n & l=2n
      IF(MOD((2*HKL(1)+HKL(3)),4).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(9)=ST(9)+F
      SDT(9)=SDT(9)+SF
      NF1(17)=NF1(17)+1
      ELSE
      ST1(9)=ST1(9)+F
      SDT1(9)=SDT1(9)+SF
      NF1(18)=NF1(18)+1
      ENDIF
C---- h=2n, l=2n
      IF(MOD(HKL(1),2).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(15)=ST(15)+F
      SDT(15)=SDT(15)+SF
      NF1(27)=NF1(27)+1
      ELSE
      ST1(15)=ST1(15)+F
      SDT1(15)=SDT1(15)+SF
      NF1(28)=NF1(28)+1
      ENDIF
C---- l=3n
      IF(MOD(HKL(3),3).EQ.0)THEN
      ST(16)=ST(16)+F
      SDT(16)=SDT(16)+SF
      NF1(29)=NF1(29)+1
      ELSE
      ST1(16)=ST1(16)+F
      SDT1(16)=SDT1(16)+SF
      NF1(30)=NF1(30)+1
      ENDIF
C---- h=2n
      IF(MOD(HKL(1),2).EQ.0)THEN
      ST(22)=ST(22)+F
      SDT(22)=SDT(22)+SF
      NF1(41)=NF1(41)+1
      ELSE
      ST1(22)=ST1(22)+F
      SDT1(22)=SDT1(22)+SF
      NF1(42)=NF1(42)+1
      ENDIF
C==== h h h reflections
      IF(HKL(1).NE.HKL(3))GO TO 38
C---- h=2n
      IF(MOD(HKL(1),2).EQ.0)THEN
      ST(14)=ST(14)+F
      SDT(14)=SDT(14)+SF
      NF1(25)=NF1(25)+1
      ELSE
      ST1(14)=ST1(14)+F
      SDT1(14)=SDT1(14)+SF
      NF1(26)=NF1(26)+1
      ENDIF
C==== h -h l
38    IF(HKL(1).NE.-HKL(2))GO TO 39
C---- l=2n
      IF(MOD(HKL(3),2).EQ.0)THEN
      ST(10)=ST(10)+F
      SDT(10)=SDT(10)+SF
      NF1(19)=NF1(19)+1
      ELSE
      ST1(10)=ST1(10)+F
      SDT1(10)=SDT1(10)+SF
      NF1(20)=NF1(20)+1
      ENDIF
C---- h+l=3n
      IF(MOD((HKL(1)+HKL(3)),3).EQ.0)THEN
      ST(11)=ST(11)+F
      SDT(11)=SDT(11)+SF
      NF1(21)=NF1(21)+1
      ELSE
      ST1(11)=ST1(11)+F
      SDT1(11)=SDT1(11)+SF
      NF1(22)=NF1(22)+1
      ENDIF
C---- -h+l=3n
      IF(MOD((-HKL(1)+HKL(3)),3).EQ.0)THEN
      ST(12)=ST(12)+F
      SDT(12)=SDT(12)+SF
      NF1(23)=NF1(23)+1
      ELSE
      ST1(12)=ST1(12)+F
      SDT1(12)=SDT1(12)+SF
      NF1(24)=NF1(24)+1
      ENDIF
C---- h+l=3n & l=2n
      IF(MOD((HKL(1)+HKL(3)),3).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(17)=ST(17)+F
      SDT(17)=SDT(17)+SF
      NF1(31)=NF1(31)+1
      ELSE
      ST1(17)=ST1(17)+F
      SDT1(17)=SDT1(17)+SF
      NF1(32)=NF1(32)+1
      ENDIF
C---- -h+l=3n & l=2n
      IF(MOD((-HKL(1)+HKL(3)),3).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(18)=ST(18)+F
      SDT(18)=SDT(18)+SF
      NF1(33)=NF1(33)+1
      ELSE
      ST1(18)=ST1(18)+F
      SDT1(18)=SDT1(18)+SF
      NF1(34)=NF1(34)+1
      ENDIF
C---- h=3n
      IF(MOD(HKL(1),3).EQ.0)THEN
      ST(23)=ST(23)+F
      SDT(23)=SDT(23)+SF
      NF1(43)=NF1(43)+1
      ELSE
      ST1(23)=ST1(23)+F
      SDT1(23)=SDT1(23)+SF
      NF1(44)=NF1(44)+1
      ENDIF
C---- h=3n, l=2n
      IF(MOD(HKL(1),3).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(24)=ST(24)+F
      SDT(24)=SDT(24)+SF
      NF1(45)=NF1(45)+1
      ELSE
      ST1(24)=ST1(24)+F
      SDT1(24)=SDT1(24)+SF
      NF1(46)=NF1(46)+1
      ENDIF
C---- 2h+l=3n
      IF(MOD((2*HKL(1)+HKL(3)),3).EQ.0)THEN
      ST(25)=ST(25)+F
      SDT(25)=SDT(25)+SF
      NF1(47)=NF1(47)+1
      ELSE
      ST1(25)=ST1(25)+F
      SDT1(25)=SDT1(25)+SF
      NF1(48)=NF1(48)+1
      ENDIF
C---- 2h+l=3n, l=2n
      IF(MOD((2*HKL(1)+HKL(3)),3).EQ.0.AND.MOD(HKL(3),2).EQ.0)THEN
      ST(26)=ST(26)+F
      SDT(26)=SDT(26)+SF
      NF1(49)=NF1(49)+1
      ELSE
      ST1(26)=ST1(26)+F
      SDT1(26)=SDT1(26)+SF
      NF1(50)=NF1(50)+1
      ENDIF
C---- none
39    ST(13)=ST(13)+F
      SDT(13)=SDT(13)+SF
      GO TO 19
29    GO TO (30,31,32,33,34,35,36),(KD-9)
C-----h 0 0 reflections
30    IF(ST(9).LT.1E-5)ST(9)=1
      SSS=100/ST(9)
      PC1=ST(1)*SSS
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=100
      WRITE(IO,108)IT,NF(1)
108   FORMAT(/'Total number of reflections of ',A5,' type:',I10//
     1 'Condition ',9X,'Intensity sum',6X,'e.s.d. Sum',7X,'%',5X,
     2 'N.reflections')
      WRITE(IO,109)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(9),SDT(9),PC7,NF(1)
109   FORMAT('h=2n',12X,2F15.2,F12.2,4X,I6/'h<>2n',11X,2F15.2,F12.2,
     1 4X,I6/'h=3n',12X,2F15.2,F12.2,4X,I6/'h<>3n',11X,2F15.2,F12.2,4X,
     2 I6/'h=4n',12X,2F15.2,F12.2,4X,I6/'h<>4n',11X,2F15.2,F12.2,4X,I6/
     3 'none',12X,2F15.2,F12.2,4X,I6)
      GO TO 15
C-----0 k 0 reflections
31    IF(ST(9).LT.1E-5)ST(9)=1
      SSS=100/ST(9)
      PC1=ST(1)*SSS
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=100
      WRITE(IO,108)IT,NF(2)
      WRITE(IO,110)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(9),SDT(9),PC7,NF(2)
110   FORMAT('k=2n',12X,2F15.2,F12.2,4X,I6/'k<>2n',11X,2F15.2,F12.2,4X,
     1 I6/'k=3n',12X,2F15.2,F12.2,4X,I6/'k<>3n',11X,2F15.2,F12.2,4X,I6/
     2 'k=4n',12X,2F15.2,F12.2,4X,I6/'k<>4n',11X,2F15.2,F12.2,4X,I6/
     3 'none',12X,2F15.2,F12.2,4X,I6)
      GO TO 15
C-----0 0 l reflections
32    IF(ST(9).LT.1E-5)ST(9)=1
      SSS=100/ST(9)
      PC1=ST(1)*SSS                                                                                                                     31    PC1=ST(1)/ST(9)*100
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=ST(4)*SSS
      PC8=ST1(4)*SSS
      PC9=100
      WRITE(IO,108)IT,NF(3)
      WRITE(IO,111)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(4),SDT(4),PC7,NF1(7),
     3 ST1(4),SDT1(4),PC8,NF1(8),ST(9),SDT(9),PC9,NF(3)
111   FORMAT('l=2n',12X,2F15.2,F12.2,4X,I6/'l<>2n',11X,2F15.2,F12.2,4X,
     1 I6/'l=4n',12X,2F15.2,F12.2,4X,I6/'l<>4n',11X,2F15.2,F12.2,4X,I6/
     2 'l=3n',12X,2F15.2,F12.2,4X,I6/'l<>3n',11X,2F15.2,F12.2,4X,I6/
     3 'l=6n',12X,2F15.2,F12.2,4X,I6/'l<>6n',11X,2F15.2,F12.2,4X,I6/
     4 'none',12X,2F15.2,F12.2,4X,I6)
      GO TO 15
C-----0 k l reflections
33    IF(ST(9).LT.1E-5)ST(9)=1
      SSS=100/ST(9)
      PC1=ST(1)*SSS
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=ST(4)*SSS
      PC8=ST1(4)*SSS
      PC9=ST(5)*SSS
      PC10=ST1(5)*SSS
      PC11=ST(6)*SSS
      PC12=ST1(6)*SSS
      PC13=100
      PC14=ST(7)*SSS
      PC15=ST1(7)*SSS
      WRITE(IO,108)IT,NF(4)
      WRITE(IO,112)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(4),SDT(4),PC7,NF1(7),
     3 ST1(4),SDT1(4),PC8,NF1(8),ST(5),SDT(5),PC9,NF1(9),ST1(5),
     4 SDT1(5),PC10,NF1(10),ST(6),SDT(6),PC11,NF1(11),ST1(6),SDT1(6),
     5 PC12,NF1(12),ST(7),SDT(7),PC14,NF1(13),ST1(7),SDT1(7),PC15,
     6 NF1(14),ST(9),SDT(9),PC13,NF(4)
112   FORMAT('k=2n',12X,2F15.2,F12.2,4X,I6/'k<>2n',11X,2F15.2,F12.2,4X,
     1 I6/'l=2n',12X,2F15.2,F12.2,4X,I6/'l<>2n',11X,2F15.2,F12.2,4X,I6/
     2 'k+l=2n',10X,2F15.2,F12.2,4X,I6/'k+l<>2n',9X,2F15.2,F12.2,4X,I6/
     3 'k+l=4n; k,l=2n',2X,2F15.2,F12.2,4X,I6/'k+l<>4n; k,l<>2n',2F15.2
     4 ,F12.2,4X,I6/'k+l=3n',10X,2F15.2,F12.2,4X,I6/'k+l<>3n',9X,2F15.2
     5 ,F12.2,4X,I6/'-k+l=3n',9X,2F15.2,F12.2,4X,I6/'-k+l<>3n',8X,
     6 2F15.2,F12.2,4X,I6/'k,l=2n ',9X,2F15.2,F12.2,4X,I6/'k,l<>2n',9X,
     7 2F15.2,F12.2,4X,I6/'none',12X,2F15.2,F12.2,4X,I6)
      GO TO 15
C-----h 0 l reflections
34    IF(ST(9).LT.1E-5)ST(9)=1
      SSS=100/ST(9)
      PC1=ST(1)*SSS
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=ST(4)*SSS
      PC8=ST1(4)*SSS
      PC9=ST(5)*SSS
      PC10=ST1(5)*SSS
      PC11=ST(6)*SSS
      PC12=ST1(6)*SSS
      PC14=ST(7)*SSS
      PC15=ST1(7)*SSS
      PC13=100
      WRITE(IO,108)IT,NF(5)
      WRITE(IO,113)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(4),SDT(4),PC7,NF1(7),
     3 ST1(4),SDT1(4),PC8,NF1(8),ST(5),SDT(5),PC9,NF1(9),ST1(5),
     4 SDT1(5),PC10,NF1(10),ST(6),SDT(6),PC11,NF1(11),ST1(6),SDT1(6),
     5 PC12,NF1(12),ST(7),SDT(7),PC14,NF1(13),ST1(7),SDT1(7),PC15,
     6 NF1(14),ST(9),SDT(9),PC13,NF(5)
113   FORMAT('h=2n',12X,2F15.2,F12.2,4X,I6/'h<>2n',11X,2F15.2,F12.2,4X,
     1 I6/'l=2n',12X,2F15.2,F12.2,4X,I6/'l<>2n',11X,2F15.2,F12.2,4X,I6/
     2 'h+l=2n',10X,2F15.2,F12.2,4X,I6/'h+l<>2n',9X,2F15.2,F12.2,4X,I6/
     3 'h+l=4n; h,l=2n',2X,2F15.2,F12.2,4X,I6/'h+l<>4n; h,l<>2n',2F15.2
     4 ,F12.2,4X,I6/'-h+l=3n',9X,2F15.2,F12.2,4X,I6/'-h+l<>3n',8X,
     5 2F15.2,F12.2,4X,I6/'h+l=3n',10X,2F15.2,F12.2,4X,I6/'h+l<>3n',
     6 9X,2F15.2,F12.2,4X,I6/'h,l=2n',10X,2F15.2,F12.2,4X,I6/'h,l<>2n',
     7 9X,2F15.2,F12.2,4X,I6/'none',12X,2F15.2,F12.2,4X,I6)
      GO TO 15
C-----h k 0 reflections
35    IF(ST(9).LT.1E-5)ST(9)=1
      SSS=100/ST(9)
      PC1=ST(1)*SSS
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=ST(4)*SSS
      PC8=ST1(4)*SSS
      PC9=ST(5)*SSS
      PC10=ST1(5)*SSS
      PC14=ST(7)*SSS
      PC15=ST1(7)*SSS
      SSS=(ST(6)+ST1(6))/100
      IF((ST(6)+ST1(6)).LT.1E-5) SSS=0.01
      PC11=ST(6)/SSS
      PC12=ST1(6)/SSS
      PC13=100
      WRITE(IO,108)IT,NF(6)
      WRITE(IO,114)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(4),SDT(4),PC7,NF1(7),
     3 ST1(4),SDT1(4),PC8,NF1(8),ST(5),SDT(5),PC9,NF1(9),ST1(5),
     4 SDT1(5),PC10,NF1(10),ST(7),SDT(7),PC14,NF1(13),ST1(7),SDT1(7),
     5 PC15,NF1(14),ST(9),SDT(9),PC13,NF(6),ST(6),SDT(6),PC11,NF1(11),
     6 ST1(6),SDT1(6),PC12,NF1(12),(NF1(11)+NF1(12))
114   FORMAT('h=2n',12X,2F15.2,F12.2,4X,I6/'h<>2n',11X,2F15.2,F12.2,
     1 4X,I6/'k=2n',12X,2F15.2,F12.2,4X,I6/'k<>2n',11X,2F15.2,F12.2,4X,
     2 I6/'h+k=2n',10X,2F15.2,F12.2,4X,I6/'h+k<>2n',9X,2F15.2,F12.2,4X,
     3 I6/'h+k=4n; h,k=2n',2X,2F15.2,F12.2,4X,I6/'h+k<>4n; h,k<>2n',
     4 2F15.2,F12.2,4X,I6/'h-k=3n',10X,2F15.2,F12.2,4X,I6/'h-k<>3n',
     5 9X,2F15.2,F12.2,4X,I6/'h,k=2n ',9X,2F15.2,F12.2,4X,I6/'h,k<>2n',
     6 9X,2F15.2,F12.2,4X,I6/'none',12X,2F15.2,F12.2,4X,I6//
     7 'Reflections h h 0'/'h=2n',12X,2F15.2,F12.2,4X,I6/'h<>2n',11X,
     8 2F15.2,F12.2,4X,I6/'Total number of h h 0 reflections',I6)
      GO TO 15
C-----h k l reflections
36    IF(ST(13).LT.1E-5)ST(13)=1
      SSS=100/ST(13)
      PC1=ST(1)*SSS
      PC2=ST1(1)*SSS
      PC3=ST(2)*SSS
      PC4=ST1(2)*SSS
      PC5=ST(3)*SSS
      PC6=ST1(3)*SSS
      PC7=ST(4)*SSS
      PC8=ST1(4)*SSS
      PC9=ST(5)*SSS
      PC10=ST1(5)*SSS
      PC11=ST(6)*SSS
      PC12=ST1(6)*SSS
C********* h-k=3n
      PC36=ST(19)*SSS
      PC37=ST1(19)*SSS
C********* h+k=2n, k+l=2n
      PC38=ST(20)*SSS
      PC39=ST1(20)*SSS
C********* h+k=2n, k+l=2n, h+l=2n
      PC40=ST(21)*SSS
      PC41=ST1(21)*SSS
C*********
      SSS=(ST(7)+ST1(7))/100
      IF((ST(7)+ST1(7)).LT.1E-5) SSS=0.01
      PC13=ST(7)/SSS
      PC14=ST1(7)/SSS
      PC15=ST(8)/SSS
      PC16=ST1(8)/SSS
      PC17=ST(9)/SSS
      PC18=ST1(9)/SSS
      PC28=ST(15)/SSS
      PC29=ST1(15)/SSS
      PC30=ST(16)/SSS
      PC31=ST1(16)/SSS
C********* h=2n
      PC42=ST(22)/SSS
      PC43=ST1(22)/SSS
C*********
      SSS=(ST(10)+ST1(10))/100
      IF((ST(10)+ST1(10)).LT.1E-5) SSS=0.01
      PC19=ST(10)/SSS
      PC20=ST1(10)/SSS
      PC21=ST(11)/SSS
      PC22=ST1(11)/SSS
      PC23=ST(12)/SSS
      PC24=ST1(12)/SSS
      PC32=ST(17)/SSS
      PC33=ST1(17)/SSS
      PC34=ST(18)/SSS
      PC35=ST1(18)/SSS
C********* h=3n
      PC44=ST(23)/SSS
      PC45=ST1(23)/SSS
C********* h=3n, l=2n
      PC46=ST(24)/SSS
      PC47=ST1(24)/SSS
C********* 2h+h=3n
      PC48=ST(25)/SSS
      PC49=ST1(25)/SSS
C********* 2h+h=3n, l=2n
      PC50=ST(26)/SSS
      PC51=ST1(26)/SSS
C*********
      SSS=(ST(14)+ST1(14))/100
      IF((ST(14)+ST1(14)).LT.1E-5) SSS=0.01
      PC26=ST(14)/SSS
      PC27=ST1(14)/SSS
      PC25=100
      WRITE(IO,108)IT,NF(7)
      WRITE(IO,115)ST(1),SDT(1),PC1,NF1(1),ST1(1),SDT1(1),PC2,NF1(2),
     1 ST(2),SDT(2),PC3,NF1(3),ST1(2),SDT1(2),PC4,NF1(4),ST(3),SDT(3),
     2 PC5,NF1(5),ST1(3),SDT1(3),PC6,NF1(6),ST(4),SDT(4),PC7,NF1(7),
     3 ST1(4),SDT1(4),PC8,NF1(8),ST(5),SDT(5),PC9,NF1(9),ST1(5),
     4 SDT1(5),PC10,NF1(10),ST(6),SDT(6),PC11,NF1(11),ST1(6),SDT1(6),
     5 PC12,NF1(12),ST(19),SDT(19),PC36,NF1(35),ST1(19),SDT1(19),PC37,
     6 NF1(36),ST(20),SDT(20),PC38,NF1(37),ST1(20),SDT1(20),PC39,
     7 NF1(38),ST(21),SDT(21),PC40,NF1(39),ST1(21),SDT1(21),PC41,
     8 NF1(40),ST(13),SDT(13),PC25,NF(7)
115   FORMAT('h+k=2n',10X,2F15.2,F12.2,4X,I6/'h+k<>2n',9X,2F15.2,F12.2,
     1 4X,I6/'h+l=2n',10X,2F15.2,F12.2,4X,I6/'h+l<>2n',9X,2F15.2,F12.2,
     2 4X,I6/'k+l=2n',10X,2F15.2,F12.2,4X,I6/'k+l<>2n',9X,2F15.2,F12.2,
     3 4X,I6/'h+k+l=2n',8X,2F15.2,F12.2,4X,I6/'h+k+l<>2n',7X,2F15.2,
     4 F12.2,4X,I6/'-h+k+l=3n',7X,2F15.2,F12.2,4X,I6/'-h+k+l<>3n',6X,
     5 2F15.2,F12.2,4X,I6/'h-k+l=3n',8X,2F15.2,F12.2,4X,I6/'h-k+l<>3n',
     6 7X,2F15.2,F12.2,4X,I6/'h-k=3n',10X,2F15.2,F12.2,4X,I6/
     7 'h-k<>3n',9X,2F15.2,F12.2,4X,I6/
     8 'h+k,k+l=2n',6X,2F15.2,F12.2,4X,I6/
     9 'h+k,k+l<>2n',5X,2F15.2,F12.2,4X,I6/
     1 'h+k,k+l,h+l=2n',2X,2F15.2,F12.2,4X,I6/
     2 'h+k,k+l,h+l<>2n',1X,2F15.2,F12.2,4X,I6/
     3 'none',12X,2F15.2,F12.2,4X,I6)
      WRITE(IO,116)ST(7),SDT(7),PC13,NF1(13),ST1(7),SDT1(7),PC14,
     1 NF1(14),ST(8),SDT(8),PC15,NF1(15),ST1(8),SDT1(8),PC16,NF1(16),
     2 ST(9),SDT(9),PC17,NF1(17),ST1(9),SDT1(9),PC18,NF1(18),ST(15),
     3 SDT(15),PC28,NF1(27),ST1(15),SDT1(15),PC29,NF1(28),ST(16),
     4 SDT(16),PC30,NF1(29),ST1(16),SDT1(16),PC31,NF1(30),ST(22),
     5 SDT(22),PC42,NF1(41),ST1(22),SDT1(22),PC43,NF1(42),
     6 (NF1(13)+NF1(14))
116   FORMAT(/'Reflections h h l'/'l=2n',12X,2F15.2,F12.2,4X,I6/
     1 'l<>2n',11X,2F15.2,F12.2,4X,I6/'h+l=2n',10X,2F15.2,F12.2,4X,I6/
     2 'h+l<>2n',9X,2F15.2,F12.2,4X,I6/'2h+l=4n,l=2n',4X,2F15.2,F12.2,
     3 4X,I6/'2h+l<>4n,l<>2n',2X,2F15.2,F12.2,4X,I6/'h=2n,l=2n',7X,
     4 2F15.2,F12.2,4X,I6/'h<>2n,l<>2n',5X,2F15.2,F12.2,4X,I6/'l=3n',
     5 12X,2F15.2,F12.2,4X,I6/'l<>3n',11X,2F15.2,F12.2,4X,I6/
     7 'h=2n',12X,2F15.2,F12.2,4X,I6/'h<>2n',11X,2F15.2,F12.2,4X,I6/
     9 'Total number of h h l reflections ',I6)
      WRITE(IO,119)ST(10),SDT(10),PC19,NF1(19),ST1(10),
     1 SDT1(10),PC20,NF1(20),ST(11),SDT(11),PC21,NF1(21),ST1(11),
     2 SDT1(11),PC22,NF1(22),ST(12),SDT(12),PC23,NF1(23),ST1(12),
     3 SDT1(12),PC24,NF1(24),ST(17),SDT(17),PC32,NF1(31),ST1(17),
     4 SDT1(17),PC33,NF1(32),ST(18),SDT(18),PC34,NF1(33),ST1(18),
     5 SDT1(18),PC35,NF1(34),ST(23),SDT(23),PC44,NF1(43),ST1(23),
     6 SDT1(23),PC45,NF1(44),ST(24),SDT(24),PC46,NF1(45),ST1(24),
     7 SDT1(24),PC47,NF1(46),ST(25),SDT(25),PC48,NF1(47),ST1(25),
     8 SDT1(25),PC49,NF1(48),ST(26),SDT(26),PC50,NF1(49),ST1(26),
     9 SDT1(26),PC51,NF1(50),(NF1(19)+NF1(20))
119   FORMAT(/'Reflections h -h l '/'l=2n',12X,2F15.2,F12.2,4X,I6/
     1 'l<>2n',11X,2F15.2,F12.2,4X,I6/'h+l=3n',10X,2F15.2,F12.2,4X,I6/
     2 'h+l<>3n',9X,2F15.2,F12.2,4X,I6/
     3 '-h+l=3n',9X,2F15.2,F12.2,4X,I6/'-h+l<>3n',8X,2F15.2,F12.2,4X,
     4 I6/'h+l=3n,l=2n',5X,2F15.2,F12.2,4X,I6/'h+l<>3n,l<>2n',3X,
     5 2F15.2,F12.2,4X,I6/'-h+l=3n,l=2n',4X,2F15.2,F12.2,4X,I6/
     6 '-h+l<>3n,l<>2n',2X,2F15.2,F12.2,4X,I6/
     7 'h=3n',12X,2F15.2,F12.2,4X,I6/'h<>3n',11X,2F15.2,F12.2,4X,I6/
     8 'h=3n,l=2n',7X,2F15.2,F12.2,4X,I6/
     9 'h<>3n,l<>2n',5X,2F15.2,F12.2,4X,I6/
     1 '2h+l=3n',9X,2F15.2,F12.2,4X,I6/
     2 '2h+l<>3n',8X,2F15.2,F12.2,4X,I6/
     3 '2h+l=3n,l=2n',4X,2F15.2,F12.2,4X,I6/
     4 '2h+l<>3n,l<>2n',2X,2F15.2,F12.2,4X,I6/
     5 'Total number of h -h l reflections ',I6)
       WRITE(IO,120)ST(14),SDT(14),PC26,NF1(25),ST1(14),SDT1(14),PC27,
     1 NF1(26),(NF1(25)+NF1(26))
120    FORMAT(/'Reflections h h h '/'h=2n',12X,2F15.2,F12.2,4X,I6/
     1 'h<>2n',11X,2F15.2,F12.2,4X,I6/
     2 'Total number of h h h reflections ',I6)
15    CONTINUE
      STOP
      END
 
      SUBROUTINE INOU
C-----Assign input and output files
      CHARACTER FILIN*14,STR1*22,STRI*2,STRO*3,STR2*8,STR3*8,STR4*2,
     1 TIT(80)*1
      COMMON/IOU/IN,IO
      STR1='Key in the name of the'
      STRI='in'
      STRO='out'
      STR2='put file'
      STR3='compound'
      STR4='?>'
      WRITE(*,100)STR1,STRI,STR2,STR4
100   FORMAT(1X,A22,1X,A2,A8/1X,A2)
      READ(*,'(A14)')FILIN
      OPEN(UNIT=IN,FILE=FILIN,FORM='FORMATTED')
      REWIND(UNIT=IN)
      WRITE(*,101)STR1,STRO,STR2,STR4
101   FORMAT(1X,A22,1X,A3,A8/1X,A2)
      READ(*,'(A14)')FILIN
      OPEN(UNIT=IO,FILE=FILIN,FORM='FORMATTED')
      REWIND(UNIT=IO)
      WRITE(*,102)STR1,STR3,STR4
102   FORMAT(1X,A22,1X,A8/1X,A2)
      READ(*,'(80A1)')TIT
      WRITE(IO,'(80A1)')TIT
      RETURN
      END
 
      SUBROUTINE METEN(GR)
C-----Calculates the reciprocal metric tensor
      DIMENSION CR(3),CS(3),SN(3),CSR(3),T(3),GR(6)
      COMMON/GRP1/C(3),A(3)
      RD=0.017453293
      DO 1 I=1,3
      A(I)=A(I)*RD
      CS(I)=COS(A(I))
      IF(ABS(CS(I)).LT.1E-6)CS(I)=0.
1     SN(I)=SIN(A(I))
      R=1.-CS(1)*CS(1)-CS(2)*CS(2)+CS(3)*(2.*CS(1)*CS(2)-CS(3))
      VL=C(1)*C(2)*C(3)*SQRT(R)
      T(1)=CS(2)*CS(3)-CS(1)
      T(2)=CS(1)*CS(3)-CS(2)
      T(3)=CS(1)*CS(2)-CS(3)
      CR(1)=C(2)*C(3)*SN(1)/VL
      CR(2)=C(1)*C(3)*SN(2)/VL
      CR(3)=C(1)*C(2)*SN(3)/VL
      CSR(1)=T(1)/(SN(2)*SN(3))
      CSR(2)=T(2)/(SN(1)*SN(3))
      CSR(3)=T(3)/(SN(1)*SN(2))
      DO 2 I=1,3
2     GR(I)=CR(I)*CR(I)
      GR(4)=CR(2)*CR(3)*CSR(1)
      GR(5)=CR(1)*CR(3)*CSR(2)
      GR(6)=CR(1)*CR(2)*CSR(3)
      RETURN
      END
 
      SUBROUTINE SNTL(HKL,GR,RQ)
C-----This routine calculates sin(theta)/lambda
      DIMENSION GR(6)
      INTEGER HKL(3)
      RQ=0.0
      DO 1 I=1,3
1     RQ=RQ+HKL(I)**2*GR(I)
      RQ=RQ+2*HKL(2)*HKL(3)*GR(4)
      RQ=RQ+2*HKL(1)*HKL(3)*GR(5)
      RQ=RQ+2*HKL(1)*HKL(2)*GR(6)
      RQ=SQRT(RQ)/2.0
      RETURN
      END
 
      SUBROUTINE SUB42(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class 2/m
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((-H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.-H(J,3).EQ.H(I,3))
     1 .OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     2 H(I,3)).OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.-H(J,3)
     3 .EQ.H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class 2/m'')')
      RETURN
      END
 
      SUBROUTINE SUB43(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class mmm
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((-H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.H(I,3))
     1 .OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.H(J,3).EQ.
     2 H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.H(J,3)
     3 .EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.
     4 -H(J,3).EQ.H(I,3)))GO TO 1
      IF((-H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.-H(J,3).EQ.H(I,3))
     1 .OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.-H(J,3).EQ.
     2 H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.-H(J,3).
     3 EQ.H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class mmm'')')
      RETURN
      END
 
      SUBROUTINE SUB44(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class 4/m
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((-H(J,2).EQ.H(I,1).AND.H(J,1).EQ.H(I,2).AND.H(J,3).EQ.H(I,3))
     1 .OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.H(J,3).EQ.
     2 H(I,3)).OR.(H(J,2).EQ.H(I,1).AND.-H(J,1).EQ.H(I,2).AND.H(J,3)
     3 .EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.
     4 -H(J,3).EQ.H(I,3)))GO TO 1
      IF((-H(J,2).EQ.H(I,1).AND.H(J,1).EQ.H(I,2).AND.-H(J,3).EQ.H(I,3))
     1 .OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.-H(J,3).EQ.
     2 H(I,3)).OR.(H(J,2).EQ.H(I,1).AND.-H(J,1).EQ.H(I,2).AND.-H(J,3).
     3 EQ.H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class 4/m'')')
      RETURN
      END
 
      SUBROUTINE SUB45(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class 4/mmm
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((H(J,2).EQ.H(I,1).AND.H(J,1).EQ.H(I,2).AND.H(J,3).EQ.H(I,3))
     1 .OR.(-H(J,2).EQ.H(I,1).AND.H(J,1).EQ.H(I,2).AND.H(J,3).EQ.
     2 H(I,3)).OR.(-H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3)
     3 .EQ.H(I,3)).OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.
     4 H(J,3).EQ.H(I,3)))GO TO 1
      IF((-H(J,2).EQ.H(I,1).AND.-H(J,1).EQ.H(I,2).AND.H(J,3).EQ.H(I,3))
     1 .OR.(H(J,2).EQ.H(I,1).AND.-H(J,1).EQ.H(I,2).AND.H(J,3).EQ.
     2 H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.H(J,3).
     3 EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.
     4 -H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,2).EQ.H(I,1).AND.H(J,1).EQ.H(I,2).AND.-H(J,3).EQ.H(I,3)).
     1 OR.(-H(J,2).EQ.H(I,1).AND.H(J,1).EQ.H(I,2).AND.-H(J,3).EQ.
     2 H(I,3)).OR.(-H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.-H(J,3).
     3 EQ.H(I,3)).OR.(-H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.
     4 -H(J,3).EQ.H(I,3)))GO TO 1
      IF((-H(J,2).EQ.H(I,1).AND.-H(J,1).EQ.H(I,2).AND.-H(J,3).EQ.
     1 H(I,3)).OR.(H(J,2).EQ.H(I,1).AND.-H(J,1).EQ.H(I,2).AND.-H(J,3).
     2 EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.-H(J,2).EQ.H(I,2).AND.
     3 -H(J,3).EQ.H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class 4/mmm'')')
      RETURN
      END
 
      SUBROUTINE SUB46(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class -3
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      IF((H(J,1).EQ.-(H(I,1)+H(I,2)).AND.H(J,2).EQ.H(I,1).AND.H(J,3)
     1 .EQ.H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-(H(I,1)+H(I,2))
     2 .AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.
     3 -H(I,2).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      IF((H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     1 EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.(H(I,1)+H(I,2)).
     2 AND.H(J,3).EQ.-H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class -3'')')
      RETURN
      END
 
      SUBROUTINE SUB47(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class -3m
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      IF((H(J,1).EQ.-(H(I,1)+H(I,2)).AND.H(J,2).EQ.H(I,1).AND.H(J,3)
     1 .EQ.H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-(H(I,1)+H(I,2))
     2 .AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2)
     3 .EQ.-H(I,2).AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.
     4 H(J,2).EQ.(H(I,1)+H(I,2)).AND.H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.
     1 H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3).
     2 EQ.-H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.H(J,2).EQ.H(I,1).
     3 AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.
     4 -(H(I,1)+H(I,2)).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      IF((H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).EQ.-H(I,2).AND.H(J,3)
     1 .EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.(H(I,1)+H(I,2))
     2 .AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.
     3 -H(I,1).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class -3m'')')
      RETURN
      END
 
      SUBROUTINE SUB48(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class 6/m
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      IF((H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.(H(I,1)+H(I,2)).AND.H(J,3)
     1 .EQ.H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.H(J,2).EQ.H(I,1)
     2 .AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.
     3 -H(I,2).AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2)
     4 .EQ.-(H(I,1)+H(I,2)).AND.H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     1 EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3)
     2 .EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.(H(I,1)+H(I,2))
     3 .AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.
     4 H(J,2).EQ.H(I,1).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     1 -H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-(H(I,1)+H(I,2)).
     2 AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2)
     3 .EQ.-H(I,1).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class 6/m'')')
      RETURN
      END
 
      SUBROUTINE SUB49(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class 6/mmm
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      IF((H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.(H(I,1)+H(I,2)).AND.H(J,3)
     1 .EQ.H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.H(J,2).EQ.H(I,1)
     2 .AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.
     3 -H(I,2).AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2)
     4 .EQ.-(H(I,1)+H(I,2)).AND.H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     1 EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3).
     2 EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.(H(I,1)+H(I,2))
     3 .AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.
     4 H(J,2).EQ.H(I,1).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     1 -H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-(H(I,1)+H(I,2)).
     2 AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).
     3 EQ.-H(I,1).AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.
     4 H(J,2).EQ.H(I,1).AND.H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.(H(I,1)+H(I,2)).AND.H(J,3).
     1 EQ.H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.H(J,2).EQ.H(I,2).
     2 AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.
     3 -H(I,1).AND.H(J,3).EQ.H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).
     4 EQ.-(H(I,1)+H(I,2)).AND.H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).
     1 EQ.H(I,3)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,1).AND.H(J,3).
     2 EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.(H(I,1)+H(I,2)).
     3 AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.-(H(I,1)+H(I,2)).AND.
     4 H(J,2).EQ.H(I,2).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.
     1 -H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-(H(I,1)+H(I,2)).
     2 AND.H(J,3).EQ.-H(I,3)).OR.(H(J,1).EQ.(H(I,1)+H(I,2)).AND.H(J,2).
     3 EQ.-H(I,2).AND.H(J,3).EQ.-H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class 6/mmm'')')
      RETURN
      END
 
      SUBROUTINE SUB50(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class m-3
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((H(J,1).EQ.H(I,3).AND.H(J,2).EQ.H(I,1).AND.H(J,3).EQ.H(I,2))
     1 .OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.
     2 H(I,1)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3)
     3 .EQ.-H(I,3)).OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.H(I,1).AND.
     4 H(J,3).EQ.-H(I,2)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.-H(I,1)).
     1 OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.
     2 H(I,1)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.H(I,1).AND.H(J,3).
     3 EQ.H(I,2)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.H(I,2).AND.
     4 H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     1 H(I,3)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     2 EQ.H(I,2)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,3).AND.
     3 H(J,3).EQ.H(I,1)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-H(I,3).
     4 AND.H(J,3).EQ.H(I,1)))GO TO 1
      IF((H(J,1).EQ.H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.H(I,2)).
     1 OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     2 H(I,3)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).
     3 EQ.-H(I,1)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.H(I,1).AND.
     4 H(J,3).EQ.-H(I,2)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.-H(I,3))
     1 .OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     2 -H(I,3)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     3 EQ.-H(I,2)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,3).AND.
     4 H(J,3).EQ.-H(I,1)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-H(I,3).AND.H(J,3).EQ.
     1 -H(I,1)).OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     2 EQ.-H(I,2)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,2).AND.
     3 H(J,3).EQ.-H(I,3)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class m-3'')')
      RETURN
      END
 
      SUBROUTINE SUB51(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class m-3m (1st part)
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((H(J,1).EQ.H(I,3).AND.H(J,2).EQ.H(I,1).AND.H(J,3).EQ.H(I,2))
     1 .OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.
     2 H(I,1)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3)
     3 .EQ.-H(I,3)).OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.H(I,1).AND.
     4 H(J,3).EQ.-H(I,2)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.-H(I,1)).
     1 OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.
     2 H(I,1)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.H(I,1).AND.H(J,3).
     3 EQ.H(I,2)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.H(I,2).AND.
     4 H(J,3).EQ.H(I,3)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     1 H(I,3)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     2 EQ.H(I,2)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,3).AND.
     3 H(J,3).EQ.H(I,1)).OR.(H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-H(I,3).
     4 AND.H(J,3).EQ.H(I,1)))GO TO 1
      IF((H(J,1).EQ.H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.H(I,2)).
     1 OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.H(I,3))
     2 .OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.
     3 -H(I,1)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.H(I,1).AND.H(J,3).
     4 EQ.-H(I,2)))GO TO 1
      IF((H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.-H(I,3))
     1 .OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).EQ.
     2 -H(I,3)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     3 EQ.-H(I,2)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,3).AND.
     4 H(J,3).EQ.-H(I,1)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-H(I,3).AND.H(J,3).EQ.-H(I,1))
     1 .OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.
     2 -H(I,2)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).
     3 EQ.-H(I,3)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,3).AND.H(J,3)
     4 .EQ.H(I,2)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      RETURN
      END
 
      SUBROUTINE SUB52(NT,SD1,SD2,NCP,NFT,SFTOT)
C-----Laue class m-3m (2nd part)
      INTEGER H(10000,3)
      DIMENSION FI(10000),SFI(10000)
      COMMON/LAU/H,FI,SFI
     1      /IOU/IN,IO
     2      /GRP2/KKK
      DO 2 I=1,(NT-1)
      DO 2 J=(I+1),NT
      ISI1=ABS(H(I,1))+ABS(H(I,2))+ABS(H(I,3))
      ISI2=ABS(H(J,1))+ABS(H(J,2))+ABS(H(J,3))
      IF(ISI1.NE.ISI2)GO TO 2
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,1).AND.H(J,3).EQ.H(I,3)).
     1 OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.H(I,1)).
     2 OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.H(I,1).AND.H(J,3).EQ.H(I,3))
     3 .OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.H(I,3).AND.H(J,3).EQ.
     4 H(I,2)))GO TO 1
      IF((H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.H(I,1)).
     1 OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,3).AND.H(J,3).EQ.
     2 H(I,2)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     3 EQ.H(I,3)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.-H(I,2).AND.
     4 H(J,3).EQ.H(I,1)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.H(I,3)).
     1 OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,3).AND.H(J,3).EQ.
     2 H(I,2)).OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).
     3 EQ.H(I,1)).OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.H(I,3).AND.H(J,3).
     4 EQ.-H(I,2)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.H(I,1).AND.H(J,3).EQ.-H(I,3)).
     1 OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.-H(I,1))
     2 .OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.H(I,1).AND.H(J,3).EQ.
     3 -H(I,3)).OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.H(I,3).AND.H(J,3).
     4 EQ.-H(I,2)))GO TO 1
      IF((H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.H(I,2).AND.H(J,3).EQ.-H(I,1))
     1 .OR.(H(J,1).EQ.-H(I,1).AND.H(J,2).EQ.-H(I,3).AND.H(J,3).EQ.
     2 H(I,2)).OR.(H(J,1).EQ.-H(I,2).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).
     3 EQ.-H(I,3)).OR.(H(J,1).EQ.-H(I,3).AND.H(J,2).EQ.-H(I,2).AND.
     4 H(J,3).EQ.-H(I,1)))GO TO 1
      IF((H(J,1).EQ.H(I,2).AND.H(J,2).EQ.-H(I,1).AND.H(J,3).EQ.-H(I,3))
     1 .OR.(H(J,1).EQ.H(I,1).AND.H(J,2).EQ.-H(I,3).AND.H(J,3).EQ.
     2 -H(I,2)).OR.(H(J,1).EQ.H(I,3).AND.H(J,2).EQ.-H(I,2).AND.H(J,3).
     3 EQ.-H(I,1)))GO TO 1
      GO TO 2
1     DIF=ABS(FI(I)-FI(J))
      SD1=SD1+DIF
      SDF=SQRT(SFI(I)**2+SFI(J)**2)
      SD2=SD2+SQRT(SDF)
      NDF=(DIF+0.5)
      NSF=(SDF+0.5)
      NCP=NCP+1
      SFTOT=SFTOT+1
      NFT=NFT+1
      IF(KKK.EQ.1)WRITE(IO,100)(H(I,K),K=1,3),FI(I),SFI(I),
     1 (H(J,K),K=1,3),FI(J),SFI(J),NDF,NSF
100   FORMAT(3I4,F10.2,F8.2,3X,3I4,F10.2,F8.2,I7,'(',I4,')')
2     CONTINUE
      WRITE(IO,'(/'' Laue class m-3m'')')
      RETURN
      END
