anchor.diff:      if (st_debug) then
         write(lout,'(1(a,1pe22.15))')'CHEBY> CHEBY_KICK_FOX taking into account angle [deg]=',cheby_angle(icheby(ix))
       end if
  -    ! radial position of main beam relative to center of elens beam
  +    ! radial position of main beam relative to center of cheby beam
       ! rr = sqrt(xx**2+yy**2)
   !FOX  RR_SQ=(XI+YI)*(XI+YI)-(TWO*XI)*YI ;
       call dapek(RR_SQ,hh,RRA)
  
positive.code:   call alloc(cheby_offset_y   ,            ncheby_new,            zero, 'cheby_offset_y'   )
    call alloc(cheby_I          ,            ncheby_new,            -one, 'cheby_I'          )
    call alloc(cheby_scalingFact,            ncheby_new,             one, 'cheby_scalingFact')
    call alloc(cheby_lFox       ,            ncheby_new,         .false., 'cheby_lFox'       )
  end subroutine cheby_expand_arrays_lenses
  
  subroutine cheby_expand_arrays_map_echo(ncheby_mapEchoes_new)
  
negative.code:       call sixin_echoVal("Ny     []",cheby_mapNy  (ncheby_mapEchoes),          "CHEBY",iLine)
      end if
  
    case("FOX")
      if(nSplit<2 .or. nSplit>3) then
        write(lerr,"(a,i0)") "CHEBY> ERROR Expected 1 or 2 input parameters for FOX line, got ",nSplit-1
        write(lerr,"(a)")    "CHEBY>       example:     FOX  on|off|true|false (ALL|BEF(ORE)|AFT(ER))"
        iErr = .true.
        return
      end if
     
      call chr_cast(lnSPlit(2), tmpl,iErr)
      if (ncheby>0) cheby_lFox(ncheby)=tmpl
  
      if (nSplit>=3) then
        select case (chr_toLower(trim(lnSplit(3))))
        case('all')
          do tmpi1=1,ncheby-1
            cheby_lFox(tmpi1) = tmpl
          end do
          cheby_lFox_def=tmpl
          if(st_debug) write(lout,"(a)") "CHEBY> Setting lFox as read to all chebyshev lenses"
        case('bef','before')
          do tmpi1=1,ncheby-1
            cheby_lFox(tmpi1) = tmpl
          end do
          if(st_debug) write(lout,"(a)") "CHEBY> Setting lFox as read to all chebyshev lenses "// &
               "declared before the current FOX line"
        case('aft','after')
          cheby_lFox_def=tmpl
          if(st_debug) write(lout,"(a)") "CHEBY> Setting lFox as read to all chebyshev lenses "// &
               "declared after the current FOX line"
        case default
          write(lerr,"(a)") "CHEBY> ERROR Unidentified third parameter of FOX line, got: '"//trim(lnSplit(3))//"'"
          write(lerr,"(a)") "CHEBY>       example:     FOX  on|off|true|false (ALL|BEF(ORE)|AFT(ER))"
          iErr = .true.
          return
        end select ! case (lnSplit(3))
      end if
      
      if(st_debug) then
        call sixin_echoVal("fox",tmpl,"CHEBY",iLine)
      end if
       
    case default
  
      if(nSplit < 2) then
  