anchor.diff:    use crcoall
     use mod_alloc
     use numerical_constants, only : zero, one
  +  use physical_constants, only: pmae
     implicit none
   
     integer, allocatable, save  :: ielens(:)                  ! index of elens (nele)
  
positive.code:   integer, intent(in) :: ix
    integer, intent(in) :: n
    
    real(kind=fPrec) xx, yy, rr, frr, rr_sq, r1_sq, elSig_sq
    integer          jj
  
    r1_sq=elens_r1(ielens(ix))**2
  
negative.code:   logical, allocatable, save          :: elens_lAllowUpdate_CR(:) ! (nelens)
  #endif
    ! R1/R2 expressed in normalised units (either betatron or dispersion)
    real(kind=fPrec), allocatable, save :: elens_emin(:)            ! normalised emittance [m rad] (nelens)
    real(kind=fPrec), allocatable, save :: elens_sigdpp(:)          ! default rms of distribution in delta_p / p [] (nelens)
    integer, allocatable, save          :: elens_iSet(:)            ! which value of beta or disp should be taken (nelens):
                                                                    ! 0: none
                                                                    ! 1: min
                                                                    ! 2: max
                                                                    ! 3: average
                                                                    ! 4: quadratic average
                                                                    ! 5: geometric average
    real(kind=fPrec), allocatable, save :: elens_optVal(:)          ! value of optics function for normalised settings (nelens)
    integer, allocatable, save          :: elens_nUpdates(:)        ! how many slices are being used (nelens)
                                                                    
    ! beam of the lens
    real(kind=fPrec), allocatable, save :: elens_beam_mass(:)       ! mass of lens beam [MeV/c2] (nelens)
    real(kind=fPrec), allocatable, save :: elens_beam_chrg(:)       ! charge of lens beam [e] (nelens)
    
    ! radial profile
    integer, allocatable, save          :: elens_iRadial(:)         ! mapping to the radial profile (nelens)
    real(kind=fPrec), allocatable, save :: elens_radial_fr1(:)      ! value of f(R1) in case of radial profiles from file [0:1] (nelens)
  