subroutine rdb_debug_chksum_2d(grid, arr, label, field, stage, step, probe, loc)
!! 2D twin of rdb_debug_chksum_3d (BT-work fields).
type(hgrid_t), intent(in) :: grid
real(wp), intent(in) :: arr(:, :)
! assumed-shape-ok: no device loop here; forwards a contiguous
! actual to the explicit-shape chksum_stats_2d kernel.
character(len=*), intent(in) :: label, field
integer, intent(in) :: stage, step, loc
type(chksum_probe_t), intent(inout) :: probe
integer :: nx, ny, ia, ib, ja, jb
type(chksum_stats_t) :: st
if (.not. chksum_active(probe, step)) return
call chksum_loc_extents(grid, loc, nx, ny)
if (probe%interior) then
call chksum_loc_interior(grid, loc, ia, ib, ja, jb)
call chksum_stats_2d(arr, nx, ny, st, ia, ib, ja, jb)
else
call chksum_stats_2d(arr, nx, ny, st)
end if
call chksum_row(probe, label, stage, step, field, st)
end subroutine rdb_debug_chksum_2d