anchor.diff:  allocate(allD(nAllD)); allD = (/ (i,i=1,nAllD) /)
   allocate(allD2LabelD(nAllD));
   ! 1) Check whether we have to postprocess the labeling before writing it out
  +!    Postprocessing is needed if we do not want to enumerate all dset members of a primitive unit cell
  +!    due to some equivalencies. 
  +!    For example, in a 1x1 symmetric surface slab ( (*) denotes an atom ):
  +!
  +!      ------------------------------------------------ surface
  +!         (*)  topmost surface layer, dvector# 1
  +!         (*)  dvector# 2
  +!         (*)  dvector# 3
  +!         (*)  bottommost surface layer, dvector# 4
  +!      ------------------------------------------------ surface
  +!
  +!    the topmost and the bottommost atom should always have the same occupancy, as well as dvector 2
  +!    and dvector 3 should. You can therefore specify the following equivalency list:
  +!
  +!         equivalency of dvector# | 1 2 3 4
  +!         ---------------------------------   
  +!         equivalency list        | 1 2 2 1
  +!
  +!    which means that dvector# 1 and dvector# 4 have to have the same occupancy, they are equivalent
  +!    by enumeration. The same is true for dvector# 2 and dvector# 3
  +!
  +!    In this example, the enumeration code should only find enumerations of dvector# 1 and dvector# 2.
  +!    The occupations of dvector# 3 and dvector# 4 are then constructed in a postprocessing step. 
  +!    The postprocessing step takes the enumerated form (i.e. dvectors# 1 and 2, e.g. a labeling 0101 for
  +!    two unit cells) and tranforms it into a form that is valid for ALL dvectors, e.g. labeling 01010101 for
  +!    two unit cells).
  +!
   postprocessLabeling = .not. (all(  abs( equivalencies-allD ) ==0))
   allocate(pplabeling(n*nAllD))  ! this is ok whether we do postprocessing (nAllD>nD) or not (nAllD==nD)
   ! 2) if yes:
  
positive.code: 
  contains
  
  logical function check_labeling_numbers(labeling,el,range)
  integer, intent(in) :: labeling(:)
  integer, intent(in) :: el
  
negative.code: integer, intent(inout) :: Tcnt, Scnt, Hcnt ! counters for total number of labelings and number of this size and HNF running total 
  integer, intent(in) :: permIndx(:)
  character, intent(in) :: lm(:)
  integer, intent(in) :: number_ElementN     ! concentration check parameter: which element's concentration is checked?
  integer, intent(in) :: number_Range(2)     ! concentration check parameter: the lower and upper limit of the number of atoms
                                             !                                if spezies "number_ElementN" in the unit cell of 
                                             !                                size "n"
  
  integer nHNF ! Number of HNFs in the list that match the current block index, HNFi
  integer, allocatable :: vsH(:), vsL(:) ! Vector subscript for matching the HNF index to the HNF list
  