Skip to content

Struggling with NCAR-CESM2 #26

@nicolamasotti

Description

@nicolamasotti

@malmans2 I'm struggling with this specific ingestion

    filename_or_obj:
      "experiment_id": historical
      "source_id": CESM2
      "frequency": ["day"]
      "variable_id": ["tas"]
      "variant_label": r1i1p1f1
      "grid_label": gn
    esgpull_path: /data/esgpull
    index_node: esgf-node.ornl.gov/esgf-1-5-bridge
    #index_node: esgf.ceda.ac.uk

I did all kinds of stunts to get the files, but now that I think I have them, I'm getting this error:

 File "/src/bopen/hedp-data-access/hedp_data_access/setup.py", line 202, in do_setup
    ds, _ = open_and_transform(xarray_open_kwargs, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/src/bopen/hedp-data-access/hedp_data_access/job_utils.py", line 135, in open_and_transform
    ds = xr.open_dataset(**xarray_open_kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray/backends/api.py", line 606, in open_dataset
    backend_ds = backend.open_dataset(
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray_esgf/engine.py", line 34, in open_dataset
    return client.open_dataset(
           ^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray_esgf/client.py", line 35, in wrapper
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray_esgf/client.py", line 175, in open_dataset
    obj = xr.combine_by_coords(
          ^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray/structure/combine.py", line 1108, in combine_by_coords
    concatenated_grouped_by_data_vars = tuple(
                                        ^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray/structure/combine.py", line 1109, in <genexpr>
    _combine_single_variable_hypercube(
  File "/venv/lib/python3.12/site-packages/xarray/structure/combine.py", line 763, in _combine_single_variable_hypercube
    combined_ids, concat_dims = _infer_concat_order_from_coords(list(datasets))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/xarray/structure/combine.py", line 134, in _infer_concat_order_from_coords
    raise ValueError(
ValueError: Coordinate variable time is neither monotonically increasing nor monotonically decreasing on all dataset

This feels strage as when I DIN'T have all the files xarray-esgf was moving forward and the ingestion chain crashed later on.

I have also noticed that by the time to_zarr(compute=False) happens, time_bnds appears as a data_var in the dataset that is being saved instead of as a coord, which i don't think it is supposed to happen. If we get pass the xarray combine, I think this issue will emerge again.

Visual check that the files seems to be there:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions