anchor.diff:            freq(ipoint_) = grid(igrid)%freql+real(ipoint-1,rk)*dfreq
          enddo
          grid(igrid)%dfreq = dfreq
  +       if (grid(igrid)%offset<0) grid(igrid)%offset = offset
        enddo
        ! last point 
        freq(npoints) = grid(Ngrids)%freqr
  
positive.code:      real(rk),intent(in) :: freq(npoints)
       integer(ik),intent(out) :: ib,ie
       !
       real(rk) :: dfreq_t,freql_t
       integer(ik) :: igrid
       !
       ib = 1
  
negative.code:        !
         dfreq_t = grid(igrid)%dfreq
         freql_t = grid(igrid)%freql
         offset_ = grid(igrid)%offset
         !
         if (tranfreq-offset_>=grid(igrid)%freql) then
           ib =  max(nint( ( tranfreq-offset_-freql_t)/dfreq_t )+1,1)
           ib = grid(igrid)%i1+ib-1
         elseif(igrid>1) then
           ib =  max(nint( ( tranfreq-offset_-grid(igrid-1)%freql)/grid(igrid-1)%dfreq )+1,1)
           ib = grid(igrid-1)%i1+ib-1
         endif
         !
         if (tranfreq+offset_<=grid(igrid)%freqr) then
           ie =  min(nint( ( tranfreq+offset_-freql_t)/dfreq_t )+1,npoints)
           ie = grid(igrid)%i1+ie-1
         elseif(igrid<Ngrids) then
           ie =  min(nint( ( tranfreq+offset_-grid(igrid+1)%freql)/grid(igrid+1)%dfreq )+1,npoints)
           ie = grid(igrid+1)%i1+ie-1
         endif
         !
  