      subroutine conditions
      implicit none
      include 'io_files.inc'

c...	common blocks
      integer ibravl,isystm
      common /cell/ ibravl,isystm

      integer ihoo,ioko,iool,ihko,ihol,iokl,ihhl,ilau,itrig
      COMMON /EXTI/ IHOO,IOKO,IOOL,IHKO,IHOL,IOKL,IHHL,ILAU,ITRIG

c...	local variables

      WRITE (unitstruct,*) '>> conditions():' 
      WRITE (unitstruct,148)                 ! Conditions
      IF(IBRAVL.EQ.1) WRITE(unitstruct,208)  ! P: none
      IF(IBRAVL.EQ.2) WRITE(unitstruct,213)  ! I: h+k+l=2n
      IF(IBRAVL.EQ.3) WRITE(unitstruct,214)  ! R: -h+k+l=3n
      IF(IBRAVL.EQ.4) WRITE(unitstruct,212)  ! F: h,k,l all even or all odd
      IF(IBRAVL.EQ.5) WRITE(unitstruct,209)  ! A: k+l=2n
      IF(IBRAVL.EQ.6) WRITE(unitstruct,215)  ! B: h+l=2n
      IF(IBRAVL.EQ.7) WRITE(unitstruct,211)  ! C: h+k=2n

C  space group conditions

C  l=0 -> h+k=IHKO*n
      IF ((IHKO.EQ.2).OR.(IHKO.EQ.4)) WRITE (unitstruct,176) IHKO

C  l=0 -> k=2n
      IF (IHKO.EQ.3) WRITE (unitstruct,175)

C  l=0 -> h=2n
      IF (IHKO.EQ.5) WRITE (unitstruct,174)

C  h=0 -> k+l=IOKL*n
      IF ((IOKL.EQ.2).OR.(IOKL.EQ.4)) WRITE (unitstruct,178) IOKL

C  h=0 -> l=2n
      IF (IOKL.EQ.3) WRITE (unitstruct,210)

C  h=0 -> k=2n
      IF (IOKL.EQ.5) WRITE (unitstruct,177)

C  k=0 -> h+l=IHOL*n  etc.
      IF ((IHOL.EQ.2).OR.(IHOL.EQ.4)) WRITE (unitstruct,181) IHOL
      IF (IHOL.EQ.3) WRITE (unitstruct,180)
      IF (IHOL.EQ.5) WRITE (unitstruct,179)

C  h=k -> l=2n
      IF (IHHL.EQ.2) WRITE (unitstruct,182)

C  h=k -> 2h+l=4n
      IF (IHHL.EQ.3) WRITE (unitstruct,183)

C  k=0, l=0 -> h=IHOO*n
      IF (IHOO.GT.1) WRITE (unitstruct,184) IHOO

C  h=0, l=0 -> k=2n
      IF (IOKO.GT.1) WRITE (unitstruct,185)

C  h=0, k=0 -> l=2n
      IF (IOOL.GT.1) WRITE (unitstruct,186) IOOL

      write(unitstruct,*)
      return
      
 148  FORMAT (48HGENERAL CONDITIONS LIMITING POSSIBLE REFLECTIONS  )
 174  FORMAT (19H HKO WITH H=2N ONLY)
 175  FORMAT (19H HKO WITH K=2N ONLY)
 176  FORMAT (14H HKO WITH H+K=,I1,6HN ONLY)
 177  FORMAT (19H OKL WITH K=2N ONLY)
 210  FORMAT (19H OKL WITH L=2N ONLY)
 178  FORMAT (14H OKL WITH K+L=,I1,6HN ONLY)
 179  FORMAT (19H HOL WITH H=2N ONLY)
 180  FORMAT (19H HOL WITH L=2N ONLY)
 181  FORMAT (14H HOL WITH H+L=,I1,6HN ONLY)
 182  FORMAT (19H HHL WITH L=2N ONLY)
 183  FORMAT (22H HHL WITH 2H+L=4N ONLY)
 184  FORMAT (12H HOO WITH H=,I1,6HN ONLY)
 185  FORMAT (19H OKO WITH K=2N ONLY)
 186  FORMAT (12H OOL WITH L=,I1,6HN ONLY)
 187  FORMAT (/21H MONOCLINIC STRUCTURE)
 188  FORMAT (/20H TRICLINIC STRUCTURE)
 189  FORMAT (/23H ORTHORHOMBIC STRUCTURE)
 190  FORMAT (/19H TRIGONAL STRUCTURE)
 191  FORMAT (/21H TETRAGONAL STRUCTURE)
 192  FORMAT (/16H CUBIC STRUCTURE)
 193  FORMAT (/20H HEXAGONAL STRUCTURE)
 194  FORMAT(/53H SOMETHING VERY BAD HAPPENED. CALL THE AUTHORS PLEASE)
 208  FORMAT(10H HKL  NONE)
 209  FORMAT(21H HKL WITH K+L=2N ONLY)
 215  FORMAT(21H HKL WITH H+L=2N ONLY)
 211  FORMAT(21H HKL WITH H+K=2N ONLY)
 212  FORMAT(40H HKL WITH H,K,L ALL EVEN OR ALL ODD ONLY )
 213  FORMAT(23H HKL WITH H+K+L=2N ONLY)
 214  FORMAT(24H HKL WITH -H+K+L=3N ONLY)
 220  FORMAT(5I5)

      end
