anchor.diff:    use crcoall
     use string_tools
     use mod_common
  +  use mod_units, only: units_openUnit
   
     implicit none
   
     integer i,j
  -  logical lerror,lopen
  -#ifdef BOINC
  -  character(len=256) filename
  -#endif
  +  logical lerror,lopen,err
     character(len=1024) arecord
   
     write(93,*) "SIXTRACR CRCHECK REPOSITIONING file of APERTURE LOSSES to apefilepos_cr=",apefilepos_cr
     flush(93)
   
     inquire( unit=losses_unit, opened=lopen )
  -  if (.not. lopen) then
  -#ifdef BOINC
  -    call boincrf(losses_filename,filename)
  -    open(losses_unit,file=filename, status='old',form='formatted',action='readwrite')
  -#else
  -    open(losses_unit,file=trim(losses_filename), status='old',form='formatted',action='readwrite')
  -#endif
  -  end if
  +  if (.not. lopen) call units_openUnit(unit=losses_unit,fileName=losses_filename,status='old',formatted=.true.,mode='rw',err=err)
   
     apefilepos = 0
     do j=1,apefilepos_cr
  
positive.code:   ! A.Mereghetti (CERN, BE/ABP-HSS), 22-03-2018
    ! dump cross-sections of apertures at specific locations (loop)
    !-----------------------------------------------------------------------
    implicit none
    ! temporary variables
    logical lfound, lopen, lApeUp, lApeDw
    integer ixsec, ierro, iEl, ixEl, iApeUp, ixApeUp, iApeDw, ixApeDw, itmpape
    real(kind=fPrec) sLoc, tmpape(9)
  #ifdef BOINC
    character(len=256) filename
  #endif
  
    ! loop over requested lines
    do ixsec=1,mxsec
  
negative.code: !     always in main code
  !-----------------------------------------------------------------------
    use parpro
    use mod_units, only: units_openUnit
    implicit none
  
  ! temporary variables
    integer i, ix
    logical lopen,err
  
    integer iOld, ixOld, niter, oKApe, jj
    real(kind=fPrec) aprr(9),slos
  