anchor.diff:      fmtUnit = trim(fmtName(unitPos:fmtLen))
     else
       fmtBase = trim(fmtName)
  -    fmtUnit = "[none]"
  +    fmtUnit = "[1]"
     end if
   
     select case(chr_toUpper(fmtBase))
   
  -  case("OFF","SKIP") ! Ignored
  -    call dist_appendFormat(dist_fmtNONE, one)
  -  case("ID") ! Particle ID
  -    call dist_appendFormat(dist_fmtPartID, one)
  -  case("PARENT") ! Parent ID
  -    call dist_appendFormat(dist_fmtParentID, one)
  -
  -  case("X") ! Horizontal position
  +  case("OFF","SKIP")
  +    call dist_appendFormat(dist_fmtNONE,     one,  0)
  +  case("ID")
  +    call dist_appendFormat(dist_fmtPartID,   one,  0)
  +  case("PARENT")
  +    call dist_appendFormat(dist_fmtParentID, one,  0)
  +
  +  case("X")
       call dist_unitScale(fmtName, fmtUnit, 1, uFac, fErr)
  -    call dist_appendFormat(dist_fmtX, uFac)
  -  case("Y") ! Vertical positiom
  +    call dist_appendFormat(dist_fmtX,        uFac, 1)
  +  case("Y")
       call dist_unitScale(fmtName, fmtUnit, 1, uFac, fErr)
  -    call dist_appendFormat(dist_fmtY, uFac)
  -  case("XP") ! Horizontal angle
  +    call dist_appendFormat(dist_fmtY,        uFac, 3)
  +
  +  case("XP")
  +    call dist_appendFormat(dist_fmtXP,       uFac, 2)
  +  case("YP")
  +    call dist_appendFormat(dist_fmtYP,       uFac, 4)
  +
  +  case("PX")
  +    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  +    call dist_appendFormat(dist_fmtPX,       uFac, 2)
  +  case("PY")
  +    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  +    call dist_appendFormat(dist_fmtPY,       uFac, 4)
  +
  +  case("PX/P0","PXP0")
  +    call dist_appendFormat(dist_fmtPX,       one,  2)
  +  case("PY/P0","PYP0")
  +    call dist_appendFormat(dist_fmtPY,       one,  4)
  +
  +  case("SIGMA")
  +    call dist_unitScale(fmtName, fmtUnit, 1, uFac, fErr)
  +    call dist_appendFormat(dist_fmtSIGMA,    uFac, 5)
  +  case("ZETA")
  +    call dist_unitScale(fmtName, fmtUnit, 1, uFac, fErr)
  +    call dist_appendFormat(dist_fmtZETA,     uFac, 5)
  +  case("DT")
  +    call dist_unitScale(fmtName, fmtUnit, 4, uFac, fErr)
  +    call dist_appendFormat(dist_fmtDT,       uFac, 5)
  +
  +  case("E")
  +    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  +    call dist_appendFormat(dist_fmtE,        uFac, 6)
  +  case("P")
  +    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  +    call dist_appendFormat(dist_fmtP,        uFac, 6)
  +  case("DE/E0","DEE0")
  +    call dist_appendFormat(dist_fmtDEE0,     one,  6)
  +  case("DP/P0","DPP0")
  +    call dist_appendFormat(dist_fmtDPP0,     one,  6)
  +  case("DE/P0","DEP0","PT")
  +    call dist_appendFormat(dist_fmtPT,       one,  6)
  +
  +  case("XN")
  +    call dist_appendFormat(dist_fmtXN,       one,  1)
  +  case("YN")
  +    call dist_appendFormat(dist_fmtYN,       one,  3)
  +  case("ZN")
  +    call dist_appendFormat(dist_fmtZN,       one,  5)
  +  case("PXN")
  +    call dist_appendFormat(dist_fmtPXN,      one,  2)
  +  case("PYN")
  +    call dist_appendFormat(dist_fmtPYN,      one,  4)
  +  case("PZN")
  +    call dist_appendFormat(dist_fmtPZN,      one,  6)
  +
  +  case("JX")
  +    call dist_appendFormat(dist_fmtJX,       one,  1)
  +  case("JY")
  +    call dist_appendFormat(dist_fmtJY,       one,  3)
  +  case("JZ")
  +    call dist_appendFormat(dist_fmtJZ,       one,  5)
  +  case("PHIX")
       call dist_unitScale(fmtName, fmtUnit, 2, uFac, fErr)
  -    call dist_appendFormat(dist_fmtXP, uFac)
  -  case("YP") ! Vertical angle
  +    call dist_appendFormat(dist_fmtPhiX,     uFac, 2)
  +  case("PHIY")
       call dist_unitScale(fmtName, fmtUnit, 2, uFac, fErr)
  -    call dist_appendFormat(dist_fmtYP, uFac)
  -  case("PX") ! Horizontal momentum
  +    call dist_appendFormat(dist_fmtPhiY,     uFac, 4)
  +  case("PHIZ")
  +    call dist_unitScale(fmtName, fmtUnit, 2, uFac, fErr)
  +    call dist_appendFormat(dist_fmtPhiZ,     uFac, 6)
  +
  +  case("MASS","M")
       call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  -    call dist_appendFormat(dist_fmtPX, uFac)
  -  case("PY") ! Vertical momentum
  -    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  -    call dist_appendFormat(dist_fmtPY, uFac)
  -  case("PX/P0","PXP0") ! Relative horizontal momentum
  -    call dist_appendFormat(dist_fmtPX, one)
  -  case("PY/P0","PYP0") ! Relative vertical momentum
  -    call dist_appendFormat(dist_fmtPY, one)
  -  case("SIGMA") ! Longitudinal relative position
  -    call dist_unitScale(fmtName, fmtUnit, 1, uFac, fErr)
  -    call dist_appendFormat(dist_fmtSIGMA, uFac)
  -  case("DT") ! Time delay
  -    call dist_unitScale(fmtName, fmtUnit, 4, uFac, fErr)
  -    call dist_appendFormat(dist_fmtDT, uFac)
  -  case("E") ! Particle energy
  -    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  -    call dist_appendFormat(dist_fmtE, uFac)
  -  case("P") ! Particle momentum
  -    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  -    call dist_appendFormat(dist_fmtP, uFac)
  -  case("DE/E0","DEE0") ! Relative particle energy (to reference particle)
  -    call dist_appendFormat(dist_fmtDEE0, one)
  -  case("DP/P0","DPP0") ! Relative particle momentum (to reference particle)
  -    call dist_appendFormat(dist_fmtDPP0, one)
  -
  -  case("MASS","M") ! Particle mass
  -    call dist_unitScale(fmtName, fmtUnit, 3, uFac, fErr)
  -    call dist_appendFormat(dist_fmtMASS, uFac)
  -  case("CHARGE","Q") ! Particle charge
  -    call dist_appendFormat(dist_fmtCHARGE, one)
  -  case("ION_A") ! Ion atomic mass
  -    call dist_appendFormat(dist_fmtIonA, one)
  -  case("ION_Z") ! Ion atomic number
  -    call dist_appendFormat(dist_fmtIonZ, one)
  -  case("PDGID") ! Particle PDG ID
  -    call dist_appendFormat(dist_fmtPDGID, one)
  +    call dist_appendFormat(dist_fmtMASS,     uFac, 0)
  +  case("CHARGE","Q")
  +    call dist_appendFormat(dist_fmtCHARGE,   one,  0)
  +  case("ION_A")
  +    call dist_appendFormat(dist_fmtIonA,     one,  0)
  +  case("ION_Z")
  +    call dist_appendFormat(dist_fmtIonZ,     one,  0)
  +  case("PDGID")
  +    call dist_appendFormat(dist_fmtPDGID,    one,  0)
   
     case("4D") ! 4D default coordinates
  -    call dist_appendFormat(dist_fmtX, one)          ! Horizontal position
  -    call dist_appendFormat(dist_fmtY, one)          ! Vertical positiom
  -    call dist_appendFormat(dist_fmtXP, one)         ! Horizontal angle
  -    call dist_appendFormat(dist_fmtYP, one)         ! Vertical angle
  +    call dist_appendFormat(dist_fmtX,        one,  1)
  +    call dist_appendFormat(dist_fmtPX,       one,  2)
  +    call dist_appendFormat(dist_fmtY,        one,  3)
  +    call dist_appendFormat(dist_fmtPY,       one,  4)
   
     case("6D") ! 6D default coordinates
  -    call dist_appendFormat(dist_fmtX, one)          ! Horizontal position
  -    call dist_appendFormat(dist_fmtY, one)          ! Vertical positiom
  -    call dist_appendFormat(dist_fmtXP, one)         ! Horizontal angle
  -    call dist_appendFormat(dist_fmtYP, one)         ! Vertical angle
  -    call dist_appendFormat(dist_fmtSIGMA, one)      ! Longitudinal relative position
  -    call dist_appendFormat(dist_fmtDPP0, one)       ! Relative particle momentum (to reference particle)
  -
  -  case("4D_NORM") ! 4D normalised coordinates
  -    call dist_appendFormat(dist_fmtX_NORM, one)     ! Normalised horizontal position
  -    call dist_appendFormat(dist_fmtY_NORM, one)     ! Normalised vertical positiom
  -    call dist_appendFormat(dist_fmtXP_NORM, one)    ! Normalised horizontal angle
  -    call dist_appendFormat(dist_fmtYP_NORM, one)    ! Normalised vertical angle
  -    dist_norm4D = .true.
  -
  -  case("6D_NORM") ! 6D normalised coordinates
  -    call dist_appendFormat(dist_fmtX_NORM, one)     ! Normalised horizontal position
  -    call dist_appendFormat(dist_fmtY_NORM, one)     ! Normalised vertical positiom
  -    call dist_appendFormat(dist_fmtXP_NORM, one)    ! Normalised horizontal angle
  -    call dist_appendFormat(dist_fmtYP_NORM, one)    ! Normalised vertical angle
  -    call dist_appendFormat(dist_fmtSIGMA_NORM, one) ! Normalised longitudinal relative position
  -    call dist_appendFormat(dist_fmtDPP0_NORM, one)  ! Normalised relative particle momentum (to reference particle)
  -    dist_norm6D = .true.
  +    call dist_appendFormat(dist_fmtX,        one,  1)
  +    call dist_appendFormat(dist_fmtPX,       one,  2)
  +    call dist_appendFormat(dist_fmtY,        one,  3)
  +    call dist_appendFormat(dist_fmtPY,       one,  4)
  +    call dist_appendFormat(dist_fmtZETA,     one,  5)
  +    call dist_appendFormat(dist_fmtDPP0,     one,  6)
  +
  +  case("NORM") ! 6D normalised coordinates
  +    call dist_appendFormat(dist_fmtXN,       one,  1)
  +    call dist_appendFormat(dist_fmtPXN,      one,  2)
  +    call dist_appendFormat(dist_fmtYN,       one,  3)
  +    call dist_appendFormat(dist_fmtPYN,      one,  4)
  +    call dist_appendFormat(dist_fmtZN,       one,  5)
  +    call dist_appendFormat(dist_fmtPZN,      one,  6)
  +
  +  case("ACTION") ! 6D action
  +    call dist_appendFormat(dist_fmtJX,       one,  1)
  +    call dist_appendFormat(dist_fmtPhiX,     one,  2)
  +    call dist_appendFormat(dist_fmtJY,       one,  3)
  +    call dist_appendFormat(dist_fmtPhiY,     one,  4)
  +    call dist_appendFormat(dist_fmtJZ,       one,  5)
  +    call dist_appendFormat(dist_fmtPhiZ,     one,  6)
   
     case("IONS") ! The ion columns
  -    call dist_appendFormat(dist_fmtMASS, c1e3)      ! Particle mass
  -    call dist_appendFormat(dist_fmtCHARGE, one)     ! Particle charge
  -    call dist_appendFormat(dist_fmtIonA, one)       ! Ion atomic mass
  -    call dist_appendFormat(dist_fmtIonZ, one)       ! Ion atomic number
  -    call dist_appendFormat(dist_fmtPDGID, one)      ! Particle PDG ID
  +    call dist_appendFormat(dist_fmtMASS,     c1e3, 0)
  +    call dist_appendFormat(dist_fmtCHARGE,   one,  0)
  +    call dist_appendFormat(dist_fmtIonA,     one,  0)
  +    call dist_appendFormat(dist_fmtIonZ,     one,  0)
  +    call dist_appendFormat(dist_fmtPDGID,    one,  0)
   
     case("OLD_DIST") ! The old DIST block file format
  -    call dist_appendFormat(dist_fmtPartID, one)     ! Particle ID
  -    call dist_appendFormat(dist_fmtParentID, one)   ! Parent ID
  -    call dist_appendFormat(dist_fmtNONE, one)       ! Ignored
  -    call dist_appendFormat(dist_fmtX, c1e3)         ! Horizontal position
  -    call dist_appendFormat(dist_fmtY, c1e3)         ! Vertical positiom
  -    call dist_appendFormat(dist_fmtNONE, one)       ! Ignored
  -    call dist_appendFormat(dist_fmtXP, c1e3)        ! Horizontal angle
  -    call dist_appendFormat(dist_fmtYP, c1e3)        ! Vertical angle
  -    call dist_appendFormat(dist_fmtNONE, one)       ! Ignored
  -    call dist_appendFormat(dist_fmtIonA, one)       ! Ion atomic mass
  -    call dist_appendFormat(dist_fmtIonZ, one)       ! Ion atomic number
  -    call dist_appendFormat(dist_fmtMASS, c1e3)      ! Particle mass
  -    call dist_appendFormat(dist_fmtP, c1e3)         ! Particle momentum
  -    call dist_appendFormat(dist_fmtDT, one)         ! Time delay
  +    call dist_appendFormat(dist_fmtPartID,   one,  0)
  +    call dist_appendFormat(dist_fmtParentID, one,  0)
  +    call dist_appendFormat(dist_fmtNONE,     one,  0)
  +    call dist_appendFormat(dist_fmtX,        c1e3, 1)
  +    call dist_appendFormat(dist_fmtY,        c1e3, 3)
  +    call dist_appendFormat(dist_fmtNONE,     one,  0)
  +    call dist_appendFormat(dist_fmtXP,       c1e3, 2)
  +    call dist_appendFormat(dist_fmtYP,       c1e3, 4)
  +    call dist_appendFormat(dist_fmtNONE,     one,  0)
  +    call dist_appendFormat(dist_fmtIonA,     one,  0)
  +    call dist_appendFormat(dist_fmtIonZ,     one,  0)
  +    call dist_appendFormat(dist_fmtMASS,     c1e3, 0)
  +    call dist_appendFormat(dist_fmtP,        c1e3, 6)
  +    call dist_appendFormat(dist_fmtDT,       one,  5)
   
     case default
       write(lerr,"(a)") "DIST> ERROR Unknown column format '"//trim(fmtName)//"'"
  
positive.code:   ! Physical Coordinates
    integer, parameter :: dist_fmtX           = 11 ! Horizontal position
    integer, parameter :: dist_fmtY           = 12 ! Vertical positiom
    integer, parameter :: dist_fmtXP          = 13 ! Horizontal angle
    integer, parameter :: dist_fmtYP          = 14 ! Vertical angle
    integer, parameter :: dist_fmtPX          = 15 ! Horizontal momentum
    integer, parameter :: dist_fmtPY          = 16 ! Vertical momentum
    integer, parameter :: dist_fmtPXP0        = 17 ! Relative horizontal momentum
    integer, parameter :: dist_fmtPYP0        = 18 ! Relative vertical momentum
    integer, parameter :: dist_fmtSIGMA       = 19 ! Longitudinal relative position
    integer, parameter :: dist_fmtDT          = 20 ! Time delay
    integer, parameter :: dist_fmtE           = 21 ! Particle energy
    integer, parameter :: dist_fmtP           = 22 ! Particle momentum
    integer, parameter :: dist_fmtDEE0        = 23 ! Relative particle energy (to reference particle)
    integer, parameter :: dist_fmtDPP0        = 24 ! Relative particle momentum (to reference particle)
  
    ! Normalised Coordinates
    integer, parameter :: dist_fmtX_NORM      = 31 ! Normalised horizontal position
    integer, parameter :: dist_fmtY_NORM      = 32 ! Normalised vertical positiom
    integer, parameter :: dist_fmtXP_NORM     = 33 ! Normalised horizontal angle
    integer, parameter :: dist_fmtYP_NORM     = 34 ! Normalised vertical angle
    integer, parameter :: dist_fmtSIGMA_NORM  = 35 ! Normalised longitudinal relative position
    integer, parameter :: dist_fmtDPP0_NORM   = 36 ! Normalised relative particle momentum (to reference particle)
  
    ! Ion Columns
    integer, parameter :: dist_fmtMASS        = 51 ! Particle mass
  
negative.code: 
    use crcoall
    use mod_common
    use mod_particles
    use mod_common_main
    use physical_constants
    use numerical_constants
  
    logical doAction, doNormal
  
    doAction = .false.
    doNormal = .false.
  
    select case(dist_partFmt(6))
    case(dist_fmtNONE)
      ejv(1:napx)  = e0
      call part_updatePartEnergy(1,.false.)
    case(dist_fmtE)
      ejv(1:napx)  = dist_partCol6(1:napx)
      call part_updatePartEnergy(1,.false.)
    case(dist_fmtP)
      ejfv(1:napx) = dist_partCol6(1:napx)
      call part_updatePartEnergy(2,.false.)
    case(dist_fmtDEE0)
      ejv(1:napx)  = (one + dist_partCol6(1:napx))*e0
      call part_updatePartEnergy(1,.false.)
    case(dist_fmtDPP0)
      dpsv(1:napx) = dist_partCol6(1:napx)*c1e3
      call part_updatePartEnergy(3,.false.)
    case(dist_fmtPT)
      ejv(1:napx)  = (one + dist_partCol6(1:napx))*e0f
      call part_updatePartEnergy(1,.false.)
    case(dist_fmtPZN)
      doNormal = .true.
    case(dist_fmtPhiZ)
      doAction = .true.
    end select
  
    select case(dist_partFmt(5))
    case(dist_fmtNONE)
      sigmv(1:napx) = zero
    case(dist_fmtZETA)
      sigmv(1:napx) = dist_partCol5(1:napx)*rvv(1:napx)
    case(dist_fmtSIGMA)
      sigmv(1:napx) = dist_partCol5(1:napx)
    case(dist_fmtDT)
      sigmv(1:napx) = -(e0f/e0)*(dist_partCol5(1:napx)*clight)
    case(dist_fmtZN)
      doNormal = .true.
    case(dist_fmtJZ)
      doAction = .true.
    end select
  
    select case(dist_partFmt(1))
    case(dist_fmtNONE)
      xv1(1:napx) = zero
    case(dist_fmtX)
      xv1(1:napx) = dist_partCol1(1:napx)
    case(dist_fmtXN)
      doNormal = .true.
    case(dist_fmtJX)
      doAction = .true.
    end select
  
    select case(dist_partFmt(2))
    case(dist_fmtNONE)
      yv1(1:napx) = zero
    case(dist_fmtXP)
      yv1(1:napx) = dist_partCol2(1:napx)
    case(dist_fmtPX)
      yv1(1:napx) = (dist_partCol2(1:napx)/ejfv(1:napx))*c1e3
    case(dist_fmtPXP0)
      yv1(1:napx) = (dist_partCol2(1:napx)/e0f)*c1e3
    case(dist_fmtPXN)
      doNormal = .true.
    case(dist_fmtPhiX)
      doAction = .true.
    end select
  
    select case(dist_partFmt(3))
    case(dist_fmtNONE)
      xv2(1:napx) = zero
    case(dist_fmtY)
      xv2(1:napx) = dist_partCol3(1:napx)
    case(dist_fmtYN)
      doNormal = .true.
    case(dist_fmtJY)
      doAction = .true.
    end select
  
    select case(dist_partFmt(4))
    case(dist_fmtNONE)
      yv2(1:napx) = zero
    case(dist_fmtYP)
      yv2(1:napx) = dist_partCol4(1:napx)
    case(dist_fmtPY)
      yv2(1:napx) = (dist_partCol4(1:napx)/ejfv(1:napx))*c1e3
    case(dist_fmtPYP0)
      yv2(1:napx) = (dist_partCol4(1:napx)/e0f)*c1e3
    case(dist_fmtPYN)
      doNormal = .true.
    case(dist_fmtPhiY)
      doAction = .true.
    end select
  
    if(doNormal .and. doAction) then
      write(lerr,"(a)") "DIST> ERROR Cannot mix normalised and action coordinates"
      call prror
    end if
  
    if(doNormal) then
      ! Call DISTlib
      continue
    end if
  
    if(doAction) then
      ! Call DISTlib
      continue
    end if
  
  