
C     INCLUDE 'Zena2.inc'

C      enatiomorphous sp.gr. 2: calc --> routine to check sp.gr.  
C ==>  include in $520 INVERT and in $801 TRACOR  
C ==>  in combination with Zena1.inc to be included in the same routines
C 2007 
C      EXIT: if not enantiomorphous sp.gr. : KSPGR = 0
C      EXIT: if enantiomorphous pairs found: KSPGR = 1
C
C  ==> the include call must be followed by FORTRAN statement 149
C
C         needed: /CRYSA/ and /CRYSB/  and: NCALC=1 !
*         CHARACTER*16 SPGRX, SPGRT
*         CHARACTER*6 SPGRIN(22) compressed,  pairs: (1,2), (3,4) etc
*         CHARACTER*9 SPGROT(22) printable table
*         DATA SPGRIN / 'P31'     , 'P32'     , 'P3121'    , etc
*         DATA SPGROT / 'P 31'    , 'P 32'    , 'P 31 2 1' , etc
C         test: ACNORT

C corr 7 dec 2007
      IF (NCALL .GE. 2) GOTO 148

      ISPGR = 0
      KSPGR = 0
      
      IF (ICENT .NE. 1 .OR. ILATT .NE. 1) GOTO 148
C        P-cell, non-centrosymm. : compress and test

         WRITE (7, FMT='('' SPGR '', A16)' ) SPGR
         SPGRX = SPGR
         DO 144 I = 1, 11
         IF (SPGRX(I:I) .EQ. ' ') THEN
            SPGRT(1:16-I) = SPGRX(I+1:16)
            SPGRX(I:15) = SPGRT(1:16-I)
            ENDIF  
  144    CONTINUE

         SPGRX(10:16) = ' '
 
         DO 145 I = 1, 22
         IF (SPGRX(1:6) .EQ. SPGRIN(I)) GOTO 147
  145    CONTINUE
C           no enantiomorphous sp.gr. found

         GOTO 148

C        yes: one enantiomorphous sp.gr. found
  147 CONTINUE
      KSPGR = 1
      J = I+1
      IF ( (I/2) * 2 .EQ. I) J = I-1

      CALL WR24
      WRITE (9, 149) SPGROT(I), SPGROT(J)  
*     WRITE (7, 149) SPGROT(I), SPGROT(J)  
C note: FORMAT is outside the include files because the message is
C different for INVERT and TRACOR.

  148 CONTINUE

C to be continued with
* 149 FORMAT (/ ' Space groups ',A9, ' and ', A9,

C end of 'Zena2.inc'
  