xmitgcm icon indicating copy to clipboard operation
xmitgcm copied to clipboard

open_mdsdataset can't chunk by time when read_grid=True

Open ds4g15 opened this issue 4 years ago • 0 comments

Hi, thanks for the really useful module! I think I've discovered an issue with open_mdsdataset (though I haven't been using it long and this might just be down to me).

It seems that after looping over iteration numbers and opening the corresponding model output (each producing a dataset with 'time' as a coordinate, open_mdsdataset then reads the model grid, inserting a dataset for which 'time' is not a coordinate, before chunking. If supplying an argument such as chunks={'time':1200, 'face':1,'j':90,'i':90}, this results in the following error (from xarray/core/dataset.py):

ValueError: some chunks keys are not dimensions on this object: {'time'}

If I remove the time key from the chunks dict, or set read_grid=False, everything works as expected.

ds4g15 avatar Aug 23 '21 23:08 ds4g15