      subroutine getinp (title,elemt,ide,x,y,z,cel,iatom,igr,           GETI001
     &                   isearc,conang,conver,dmax,ispa,icalc)          GETI002
c ----------------------------------------------------------------------GETI003
c     read the input cards from SEXIE.INP                               GETI004
c ----------------------------------------------------------------------GETI005
c     This program module is part of the PhysiSoft X-ray Library        GETI006
c     and may not be sold or reproduced for commercial purposes.        GETI007
c     Although it has been tested carefully, there is no warranty       GETI008
c     regarding accuracy or freedom from side-effects.                  GETI009
c                   (C) 1986-1990 Bernhard Rupp                         GETI010
c ----------------------------------------------------------------------GETI011
      parameter (iat=20)                                                GETI012
                                                                        GETI013
      character elemt*2,ide*4,title*60                                  GETI014
      logical exists                                                    GETI015
      dimension elemt(iat),ide(iat),x(iat),y(iat),z(iat),igr(36),cel(6) GETI016
      dimension icalc(iat)                                              GETI017
                                                                        GETI018
      inquire(file='sexie.inp', err=7002,exist=exists)                  GETI019
c --- if not exists alarm ---                                           GETI020
      if (.not.exists) then                                             GETI021
         print*,' I can''t find a file SEXIE.INP - tilt'                GETI022
         stop 1                                                         GETI023
      end if                                                            GETI024
                                                                        GETI025
c --- open datafile for input - IBM  --                                 GETI026
      open (5,file='sexie.inp',err=7002,status='old')                   GETI027
                                                                        GETI028
c --- title -                                                           GETI029
      read (5,'(a)') title                                              GETI030
                                                                        GETI031
c --- control parameters -                                              GETI032
      read (5,*,err=9001) dmax,conver,isearc,conang                     GETI033
                                                                        GETI034
c --- cell constants -                                                  GETI035
      read (5,*,err=9002) (cel(i),i=1,6)                                GETI036
                                                                        GETI037
c --- space group -                                                     GETI038
      read (5,'(10a1,1x,i3)') (igr(I),I=1,10),ispa                      GETI039
      ibravl=ibrav(igr(i))                                              GETI040
                                                                        GETI041
c --- atom cards -                                                      GETI042
      do 1001 i=1,iat                                                   GETI043
         read (5,'(a2,2x,a4,3f8.4,i3)',end=7001,err=9003)               GETI044
     &        elemt(i),ide(i),x(i),y(i),z(i),icalc(i)                   GETI045
                                                                        GETI046
c ---    make coordinates positive -                                    GETI047
         if (x(i).lt.0) x(i)=x(i)+1                                     GETI048
         if (y(i).lt.0) y(i)=y(i)+1                                     GETI049
         if (x(i).lt.0) z(i)=z(i)+1                                     GETI050
 1001 continue                                                          GETI051
 7001 continue                                                          GETI052
      iatom=i-1                                                         GETI053
      close (unit=5,status='keep')                                      GETI054
      return                                                            GETI055
                                                                        GETI056
 7002 print*,'Cannot open input file SEXIE.INP - tilt'                  GETI057
      goto 9999                                                         GETI058
 9001 print*,'Error reading input - check control parameters card 2'    GETI059
      goto 9999                                                         GETI060
 9002 print*,'Error reading input - check cell constants card 3'        GETI061
      goto 9999                                                         GETI062
 9003 print*,'Error reading input - check atom cards and parameters'    GETI063
                                                                        GETI064
 9999 close (unit=5,status='keep')                                      GETI065
      stop                                                              GETI066
      end                                                               GETI067
