C
C     ================================
      SUBROUTINE DECSYM(JHKL,HKL,KSYM)
C     ================================
C
C---- subroutine decsym decodes symmetry operations according to ksym
C     which was attached to every reflection by subroutine turnip
C     as in protin and ulysses.
C
C---- uses matrices read into core by symmat, and inverted by syminv
C
C---- Symmetry matrix is stored in core (array isym) as 
C     a 9-element column
C     i.e.the first row of the symmetry matrix m occupies elements 1-3
C     of column m of array symmat,the second occupies elements 4-7 etc.
C     to retrieve the original index from lcf file ,the inverse
C     of symmetry matrix isym is needed .
C
C
C
C
C
C---- if ksym = 1 , use identity
C
C     .. Scalar Arguments ..
      INTEGER KSYM
C     ..
C     .. Array Arguments ..
      REAL HKL(3)
      INTEGER JHKL(3)
C     ..
C     .. Scalars in Common ..
      INTEGER NISYM
      CHARACTER PGNAME*10
C     ..
C     .. Arrays in Common ..
      INTEGER ISYM
C     ..
C     .. Local Scalars ..
      INTEGER I,J,KS
C     ..
C     .. Common blocks ..
      COMMON /SYMM/NISYM,ISYM(9,47)
      COMMON /SYMM1/PGNAME
C     ..
C
C
      IF (KSYM.EQ.1) THEN
C
C---- identity
C
        DO 10 I = 1,3
          HKL(I) = JHKL(I)
   10   CONTINUE
C
C
      ELSE
        KS = KSYM - 1
C
C
        DO 20 I = 1,3
          J = 3*I - 2
          HKL(I) = ISYM(J+1,KS)*JHKL(2) + ISYM(J,KS)*JHKL(1) +
     +             ISYM(J+2,KS)*JHKL(3)
   20   CONTINUE
C
C
      END IF
C
C
      END
