anchor.diff:      iErr = .true.
       return
     end if
  -  if(elens_r1(ielens(iElem)) < zero) then
  -    write(lout,"(a)") "ELENS> ERROR R1<0!"
  +  if(elens_r1(ielens(iElem)) <= zero) then
  +    write(lout,"(a)") "ELENS> ERROR R1<=0!"
       iErr = .true.
       return
     end if
  
positive.code:     ! Uniform distribution
      elens_geo_norm(ielens(iElem)) = (elens_r2(ielens(iElem))+elens_r1(ielens(iElem)))*&
                                      (elens_r2(ielens(iElem))-elens_r1(ielens(iElem)))
    else if(elens_type(ielens(iElem)) == 2) then
      ! Gaussian distribution
      elens_geo_norm(ielens(iElem)) = exp_mb(-0.5*(elens_r1(ielens(iElem))/elens_sig(ielens(iElem)))**2)&
                                      -exp_mb(-0.5*(elens_r2(ielens(iElem))/elens_sig(ielens(iElem)))**2)
    end if
  
    if(st_debug) then
  
negative.code:   call chr_cast(lnSplit(6),elens_offset_x(ielens(iElem)),iErr)
    call chr_cast(lnSplit(7),elens_offset_y(ielens(iElem)),iErr)
  
  !   if(elens_type(ielens(iElem)) == 2) then
  !     ! GAUSSIAN profile of electrons: need also sigma of e-beam
  !     call chr_cast(lnSplit(8),elens_sig(ielens(iElem)),iErr)
  ! 
  !   elseif(elens_type(ielens(iElem)) == 3 )then
  !     ! Profile of electrons given by Chebyshev polynomials: need also
  !     !   name of file where coefficients are stored and angle
  !     tmpch = trim(lnSplit(8))
  !     call chr_cast(lnSplit(9),elens_cheby_angle(ielens(iElem)),iErr)
  ! 
  !     ! Check if table of coefficients has already been requested:
  !     chIdx = -1
  !     do tmpi1=1,melens_cheby_tables
  !       if(tmpch == elens_cheby_filename(tmpi1)) then
  !         elens_iCheby(ielens(iElem)) = tmpi1
  !         chIdx = tmpi1
  !         exit
  !       end if
  !     end do
  !     if(chIdx == -1) then
  !       ! Unsuccessful search
  !       melens_cheby_tables = melens_cheby_tables+1
  !       if(melens_cheby_tables > nelens_cheby_tables) then
  !         write(lout,"(2(a,i0))") "ELENS> ERROR Too many tables for Chebyshev coefficients: ",melens_cheby_tables,&
  !           ". Max is ",nelens_cheby_tables
  !         iErr = .true.
  !         return
  !       end if
  !       elens_iCheby(ielens(iElem)) = melens_cheby_tables
  !       elens_cheby_filename(tmpi1) = tmpch
  !     end if
  !   end if
  
    ! Additional geometrical infos:
    ! Depending on profile, the position of these parameters change
  