anchor.diff:  print *, "Rotationally equivalent HNFs are not considered"
   print *, "Change this in the future"
   
  +call get_permutations((/(i,i=0,k-1)/),labPerms)
  +nLP = size(labPerms,2)
  +write(*,'("labPerms",30i2)') (labPerms(i,:),i=1,size(labPerms,1))
  +
   open(13,file="debug_match_check.out")
   do ! Read each structure from f1 and see if it is in the list of f2 structures
      read(f1,*,iostat=ioerr) strN, sizeN, hdgenfact, labdgen, totdgen, idx, n,  pgOps, diag, a,b,c,d,e,f, L1(:,:,1), labeling
  
positive.code:    match = 0
     ! Read in each structure from the second file and see if it matches the current structures from
     ! file 1.
     f2 = 14;
     open(f2,file=f2name,status="old")
     lc = 0 ! Count the number of lines
     do ! read the second file until the structure list begins
  
negative.code: 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 :: ilabeling(:), ilabeling2(:), atomType(:), permutedLab(:)
  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(:)
  