anchor.diff:    integer, intent(in) :: ix
     integer, intent(in) :: n
     
  -  real(kind=fPrec) xx, yy, rr, frr, rr_sq, r1_sq, elSig_sq
  +  real(kind=fPrec) xx, yy, rr, frr, rr_sq, r1_sq, elSig_sq, tmpBB
     integer          jj
   
     r1_sq=elens_r1(ielens(ix))**2
  
positive.code:   integer, save               :: elens_iSet_def=0           ! default iSet
    logical, save               :: elens_lFox_def=.true.      ! default lFox
    integer, save               :: elens_radial_mpoints_def=2 ! default number of points for interpolating radial profiles from ASCI files
    
    ! variables to save elens parameters for tracking etc.
    integer, allocatable, save          :: elens_type(:)            ! integer for elens type (nelens)
  
negative.code:   use floatPrecision
    use mathlib_bouncer
    use numerical_constants, only : zero, one, two, pi, c1e3, c1m3, c1m6
    use physical_constants, only: clight, eps0
    use mod_common, only : e0, beta0, brho, bez, kz, zz0
    use mod_settings, only : st_quiet
  
    implicit none
  
    integer j,jj
    real(kind=fPrec) gamma_lens_beam
  
    if(elens_lThetaR2(j) .and. elens_lAllowUpdate(j)) then
      ! the update of elens_beta_lens_beam is not strictly needed here,
      !   apart from the case of elens_Ek is DYNK-ed
      gamma_lens_beam  = ((elens_Ek(j)*c1m3)/elens_beam_mass(j))+one ! from kinetic energy
      elens_beta_lens_beam(j) = sqrt((one+one/gamma_lens_beam)*(one-one/gamma_lens_beam))
      
      ! r2: from mm to m (c1m3)
      ! theta: from rad to mrad (c1e3)
      elens_theta_r2(j) = gamma_lens_beam*((elens_len(j)*abs(elens_I(j)))/ &
           ((((two*pi)*((eps0*clight)*clight))*brho)*(elens_r2(j)*c1m3)))*c1e3
      elens_theta_r2(j) = sign(elens_theta_r2(j),elens_beam_chrg(j))
      elens_theta_r2(j) = elens_theta_r2(j)*(one/(elens_beta_lens_beam(j)*beta0)- &
           sign(one,elens_I(j)/elens_beam_chrg(j)))
  
      if ( elens_type(j)>=2 ) elens_theta_r2(j) = elens_theta_r2(j) * elens_geo_norm(j)
  
  