def METHOD_NAME(tmpdir, at):
    grid = RasterModelGrid((4, 3))
    name = "topographic__elevation"
    for src_at in {"node", "link", "patch", "corner", "face", "cell"}:
        grid.add_field(name, grid.ones(at=src_at) * 10.0, at=src_at)
    include = f"at_{at}:*"
    with tmpdir.as_cwd():
        to_netcdf(grid, "test.nc", format="NETCDF4", include=include)
        with xr.open_dataset("test.nc") as actual:
            actual_fields = {
                name for name in actual.variables if name.startswith("at_")
            }
            nc_name = f"at_{at}:{name}"
            assert actual_fields == {nc_name}
            assert_array_equal(actual[nc_name], getattr(grid, "at_" + at)[name])