anchor.diff:            "' with unit ",xsecunit(ixsec)
           call prror(-1)
        end if
  -#ifdef BOINC
  -     call boincrf(xsec_filename(ixsec),filename)
  -     open(xsecunit(ixsec),file=filename,status='replace',form='formatted')
  -#else
  -     open(xsecunit(ixsec),file=trim(xsec_filename(ixsec)),status='replace',form='formatted')
  -#endif
  +     call units_openUnit(unit=xsecunit(ixsec),fileName=xsec_filename(ixsec),formatted=.true.,mode='w',err=err)
        if(ierro .ne. 0) then
           write(lout,"(2(a,i0))") "APER> ERROR Opening file '"//trim(xsec_filename(ixsec))//&
             "' on unit # ",xsecunit(ixsec),", iostat = ",ierro
  
positive.code: 
    ! Change from 'readwrite' to 'write'
    close(losses_unit)
  #ifdef BOINC
    call boincrf(losses_filename,filename)
    open(losses_unit,file=filename, status='old',position='append',form='formatted',action='write')
  #else
    open(losses_unit,file=trim(losses_filename), status='old',position='append',form='formatted',action='write')
  #endif
  
    return
  
  
negative.code:   use string_tools
    use file_units
    use sixtrack_input
    use mod_units, only: units_openUnit
  
    implicit none
  
  