anchor.diff:  logical err
   real(dp), allocatable :: rgp(:,:)
   logical, allocatable :: skip(:)
  +integer OpIndxInSuperCellList, RowInDxGTable
  +
  +open(19,file="debug_get_rotation_perms_lists.out")
   
   ! Number of HNFs (superlattices); Index of the superlattices; Number of d-vectors in d set
   nH = size(HNF,3); n = determinant(HNF(:,:,1)); nD = size(RPList(1)%v,2) 
  
positive.code:       enddo
     enddo
  enddo ! loop over iH (superlattices)
  ENDSUBROUTINE get_rotation_perms_lists
  
  !***************************************************************************************************
  
negative.code:    !print *,nop,nd,n;stop
     allocate(rperms%perm(nOp,nD*n),STAT=status)
     if (status/=0) stop "Allocation failed in get_rotation_perm_lists: rperms%perm"
     do iOp = 1, nOp ! For each rotation, find the permutation 
        dgp = 0 ! Initialize the (d,g) table
        do iD = 1, nD ! Loop over each row in the (d,g) table
  