**==cellcx.f  
C LAST UPDATE:
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C*************************
C**       CELLCX        **
C*************************
C
C Purpose: Convert between expanded and contracted form of cell params
C
      SUBROUTINE CELLCX(MSYS,CELLC,CELLX,IT,ICTYP)
C
C PARAMETERS
C
C        MSYS (I)       CRYSTAL SYSTEM 1-7
C       CELLC (I OR O)  CONTRACTED FORM OF CELL PARAMETERS (1-6 VALS)
C       CELLX (O OR I)  EXPANDED FORM OF CELL PARAMETERS (6 VALUES)
C          IT (I)       =1 CONVERT FROM CONTRACTED TO EXPANDED
C                       =2 CONVERT FROM EXPANDED TO CONTRACTED
C       ICTYP (I)       CELL TYPE =1 REAL, =2 RECIPROCAL
C
C
      REAL CELLC(6),CELLX(6)
C
C-------------------------------------------------------------------------------
C
      IF (IT.EQ.1) THEN
         IF (MSYS.EQ.1) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(2)
            CELLX(3) = CELLC(3)
            CELLX(4) = CELLC(4)
            CELLX(5) = CELLC(5)
            CELLX(6) = CELLC(6)
            RETURN
         ELSE IF (MSYS.EQ.2) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(2)
            CELLX(3) = CELLC(3)
            CELLX(4) = 90.0
            CELLX(5) = CELLC(4)
            CELLX(6) = 90.0
            RETURN
         ELSE IF (MSYS.EQ.3) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(2)
            CELLX(3) = CELLC(3)
            CELLX(4) = 90.0
            CELLX(5) = 90.0
            CELLX(6) = 90.0
            RETURN
         ELSE IF (MSYS.EQ.4) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(1)
            CELLX(3) = CELLC(2)
            CELLX(4) = 90.0
            CELLX(5) = 90.0
            CELLX(6) = 90.0
            RETURN
         ELSE IF (MSYS.EQ.5) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(1)
            CELLX(3) = CELLC(2)
            CELLX(4) = 90.0
            CELLX(5) = 90.0
            CELLX(6) = 120.0
            IF (ICTYP.EQ.2) CELLX(6) = 60.0
            RETURN
         ELSE IF (MSYS.EQ.6) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(1)
            CELLX(3) = CELLC(1)
            CELLX(4) = CELLC(2)
            CELLX(5) = CELLC(2)
            CELLX(6) = CELLC(2)
            RETURN
         ELSE IF (MSYS.EQ.7) THEN
            CELLX(1) = CELLC(1)
            CELLX(2) = CELLC(1)
            CELLX(3) = CELLC(1)
            CELLX(4) = 90.0
            CELLX(5) = 90.0
            CELLX(6) = 90.0
            RETURN
         END IF
         RETURN
      END IF
      IF (IT.EQ.2) THEN
         DO 20 I = 1 , 6
            CELLC(I) = 0.0
 20      CONTINUE
         IF (MSYS.EQ.1) THEN
            DO 30 I = 1 , 6
               CELLC(I) = CELLX(I)
 30         CONTINUE
            RETURN
         ELSE IF (MSYS.EQ.2) THEN
            CELLC(1) = CELLX(1)
            CELLC(2) = CELLX(2)
            CELLC(3) = CELLX(3)
            CELLC(4) = CELLX(5)
            RETURN
         ELSE IF (MSYS.EQ.3) THEN
            CELLC(1) = CELLX(1)
            CELLC(2) = CELLX(2)
            CELLC(3) = CELLX(3)
            RETURN
         ELSE IF (MSYS.EQ.4) THEN
            CELLC(1) = CELLX(1)
            CELLC(2) = CELLX(3)
            RETURN
         ELSE IF (MSYS.EQ.5) THEN
            CELLC(1) = CELLX(1)
            CELLC(2) = CELLX(3)
            RETURN
         ELSE IF (MSYS.EQ.6) THEN
            CELLC(1) = CELLX(1)
            CELLC(2) = CELLX(4)
            RETURN
         ELSE IF (MSYS.EQ.7) THEN
            CELLC(1) = CELLX(1)
            RETURN
         END IF
      END IF
      RETURN
      END
