      subroutine celinp (nsy,a,b,c,al,be,ga,cvt,ispa)                   CELI001
c---------------------------------------------------------------------- CELI002
c   This subroutine writes a some text and inquires the necessary       CELI003
c   cell constants and angles for  the corresponding system.            CELI004
c   Code is property of the PhysiSoft Corporation, Bernhard Rupp, 1986  CELI005
C   revised version with call to RTHCVT (rho to hex conversion)         CELI006
c ----------------------------------------------------------------------CELI007
c     This program module is part of the PhysiSoft X-ray Library        CELI008
c     and may not be sold or reproduced for commercial purposes.        CELI009
c     Although it has been tested carefully, there is no warranty       CELI010
c     regarding accuracy or freedom from side-effects.                  CELI011
c                   (C) 1986-1990 Bernhard Rupp                         CELI012
c ----------------------------------------------------------------------CELI013
                                                                        CELI014
       IMPLICIT REAL (A-H,O-Z)                                          CELI015
       character tt*52, answ                                            CELI016
       logical cvt                                                      CELI017
       dimension tt(8)                                                  CELI018
                                                                        CELI019
       data (tt(i),i=1,8) /' Cubic structure',                          CELI020
     &  ' Tetragonal structure, c axis unique',                         CELI021
     &  ' Hexagonal structure, c axis unique',                          CELI022
     &  ' Rhombohedral structure',                                      CELI023
     &  ' Orthorhombic structure',                                      CELI024
     &  ' Monoclinic structure, no higher symmetry ?',                  CELI025
     &  ' Triclinic structure, that''s going to be a mess...',          CELI026
     &  ' Trigonal structure, c axis unique' /                          CELI027
                                                                        CELI028
c ---  crank out the text --                                            CELI029
       write(*,'(/,1x,a,i3)') ' Space group Nr. ',ispa                  CELI030
       write(*,'(/,1x,a)') tt(nsy)                                      CELI031
                                                                        CELI032
c ---  ask for cubic --                                                 CELI033
 7001  if (nsy.eq.1) then                                               CELI034
          call celpar (1,a)                                             CELI035
          b=a                                                           CELI036
          c=a                                                           CELI037
          al=90.0                                                       CELI038
          be=al                                                         CELI039
          ga=al                                                         CELI040
                                                                        CELI041
c ---  ask for system with unique axis c --                             CELI042
       elseif (nsy.eq.2.or.nsy.eq.3.or.(nsy.eq.4.and.(.not.cvt))        CELI043
     &        .or.nsy.eq.8) then                                        CELI044
          call celpar (1,a)                                             CELI045
          call celpar (3,c)                                             CELI046
          b=a                                                           CELI047
          al=90.0                                                       CELI048
          be=al                                                         CELI049
          ga=al                                                         CELI050
          if(nsy.eq.3.or.nsy.eq.8.or.(nsy.eq.4.and.(.not.cvt))) ga=120.0CELI051
                                                                        CELI052
c ---  here is the conversion rho to hex ---                            CELI053
       elseif (nsy.eq.4.and.cvt) then                                   CELI054
          call celpar (1,a)                                             CELI055
          call celpar (4,al)                                            CELI056
c ---     'I' calls rtcvt internal - no questions for input ---         CELI057
          call rthcvt ('I',nsy,a,b,c,al)                                CELI058
c ---     returned a hex and c hex --                                   CELI059
c         write (*,'(/a,f9.4,a,f9.4)')                                  CELI060
c    &    ' Rhombohedral cell dimensions transformed to a(h) =',        CELI061
c    &    a,', c(h) =',c                                                CELI062
          b=a                                                           CELI063
          al=90.0                                                       CELI064
          be=al                                                         CELI065
          ga=120.0                                                      CELI066
                                                                        CELI067
c ---  ortho ---                                                        CELI068
       elseif (nsy.eq.5) then                                           CELI069
          call celpar (1,a)                                             CELI070
          call celpar (2,b)                                             CELI071
          call celpar (3,c)                                             CELI072
          al=90.0                                                       CELI073
          be=al                                                         CELI074
          ga=al                                                         CELI075
c ---  mono --                                                          CELI076
       elseif (nsy.eq.6) then                                           CELI077
          call celpar (1,a)                                             CELI078
          call celpar (2,b)                                             CELI079
          call celpar (3,c)                                             CELI080
          call celpar (5,be)                                            CELI081
          al=90.0                                                       CELI082
          ga=al                                                         CELI083
c --- triclin --                                                        CELI084
       elseif (nsy.eq.7) then                                           CELI085
          call celpar (1,a)                                             CELI086
          call celpar (2,b)                                             CELI087
          call celpar (3,c)                                             CELI088
          call celpar (4,al)                                            CELI089
          call celpar (5,be)                                            CELI090
          call celpar (6,ga)                                            CELI091
       else                                                             CELI092
          print*,' Unable to decode system in SPCTXT - <cr> to resume'  CELI093
          call inkey (answ)                                             CELI094
       endif                                                            CELI095
       return                                                           CELI096
       end                                                              CELI097
                                                                        CELI098
