anchor.diff:     ! write(17,'(/,"ERROR: The input structure wasn''t primitive")')
      ! write(17,'("atom type: ",20(i2,1x))') aTypTemp(:)
      ! write(17,'("number of atoms: ",i2,5x," size of aTyp:",i2)') nAt, size(aTypTemp)
  -   stop "ERROR: input structure for get_gspace_representation was not primitive";endif
  +   !stop "ERROR: input structure for get_gspace_representation was not primitive";endif
  +  write(*,'(A)') "WARNING: input structure for get_gspace_representation was not primitive";endif
   aTypTemp = 1; pLVtemp = sLV
   call make_primitive(pLVtemp,aTypTemp,aBasTemp,.false.,eps)
   ! write(17,'("Parent lattice (columns): ",/,3(3(f7.3,1x),/))') (pLVtemp(iAt,:),iAt=1,3)
  
positive.code: !* Check that the site basis for both the enum file and POSCAR are consistent.
  !  They might not have the same origin so try all distinct origin shifts and see if there is any
  !  shift that maps all of the sites in one case to all of the sites in the other
  do iAt = 1, nD
     !write(*,'("iAt:",i3,"  EnumBas ",3(F8.4,1x))') iAt,EnumBas(:,iAt)
     !write(*,'("iAt:",i3,"  dset ",3(F8.4,1x))') iAt,dset(:,iAt)
     diff = dsetStruc(:,iAt)-dset(:,1)
     !write(*,'("iAt:",i3,"  diff ",3(F8.4,1x))') iAt,dset(:,iAt)-EnumBas(:,1)
     do iE = 1, nD
        mapped=.false.
        do iP = 1, nD
           testsite = dset(:,iP)-diff
           !write(*,'("iP:",i3,"  testsite",3(F8.4,1x))') iP,testsite
           call bring_into_cell(testsite,pLVinv,pLV,eps) ! Make sure we stay in the same cell        
           !write(*,'("iP:",i3,"  testsite",3(F8.4,1x))') iP,testsite
           if (equal(testsite,dset(:,iE),eps)) then ! this site maps to one in other lattice
              mapped=.true.;!print *,"mapped" 
              exit
           endif
        enddo
        if(.not. mapped) exit
     enddo
     ! If we get to here and mapped is true, then the iE loop concluded without mapped ever coming up
     ! false in the iP loop. If that is the case, then the sites in EnumBas all had coincident sites
     ! in aBas. That means that the parent lattices (POSCAR and enum) are equivalent even if they
     ! don't have the same origin.
     if (mapped) exit
  enddo
  if (.not. mapped) stop "The lattice sites of the two parent lattices are not coincident"
  if (.not. equal(diff,0._dp,eps)) then
     ! write(17,'("The atomic sites of the parent lattice of the input structure have been shifted by")')
     ! write(17,'(3(f8.4,1x),/)') diff
     dset = dset - spread(diff,2,size(aBas(:,2)))
     do iAt = 1, nD
        call bring_into_cell(dset(:,iAt),pLVinv,pLV,eps)
        ! write(17,'("new pBas: ",3(f8.4,1x))') dset(:,iAt)
  
negative.code: !   write(18,'("Atom #: ",i3,"   position: ",3(f7.3,1x))') iAt,aBas(:,iAt)
  !enddo
  
  !write(*,'("Diagonal entries of HNF: ",3(i3,1x))') diag
  !write(*,'("Left transform:",/,3(3i3,1x,/),/)') transpose(L)
  !write(*,'("parent lattice vectors (columns):",/,3(3(f7.3,1x),/),/)') transpose(A)
  !write(*,'("parLatt inverse (columns):",/,3(3(f7.3,1x),/),/)') transpose(Ainv)
  !do iAt = 1, nAt
  !   write(*,'("Atom #: ",i3,"   position: ",3(f7.3,1x))') iAt,aBas(:,iAt)
  !enddo
  
  g = 0
  do iAt = 1, nAt ! Map each real space vector (atom position) into the group
     ! We need to account for the fact that some of the atomic positions are offset by one of the
  