anchor.diff:        enddo
         write(*,'("Concentrations match for structures ",2(i6,1x))') strN, strN2
         write(13,'("Concentrations match for structures ",2(i6,1x))') strN, strN2
  +      write(*,'(2(14i1,/))') ilabeling1, ilabeling2
         if (any(L1/=L2)) then ! We must find the automorphism that connects the two different groups and adjust ilabeling2 accordingly
            if (associated(g1)) deallocate(g1)
            if (associated(g2)) deallocate(g2)
  
positive.code: real(dp), allocatable :: dset1(:,:), dset2(:,:), rot(:,:,:), shift(:,:)
  real(dp), pointer :: sLVlist(:,:,:)
  integer, pointer :: HNFout(:,:,:), eq(:), digit(:), HNFin(:,:,:)
  integer, pointer, dimension(:,:) :: label, g1, g2, dlabel, pLabel, qLabel
  integer :: LatDim1, LatDim2, match, nD1, nD2, Nmin, Nmax, k, ioerr
  integer :: strN, sizeN, n, pgOps, diag(3), a, b, c, d, e, f, i, jl, j, cDigits
  integer :: iuq, nuq, iP, nP, lc, iStr2, HNFtest(3,3), hdgenfact, labdgen, totdgen
  integer :: strN2, hnfN2, n2, pgOps2, diag2(3), iL, nL, idx, f1, f2, iLP, nLP, jp
  !integer :: sizeN2
  integer, allocatable :: ilabeling1(:), ilabeling2(:), atomType(:), automorphism(:)
  real(dp) :: eps
  logical full, HNFmatch, foundLab, err, equiatomic
  character(maxLabLength)   :: labeling ! List, 0..k-1, of the atomic type at each site
  type(RotPermList)         :: dRotList1, dRotList2
  type(RotPermList),pointer :: LattRotList1(:), LattRotList2(:)
  type(opList), pointer     :: fixOp(:)
  integer, pointer          :: crange(:,:)
  !logical                   :: conc_check
  integer, pointer          :: degen_list(:)
  integer, pointer          :: rotProdLab(:)
  integer, pointer          :: labPerms(:,:)
  
  SNF = 0
  allocate(HNFin(3,3,1))
  
negative.code:                   enddo
                 endif
              enddo
           if(.not. foundLab) then
              write(13,'("Labeling didn''t match for str #:",i8)') strN
           else
              write(13,'("Structure number:",i8," in file2 is a match to ",i8," in file1!")') strN2, strN
           endif
           !if (match/=0) exit
     enddo compareloop
     close(f2)
     if(match==0) then
        write(13,'("Match for str #:",i8," in file 1 was not found in file 2")') strN
        write(*,'("Match for str #:",i8," in file 1 was not found in file 2")') strN
        stop
     else
        write(13,'("Structure number:",i8," is a match to # ",i9," in file 2.")') strN, match
        write(*,'("Structure number:",i8," is a match to # ",i9," in file 2.")') strN, match
  