      subroutine reorinfo(atom,atom1,natom,coorn)
      use module
      use mod_script
      use moddi
      IMPLICIT REAL(8)(A-H,O-X,Z),logical(1)(y)
      character(4),dimension(nsym*natom) :: atom,atom1
      character(8) lab1
      dimension coortmp(3),sim(8)
      dimension coorn(3,natom*nsym)
      character(3) sim
      natom1=0
      do iat=1,natom
         n0=natom1+1
         natom1=natom1+multat(iat)
         atom1(n0:natom1)=atom(iat)
      enddo
         
      print*,'atomes en symetrie ',atom(1:natom)
      print*,'atomes en local    ',atom1(1:natom1)
!
! Nouvelles coordonnees
!
      ! on lit les operations de symetrie de desymorb
      open(99,form='unformatted',status='old',file='DESYMORB2')
      do k=1,6
         read(99)
      enddo
      read(99) sim(1:nsym)
         print*,'sim   ',sim(1:nsym)
      n=0
      do k=1,natom
         n=n+1
         ndep=n
         coorn(:,n)=coor(:,k)
         do iop=2,nsym
            ynouv=.false.
            coortmp=coor(:,k)
            if(abs(coor(1,k))>1.d-6) then
               if(index(sim(iop),'X')/=0) then
                  ynouv=.true.
                  coortmp=coortmp*(/-1,1,1/)
               endif
            endif
            if(abs(coor(2,k))>1.d-6) then
               if(index(sim(iop),'Y')/=0) then
                  ynouv=.true.
                  coortmp=coortmp*(/1,-1,1/)
               endif
            endif
            if(abs(coor(3,k))>1.d-6) then
               if(index(sim(iop),'Z')/=0) then
                  ynouv=.true.
                  coortmp=coortmp*(/1,1,-1/)
               endif
            endif
            if(ynouv) then
               do i=ndep,n
                  if(all(coortmp==coorn(:,i))) then 
                     ynouv=.false.
                     exit
                  endif
               enddo
            endif
            if(ynouv) then
               n=n+1
               !print*,'iop',iop,n,k
               coorn(:,n)=coortmp
            endif
         enddo
      enddo
      print*,'coordonnees totales'
      call mscript(coorn(:,1:natom1))
      natom=natom1
      atom=atom1
      return
      end
