      subroutine oneout (title,dmax,conang,condis,isearc,iatom,vez,cel, ONEO001
     &isystm,isyst,igr,isymce,ibravl,ispa,t,cosi,revdat,icomp,lv,an,de, ONEO002
     &avern,izell,lo,hi,loang,hiang,omit,iwater,bump,iano,lambda)                   ONEO003
c ----------------------------------------------------------------------ONEO004
c     This program module is part of the author's X-ray Library         ONEO005
c     and may not be sold or reproduced for commercial purposes.        ONEO006
c     Although it has been tested carefully, there is no warranty       ONEO007
c     regarding accuracy or freedom from side-effects.                  ONEO008
c                   (C) 1986-1994 Bernhard Rupp                         ONEO009
c ----------------------------------------------------------------------ONEO010
c              ONEOUT writes first part of SEXIE output                 ONEO011
c ----------------------------------------------------------------------ONEO012
      character sys$*12,bra$*13,nul*7,f*13,bcc*15,fmt3*5,revdat*8       ONEO013
      character rh*30,tv*23,title*60,fms1*26,fmt1*10,fmt2*8             ONEO014
      character avern*3,icomp*4,lv,an,de                                ONEO015
      integer igr(36)                                                   ONEO016
      real lo,hi,loang,hiang,omit,lambda                                ONEO017
      dimension cel(6),sys$(7),bra$(7),f(3),t(3,3),cosi(3)              ONEO018
                                                                        ONEO019
      data xkev /12.397639/                                             FPRI131
      data (sys$(i),i=1,7)/ 'monoclinic  ', 'orthorhombic',             ONEO020
     &'rhombohedral', 'tetragonal  ',  'cubic       ',                  ONEO021
     &'hexagonal   ', 'triclinic   '/                                   ONEO022
                                                                        ONEO023
      data (bra$(i),i=1,7)/ 'primitive    ',  'body centered',          ONEO024
     &'rhombohedral ', 'face centered', 'A-centered   ',                ONEO025
     &'B-centered   ', 'C-centered   '/                                 ONEO026
      data nul/'(0,0,0)'/                                               ONEO027
      data (f(i),i=1,3)/', (0,1/2,1/2)',', (1/2,0,1/2)',', (1/2,1/2,0)'/ONEO028
      data bcc/', (1/2,1/2,1/2)'/                                       ONEO029
      data rh/', (2/3,1/3,1/3), (1/3,2/3,2/3)'/                         ONEO030
      data tv/' Translation vectors : '/                                ONEO031
                                                                        ONEO032
      fmt1='(1x,a1,a,i'                                                 ONEO033
      fmt2=',a,12a1,'                                                   ONEO034
      fmt3='x,a1)'                                                      ONEO035
                                                                        ONEO036
      call clrscr (icomp)                                               ONEO037
                                                                        ONEO038
      do 9001 ipr=6,7                                                   ONEO039
      call frames (ipr,1,icomp)                                         ONEO040
      write(ipr,'(1x,a1,26x,a,26x,a1)')lv,'P R O G R A M   S E X I E',lvONEO041
      call frames (ipr,2,icomp)                                         ONEO042
      write(ipr,'(1x,a1,8x,a,a,8x,a1)')lv,'Calculation of Coordination',ONEO043
     & ' Shells and Interatomic Distances ',lv                          ONEO044
      write(ipr,'(1x,a1,25x,a,26x,a1)')lv,'       Bernhard Rupp      ', ONEO045
     & lv                                                               ONEO046
      write(ipr,'(1x,a1,23x,a,a,a,a,24x,a1)')lv,'Version ',avern,       ONEO047
     & ', Revision ',revdat   ,lv                                       ONEO048
      write(ipr,'(1x,a1,11x,a,12x,a1)')lv,  '       Proprietary code of ONEO049
     &Bernhard Rupp  (C) 1988-95 ',lv                                   ONEO050
      call frames (ipr,2,icomp)                                         ONEO051
      write(ipr,'(1x,a1,a,a60,8x,a1)')lv,' Title : ',title,lv           ONEO052
      write(ipr,'(1x,a1,a,55x,a1)')lv,' Control parameters : ',lv       ONEO053
                                                                        ONEO054
      if (iatom.gt.0.and.dmax.gt.0.and.iwater.ne.3) then                ONEO055
         write(ipr,'(1x,a1,a,f5.2,1x,a1,30x,a1)') lv,                   ONEO056
     &   ' Largest ligand distance in calculation ', dmax, an,lv        ONEO057
         write(ipr,'(1x,a1,a,a,f6.3,1x,a1,3x,a1)') lv,                  ONEO058
     &   ' Maximum deviation for considering atoms to be in a common',  ONEO059
     &   ' shell :',condis,an,lv                                        ONEO060
         if (isearc.eq.1) then                                          ONEO061
         write(ipr,'(1x,a1,a,f6.2,1x,a1,12x,a1)') lv,                   ONEO062
     &   ' Maximum deviation for considering angles to be special :',   ONEO063
     &   conang, de,lv                                                  ONEO064
         write(ipr,'(1x,a1,a,36x,a1)') lv,                              ONEO065
     &   ' Search for coordination geometry enabled',lv                 ONEO066
         else                                                           ONEO067
         write(ipr,'(1x,a1,a,35x,a1)') lv,                              ONEO068
     &   ' Search for coordination geometry disabled',lv                ONEO069
         end if                                                         ONEO070
         if (iwater.eq.1) then                                          ONEO071
            call frames (ipr,2,icomp)                                   ONEO072
            write(ipr,'(1x,a1,a,36x,a1)') lv,                           ONEO073
     &       ' Search for water structure enabled      ',lv             ONEO074
            if (izell.eq.0) then                                        ONEO075
               write(ipr,'(1x,a1,a,36x,a1)') lv,                        ONEO076
     &       ' Printout of unit cell contents omitted  ',lv             ONEO077
            else                                                        ONEO078
               write(ipr,'(1x,a1,a,36x,a1)') lv,                        ONEO079
     &       ' Full printout of unit cell contents     ',lv             ONEO080
            end if                                                      ONEO081
            write(ipr,'(1x,a1,a,a,f6.3,1x,a1,9x,a1)') lv,               ONEO082
     &     ' Lower limit for hydrogen bond distance in water structure',ONEO083
     &     ' :',lo,an,lv                                                ONEO084
            write(ipr,'(1x,a1,a,a,f6.3,1x,a1,9x,a1)') lv,               ONEO085
     &     ' Upper limit for hydrogen bond distance in water structure',ONEO086
     &     ' :',hi,an,lv                                                ONEO087
            write(ipr,'(1x,a1,a,a,f6.2,1x,a1,9x,a1)') lv,               ONEO088
     &     ' Lower limit for hydrogen bond angle in water structure   ',ONEO089
     &     ' :',loang,de,lv                                             ONEO090
            write(ipr,'(1x,a1,a,a,f6.2,1x,a1,9x,a1)') lv,               ONEO091
     &     ' Upper limit for hydrogen bond angle in water structure   ',ONEO092
     &     ' :',hiang,de,lv                                             ONEO093
            write(ipr,'(1x,a1,a,f5.2,1x,a1,23x,a1)') lv,                ONEO094
     &     ' Printout of coordination shells omitted past  ',omit,an,lv ONEO095
            write(ipr,'(1x,a1,a,f5.2,1x,a1,23x,a1)') lv,                ONEO096
     &     ' Bad atom contacts are defined below           ',bump,an,lv ONEO097
         end if                                                         ONEO098
      elseif (iatom.eq.0) then                                          ONEO099
         write(ipr,'(1x,a1,a,28x,a1)') lv,                              ONEO100
     &   ' No atom card detected - space group decoding only',lv        ONEO101
      elseif (iwater.eq.3) then
         write(ipr,'(1x,a1,a,28x,a1)') lv,                              ONEO100
     &   ' Preparing structure factor calculation          ',lv         ONEO101
         if (iano.eq.1) then
            write(ipr,'(1x,a1,a,28x,a1)') lv,                              ONEO100
     &   ' Anomalous dispersion correction is enabled      ',lv         ONEO101
         write(ipr,'(1x,a1,a,f8.5,1x,a1,a,f7.4,a,33x,a1)') lv,                   ONEO096
     &   ' Wavelength is ',lambda,an,' (',xkev/lambda,' keV)',lv                                     ONEO097
         else
            write(ipr,'(1x,a1,a,28x,a1)') lv,                              ONEO100
     &   ' No anomalous dispersion correction performed    ',lv         ONEO101
         end if
      end if                                                            ONEO102
                                                                        ONEO103
      call frames (ipr,2,icomp)                                         ONEO104
      write(ipr,'(1x,a1,a,a1,a,a1,a,a1,a,29x,a1)') lv,                  ONEO105
     &' Unit cell dimensions in ',an,', deg(',de,') and cubic ',        ONEO106
     & an,' :',lv                                                       ONEO107
      call frames (ipr,2,icomp)                                         ONEO108
      write(ipr,'(1x,a1,a,5x,a1)') lv,                                  ONEO109
     & '      a         b         c       alpha     beta      gamma     ONEO110
     & volume ',lv                                                      ONEO111
      write (ipr,'(1x,a1,3(1x,f9.4),3(1x,f9.3),f12.3,5x,a1)') lv,       ONEO112
     & (cel(i),i=1,6), vez, lv                                          ONEO113
                                                                        ONEO114
      call tensor (cel,t,cosi,ipr,icomp)                                ONEO115
      write (ipr,'(/,2x,a,/)') 'Space group decoding follows'           ONEO116
                                                                        ONEO117
      call frames (ipr,1,icomp)                                         ONEO118
      if (ispa.ne.0) then                                               ONEO119
         izap=int(ilog10(ispa))+1                                       ONEO120
         write(fms1,'(a10,i1,a8,i2,a5)') fmt1,izap,fmt2,45-izap,fmt3    ONEO121
         write(ipr,fms1) lv,                                            ONEO122
     &         ' Space group Nr. ',ispa,' : ',(igr(i),i=1,12),lv        ONEO123
      else                                                              ONEO124
         write(ipr,'(1x,a1,a,12a1,50x,a1)') lv,                         ONEO125
     &         ' Space group : ',(igr(i),i=1,12),lv                     ONEO126
      end if                                                            ONEO127
      call frames (ipr,2,icomp)                                         ONEO128
                                                                        ONEO129
      isy=isystm                                                        ONEO130
      if (isy.eq.3) isy=6                                               ONEO131
      write (ipr,'(1x,a1,a,a,18x,a1)') lv,                              ONEO132
     & ' System as decoded from unit cell dimensions : ',sys$(isystm),lvONEO133
      if (isyst.eq.isy) then                                            ONEO134
         write (ipr,'(1x,a1,a,12a1,33x,a1)') lv,                        ONEO135
     &    ' is consistent with space group ',(igr(i),i=1,12) ,lv        ONEO136
      else                                                              ONEO137
         write (ipr,'(1x,a1,a,12a1,29x,a1)') lv,                        ONEO138
     &    ' is not consistent with space group ',(igr(i),i=1,12) ,lv    ONEO139
      end if                                                            ONEO140
      if (isymce.eq.1) then                                             ONEO141
         write(ipr,'(1x,a1,a,30x,a1)') lv,                              ONEO142
     &   ' Centrosymmetric structure (X,Y,Z) = (-X,-Y,-Z)',lv           ONEO143
      else                                                              ONEO144
         write(ipr,'(1x,a1,a,47x,a1)') lv,                              ONEO145
     &   ' Non centrosymmetric structure',lv                            ONEO146
      end if                                                            ONEO147
                                                                        ONEO148
      write(ipr,'(1x,a1,a,a,43x,a1)') lv,                               ONEO149
     &' Bravais translation ',bra$(ibravl),lv                           ONEO150
      if (ibravl.eq.2) then                                             ONEO151
         write(ipr,'(1x,a1,a,a,a,32x,a1)') lv,tv,nul,bcc,lv             ONEO152
      elseif (ibravl.eq.3) then                                         ONEO153
         write(ipr,'(1x,a1,a,a,a,17x,a1)') lv,tv,nul,rh,lv              ONEO154
      elseif (ibravl.eq.4) then                                         ONEO155
         write(ipr,'(1x,a1,a,a,a,a,a,8x,a1)')lv,tv,nul,f(3),f(1),f(2),lvONEO156
      else                                                              ONEO157
         do 0001,i=5,7                                                  ONEO158
            if (ibravl.eq.i) write(ipr,'(1x,a1,a,a,a,34x,a1)')          ONEO159
     &          lv,tv,nul,f(i-4),lv                                     ONEO160
 0001    continue                                                       ONEO161
      end if                                                            ONEO162
      call frames (ipr,2,icomp)                                         ONEO163
 9001 continue                                                          ONEO164
      return                                                            ONEO165
      end                                                               ONEO166
