anchor.diff:      write(lerr,"(a)") "CHEBY> ERROR Failed to split Chebyshev input line"
       goto 30
     end if
  -
  + 
     if(inLine(1:1) == "I") then
       ! Read reference current of lens
       if(nSplit < 3) then
  
positive.code:     end if
      iDim = size(cheby_coeffs,1)
      jDim = size(cheby_coeffs,2)
      if(ii>=iDim) call alloc(cheby_coeffs,     ii, jDim-1, ifile, zero, 'cheby_coeffs', 0, 0, 1 )
      iDim = size(cheby_coeffs,1)
      if(jj>=jDim) call alloc(cheby_coeffs, iDim-1,     jj, ifile, zero, 'cheby_coeffs', 0, 0 ,1 )
      call chr_cast(lnSplit(4),cheby_coeffs(ii,jj,ifile),spErr)
      if(spErr) then
        write(lerr,"(a)") "CHEBY> ERROR in casting Chebyshev coefficient: "//trim(lnSplit(4))
  
negative.code:       goto 30
      end if
  
    else if(chr_toUpper(inLine(1:5)) == "TABLE" ) then
      ! Read chebyshev coefficients in tabular format
      if (chr_toLower(lnSplit(3)) == "y" ) then
        ! line with header
        if ( lnSplit(2) /= ":" .or. lnSplit(4) /= "|" ) then
          write(lerr,"(a)") "CHEBY> ERROR Incorret format of header line."
          goto 50
        end if
        ! - in case, de-allocate
        if ( allocated( jOrder ) ) call dealloc(jOrder,'jOrder')
        ! - allocate
        call alloc( jOrder, nSplit-4, 0, 'jOrder' )
        ! - parse header and store it in memory
        do jj=1,nSplit-4
          call chr_cast(lnSplit(jj+4),jOrder(jj),spErr)
          if ( jOrder(jj) < 0 ) then
            write(lerr,"(a)") "CHEBY> ERROR Header line contains a negative index."
            goto 50
          end if
        end do
        ! - find max order in header
        jMax=maxval( jOrder )
      elseif (chr_toLower(lnSplit(3)) == "x" ) then
        ! line with actual coefficients
        if ( .not. allocated( jOrder ) ) then
          write(lerr,"(a)") "CHEBY> ERROR Coefficient line comes before/without header line."
          goto 50
        end if
        if ( lnSplit(2) /= ":" .or. lnSplit(5) /= "|" ) then
          write(lerr,"(a)") "CHEBY> ERROR Incorret format of line of coefficients."
          goto 50
        end if
        if ( nSplit-5 > size(jOrder) ) then
          write(lerr,"(a)") "CHEBY> ERROR Incorret format of line of coefficients."
          goto 50
        end if
        call chr_cast(lnSplit(4),ii,spErr)
        ! add new coefficients
        iDim = size(cheby_coeffs,1)
        jDim = size(cheby_coeffs,2)
        if(ii>=iDim)   call alloc(cheby_coeffs,     ii, jDim-1, ncheby_tables, zero, 'cheby_coeffs', 0, 0, 1 )
        iDim = size(cheby_coeffs,1)
        if(jMax>=jDim) call alloc(cheby_coeffs, iDim-1,   jMax, ncheby_tables, zero, 'cheby_coeffs', 0, 0 ,1 )
        do jj=1,nSplit-5
          call chr_cast(lnSplit(jj+5),cheby_coeffs(ii,jOrder(jj),ifile),spErr)
        end do
        cheby_maxOrder(ifile)=max(ii,jMax,cheby_maxOrder(ifile))
        if ( cheby_maxOrder(ifile) > cheby_maxNterms-1 ) then
          write(lerr,"(2(a,i0))") "CHEBY> ERROR order of map too high: ",cheby_maxOrder(ifile), &
               " > ",cheby_maxNterms-1
          write(lerr,"(a)")       "CHEBY>       please increase cheby_maxNterms parameter"
          goto 30
        end if
      else
        write(lerr,"(a)") "CHEBY> ERROR Un-recognized line for tabular format of coefficients."
        goto 50
      end if
      
    else
      ! Read chebyshev coefficients in format: "ii jj : value"
      if(nSplit /= 4) then
        write(lerr,"(a)") "CHEBY> ERROR Not enough arguments for expressing Chebyshev coefficients [Vm]."
        write(lerr,"(a)") "CHEBY>       Correct format:"
  