anchor.diff:    end select
   
   end subroutine dist_parseInputLine
  +
  +subroutine dist_setColumnFormat(fmtName, fErr)
  +
  +  use crcoall
  +  use string_tools
  +
  +  character(len=*), intent(in)  :: fmtName
  +  logical,          intent(out) :: fErr
  +
  +  fErr = .false.
  +
  +  select case(chr_toUpper(fmtName))
  +
  +  case("NONE")
  +    call dist_appendFormat(dist_fmtNONE)        ! Ignored
  +  case("ID")
  +    call dist_appendFormat(dist_fmtPartID)      ! Particle ID
  +  case("PARENT")
  +    call dist_appendFormat(dist_fmtParentID)    ! Parent ID
  +
  +  case("X")
  +    call dist_appendFormat(dist_fmtX)           ! Horizontal position
  +  case("Y")
  +    call dist_appendFormat(dist_fmtY)           ! Vertical positiom
  +  case("XP")
  +    call dist_appendFormat(dist_fmtXP)          ! Horizontal angle
  +  case("YP")
  +    call dist_appendFormat(dist_fmtYP)          ! Vertical angle
  +  case("PX")
  +    call dist_appendFormat(dist_fmtPX)          ! Horizontal momentum
  +  case("PY")
  +    call dist_appendFormat(dist_fmtPY)          ! Vertical momentum
  +  case("SIGMA","DS")
  +    call dist_appendFormat(dist_fmtSIGMA)       ! Longitudinal relative position
  +  case("DT")
  +    call dist_appendFormat(dist_fmtDT)          ! Time delay
  +  case("E")
  +    call dist_appendFormat(dist_fmtE)           ! Particle energy
  +  case("P")
  +    call dist_appendFormat(dist_fmtP)           ! Particle momentum
  +  case("DE/E0")
  +    call dist_appendFormat(dist_fmtDEE0)        ! Relative particle energy (to reference particle)
  +  case("DP/P0")
  +    call dist_appendFormat(dist_fmtDPP0)        ! Relative particle momentum (to reference particle)
  +
  +  case("X_NORM")
  +    call dist_appendFormat(dist_fmtX_NORM)      ! Normalised horizontal position
  +  case("Y_NORM")
  +    call dist_appendFormat(dist_fmtY_NORM)      ! Normalised vertical positiom
  +  case("XP_NORM")
  +    call dist_appendFormat(dist_fmtXP_NORM)     ! Normalised horizontal angle
  +  case("YP_NORM")
  +    call dist_appendFormat(dist_fmtYP_NORM)     ! Normalised vertical angle
  +  case("PX_NORM")
  +    call dist_appendFormat(dist_fmtPX_NORM)     ! Normalised horizontal momentum
  +  case("PY_NORM")
  +    call dist_appendFormat(dist_fmtPY_NORM)     ! Normalised vertical momentum
  +  case("SIGMA_NORM","DS_NORM")
  +    call dist_appendFormat(dist_fmtSIGMA_NORM)  ! Normalised longitudinal relative position
  +  case("DT_NORM")
  +    call dist_appendFormat(dist_fmtDT_NORM)     ! Normalised time delay
  +  case("E_NORM")
  +    call dist_appendFormat(dist_fmtE_NORM)      ! Normalised particle energy
  +  case("P_NORM")
  +    call dist_appendFormat(dist_fmtP_NORM)      ! Normalised particle momentum
  +  case("DE/E0_NORM")
  +    call dist_appendFormat(dist_fmtDEE0_NORM)   ! Normalised relative particle energy (to reference particle)
  +  case("DP/P0_NORM")
  +    call dist_appendFormat(dist_fmtDPP0_NORM)   ! Normalised relative particle momentum (to reference particle)
  +
  +  case("MASS","M")
  +    call dist_appendFormat(dist_fmtMASS)        ! Particle mass
  +  case("CHARGE","Q")
  +    call dist_appendFormat(dist_fmtCHARGE)      ! Particle charge
  +  case("ION_A")
  +    call dist_appendFormat(dist_fmtIonA)        ! Ion atomic number
  +  case("ION_Z")
  +    call dist_appendFormat(dist_fmtIonZ)        ! Ion atomic charge
  +  case("PDGID")
  +    call dist_appendFormat(dist_fmtPDGID)       ! Particle PDG ID
  +
  +  case("DEFAULT_4D") ! 4D default coordinates
  +    call dist_appendFormat(dist_fmtX)           ! Horizontal position
  +    call dist_appendFormat(dist_fmtY)           ! Vertical positiom
  +    call dist_appendFormat(dist_fmtXP)          ! Horizontal angle
  +    call dist_appendFormat(dist_fmtYP)          ! Vertical angle
  +
  +  case("DEFAULT_6D") ! 6D default coordinates
  +    call dist_appendFormat(dist_fmtX)           ! Horizontal position
  +    call dist_appendFormat(dist_fmtY)           ! Vertical positiom
  +    call dist_appendFormat(dist_fmtXP)          ! Horizontal angle
  +    call dist_appendFormat(dist_fmtYP)          ! Vertical angle
  +    call dist_appendFormat(dist_fmtSIGMA)       ! Longitudinal relative position
  +    call dist_appendFormat(dist_fmtDPP0)        ! Relative particle momentum (to reference particle)
  +
  +  case("DEFAULT_4D_NORM") ! 4D normalised coordinates
  +    call dist_appendFormat(dist_fmtX_NORM)      ! Normalised horizontal position
  +    call dist_appendFormat(dist_fmtY_NORM)      ! Normalised vertical positiom
  +    call dist_appendFormat(dist_fmtXP_NORM)     ! Normalised horizontal angle
  +    call dist_appendFormat(dist_fmtYP_NORM)     ! Normalised vertical angle
  +
  +  case("DEFAULT_6D_NORM") ! 6D normalised coordinates
  +    call dist_appendFormat(dist_fmtX_NORM)      ! Normalised horizontal position
  +    call dist_appendFormat(dist_fmtY_NORM)      ! Normalised vertical positiom
  +    call dist_appendFormat(dist_fmtXP_NORM)     ! Normalised horizontal angle
  +    call dist_appendFormat(dist_fmtYP_NORM)     ! Normalised vertical angle
  +    call dist_appendFormat(dist_fmtSIGMA_NORM)  ! Normalised longitudinal relative position
  +    call dist_appendFormat(dist_fmtDPP0_NORM)   ! Normalised relative particle momentum (to reference particle)
  +
  +  case("DEFAULT_OLD") ! The old DIST block file format
  +    call dist_appendFormat(dist_fmtPartID)      ! Particle ID
  +    call dist_appendFormat(dist_fmtNONE)        ! Ignored
  +    call dist_appendFormat(dist_fmtNONE)        ! Ignored
  +    call dist_appendFormat(dist_fmtX)           ! Horizontal position
  +    call dist_appendFormat(dist_fmtY)           ! Vertical positiom
  +    call dist_appendFormat(dist_fmtNONE)        ! Ignored
  +    call dist_appendFormat(dist_fmtXP)          ! Horizontal angle
  +    call dist_appendFormat(dist_fmtYP)          ! Vertical angle
  +    call dist_appendFormat(dist_fmtNONE)        ! Ignored
  +    call dist_appendFormat(dist_fmtIonA)        ! Ion atomic number
  +    call dist_appendFormat(dist_fmtIonZ)        ! Ion atomic charge
  +    call dist_appendFormat(dist_fmtMASS)        ! Particle mass
  +    call dist_appendFormat(dist_fmtP)           ! Particle momentum
  +    call dist_appendFormat(dist_fmtDT)          ! Time delay
  +  ! call dist_appendFormat(dist_fmtCHARGE)      ! Particle charge
  +  ! call dist_appendFormat(dist_fmtPDGID)       ! Particle PDG ID
  +
  +  case default
  +    write(lout,"(a)") "DIST> ERROR Unknown column format '"//trim(fmtName)//"'"
  +    fErr = .true.
  +
  +  end select
  +
  +end subroutine dist_setColumnFormat
  +
  +subroutine dist_appendFormat(fmtID)
  +
  +  use mod_alloc
  +
  +  integer, intent(in) :: fmtID
  +
  +  dist_nColumns = dist_nColumns + 1
  +  call alloc(dist_colFormat,dist_nColumns,dist_fmtNONE,"dist_colFormat")
  +  dist_colFormat(dist_nColumns) = fmtID
  +
  +end subroutine dist_appendFormat
   
   ! ================================================================================================ !
   !  A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team
  
positive.code:   logical,          intent(inout) :: iErr
  
    character(len=:), allocatable   :: lnSplit(:)
    integer nSplit
    logical spErr
  
    call chr_split(inLine, lnSplit, nSplit, spErr)
    if(spErr) then
  
negative.code: 
    select case(lnSplit(1))
  
    case("FORMAT")
      if(nSplit < 2) then
        write(lerr,"(a,i0)") "DIST> ERROR FORMAT takes at least 1 argument, got ",nSplit-1
        write(lerr,"(a)")    "DIST>       FORMAT [list of columns]"
        iErr = .true.
        return
      end if
      do i=2,nSplit
        call dist_setColumnFormat(lnSplit(i),cErr)
        if(cErr) then
          iErr = .true.
          return
        end if
      end do
  
    case("READ")
      if(nSplit < 2) then
        write(lerr,"(a,i0)") "DIST> ERROR READ takes 1 argument, got ",nSplit-1
        write(lerr,"(a)")    "DIST>       READ filename"
        iErr = .true.
        return
      end if
  