anchor.diff:          time = start_time + 5.0_dp
           call gsi%interpolate(time, tx, ty, tv)
           do k = 1, ng
  -            if(all(abs(tv(:,k) - k*(time + cx * tx + cy * ty)) < errtol)) then
  +            if(all(abs(tv(:,k) - k*(time + cxy(1) * tx + cxy(2) * ty)) < errtol)) then
                   print*, 'PASS'
               else
  -                print*, 'FAIL', abs(tv(:,k) - k*(time + cx * tx + cy * ty))
  +                print*, 'FAIL', abs(tv(:,k) - k*(time + cxy(1) * tx + cxy(2) * ty))
               end if
           end do
   
  
positive.code:     end subroutine
  
      ! Use this for testing the grid interpolator
      subroutine for_test_get_grid_at_time(time, x, y, grid)
              real(dp), intent(in) :: time
              real(dp), intent(in) :: x(:), y(:)
              real(dp), intent(inout) :: grid(:,:,:)
  
              integer(ip) :: j, k
  
              do k = 1, size(grid,3, kind=ip)
              do j = 1, size(grid,2, kind=ip)
                  grid(:,j,k) = (cx * x + cy * y(j) + time)*k
              end do
              end do
  
  
negative.code:     end type
  
      interface
          subroutine get_grid_at_time(time, x, y, grid, grid_update_context)
              !! A subroutine with this interface must be provided to the grid_spacetime_interpolator
              !! It populates the grid given the time, and the x/y coordinates associated with the grid.
              import dp, c_ptr
              implicit none
              real(dp), intent(in) :: time
              real(dp), intent(in) :: x(:), y(:)
              real(dp), intent(inout) :: grid(:,:,:)
              type(c_ptr), intent(in) :: grid_update_context
          end subroutine
      end interface
  
      contains
  
      subroutine swap_rank3_arrays(g1, g2)
          !! Swap g1 and g2, without any copy.
          real(dp), allocatable, intent(inout) :: g1(:,:,:), g2(:,:,:)
  
          real(dp), allocatable :: tmp_g1(:,:,:)
  
          call move_alloc(g1, tmp_g1)
          call move_alloc(g2, g1)
          call move_alloc(tmp_g1, g2)
  
      end subroutine
  
      subroutine initialise_grid_spacetime_interpolator(gsi, x, y, start_time, dt, ng)
          !! Setup the grid_spacetime_interpolator
  