anchor.diff:          END DO
           kj_ys = kajiura_G(kj_xs)
           if(log_transform_interpolation) kj_ys = log(kj_ys)
  +
  +        precomputed_gradient = (kj_ys(2:ninterp_points) - kj_ys(1:(ninterp_points-1)))/&
  +            (kj_xs(2:ninterp_points) - kj_xs(1:(ninterp_points-1)))
           !CALL kajiura_G_log_interpolator%initialise(kj_xs, kj_ys, copy_data=.FALSE.)
   
           output = 0.0_dp
  
positive.code:     ! We want to find the index corresponding to the value in 'x' that is nearest y.
      ! This is a useful operation e.g. for interpolation of sorted input data
      !
      SUBROUTINE nearest_index_sorted(n, x, y, output)
          INTEGER(ip), INTENT(IN) :: n
          REAL(dp), INTENT(IN) :: x(n)
          REAL(dp), INTENT(IN) :: y      
  
negative.code:                         r_on_d(1) = filterXYr(j, i) * depth_inv(n,m)
                          IF(r_on_d(1) < kajiuraGmax) THEN
                              ! Get the kajiura value from interpolation
                              CALL linear_interpolation(ninterp_points, kj_xs, kj_ys, 1, r_on_d, G_j_i, precomputed_gradient)
                              !CALL kajiura_G_log_interpolator%eval(r_on_d, G_j_i)    
                              ! Undo logarithm that was applied for interpolation
                              if(log_transform_interpolation) G_j_i(1) = exp(G_j_i(1))
  