anchor.diff:          integer(ip) :: i, j, k
           real(dp) :: tx(5), ty(5), tv(5,ng), test_grid(10, 20, ng)
           real(dp) :: errtol
  +        type(c_ptr) :: grid_update_context
  +        real(dp), parameter :: cx = 2.7_dp, cy = 3.05_dp
  +        real(dp), target :: cxy(2) = [cx, cy]
   
           errtol = 3*spacing(100.0_dp)
   
  
positive.code:         gsi%g2_time = start_time + dt
  
          ! Read the grids
          call gsi%get_grid_at_time(gsi%g1_time, x, y, gsi%g1)
          call gsi%get_grid_at_time(gsi%g2_time, x, y, gsi%g2)
  
      end subroutine
  
  
negative.code:     end subroutine
  
      ! Use this for testing the grid interpolator
      subroutine for_test_get_grid_at_time(time, x, y, grid, grid_update_context)
              real(dp), intent(in) :: time
              real(dp), intent(in) :: x(:), y(:)
              real(dp), intent(inout) :: grid(:,:,:)
              type(c_ptr), intent(in) :: grid_update_context
  
              integer(ip) :: j, k
              real(dp), pointer :: cxy(:)
  
              call c_f_pointer(grid_update_context, cxy, [2])
  
              do k = 1, size(grid,3, kind=ip)
              do j = 1, size(grid,2, kind=ip)
                  grid(:,j,k) = (cxy(1) * x + cxy(2) * y(j) + time)*k
              end do
              end do
  
  