anchor.diff:      else
   #endif
         call f_requestUnit("dist0.dat", fUnit)
  -      call f_open(unit=fUnit,file="dist0.dat",formatted=.true.,mode="w")
  +      call f_open(unit=fUnit,file="dist0.dat",formatted=.true.,mode="w",status="replace")
         do j=1, napx
           write(fUnit,"(6(1x,e23.15))") xv1(j), yv1(j), xv2(j), yv2(j), sigmv(j), ejv(j)
         end do
  
positive.code:   else
  #endif
      call f_requestUnit(coll_efficDPFile,coll_efficDPUnit)
      call f_open(unit=coll_efficDPUnit,file=coll_efficDPFile,formatted=.true.,mode="w")
      if(n_tot_absorbed /= 0) then
        write(coll_efficDPUnit,"(a1,1x,a13,2(1x,a15),2(1x,a8))") "#","dp/p","n_dpop/tot_nabs","n_dpop","tot_nabs","npart"
        do k=1,numeffdpop
  
negative.code:   if(dowrite_amplitude) then
      ! Write amplitude.dat
      call f_requestUnit(coll_ampFile,coll_ampUnit)
      call f_open(unit=coll_ampUnit,file=coll_ampFile,formatted=.true.,mode="w",status="replace")
      write(coll_ampUnit,"(a1,1x,a6,1x,a20,19(1x,a20))") "#","ielem",chr_rPad("name",20),"s","AX_AV","AX_RMS","AY_AV","AY_RMS",&
        "alphax","alphay","betax","betay","orbitx","orbity","dispx","dispy","xbob","ybob","xpbob","ypbob","mux","muy"
      do i=1,iu
  