anchor.diff:    use mod_common
     use mod_commonmn
     use mod_settings
  -
  -  implicit none
  -
  -  character(len=15) :: fileName
  -  integer           :: fileUnit, j
  +  use string_tools
  +
  +  implicit none
  +
  +  character(len=200) :: roundBuf
  +  character(len=15)  :: fileName
  +  integer            :: fileUnit, j, k
  +  logical            :: rErr
   
     select case(st_finalstate)
   
  
positive.code:     fileName = "final_state.dat"
      call funit_requestUnit(fileName, fileUnit)
  
      open(fileUnit,file=fileName,form="formatted",status="new")
  
      write(fileUnit,"(a,i0)") "# napx  : ",napx
      write(fileUnit,"(a,i0)") "# npart : ",npart
      write(fileUnit,"(a1,a7,1x,a4,8(1x,a23))") "#","partID","lost","x","y","xp","yp","sigma","dp","p","e"
  
      do j=1,npart
        write(fileUnit, "(i8,1x,l4,8(1x,es23.16))") nlostp(j),llostp(j),xv1(j),xv2(j),yv1(j),yv2(j),sigmv(j),dpsv(j),ejfv(j),ejv(j)
      end do
  
      flush(fileUnit)
  
negative.code:     fileName = "final_state.bin"
      call funit_requestUnit(fileName, fileUnit)
  
      open(fileUnit,file=fileName,form="unformatted",access="stream",status="replace")
  
      write(fileUnit) int(napx, kind=int32)
      write(fileUnit) int(npart,kind=int32)
  