anchor.diff:      minAmpl = min(Nap1pos,Nap2pos,Nap1neg,Nap2neg)
   
   !   Assign amplitudes in x and y for the halo generation function
  -    if((mynex.gt.0).and.(myney.eq.zero)) then ! horizontal halo
  +    if((cdist_ampX.gt.0).and.(cdist_ampY.eq.zero)) then ! horizontal halo
         mynex2 = minAmpl
  -    else if((mynex.eq.0).and.(myney.gt.zero)) then ! vertical halo
  +    else if((cdist_ampX.eq.0).and.(cdist_ampY.gt.zero)) then ! vertical halo
         myney2 = minAmpl
       end if               ! other cases taken care of above - in these cases, program has already stopped
   
  
positive.code: 
  !     Treat as a pencil beam in main routine.
  
  subroutine makedis_coll(myalphax, myalphay, mybetax, mybetay, mynex, mdex, myney, mdey)
  
    use crcoall
    use mathlib_bouncer
    use mod_ranlux
    use mod_common, only : napx
    use mod_common_main, only : xv1, xv2, yv1, yv2, ejv, sigmv
  
    implicit none
  
    integer :: j
  
    real(kind=fPrec) myalphax,mybetax,myemitx0,myemitx,mynex,mdex,myalphay,mybetay,&
      myemity0,myemity,myney,mdey,xsigmax,ysigmay
  
    real(kind=fPrec) iix, iiy, phix,phiy,cutoff
  
  
negative.code: 
      else if(mynex == zero .and. myney > zero) then ! halo in y
  20    continue
        myemity = myemity0*(myney+(rndm4()*cdist_smearY))**2
        ysigmay = sqrt(mybetay*myemity)
        xv2(j)  = ysigmay * sin_mb(twopi*rndm4())
        if(abs(xv2(j)).lt.cutoff) goto 20
  