def METHOD_NAME(tmpdir, format):
    grid = RasterModelGrid((3, 4))
    grid.event_layers.add(10.0, water_depth=[1.0, 2.0])
    with tmpdir.as_cwd():
        to_netcdf(grid, "test.nc", include="at_layer*", format=format)
        actual = xr.open_dataset("test.nc")
        actual_fields = {name for name in actual.variables if name.startswith("at_")}
        assert actual_fields == {"at_layer_cell:water_depth", "at_layer_cell:thickness"}