anchor.diff:      end if
       cdb_cFamily(j) = famID
   
  -    call cdb_getCollStage(cdb_cName(j), collType)
  -    cdb_famStage(famID) = collType
  +    call cdb_getCollStage(cdb_cName(j), collStage)
  +    cdb_famStage(famID) = collStage
   
       matID = collmat_getCollMatID(cdb_cMaterial(j))
       if(matID > 0) then
  
positive.code:       case("CRY")
          cdb_famStage(famID) = cdb_stgCrystal
        case default
          write(lerr,"(a,i0)") "COLLDB> ERROR Unknown collimator type '"//trim(lnSplit(4))//"' on line ",iLine
          call prror
        end select
        goto 10
  
negative.code: !  V.K. Berglyd Olsen, BE-ABP-HSS
  !  Created: 2019-10-07
  !  Updated: 2019-10-07
  !  Get name from collimator stage ID
  ! ================================================================================================ !
  character(len=9) function cdb_getStageName(typID)
  
    integer, intent(in) :: typID
  
    if(iand(typID,cdb_stgPrimary) == cdb_stgPrimary) then
      cdb_getStageName = "PRIMARY"
    elseif(iand(typID,cdb_stgSecondary) == cdb_stgSecondary) then
      cdb_getStageName = "SECONDARY"
    elseif(iand(typID,cdb_stgTertiary) == cdb_stgTertiary) then
      cdb_getStageName = "TERTIARY"
    elseif(iand(typID,cdb_stgOther) == cdb_stgOther) then
      cdb_getStageName = "OTHER"
    elseif(iand(typID,cdb_stgCrystal) == cdb_stgCrystal) then
      cdb_getStageName = "CRYSTAL"
    else
      cdb_getStageName = "UNKNOWN"
    end if
  
  end function cdb_getStageName
  
  ! ================================================================================================ !
  !  V.K. Berglyd Olsen, BE-ABP-HSS
  