anchor.diff:    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'       )
  +  call alloc(cheby_lFox       ,            ncheby_new,  cheby_lFox_def, 'cheby_lFox'       )
   end subroutine cheby_expand_arrays_lenses
   
   subroutine cheby_expand_arrays_map_echo(ncheby_mapEchoes_new)
  
positive.code:   ! last modified: 02-04-2020
    ! module for handling maps expressed by Chebyshev polynomials
  
    integer, allocatable, save  :: icheby(:)            ! index of chebyshev lens
    integer, save               :: ncheby=0             ! number of chebyshev lenses actually in memory
    integer, save               :: ncheby_mapEchoes=0   ! number of requested echoes of maps
    integer, save               :: ncheby_tables=0      ! number of chebyshev tables in memory
    integer, parameter          :: cheby_kz=42          ! kz of chebyshev lenses
    integer, parameter          :: cheby_ktrack=67      ! ktrack of chebyshev lenses
    integer, parameter          :: cheby_maxOrderFox=21 ! max order (required by FOX)
                                                        ! please keep this synched with TX, TY, TPX and TPY
                                                        !    in the fox part of this module
  
    ! variables to save parameters for tracking etc.
    integer,          allocatable, save :: cheby_itable(:)      ! index of chebyshev table
  
negative.code:   zz=zero
    do nn=0,cheby_maxOrder(iTable)
      do jj=0,nn
        if (cheby_coeffs(jj,nn-jj,iTable) /= zero ) zz=zz+(cheby_coeffs(jj,nn-jj,iTable)*Tx(jj))*Ty(nn-jj)
      end do
    end do
  
  