Repository: ecmwf/earthkit-data
Pull request #700 (2025-05-14 16:30:14)

Improve chunking for Xarray generated with the earthkit engine
This PR adds the following changes:

- improves the serialisation of GRIB fieldlists used when Xarray is generated with chunks
- a new config option `grib-file-serialisation-policy` was added to control how GRIB data on disk is pickled. The options are "path" and "memory". The default is "path". Previously, only "memory" was implemented.
- serialisation was added to GRIB fields (both on disk and in-memory)
- serialisation was added to the `FieldListTensor`
- `TensorBackendArray`, which implements the lazy loading of DataArrays in the Xarray engine, now uses a `dask.utils.SerializableLock` for data loading



Patch:
diff --git a/docs/examples/index.rst b/docs/examples/index.rst
index 6b8574d..65614ad 100644
--- a/docs/examples/index.rst
+++ b/docs/examples/index.rst
@@ -163,6 +163,7 @@ Xarray engine
     xarray_engine_to_grib.ipynb
     xarray_engine_split.ipynb
     xarray_engine_seasonal.ipynb
+    xarray_engine_chunks.ipynb
 
 Targets and encoders
 +++++++++++++++++++++
diff --git a/docs/examples/xarray_engine_chunks.ipynb b/docs/examples/xarray_engine_chunks.ipynb
new file mode 100644
index 0000000..39eb8f6
--- /dev/null
+++ b/docs/examples/xarray_engine_chunks.ipynb
@@ -0,0 +1,1245 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "f3568669-9884-491d-8597-5130ad273337",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "source": [
+    "## Xarray engine: chunks"
+   ]
+  },
+  {
+   "cell_type": "raw",
+   "id": "b42eccf8-abcc-44a1-8406-f8aa966b1bf5",
+   "metadata": {
+    "editable": true,
+    "raw_mimetype": "text/x-rst",
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "source": [
+    "This notebook demonstrates how to use chunking in computations when a GRIB fieldlist is converted to to Xarray with :py:meth:`~data.readers.grib.index.GribFieldList.to_xarray`. Chunking can be used to handle data that does not fit into memory."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "8b1ceb8a-967d-4324-9af3-3b6eec468da1",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "source": [
+    "First, we get 2m temperature data for a whole year on a low resolution regular latitude-longitude grid. It contains 2 fields per day (at 0 and 12 UTC). This data obviously fit into memory, so only used for demonstration purposes."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "id": "3a4f7dd0-f443-4cda-8725-cd61927d1409",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "outputs": [
+    {
+     "data": {
+      "application/vnd.jupyter.widget-view+json": {
+       "model_id": "98299fdfafa74aa5b8cbc0f95188b8d5",
+       "version_major": 2,
+       "version_minor": 0
+      },
+      "text/plain": [
+       "t2_1_year_hourly.grib:   0%|          | 0.00/429k [00:00<?, ?B/s]"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "data": {
+      "text/plain": [
+       "732"
+      ]
+     },
+     "execution_count": 1,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import earthkit.data as ekd\n",
+    "ds_fl = ekd.from_source(\"sample\", \"t2_1_year_hourly.grib\")\n",
+    "len(ds_fl)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "e634b083-5491-4f12-83d0-3a1fb6c80e95",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "source": [
+    "Next, we convert the GRIB Fieldlist to Xarray using the chunk size of 10 fields."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "id": "0c270a17-cc0e-4fb0-9042-e7c8e1dc0fb1",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
+       "<defs>\n",
+       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
+       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
+       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
+       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
+       "</symbol>\n",
+       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
+       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
+       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
+       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
+       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
+       "</symbol>\n",
+       "</defs>\n",
+       "</svg>\n",
+       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
+       " *\n",
+       " */\n",
+       "\n",
+       ":root {\n",
+       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
+       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
+       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
+       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
+       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
+       "  --xr-background-color: var(--jp-layout-color0, white);\n",
+       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
+       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
+       "}\n",
+       "\n",
+       "html[theme=\"dark\"],\n",
+       "html[data-theme=\"dark\"],\n",
+       "body[data-theme=\"dark\"],\n",
+       "body.vscode-dark {\n",
+       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
+       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
+       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
+       "  --xr-border-color: #1f1f1f;\n",
+       "  --xr-disabled-color: #515151;\n",
+       "  --xr-background-color: #111111;\n",
+       "  --xr-background-color-row-even: #111111;\n",
+       "  --xr-background-color-row-odd: #313131;\n",
+       "}\n",
+       "\n",
+       ".xr-wrap {\n",
+       "  display: block !important;\n",
+       "  min-width: 300px;\n",
+       "  max-width: 700px;\n",
+       "}\n",
+       "\n",
+       ".xr-text-repr-fallback {\n",
+       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
+       "  display: none;\n",
+       "}\n",
+       "\n",
+       ".xr-header {\n",
+       "  padding-top: 6px;\n",
+       "  padding-bottom: 6px;\n",
+       "  margin-bottom: 4px;\n",
+       "  border-bottom: solid 1px var(--xr-border-color);\n",
+       "}\n",
+       "\n",
+       ".xr-header > div,\n",
+       ".xr-header > ul {\n",
+       "  display: inline;\n",
+       "  margin-top: 0;\n",
+       "  margin-bottom: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-obj-type,\n",
+       ".xr-array-name {\n",
+       "  margin-left: 2px;\n",
+       "  margin-right: 10px;\n",
+       "}\n",
+       "\n",
+       ".xr-obj-type {\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-sections {\n",
+       "  padding-left: 0 !important;\n",
+       "  display: grid;\n",
+       "  grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
+       "}\n",
+       "\n",
+       ".xr-section-item {\n",
+       "  display: contents;\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input {\n",
+       "  display: inline-block;\n",
+       "  opacity: 0;\n",
+       "  height: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input + label {\n",
+       "  color: var(--xr-disabled-color);\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input:enabled + label {\n",
+       "  cursor: pointer;\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input:focus + label {\n",
+       "  border: 2px solid var(--xr-font-color0);\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input:enabled + label:hover {\n",
+       "  color: var(--xr-font-color0);\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary {\n",
+       "  grid-column: 1;\n",
+       "  color: var(--xr-font-color2);\n",
+       "  font-weight: 500;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary > span {\n",
+       "  display: inline-block;\n",
+       "  padding-left: 0.5em;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:disabled + label {\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in + label:before {\n",
+       "  display: inline-block;\n",
+       "  content: \"►\";\n",
+       "  font-size: 11px;\n",
+       "  width: 15px;\n",
+       "  text-align: center;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:disabled + label:before {\n",
+       "  color: var(--xr-disabled-color);\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:checked + label:before {\n",
+       "  content: \"▼\";\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:checked + label > span {\n",
+       "  display: none;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary,\n",
+       ".xr-section-inline-details {\n",
+       "  padding-top: 4px;\n",
+       "  padding-bottom: 4px;\n",
+       "}\n",
+       "\n",
+       ".xr-section-inline-details {\n",
+       "  grid-column: 2 / -1;\n",
+       "}\n",
+       "\n",
+       ".xr-section-details {\n",
+       "  display: none;\n",
+       "  grid-column: 1 / -1;\n",
+       "  margin-bottom: 5px;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
+       "  display: contents;\n",
+       "}\n",
+       "\n",
+       ".xr-array-wrap {\n",
+       "  grid-column: 1 / -1;\n",
+       "  display: grid;\n",
+       "  grid-template-columns: 20px auto;\n",
+       "}\n",
+       "\n",
+       ".xr-array-wrap > label {\n",
+       "  grid-column: 1;\n",
+       "  vertical-align: top;\n",
+       "}\n",
+       "\n",
+       ".xr-preview {\n",
+       "  color: var(--xr-font-color3);\n",
+       "}\n",
+       "\n",
+       ".xr-array-preview,\n",
+       ".xr-array-data {\n",
+       "  padding: 0 5px !important;\n",
+       "  grid-column: 2;\n",
+       "}\n",
+       "\n",
+       ".xr-array-data,\n",
+       ".xr-array-in:checked ~ .xr-array-preview {\n",
+       "  display: none;\n",
+       "}\n",
+       "\n",
+       ".xr-array-in:checked ~ .xr-array-data,\n",
+       ".xr-array-preview {\n",
+       "  display: inline-block;\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list {\n",
+       "  display: inline-block !important;\n",
+       "  list-style: none;\n",
+       "  padding: 0 !important;\n",
+       "  margin: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list li {\n",
+       "  display: inline-block;\n",
+       "  padding: 0;\n",
+       "  margin: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list:before {\n",
+       "  content: \"(\";\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list:after {\n",
+       "  content: \")\";\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list li:not(:last-child):after {\n",
+       "  content: \",\";\n",
+       "  padding-right: 5px;\n",
+       "}\n",
+       "\n",
+       ".xr-has-index {\n",
+       "  font-weight: bold;\n",
+       "}\n",
+       "\n",
+       ".xr-var-list,\n",
+       ".xr-var-item {\n",
+       "  display: contents;\n",
+       "}\n",
+       "\n",
+       ".xr-var-item > div,\n",
+       ".xr-var-item label,\n",
+       ".xr-var-item > .xr-var-name span {\n",
+       "  background-color: var(--xr-background-color-row-even);\n",
+       "  margin-bottom: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-var-item > .xr-var-name:hover span {\n",
+       "  padding-right: 5px;\n",
+       "}\n",
+       "\n",
+       ".xr-var-list > li:nth-child(odd) > div,\n",
+       ".xr-var-list > li:nth-child(odd) > label,\n",
+       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
+       "  background-color: var(--xr-background-color-row-odd);\n",
+       "}\n",
+       "\n",
+       ".xr-var-name {\n",
+       "  grid-column: 1;\n",
+       "}\n",
+       "\n",
+       ".xr-var-dims {\n",
+       "  grid-column: 2;\n",
+       "}\n",
+       "\n",
+       ".xr-var-dtype {\n",
+       "  grid-column: 3;\n",
+       "  text-align: right;\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-var-preview {\n",
+       "  grid-column: 4;\n",
+       "}\n",
+       "\n",
+       ".xr-index-preview {\n",
+       "  grid-column: 2 / 5;\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-var-name,\n",
+       ".xr-var-dims,\n",
+       ".xr-var-dtype,\n",
+       ".xr-preview,\n",
+       ".xr-attrs dt {\n",
+       "  white-space: nowrap;\n",
+       "  overflow: hidden;\n",
+       "  text-overflow: ellipsis;\n",
+       "  padding-right: 10px;\n",
+       "}\n",
+       "\n",
+       ".xr-var-name:hover,\n",
+       ".xr-var-dims:hover,\n",
+       ".xr-var-dtype:hover,\n",
+       ".xr-attrs dt:hover {\n",
+       "  overflow: visible;\n",
+       "  width: auto;\n",
+       "  z-index: 1;\n",
+       "}\n",
+       "\n",
+       ".xr-var-attrs,\n",
+       ".xr-var-data,\n",
+       ".xr-index-data {\n",
+       "  display: none;\n",
+       "  background-color: var(--xr-background-color) !important;\n",
+       "  padding-bottom: 5px !important;\n",
+       "}\n",
+       "\n",
+       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
+       ".xr-var-data-in:checked ~ .xr-var-data,\n",
+       ".xr-index-data-in:checked ~ .xr-index-data {\n",
+       "  display: block;\n",
+       "}\n",
+       "\n",
+       ".xr-var-data > table {\n",
+       "  float: right;\n",
+       "}\n",
+       "\n",
+       ".xr-var-name span,\n",
+       ".xr-var-data,\n",
+       ".xr-index-name div,\n",
+       ".xr-index-data,\n",
+       ".xr-attrs {\n",
+       "  padding-left: 25px !important;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs,\n",
+       ".xr-var-attrs,\n",
+       ".xr-var-data,\n",
+       ".xr-index-data {\n",
+       "  grid-column: 1 / -1;\n",
+       "}\n",
+       "\n",
+       "dl.xr-attrs {\n",
+       "  padding: 0;\n",
+       "  margin: 0;\n",
+       "  display: grid;\n",
+       "  grid-template-columns: 125px auto;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dt,\n",
+       ".xr-attrs dd {\n",
+       "  padding: 0;\n",
+       "  margin: 0;\n",
+       "  float: left;\n",
+       "  padding-right: 10px;\n",
+       "  width: auto;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dt {\n",
+       "  font-weight: normal;\n",
+       "  grid-column: 1;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dt:hover span {\n",
+       "  display: inline-block;\n",
+       "  background: var(--xr-background-color);\n",
+       "  padding-right: 10px;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dd {\n",
+       "  grid-column: 2;\n",
+       "  white-space: pre-wrap;\n",
+       "  word-break: break-all;\n",
+       "}\n",
+       "\n",
+       ".xr-icon-database,\n",
+       ".xr-icon-file-text2,\n",
+       ".xr-no-icon {\n",
+       "  display: inline-block;\n",
+       "  vertical-align: middle;\n",
+       "  width: 1em;\n",
+       "  height: 1.5em !important;\n",
+       "  stroke-width: 0;\n",
+       "  stroke: currentColor;\n",
+       "  fill: currentColor;\n",
+       "}\n",
+       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;2t&#x27; (valid_time: 732, latitude: 13, longitude: 24)&gt; Size: 2MB\n",
+       "dask.array&lt;open_dataset-2t, shape=(732, 13, 24), dtype=float64, chunksize=(10, 13, 24), chunktype=numpy.ndarray&gt;\n",
+       "Coordinates:\n",
+       "  * valid_time  (valid_time) datetime64[ns] 6kB 2020-01-01 ... 2020-12-31T06:...\n",
+       "  * latitude    (latitude) float64 104B 90.0 75.0 60.0 ... -60.0 -75.0 -90.0\n",
+       "  * longitude   (longitude) float64 192B 0.0 15.0 30.0 ... 315.0 330.0 345.0\n",
+       "Attributes:\n",
+       "    standard_name:  air_temperature\n",
+       "    long_name:      2 metre temperature\n",
+       "    units:          K</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'2t'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>valid_time</span>: 732</li><li><span class='xr-has-index'>latitude</span>: 13</li><li><span class='xr-has-index'>longitude</span>: 24</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-390e8352-9552-4a08-ae01-a7b741d52a2c' class='xr-array-in' type='checkbox' checked><label for='section-390e8352-9552-4a08-ae01-a7b741d52a2c' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>dask.array&lt;chunksize=(10, 13, 24), meta=np.ndarray&gt;</span></div><div class='xr-array-data'><table>\n",
+       "    <tr>\n",
+       "        <td>\n",
+       "            <table style=\"border-collapse: collapse;\">\n",
+       "                <thead>\n",
+       "                    <tr>\n",
+       "                        <td> </td>\n",
+       "                        <th> Array </th>\n",
+       "                        <th> Chunk </th>\n",
+       "                    </tr>\n",
+       "                </thead>\n",
+       "                <tbody>\n",
+       "                    \n",
+       "                    <tr>\n",
+       "                        <th> Bytes </th>\n",
+       "                        <td> 1.74 MiB </td>\n",
+       "                        <td> 24.38 kiB </td>\n",
+       "                    </tr>\n",
+       "                    \n",
+       "                    <tr>\n",
+       "                        <th> Shape </th>\n",
+       "                        <td> (732, 13, 24) </td>\n",
+       "                        <td> (10, 13, 24) </td>\n",
+       "                    </tr>\n",
+       "                    <tr>\n",
+       "                        <th> Dask graph </th>\n",
+       "                        <td colspan=\"2\"> 74 chunks in 2 graph layers </td>\n",
+       "                    </tr>\n",
+       "                    <tr>\n",
+       "                        <th> Data type </th>\n",
+       "                        <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
+       "                    </tr>\n",
+       "                </tbody>\n",
+       "            </table>\n",
+       "        </td>\n",
+       "        <td>\n",
+       "        <svg width=\"162\" height=\"148\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
+       "\n",
+       "  <!-- Horizontal lines -->\n",
+       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
+       "  <line x1=\"10\" y1=\"28\" x2=\"80\" y2=\"98\" style=\"stroke-width:2\" />\n",
+       "\n",
+       "  <!-- Vertical lines -->\n",
+       "  <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"28\" style=\"stroke-width:2\" />\n",
+       "  <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"31\" />\n",
+       "  <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"35\" />\n",
+       "  <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"38\" />\n",
+       "  <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"42\" />\n",
+       "  <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"46\" />\n",
+       "  <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"50\" />\n",
+       "  <line x1=\"36\" y1=\"26\" x2=\"36\" y2=\"54\" />\n",
+       "  <line x1=\"39\" y1=\"29\" x2=\"39\" y2=\"58\" />\n",
+       "  <line x1=\"43\" y1=\"33\" x2=\"43\" y2=\"62\" />\n",
+       "  <line x1=\"46\" y1=\"36\" x2=\"46\" y2=\"65\" />\n",
+       "  <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"68\" />\n",
+       "  <line x1=\"54\" y1=\"44\" x2=\"54\" y2=\"72\" />\n",
+       "  <line x1=\"58\" y1=\"48\" x2=\"58\" y2=\"76\" />\n",
+       "  <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"80\" />\n",
+       "  <line x1=\"65\" y1=\"55\" x2=\"65\" y2=\"84\" />\n",
+       "  <line x1=\"69\" y1=\"59\" x2=\"69\" y2=\"88\" />\n",
+       "  <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"92\" />\n",
+       "  <line x1=\"77\" y1=\"67\" x2=\"77\" y2=\"95\" />\n",
+       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"98\" style=\"stroke-width:2\" />\n",
+       "\n",
+       "  <!-- Colored Rectangle -->\n",
+       "  <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,98.95796077440954 10.0,28.369725480291883\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
+       "\n",
+       "  <!-- Horizontal lines -->\n",
+       "  <line x1=\"10\" y1=\"0\" x2=\"41\" y2=\"0\" style=\"stroke-width:2\" />\n",
+       "  <line x1=\"12\" y1=\"2\" x2=\"44\" y2=\"2\" />\n",
+       "  <line x1=\"16\" y1=\"6\" x2=\"48\" y2=\"6\" />\n",
+       "  <line x1=\"20\" y1=\"10\" x2=\"52\" y2=\"10\" />\n",
+       "  <line x1=\"24\" y1=\"14\" x2=\"56\" y2=\"14\" />\n",
+       "  <line x1=\"28\" y1=\"18\" x2=\"60\" y2=\"18\" />\n",
+       "  <line x1=\"32\" y1=\"22\" x2=\"64\" y2=\"22\" />\n",
+       "  <line x1=\"36\" y1=\"26\" x2=\"67\" y2=\"26\" />\n",
+       "  <line x1=\"39\" y1=\"29\" x2=\"71\" y2=\"29\" />\n",
+       "  <line x1=\"43\" y1=\"33\" x2=\"75\" y2=\"33\" />\n",
+       "  <line x1=\"46\" y1=\"36\" x2=\"78\" y2=\"36\" />\n",
+       "  <line x1=\"50\" y1=\"40\" x2=\"82\" y2=\"40\" />\n",
+       "  <line x1=\"54\" y1=\"44\" x2=\"86\" y2=\"44\" />\n",
+       "  <line x1=\"58\" y1=\"48\" x2=\"90\" y2=\"48\" />\n",
+       "  <line x1=\"62\" y1=\"52\" x2=\"93\" y2=\"52\" />\n",
+       "  <line x1=\"65\" y1=\"55\" x2=\"97\" y2=\"55\" />\n",
+       "  <line x1=\"69\" y1=\"59\" x2=\"101\" y2=\"59\" />\n",
+       "  <line x1=\"73\" y1=\"63\" x2=\"105\" y2=\"63\" />\n",
+       "  <line x1=\"77\" y1=\"67\" x2=\"109\" y2=\"67\" />\n",
+       "  <line x1=\"80\" y1=\"70\" x2=\"112\" y2=\"70\" style=\"stroke-width:2\" />\n",
+       "\n",
+       "  <!-- Vertical lines -->\n",
+       "  <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
+       "  <line x1=\"41\" y1=\"0\" x2=\"112\" y2=\"70\" style=\"stroke-width:2\" />\n",
+       "\n",
+       "  <!-- Colored Rectangle -->\n",
+       "  <polygon points=\"10.0,0.0 41.92447243666881,0.0 112.51270773078646,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
+       "\n",
+       "  <!-- Horizontal lines -->\n",
+       "  <line x1=\"80\" y1=\"70\" x2=\"112\" y2=\"70\" style=\"stroke-width:2\" />\n",
+       "  <line x1=\"80\" y1=\"98\" x2=\"112\" y2=\"98\" style=\"stroke-width:2\" />\n",
+       "\n",
+       "  <!-- Vertical lines -->\n",
+       "  <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"98\" style=\"stroke-width:2\" />\n",
+       "  <line x1=\"112\" y1=\"70\" x2=\"112\" y2=\"98\" style=\"stroke-width:2\" />\n",
+       "\n",
+       "  <!-- Colored Rectangle -->\n",
+       "  <polygon points=\"80.58823529411765,70.58823529411765 112.51270773078646,70.58823529411765 112.51270773078646,98.95796077440954 80.58823529411765,98.95796077440954\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
+       "\n",
+       "  <!-- Text -->\n",
+       "  <text x=\"96.550472\" y=\"118.957961\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >24</text>\n",
+       "  <text x=\"132.512708\" y=\"84.773098\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,132.512708,84.773098)\">13</text>\n",
+       "  <text x=\"35.294118\" y=\"83.663843\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,83.663843)\">732</text>\n",
+       "</svg>\n",
+       "        </td>\n",
+       "    </tr>\n",
+       "</table></div></div></li><li class='xr-section-item'><input id='section-055a0fa7-613f-455c-86b4-8dcd094ba659' class='xr-section-summary-in' type='checkbox'  checked><label for='section-055a0fa7-613f-455c-86b4-8dcd094ba659' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>valid_time</span></div><div class='xr-var-dims'>(valid_time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2020-01-01 ... 2020-12-31T06:00:00</div><input id='attrs-006e3f34-53a6-4b70-85bc-71dbc7b7a076' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-006e3f34-53a6-4b70-85bc-71dbc7b7a076' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-64d80942-8808-4a70-b53d-6cc72d25c437' class='xr-var-data-in' type='checkbox'><label for='data-64d80942-8808-4a70-b53d-6cc72d25c437' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>standard_name :</span></dt><dd>time</dd><dt><span>long_name :</span></dt><dd>valid_time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;2020-01-01T00:00:00.000000000&#x27;, &#x27;2020-01-01T06:00:00.000000000&#x27;,\n",
+       "       &#x27;2020-01-02T00:00:00.000000000&#x27;, ..., &#x27;2020-12-30T06:00:00.000000000&#x27;,\n",
+       "       &#x27;2020-12-31T00:00:00.000000000&#x27;, &#x27;2020-12-31T06:00:00.000000000&#x27;],\n",
+       "      dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>latitude</span></div><div class='xr-var-dims'>(latitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>90.0 75.0 60.0 ... -75.0 -90.0</div><input id='attrs-2eb48e80-eb57-4f4e-b548-1d42e58e9239' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-2eb48e80-eb57-4f4e-b548-1d42e58e9239' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c93d4b51-90f4-4471-9e6a-13ebaddc839e' class='xr-var-data-in' type='checkbox'><label for='data-c93d4b51-90f4-4471-9e6a-13ebaddc839e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_north</dd><dt><span>standard_name :</span></dt><dd>latitude</dd><dt><span>long_name :</span></dt><dd>latitude</dd></dl></div><div class='xr-var-data'><pre>array([ 90.,  75.,  60.,  45.,  30.,  15.,   0., -15., -30., -45., -60., -75.,\n",
+       "       -90.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>longitude</span></div><div class='xr-var-dims'>(longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 15.0 30.0 ... 315.0 330.0 345.0</div><input id='attrs-81205c10-e20a-4ae3-a24b-f9064695e747' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-81205c10-e20a-4ae3-a24b-f9064695e747' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3dc75603-3592-4c67-9655-fe467c94ebc7' class='xr-var-data-in' type='checkbox'><label for='data-3dc75603-3592-4c67-9655-fe467c94ebc7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_east</dd><dt><span>standard_name :</span></dt><dd>longitude</dd><dt><span>long_name :</span></dt><dd>longitude</dd></dl></div><div class='xr-var-data'><pre>array([  0.,  15.,  30.,  45.,  60.,  75.,  90., 105., 120., 135., 150., 165.,\n",
+       "       180., 195., 210., 225., 240., 255., 270., 285., 300., 315., 330., 345.])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f8ecdb4a-394b-4126-b279-5ab7515f054c' class='xr-section-summary-in' type='checkbox'  ><label for='section-f8ecdb4a-394b-4126-b279-5ab7515f054c' class='xr-section-summary' >Indexes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>valid_time</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-e770684f-2b22-448e-859b-372f26b8402f' class='xr-index-data-in' type='checkbox'/><label for='index-e770684f-2b22-448e-859b-372f26b8402f' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(DatetimeIndex([&#x27;2020-01-01 00:00:00&#x27;, &#x27;2020-01-01 06:00:00&#x27;,\n",
+       "               &#x27;2020-01-02 00:00:00&#x27;, &#x27;2020-01-02 06:00:00&#x27;,\n",
+       "               &#x27;2020-01-03 00:00:00&#x27;, &#x27;2020-01-03 06:00:00&#x27;,\n",
+       "               &#x27;2020-01-04 00:00:00&#x27;, &#x27;2020-01-04 06:00:00&#x27;,\n",
+       "               &#x27;2020-01-05 00:00:00&#x27;, &#x27;2020-01-05 06:00:00&#x27;,\n",
+       "               ...\n",
+       "               &#x27;2020-12-27 00:00:00&#x27;, &#x27;2020-12-27 06:00:00&#x27;,\n",
+       "               &#x27;2020-12-28 00:00:00&#x27;, &#x27;2020-12-28 06:00:00&#x27;,\n",
+       "               &#x27;2020-12-29 00:00:00&#x27;, &#x27;2020-12-29 06:00:00&#x27;,\n",
+       "               &#x27;2020-12-30 00:00:00&#x27;, &#x27;2020-12-30 06:00:00&#x27;,\n",
+       "               &#x27;2020-12-31 00:00:00&#x27;, &#x27;2020-12-31 06:00:00&#x27;],\n",
+       "              dtype=&#x27;datetime64[ns]&#x27;, name=&#x27;valid_time&#x27;, length=732, freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>latitude</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-252860f1-c4a3-48a9-8aaa-91f5cf072f64' class='xr-index-data-in' type='checkbox'/><label for='index-252860f1-c4a3-48a9-8aaa-91f5cf072f64' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 90.0,  75.0,  60.0,  45.0,  30.0,  15.0,   0.0, -15.0, -30.0, -45.0,\n",
+       "       -60.0, -75.0, -90.0],\n",
+       "      dtype=&#x27;float64&#x27;, name=&#x27;latitude&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>longitude</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-21990eae-9c9e-4158-a051-04a894a87abd' class='xr-index-data-in' type='checkbox'/><label for='index-21990eae-9c9e-4158-a051-04a894a87abd' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([  0.0,  15.0,  30.0,  45.0,  60.0,  75.0,  90.0, 105.0, 120.0, 135.0,\n",
+       "       150.0, 165.0, 180.0, 195.0, 210.0, 225.0, 240.0, 255.0, 270.0, 285.0,\n",
+       "       300.0, 315.0, 330.0, 345.0],\n",
+       "      dtype=&#x27;float64&#x27;, name=&#x27;longitude&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3dfd592c-37a1-47b1-96fd-c5a121d14fb3' class='xr-section-summary-in' type='checkbox'  checked><label for='section-3dfd592c-37a1-47b1-96fd-c5a121d14fb3' class='xr-section-summary' >Attributes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>standard_name :</span></dt><dd>air_temperature</dd><dt><span>long_name :</span></dt><dd>2 metre temperature</dd><dt><span>units :</span></dt><dd>K</dd></dl></div></li></ul></div></div>"
+      ],
+      "text/plain": [
+       "<xarray.DataArray '2t' (valid_time: 732, latitude: 13, longitude: 24)> Size: 2MB\n",
+       "dask.array<open_dataset-2t, shape=(732, 13, 24), dtype=float64, chunksize=(10, 13, 24), chunktype=numpy.ndarray>\n",
+       "Coordinates:\n",
+       "  * valid_time  (valid_time) datetime64[ns] 6kB 2020-01-01 ... 2020-12-31T06:...\n",
+       "  * latitude    (latitude) float64 104B 90.0 75.0 60.0 ... -60.0 -75.0 -90.0\n",
+       "  * longitude   (longitude) float64 192B 0.0 15.0 30.0 ... 315.0 330.0 345.0\n",
+       "Attributes:\n",
+       "    standard_name:  air_temperature\n",
+       "    long_name:      2 metre temperature\n",
+       "    units:          K"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "ds = ds_fl.to_xarray(time_dim_mode=\"valid_time\", \n",
+    "                     chunks={\"valid_time\": 10}, \n",
+    "                     add_earthkit_attrs=False)\n",
+    "ds[\"2t\"]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "d5caa260-5e6c-432b-96b7-ea84cb261432",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "source": [
+    "We compute the mean along the temporal dimension. Xarray will load data in chunks for this computation keeping the memory usage low."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "id": "46e0abd9-7866-4e9f-9c89-c9234b372bc2",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
+       "<defs>\n",
+       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
+       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
+       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
+       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
+       "</symbol>\n",
+       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
+       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
+       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
+       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
+       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
+       "</symbol>\n",
+       "</defs>\n",
+       "</svg>\n",
+       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
+       " *\n",
+       " */\n",
+       "\n",
+       ":root {\n",
+       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
+       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
+       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
+       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
+       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
+       "  --xr-background-color: var(--jp-layout-color0, white);\n",
+       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
+       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
+       "}\n",
+       "\n",
+       "html[theme=\"dark\"],\n",
+       "html[data-theme=\"dark\"],\n",
+       "body[data-theme=\"dark\"],\n",
+       "body.vscode-dark {\n",
+       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
+       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
+       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
+       "  --xr-border-color: #1f1f1f;\n",
+       "  --xr-disabled-color: #515151;\n",
+       "  --xr-background-color: #111111;\n",
+       "  --xr-background-color-row-even: #111111;\n",
+       "  --xr-background-color-row-odd: #313131;\n",
+       "}\n",
+       "\n",
+       ".xr-wrap {\n",
+       "  display: block !important;\n",
+       "  min-width: 300px;\n",
+       "  max-width: 700px;\n",
+       "}\n",
+       "\n",
+       ".xr-text-repr-fallback {\n",
+       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
+       "  display: none;\n",
+       "}\n",
+       "\n",
+       ".xr-header {\n",
+       "  padding-top: 6px;\n",
+       "  padding-bottom: 6px;\n",
+       "  margin-bottom: 4px;\n",
+       "  border-bottom: solid 1px var(--xr-border-color);\n",
+       "}\n",
+       "\n",
+       ".xr-header > div,\n",
+       ".xr-header > ul {\n",
+       "  display: inline;\n",
+       "  margin-top: 0;\n",
+       "  margin-bottom: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-obj-type,\n",
+       ".xr-array-name {\n",
+       "  margin-left: 2px;\n",
+       "  margin-right: 10px;\n",
+       "}\n",
+       "\n",
+       ".xr-obj-type {\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-sections {\n",
+       "  padding-left: 0 !important;\n",
+       "  display: grid;\n",
+       "  grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
+       "}\n",
+       "\n",
+       ".xr-section-item {\n",
+       "  display: contents;\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input {\n",
+       "  display: inline-block;\n",
+       "  opacity: 0;\n",
+       "  height: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input + label {\n",
+       "  color: var(--xr-disabled-color);\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input:enabled + label {\n",
+       "  cursor: pointer;\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input:focus + label {\n",
+       "  border: 2px solid var(--xr-font-color0);\n",
+       "}\n",
+       "\n",
+       ".xr-section-item input:enabled + label:hover {\n",
+       "  color: var(--xr-font-color0);\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary {\n",
+       "  grid-column: 1;\n",
+       "  color: var(--xr-font-color2);\n",
+       "  font-weight: 500;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary > span {\n",
+       "  display: inline-block;\n",
+       "  padding-left: 0.5em;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:disabled + label {\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in + label:before {\n",
+       "  display: inline-block;\n",
+       "  content: \"►\";\n",
+       "  font-size: 11px;\n",
+       "  width: 15px;\n",
+       "  text-align: center;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:disabled + label:before {\n",
+       "  color: var(--xr-disabled-color);\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:checked + label:before {\n",
+       "  content: \"▼\";\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:checked + label > span {\n",
+       "  display: none;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary,\n",
+       ".xr-section-inline-details {\n",
+       "  padding-top: 4px;\n",
+       "  padding-bottom: 4px;\n",
+       "}\n",
+       "\n",
+       ".xr-section-inline-details {\n",
+       "  grid-column: 2 / -1;\n",
+       "}\n",
+       "\n",
+       ".xr-section-details {\n",
+       "  display: none;\n",
+       "  grid-column: 1 / -1;\n",
+       "  margin-bottom: 5px;\n",
+       "}\n",
+       "\n",
+       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
+       "  display: contents;\n",
+       "}\n",
+       "\n",
+       ".xr-array-wrap {\n",
+       "  grid-column: 1 / -1;\n",
+       "  display: grid;\n",
+       "  grid-template-columns: 20px auto;\n",
+       "}\n",
+       "\n",
+       ".xr-array-wrap > label {\n",
+       "  grid-column: 1;\n",
+       "  vertical-align: top;\n",
+       "}\n",
+       "\n",
+       ".xr-preview {\n",
+       "  color: var(--xr-font-color3);\n",
+       "}\n",
+       "\n",
+       ".xr-array-preview,\n",
+       ".xr-array-data {\n",
+       "  padding: 0 5px !important;\n",
+       "  grid-column: 2;\n",
+       "}\n",
+       "\n",
+       ".xr-array-data,\n",
+       ".xr-array-in:checked ~ .xr-array-preview {\n",
+       "  display: none;\n",
+       "}\n",
+       "\n",
+       ".xr-array-in:checked ~ .xr-array-data,\n",
+       ".xr-array-preview {\n",
+       "  display: inline-block;\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list {\n",
+       "  display: inline-block !important;\n",
+       "  list-style: none;\n",
+       "  padding: 0 !important;\n",
+       "  margin: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list li {\n",
+       "  display: inline-block;\n",
+       "  padding: 0;\n",
+       "  margin: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list:before {\n",
+       "  content: \"(\";\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list:after {\n",
+       "  content: \")\";\n",
+       "}\n",
+       "\n",
+       ".xr-dim-list li:not(:last-child):after {\n",
+       "  content: \",\";\n",
+       "  padding-right: 5px;\n",
+       "}\n",
+       "\n",
+       ".xr-has-index {\n",
+       "  font-weight: bold;\n",
+       "}\n",
+       "\n",
+       ".xr-var-list,\n",
+       ".xr-var-item {\n",
+       "  display: contents;\n",
+       "}\n",
+       "\n",
+       ".xr-var-item > div,\n",
+       ".xr-var-item label,\n",
+       ".xr-var-item > .xr-var-name span {\n",
+       "  background-color: var(--xr-background-color-row-even);\n",
+       "  margin-bottom: 0;\n",
+       "}\n",
+       "\n",
+       ".xr-var-item > .xr-var-name:hover span {\n",
+       "  padding-right: 5px;\n",
+       "}\n",
+       "\n",
+       ".xr-var-list > li:nth-child(odd) > div,\n",
+       ".xr-var-list > li:nth-child(odd) > label,\n",
+       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
+       "  background-color: var(--xr-background-color-row-odd);\n",
+       "}\n",
+       "\n",
+       ".xr-var-name {\n",
+       "  grid-column: 1;\n",
+       "}\n",
+       "\n",
+       ".xr-var-dims {\n",
+       "  grid-column: 2;\n",
+       "}\n",
+       "\n",
+       ".xr-var-dtype {\n",
+       "  grid-column: 3;\n",
+       "  text-align: right;\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-var-preview {\n",
+       "  grid-column: 4;\n",
+       "}\n",
+       "\n",
+       ".xr-index-preview {\n",
+       "  grid-column: 2 / 5;\n",
+       "  color: var(--xr-font-color2);\n",
+       "}\n",
+       "\n",
+       ".xr-var-name,\n",
+       ".xr-var-dims,\n",
+       ".xr-var-dtype,\n",
+       ".xr-preview,\n",
+       ".xr-attrs dt {\n",
+       "  white-space: nowrap;\n",
+       "  overflow: hidden;\n",
+       "  text-overflow: ellipsis;\n",
+       "  padding-right: 10px;\n",
+       "}\n",
+       "\n",
+       ".xr-var-name:hover,\n",
+       ".xr-var-dims:hover,\n",
+       ".xr-var-dtype:hover,\n",
+       ".xr-attrs dt:hover {\n",
+       "  overflow: visible;\n",
+       "  width: auto;\n",
+       "  z-index: 1;\n",
+       "}\n",
+       "\n",
+       ".xr-var-attrs,\n",
+       ".xr-var-data,\n",
+       ".xr-index-data {\n",
+       "  display: none;\n",
+       "  background-color: var(--xr-background-color) !important;\n",
+       "  padding-bottom: 5px !important;\n",
+       "}\n",
+       "\n",
+       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
+       ".xr-var-data-in:checked ~ .xr-var-data,\n",
+       ".xr-index-data-in:checked ~ .xr-index-data {\n",
+       "  display: block;\n",
+       "}\n",
+       "\n",
+       ".xr-var-data > table {\n",
+       "  float: right;\n",
+       "}\n",
+       "\n",
+       ".xr-var-name span,\n",
+       ".xr-var-data,\n",
+       ".xr-index-name div,\n",
+       ".xr-index-data,\n",
+       ".xr-attrs {\n",
+       "  padding-left: 25px !important;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs,\n",
+       ".xr-var-attrs,\n",
+       ".xr-var-data,\n",
+       ".xr-index-data {\n",
+       "  grid-column: 1 / -1;\n",
+       "}\n",
+       "\n",
+       "dl.xr-attrs {\n",
+       "  padding: 0;\n",
+       "  margin: 0;\n",
+       "  display: grid;\n",
+       "  grid-template-columns: 125px auto;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dt,\n",
+       ".xr-attrs dd {\n",
+       "  padding: 0;\n",
+       "  margin: 0;\n",
+       "  float: left;\n",
+       "  padding-right: 10px;\n",
+       "  width: auto;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dt {\n",
+       "  font-weight: normal;\n",
+       "  grid-column: 1;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dt:hover span {\n",
+       "  display: inline-block;\n",
+       "  background: var(--xr-background-color);\n",
+       "  padding-right: 10px;\n",
+       "}\n",
+       "\n",
+       ".xr-attrs dd {\n",
+       "  grid-column: 2;\n",
+       "  white-space: pre-wrap;\n",
+       "  word-break: break-all;\n",
+       "}\n",
+       "\n",
+       ".xr-icon-database,\n",
+       ".xr-icon-file-text2,\n",
+       ".xr-no-icon {\n",
+       "  display: inline-block;\n",
+       "  vertical-align: middle;\n",
+       "  width: 1em;\n",
+       "  height: 1.5em !important;\n",
+       "  stroke-width: 0;\n",
+       "  stroke: currentColor;\n",
+       "  fill: currentColor;\n",
+       "}\n",
+       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;2t&#x27; (latitude: 13, longitude: 24)&gt; Size: 2kB\n",
+       "array([[259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273],\n",
+       "       [273.2611026 , 275.61228088, 275.48984236, 274.29307835,\n",
+       "        268.16812105, 267.89195131, 264.09208792, 262.4144496 ,\n",
+       "        262.67648853, 261.67375629, 261.81749775, 261.75990725,\n",
+       "        261.65672248, 261.12205718, 260.31177713, 259.69160124,\n",
+       "        259.44480308, 258.91397999, 256.69544345, 261.1351634 ,\n",
+       "        263.80255581, 245.3709899 , 246.22366237, 263.91035124],\n",
+       "       [281.80054932, 277.3069957 , 278.84242945, 276.02408075,\n",
+       "        274.49351381, 274.21627678, 274.1331996 , 272.61215281,\n",
+       "        271.49176346, 269.63533416, 273.44181469, 275.6214595 ,\n",
+       "        276.75602234, 275.00730308, 276.87611285, 273.58944106,\n",
+       "        271.92337207, 268.99705718, 266.13354113, 265.23450595,\n",
+       "        271.60276073, 273.63473648, 279.19937105, 281.8119052 ],\n",
+       "       [284.15830206, 283.85715793, 286.20103601, 283.92187788,\n",
+       "        283.76810397, 284.21051346, 282.39472624, 279.20961695,\n",
+       "...\n",
+       "        283.64451278, 283.35801176, 282.91684031, 282.9554759 ,\n",
+       "        282.14711695, 282.26140144, 281.0409011 , 280.42200595],\n",
+       "       [269.24513607, 270.23454864, 271.63341305, 271.82437105,\n",
+       "        271.60942057, 270.65992432, 270.95410978, 271.93656367,\n",
+       "        273.56741237, 274.12688129, 273.18558177, 275.06365554,\n",
+       "        275.63789564, 274.6907901 , 272.28731504, 273.95432323,\n",
+       "        275.29179762, 275.50107016, 275.76251141, 276.15411831,\n",
+       "        273.34336866, 269.42683006, 268.963758  , 268.6785804 ],\n",
+       "       [234.73941544, 228.72784611, 229.33594038, 225.86723307,\n",
+       "        238.04060226, 241.2718608 , 229.15774707, 226.06100868,\n",
+       "        224.74338573, 228.59588744, 232.7254554 , 258.2240039 ,\n",
+       "        257.83465964, 258.4833106 , 262.08999605, 259.26575595,\n",
+       "        256.58991066, 260.79205376, 251.32129728, 250.12530172,\n",
+       "        253.13652952, 256.13648682, 258.81438129, 254.06318594],\n",
+       "       [227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102]])\n",
+       "Coordinates:\n",
+       "  * latitude   (latitude) float64 104B 90.0 75.0 60.0 45.0 ... -60.0 -75.0 -90.0\n",
+       "  * longitude  (longitude) float64 192B 0.0 15.0 30.0 45.0 ... 315.0 330.0 345.0</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'2t'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>latitude</span>: 13</li><li><span class='xr-has-index'>longitude</span>: 24</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-ca7c27bf-83bf-4f56-ad79-1b8acb76850f' class='xr-array-in' type='checkbox' checked><label for='section-ca7c27bf-83bf-4f56-ad79-1b8acb76850f' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>259.2 259.2 259.2 259.2 259.2 259.2 ... 227.7 227.7 227.7 227.7 227.7</span></div><div class='xr-array-data'><pre>array([[259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273],\n",
+       "       [273.2611026 , 275.61228088, 275.48984236, 274.29307835,\n",
+       "        268.16812105, 267.89195131, 264.09208792, 262.4144496 ,\n",
+       "        262.67648853, 261.67375629, 261.81749775, 261.75990725,\n",
+       "        261.65672248, 261.12205718, 260.31177713, 259.69160124,\n",
+       "        259.44480308, 258.91397999, 256.69544345, 261.1351634 ,\n",
+       "        263.80255581, 245.3709899 , 246.22366237, 263.91035124],\n",
+       "       [281.80054932, 277.3069957 , 278.84242945, 276.02408075,\n",
+       "        274.49351381, 274.21627678, 274.1331996 , 272.61215281,\n",
+       "        271.49176346, 269.63533416, 273.44181469, 275.6214595 ,\n",
+       "        276.75602234, 275.00730308, 276.87611285, 273.58944106,\n",
+       "        271.92337207, 268.99705718, 266.13354113, 265.23450595,\n",
+       "        271.60276073, 273.63473648, 279.19937105, 281.8119052 ],\n",
+       "       [284.15830206, 283.85715793, 286.20103601, 283.92187788,\n",
+       "        283.76810397, 284.21051346, 282.39472624, 279.20961695,\n",
+       "...\n",
+       "        283.64451278, 283.35801176, 282.91684031, 282.9554759 ,\n",
+       "        282.14711695, 282.26140144, 281.0409011 , 280.42200595],\n",
+       "       [269.24513607, 270.23454864, 271.63341305, 271.82437105,\n",
+       "        271.60942057, 270.65992432, 270.95410978, 271.93656367,\n",
+       "        273.56741237, 274.12688129, 273.18558177, 275.06365554,\n",
+       "        275.63789564, 274.6907901 , 272.28731504, 273.95432323,\n",
+       "        275.29179762, 275.50107016, 275.76251141, 276.15411831,\n",
+       "        273.34336866, 269.42683006, 268.963758  , 268.6785804 ],\n",
+       "       [234.73941544, 228.72784611, 229.33594038, 225.86723307,\n",
+       "        238.04060226, 241.2718608 , 229.15774707, 226.06100868,\n",
+       "        224.74338573, 228.59588744, 232.7254554 , 258.2240039 ,\n",
+       "        257.83465964, 258.4833106 , 262.08999605, 259.26575595,\n",
+       "        256.58991066, 260.79205376, 251.32129728, 250.12530172,\n",
+       "        253.13652952, 256.13648682, 258.81438129, 254.06318594],\n",
+       "       [227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102]])</pre></div></div></li><li class='xr-section-item'><input id='section-818975b3-6ce5-4877-8620-014c73313551' class='xr-section-summary-in' type='checkbox'  checked><label for='section-818975b3-6ce5-4877-8620-014c73313551' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>latitude</span></div><div class='xr-var-dims'>(latitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>90.0 75.0 60.0 ... -75.0 -90.0</div><input id='attrs-9f46e84e-2cda-414f-9f81-b07a5e67417f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9f46e84e-2cda-414f-9f81-b07a5e67417f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-39dc0fff-6fc9-47c7-93ec-28cdebffe08e' class='xr-var-data-in' type='checkbox'><label for='data-39dc0fff-6fc9-47c7-93ec-28cdebffe08e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_north</dd><dt><span>standard_name :</span></dt><dd>latitude</dd><dt><span>long_name :</span></dt><dd>latitude</dd></dl></div><div class='xr-var-data'><pre>array([ 90.,  75.,  60.,  45.,  30.,  15.,   0., -15., -30., -45., -60., -75.,\n",
+       "       -90.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>longitude</span></div><div class='xr-var-dims'>(longitude)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 15.0 30.0 ... 315.0 330.0 345.0</div><input id='attrs-dc0168d0-070d-42b3-b876-14494534016a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-dc0168d0-070d-42b3-b876-14494534016a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e2568a25-3455-4abb-ae2e-36dea4e07cf8' class='xr-var-data-in' type='checkbox'><label for='data-e2568a25-3455-4abb-ae2e-36dea4e07cf8' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_east</dd><dt><span>standard_name :</span></dt><dd>longitude</dd><dt><span>long_name :</span></dt><dd>longitude</dd></dl></div><div class='xr-var-data'><pre>array([  0.,  15.,  30.,  45.,  60.,  75.,  90., 105., 120., 135., 150., 165.,\n",
+       "       180., 195., 210., 225., 240., 255., 270., 285., 300., 315., 330., 345.])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-580926f8-4e39-4b1d-9bc6-d884926ff531' class='xr-section-summary-in' type='checkbox'  ><label for='section-580926f8-4e39-4b1d-9bc6-d884926ff531' class='xr-section-summary' >Indexes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>latitude</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-3354e27a-a114-4519-b37f-a7fcac5128e7' class='xr-index-data-in' type='checkbox'/><label for='index-3354e27a-a114-4519-b37f-a7fcac5128e7' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 90.0,  75.0,  60.0,  45.0,  30.0,  15.0,   0.0, -15.0, -30.0, -45.0,\n",
+       "       -60.0, -75.0, -90.0],\n",
+       "      dtype=&#x27;float64&#x27;, name=&#x27;latitude&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>longitude</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-7aca7f23-6e30-4550-9780-1fd740d0f3e2' class='xr-index-data-in' type='checkbox'/><label for='index-7aca7f23-6e30-4550-9780-1fd740d0f3e2' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([  0.0,  15.0,  30.0,  45.0,  60.0,  75.0,  90.0, 105.0, 120.0, 135.0,\n",
+       "       150.0, 165.0, 180.0, 195.0, 210.0, 225.0, 240.0, 255.0, 270.0, 285.0,\n",
+       "       300.0, 315.0, 330.0, 345.0],\n",
+       "      dtype=&#x27;float64&#x27;, name=&#x27;longitude&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-14a11630-11be-4b52-a979-da480092c689' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-14a11630-11be-4b52-a979-da480092c689' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
+      ],
+      "text/plain": [
+       "<xarray.DataArray '2t' (latitude: 13, longitude: 24)> Size: 2kB\n",
+       "array([[259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273,\n",
+       "        259.17798273, 259.17798273, 259.17798273, 259.17798273],\n",
+       "       [273.2611026 , 275.61228088, 275.48984236, 274.29307835,\n",
+       "        268.16812105, 267.89195131, 264.09208792, 262.4144496 ,\n",
+       "        262.67648853, 261.67375629, 261.81749775, 261.75990725,\n",
+       "        261.65672248, 261.12205718, 260.31177713, 259.69160124,\n",
+       "        259.44480308, 258.91397999, 256.69544345, 261.1351634 ,\n",
+       "        263.80255581, 245.3709899 , 246.22366237, 263.91035124],\n",
+       "       [281.80054932, 277.3069957 , 278.84242945, 276.02408075,\n",
+       "        274.49351381, 274.21627678, 274.1331996 , 272.61215281,\n",
+       "        271.49176346, 269.63533416, 273.44181469, 275.6214595 ,\n",
+       "        276.75602234, 275.00730308, 276.87611285, 273.58944106,\n",
+       "        271.92337207, 268.99705718, 266.13354113, 265.23450595,\n",
+       "        271.60276073, 273.63473648, 279.19937105, 281.8119052 ],\n",
+       "       [284.15830206, 283.85715793, 286.20103601, 283.92187788,\n",
+       "        283.76810397, 284.21051346, 282.39472624, 279.20961695,\n",
+       "...\n",
+       "        283.64451278, 283.35801176, 282.91684031, 282.9554759 ,\n",
+       "        282.14711695, 282.26140144, 281.0409011 , 280.42200595],\n",
+       "       [269.24513607, 270.23454864, 271.63341305, 271.82437105,\n",
+       "        271.60942057, 270.65992432, 270.95410978, 271.93656367,\n",
+       "        273.56741237, 274.12688129, 273.18558177, 275.06365554,\n",
+       "        275.63789564, 274.6907901 , 272.28731504, 273.95432323,\n",
+       "        275.29179762, 275.50107016, 275.76251141, 276.15411831,\n",
+       "        273.34336866, 269.42683006, 268.963758  , 268.6785804 ],\n",
+       "       [234.73941544, 228.72784611, 229.33594038, 225.86723307,\n",
+       "        238.04060226, 241.2718608 , 229.15774707, 226.06100868,\n",
+       "        224.74338573, 228.59588744, 232.7254554 , 258.2240039 ,\n",
+       "        257.83465964, 258.4833106 , 262.08999605, 259.26575595,\n",
+       "        256.58991066, 260.79205376, 251.32129728, 250.12530172,\n",
+       "        253.13652952, 256.13648682, 258.81438129, 254.06318594],\n",
+       "       [227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102,\n",
+       "        227.70048102, 227.70048102, 227.70048102, 227.70048102]])\n",
+       "Coordinates:\n",
+       "  * latitude   (latitude) float64 104B 90.0 75.0 60.0 45.0 ... -60.0 -75.0 -90.0\n",
+       "  * longitude  (longitude) float64 192B 0.0 15.0 30.0 45.0 ... 315.0 330.0 345.0"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "m = ds[\"2t\"].mean(dim=\"valid_time\").load()\n",
+    "m"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "eb9d85ea-a52f-4dc6-b081-7688f9c90536",
+   "metadata": {
+    "editable": true,
+    "slideshow": {
+     "slide_type": ""
+    },
+    "tags": []
+   },
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "dev",
+   "language": "python",
+   "name": "dev"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.11.12"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/docs/examples/xarray_engine_temporal.ipynb b/docs/examples/xarray_engine_temporal.ipynb
index ad8945b..1b1a76d 100644
--- a/docs/examples/xarray_engine_temporal.ipynb
+++ b/docs/examples/xarray_engine_temporal.ipynb
@@ -2651,9 +2651,9 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "dev_ecc",
+   "display_name": "dev",
    "language": "python",
-   "name": "dev_ecc"
+   "name": "dev"
   },
   "language_info": {
    "codemirror_mode": {
@@ -2665,7 +2665,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.10.13"
+   "version": "3.11.12"
   }
  },
  "nbformat": 4,
diff --git a/src/earthkit/data/core/config.py b/src/earthkit/data/core/config.py
index 7464dec..8ce1c2f 100644
--- a/src/earthkit/data/core/config.py
+++ b/src/earthkit/data/core/config.py
@@ -246,6 +246,11 @@ CONFIG_AND_HELP = {
         fieldlists with data on disk.
         See :doc:`/guide/misc/grib_memory` for more information.""",
     ),
+    "grib-file-serialisation-policy": _(
+        "path",
+        """GRIB file serialisation policy for fieldlists with data on disk. {validator}""",
+        validator=ListValidator(["path", "memory"]),
+    ),
 }
 
 
diff --git a/src/earthkit/data/core/fieldlist.py b/src/earthkit/data/core/fieldlist.py
index 899c811..20c858a 100644
--- a/src/earthkit/data/core/fieldlist.py
+++ b/src/earthkit/data/core/fieldlist.py
@@ -1093,6 +1093,7 @@ class FieldList(Index):
             first = next(it)
             is_property = not callable(getattr(first, accessor, None))
             vals = _vals(first)
+            first = None
             ns = array_namespace(vals)
             shape = (n, *vals.shape)
             r = ns.empty(shape, dtype=vals.dtype)
diff --git a/src/earthkit/data/indexing/tensor.py b/src/earthkit/data/indexing/tensor.py
index 4d38c31..533f9d4f 100644
--- a/src/earthkit/data/indexing/tensor.py
+++ b/src/earthkit/data/indexing/tensor.py
@@ -404,6 +404,13 @@ class FieldListTensor(TensorCore):
         assert len(indexes) == len(self._full_shape)
         return indexes[len(self._user_shape) :]
 
+    def is_full_field(self, indexes):
+        assert len(indexes) == len(self._field_shape)
+        for i, s in enumerate(indexes):
+            if not (s is None or s == slice(None, None, None) or s == slice(0, self._field_shape[i], 1)):
+                return False
+        return True
+
     def _subset(self, indexes):
         """Only allow subsetting for the user coordinates.
         Indices for the field coordinates are ignored.
@@ -496,19 +503,26 @@ class FieldListTensor(TensorCore):
                     return tuple(dims), vals.reshape(shape)
         return None, None
 
+    def __getstate__(self):
+        r = {}
+        r["source"] = self.source
+        r["user_coords"] = self.user_coords
+        r["user_shape"] = self.user_shape
+        r["user_dims"] = self.user_dims
+        r["field_coords"] = self.field_coords
+        r["field_shape"] = self.field_shape
+        r["field_dims"] = self.field_dims
+        r["full_shape"] = self.full_shape
+        r["flatten_values"] = self.flatten_values
+        return r
 
-# class ArrayTensor(TensorCore):
-#     def __init__(self, array, coords, field_shape):
-#         self._array = array
-#         self._coords = coords
-#         self._shape = self._array.shape
-#         self._field_shape = field_shape
-
-#     def to_numpy(self, **kwargs):
-#         return self._array
-
-#     def _subset(self, indexes):
-#         coords = self._subset_coords(indexes)
-#         # print(f"{indexes=}")
-#         data = self._array[indexes]
-#         return ArrayTensor(data, coords, self.field_shape)
+    def __setstate__(self, state):
+        self.source = state["source"]
+        self._user_coords = state["user_coords"]
+        self._user_shape = state["user_shape"]
+        self._user_dims = state["user_dims"]
+        self._field_coords = state["field_coords"]
+        self._field_shape = state["field_shape"]
+        self._field_dims = state["field_dims"]
+        self._full_shape = state["full_shape"]
+        self.flatten_values = state["flatten_values"]
diff --git a/src/earthkit/data/readers/grib/codes.py b/src/earthkit/data/readers/grib/codes.py
index ed1c4be..f7f0ebf 100644
--- a/src/earthkit/data/readers/grib/codes.py
+++ b/src/earthkit/data/readers/grib/codes.py
@@ -329,6 +329,21 @@ class GribField(Field):
     def clone(self, **kwargs):
         return ClonedGribField(self, **kwargs)
 
+    def __getstate__(self):
+        state = super().__getstate__()
+        state["path"] = self.path
+        state["offset"] = self._offset
+        state["length"] = self._length
+        state["use_metadata_cache"] = self._use_metadata_cache
+        return state
+
+    def __setstate__(self, state):
+        self.path = state["path"]
+        self._offset = state["offset"]
+        self._length = state["length"]
+        self._use_metadata_cache = state["use_metadata_cache"]
+        self._handle_manager = None
+
 
 class ClonedGribField(ClonedFieldCore, GribField):
     def __init__(self, field, **kwargs):
diff --git a/src/earthkit/data/readers/grib/file.py b/src/earthkit/data/readers/grib/file.py
index 8449a1d..1acf5a0 100644
--- a/src/earthkit/data/readers/grib/file.py
+++ b/src/earthkit/data/readers/grib/file.py
@@ -18,7 +18,7 @@ LOG = logging.getLogger(__name__)
 class GRIBReader(GribFieldListInOneFile, Reader):
     appendable = True  # GRIB messages can be added to the same file
 
-    def __init__(self, source, path, parts=None):
+    def __init__(self, source, path, parts=None, positions=None):
         _kwargs = {}
         for k in [
             # "array_backend",
@@ -34,7 +34,7 @@ class GRIBReader(GribFieldListInOneFile, Reader):
                 raise KeyError(f"Invalid option {k} in GRIBReader. Option names must not contain '-'.")
 
         Reader.__init__(self, source, path)
-        GribFieldListInOneFile.__init__(self, path, parts=parts, **_kwargs)
+        GribFieldListInOneFile.__init__(self, path, parts=parts, positions=positions, **_kwargs)
 
     def __repr__(self):
         return "GRIBReader(%s)" % (self.path,)
@@ -47,24 +47,42 @@ class GRIBReader(GribFieldListInOneFile, Reader):
         return True
 
     def __getstate__(self):
-        r = {"kwargs": self.source._kwargs, "messages": []}
-        for f in self:
-            r["messages"].append(f.message())
+        from earthkit.data.core.config import CONFIG
+
+        policy = CONFIG.get("grib-file-serialisation-policy")
+        r = {"serialisation_policy": policy, "kwargs": self.source._kwargs}
+
+        if policy == "path":
+            r["path"] = self.path
+            r["positions"] = self._positions
+        else:
+            r["messages"] = [f.message() for f in self]
+
         return r
 
     def __setstate__(self, state):
-        from earthkit.data import from_source
-        from earthkit.data.core.caching import cache_file
-
-        def _create(path, args):
-            with open(path, "wb") as f:
-                for message in state["messages"]:
-                    f.write(message)
-
-        path = cache_file(
-            "GRIBReader",
-            _create,
-            [],
-        )
-        ds = from_source("file", path)
-        self.__init__(ds.source, path)
+        policy = state["serialisation_policy"]
+        if policy == "path":
+            from earthkit.data import from_source
+
+            path = state["path"]
+            ds = from_source("file", path, **state["kwargs"])
+            self.__init__(ds.source, path, positions=state["positions"])
+        elif policy == "memory":
+            from earthkit.data import from_source
+            from earthkit.data.core.caching import cache_file
+
+            def _create(path, args):
+                with open(path, "wb") as f:
+                    for message in state["messages"]:
+                        f.write(message)
+
+            path = cache_file(
+                "GRIBReader",
+                _create,
+                [],
+            )
+            ds = from_source("file", path)
+            self.__init__(ds.source, path)
+        else:
+            raise ValueError(f"Unknown serialisation policy {policy}")
diff --git a/src/earthkit/data/readers/grib/index/file.py b/src/earthkit/data/readers/grib/index/file.py
index 7e60278..d8e493b 100644
--- a/src/earthkit/data/readers/grib/index/file.py
+++ b/src/earthkit/data/readers/grib/index/file.py
@@ -25,12 +25,12 @@ class GribFieldListInOneFile(GribFieldListInFiles):
     def availability_path(self):
         return os.path.join(self.path, ".availability.pickle")
 
-    def __init__(self, path, parts=None, **kwargs):
+    def __init__(self, path, parts=None, positions=None, **kwargs):
         assert isinstance(path, str), path
 
         self.path = path
         self._file_parts = parts
-        self.__positions = None
+        self.__positions = positions
         super().__init__(**kwargs)
 
     @property
diff --git a/src/earthkit/data/readers/grib/memory.py b/src/earthkit/data/readers/grib/memory.py
index b72b1b3..5087bf2 100644
--- a/src/earthkit/data/readers/grib/memory.py
+++ b/src/earthkit/data/readers/grib/memory.py
@@ -168,6 +168,12 @@ class GribFieldInMemory(GribField):
     def clone(self, **kwargs):
         return ClonedGribFieldInMemory(self, **kwargs)
 
+    def __getstate__(self):
+        return {"message": self.message()}
+
+    def __setstate__(self, state):
+        self.__init__(GribCodesHandle.from_message(state["message"]))
+
 
 class ClonedGribFieldInMemory(ClonedFieldCore, GribFieldInMemory):
     def __init__(self, field, **kwargs):
diff --git a/src/earthkit/data/utils/message.py b/src/earthkit/data/utils/message.py
index d925f17..e9e2e74 100644
--- a/src/earthkit/data/utils/message.py
+++ b/src/earthkit/data/utils/message.py
@@ -201,6 +201,10 @@ class CodesHandle(eccodes.Message):
     def _from_raw_handle(cls, handle):
         return cls(handle, None, None)
 
+    @classmethod
+    def from_message(cls, message):
+        return cls(eccodes.codes_new_from_message(message), None, None)
+
     # TODO: just a wrapper around the base class implementation to handle the
     # s,l,d qualifiers. Once these are implemented in the base class this method can
     # be removed. md5GridSection is also handled!
diff --git a/src/earthkit/data/utils/xarray/builder.py b/src/earthkit/data/utils/xarray/builder.py
index 4d0276c..6cb0b24 100644
--- a/src/earthkit/data/utils/xarray/builder.py
+++ b/src/earthkit/data/utils/xarray/builder.py
@@ -8,7 +8,6 @@
 #
 
 import logging
-import threading
 from abc import ABCMeta
 from abc import abstractmethod
 
@@ -33,7 +32,14 @@ NON_XR_OPEN_DS_KWARGS = ["split_dims", "direct_backend"]
 
 class VariableBuilder:
     def __init__(
-        self, name, var_dims, data_maker, tensor, remapping, local_attr_keys=None, fixed_local_attrs=None
+        self,
+        name,
+        var_dims,
+        data_maker,
+        tensor,
+        remapping,
+        local_attr_keys=None,
+        fixed_local_attrs=None,
     ):
         """
         Create a builder for a single variable in the dataset.
@@ -166,18 +172,21 @@ class VariableBuilder:
 
 
 class TensorBackendArray(xarray.backends.common.BackendArray):
-    def __init__(self, tensor, dims, shape, xp, dtype, variable):
+    def __init__(self, tensor, dims, shape, xp, dtype, var_name):
         super().__init__()
         self.tensor = tensor
         self.dims = dims
         self.shape = shape
+        self._var_name = var_name
 
         # xp and dtype must be set for xarray
         self.xp = xp if xp is not None else numpy
         if dtype is None:
             dtype = numpy.dtype("float64")
         self.dtype = xp.dtype(dtype)
-        self.lock = threading.Lock()
+        from dask.utils import SerializableLock
+
+        self.lock = SerializableLock()
 
     @property
     def nbytes(self):
@@ -206,16 +215,20 @@ class TensorBackendArray(xarray.backends.common.BackendArray):
 
     def _raw_indexing_method(self, key: tuple):
         with self.lock:
-            # print("_var", self._var)
-            # print(f"dims: {self.dims} key: {key} shape: {self.shape}")
-            # print(f"t-coords={self.tensor.user_coords}")
+            # LOG.debug(f"TensorBackendArray._raw_indexing_method var={self._var_name}")
+            # LOG.debug(f"   dims={self.dims} key={key} shape={self.shape}")
+            # LOG.debug(f"   tensor.user_coords={self.tensor.user_coords}")
+
             r = self.tensor[key]
-            # print(r.source.ls())
-            # print(f"r-shape: {r.user_shape}")
+            # LOG.debug(f"   cubelet user_shape={r.user_shape}")
 
+            # LOG.debug(f"   {r.user_shape=}")
             field_index = r.field_indexes(key)
-            # print(f"field.index={field_index} coords={r.user_coords}")
-            # result = r.to_numpy(index=field_index).squeeze()
+            if self.tensor.is_full_field(field_index):
+                field_index = None
+
+            # LOG.debug(f"   {field_index=}")
+
             result = r.to_numpy(index=field_index, dtype=self.dtype)
 
             # ensure axes are squeezed when needed
@@ -223,15 +236,9 @@ class TensorBackendArray(xarray.backends.common.BackendArray):
             if singles:
                 result = result.squeeze(axis=tuple(singles))
 
-            # print("result", result.shape)
-            # result = self.ekds.isel(**isels).to_numpy()
-
-            # print("result", result.shape)
-            # print(f"Loaded {self.xp.__name__} with shape: {result.shape}")
+            # LOG.debug(f"   {result.shape=}")
 
-            # Loading as numpy but then converting. This needs to be changed upstream (eccodes)
-            # to load directly into cupy.
-            # Maybe some incompatibilities when trying to copy from FFI to cupy directly
+            # Loading as numpy but then converting to the target array module
             if self.xp and self.xp != numpy:
                 result = self.xp.asarray(result)
 
@@ -444,6 +451,10 @@ class TensorBackendDataBuilder(BackendDataBuilder):
 
     def build_values(self, tensor, var_dims, name):
         """Generate the data object stored in the xarray variable"""
+        # There is no need for the extra structures in the wrapped source in the
+        # tensor any longer. It is replaced by the original unwrapped fieldlist.
+        tensor.source = tensor.source.unwrap()
+
         backend_array = TensorBackendArray(
             tensor,
             var_dims,
diff --git a/src/earthkit/data/utils/xarray/fieldlist.py b/src/earthkit/data/utils/xarray/fieldlist.py
index c4186da..474cd62 100644
--- a/src/earthkit/data/utils/xarray/fieldlist.py
+++ b/src/earthkit/data/utils/xarray/fieldlist.py
@@ -103,6 +103,12 @@ class IndexDB:
 
 
 class XArrayInputFieldList(FieldList):
+    """
+    A wrapper around a fieldlist that stores unique values.
+
+    Only for internal use for building Xarray datasets.
+    """
+
     def __init__(self, fieldlist, keys=None, db=None, remapping=None, scan_only=False, component=True):
         super().__init__()
         self.ds = fieldlist
@@ -228,6 +234,26 @@ class XArrayInputFieldList(FieldList):
         else:
             return indices, None
 
+    def unwrap(self):
+        ds = self.ds
+        while isinstance(ds, XArrayInputFieldList):
+            ds = ds.ds
+        return ds
+
+    def __getstate__(self):
+        """As a simplification, only serialise the unwrapped fieldlist.
+        We can assume that when there is a need for serialisation the wrapper
+        structure can be discarded.
+        """
+        r = {}
+        r["ds"] = self.unwrap()
+        return r
+
+    def __setstate__(self, state):
+        self.ds = state["ds"]
+        self.db = None
+        self.remapping = None
+
 
 class ReleasableField:
     def __init__(self, field):


Test patch:
diff --git a/tests/grib/test_grib_serialise.py b/tests/grib/test_grib_serialise.py
index 3eb4a75..9cf0d47 100644
--- a/tests/grib/test_grib_serialise.py
+++ b/tests/grib/test_grib_serialise.py
@@ -16,6 +16,7 @@ import sys
 import numpy as np
 import pytest
 
+from earthkit.data import config
 from earthkit.data import from_source
 from earthkit.data.core.temporary import temp_file
 from earthkit.data.readers.grib.metadata import StandAloneGribMetadata
@@ -25,6 +26,7 @@ from earthkit.data.testing import write_to_file
 
 here = os.path.dirname(__file__)
 sys.path.insert(0, here)
+from grib_fixtures import FL_FILE  # noqa: E402
 from grib_fixtures import FL_NUMPY  # noqa: E402
 from grib_fixtures import load_grib_data  # noqa: E402
 
@@ -215,3 +217,20 @@ def test_grib_serialise_file_parts():
 
     assert len(ds2) == 1
     assert ds2[0].metadata(["param", "level"]) == ["u", 1000]
+
+
+@pytest.mark.parametrize("fl_type", FL_FILE)
+@pytest.mark.parametrize("representation", ["file", "memory"])
+@pytest.mark.parametrize("policy", ["path", "memory"])
+def test_grib_serialise_policy(fl_type, representation, policy):
+    ds, _ = load_grib_data("test.grib", fl_type)
+
+    with config.temporary({"grib-file-serialisation-policy": policy}):
+        ds2 = _pickle(ds, representation)
+
+        assert len(ds2) == len(ds)
+        assert ds2.values.shape == ds.values.shape
+        if policy == "path":
+            assert ds2.path == ds.path
+        else:
+            assert ds2.path != ds.path
diff --git a/tests/xr_engine/test_xr_builder.py b/tests/xr_engine/test_xr_builder.py
new file mode 100644
index 0000000..d004a3c
--- /dev/null
+++ b/tests/xr_engine/test_xr_builder.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+
+# (C) Copyright 2020 ECMWF.
+#
+# This software is licensed under the terms of the Apache Licence Version 2.0
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
+# In applying this licence, ECMWF does not waive the privileges and immunities
+# granted to it by virtue of its status as an intergovernmental organisation
+# nor does it submit to any jurisdiction.
+#
+
+import os
+import pickle
+import sys
+
+import pytest
+
+from earthkit.data import from_source
+from earthkit.data.core.temporary import temp_file
+from earthkit.data.testing import earthkit_remote_test_data_file
+
+here = os.path.dirname(__file__)
+sys.path.insert(0, here)
+
+# Testing internal structures in the xarray engine
+
+
+def _pickle(data, representation):
+    if representation == "file":
+        with temp_file() as tmp:
+            with open(tmp, "wb") as f:
+                pickle.dump(data, f)
+
+            with open(tmp, "rb") as f:
+                data_res = pickle.load(f)
+    elif representation == "memory":
+        pickled_data = pickle.dumps(data)
+        data_res = pickle.loads(pickled_data)
+    else:
+        raise ValueError(f"Invalid representation: {representation}")
+    return data_res
+
+
+@pytest.mark.cache
+@pytest.mark.parametrize("representation", ["file", "memory"])
+def test_xr_engine_builder_fieldlist(representation):
+    ds_in = from_source("url", earthkit_remote_test_data_file("test-data/xr_engine/level/pl_small.grib"))
+
+    from earthkit.data.utils.xarray.fieldlist import XArrayInputFieldList
+
+    r = XArrayInputFieldList(ds_in)
+    assert not isinstance(r.ds, XArrayInputFieldList)
+    assert r.unwrap() is ds_in
+    r_p = _pickle(r, representation)
+    assert r_p is not r
+    assert r_p.ds is not r.ds
+    assert r_p.ds.metadata("time", astype=int) == [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+        1200,
+    ]
+
+    r0 = r.sel(param="t", level=500)
+    assert not isinstance(r0.ds, XArrayInputFieldList)
+    assert len(r0) == 8
+    assert r0.ds.metadata("time", astype=int) == [0, 0, 1200, 1200, 0, 0, 1200, 1200]
+    r0_uw = r0.unwrap()
+    assert not isinstance(r0_uw, XArrayInputFieldList)
+    assert r0_uw.metadata("time", astype=int) == [0, 0, 1200, 1200, 0, 0, 1200, 1200]
+    r0_p = _pickle(r0, representation)
+    assert r0_p is not r0
+    assert r0_p.ds is not r0.ds
+    assert r0_p.ds.metadata("time", astype=int) == [0, 0, 1200, 1200, 0, 0, 1200, 1200]
+
+    r1 = r0.order_by("time")
+    assert not isinstance(r1.ds, XArrayInputFieldList)
+    assert r1.ds.metadata("time", astype=int) == [0, 0, 0, 0, 1200, 1200, 1200, 1200]
+    r1_uw = r1.unwrap()
+    assert not isinstance(r1_uw, XArrayInputFieldList)
+    assert r1_uw.metadata("time", astype=int) == [0, 0, 0, 0, 1200, 1200, 1200, 1200]
+    r1_p = _pickle(r1, representation)
+    assert r1_p is not r1
+    assert r1_p.ds is not r1.ds
+    assert r1_p.ds.metadata("time", astype=int) == [0, 0, 0, 0, 1200, 1200, 1200, 1200]
+
+    r2 = r1.order_by("step")
+    assert not isinstance(r2.ds, XArrayInputFieldList)
+    assert r2.ds.metadata("time", astype=int) == [0, 0, 1200, 1200, 0, 0, 1200, 1200]
+    assert r2.ds.metadata("step", astype=int) == [0, 0, 0, 0, 6, 6, 6, 6]
+    r2_uw = r2.unwrap()
+    assert not isinstance(r2_uw, XArrayInputFieldList)
+    assert r2_uw.metadata("time", astype=int) == [0, 0, 1200, 1200, 0, 0, 1200, 1200]
+    assert r2_uw.metadata("step", astype=int) == [0, 0, 0, 0, 6, 6, 6, 6]
+    r2_p = _pickle(r2, representation)
+    assert r2_p is not r2
+    assert r2_p.ds is not r2.ds
+    assert r2_p.ds.metadata("time", astype=int) == [0, 0, 1200, 1200, 0, 0, 1200, 1200]
+    assert r2_p.ds.metadata("step", astype=int) == [0, 0, 0, 0, 6, 6, 6, 6]
diff --git a/tests/xr_engine/test_xr_chunks.py b/tests/xr_engine/test_xr_chunks.py
index b5bf426..92bace7 100644
--- a/tests/xr_engine/test_xr_chunks.py
+++ b/tests/xr_engine/test_xr_chunks.py
@@ -96,7 +96,6 @@ def test_xr_engine_chunk_2(_kwargs):
         assert np.isclose(r.values.mean(), 275.9938876277779)
 
 
-@pytest.mark.skipif(True, reason="Needs to be fixed")
 @pytest.mark.cache
 @pytest.mark.parametrize(
     "_kwargs",
@@ -106,6 +105,7 @@ def test_xr_engine_chunk_2(_kwargs):
         {"chunks": {"valid_time": 1}},
         {"chunks": {"valid_time": 10}},
         {"chunks": {"valid_time": (100, 200, 432), "latitude": (4, 5, 4), "longitude": (13, 3, 8)}},
+        {"chunks": {"valid_time": 100, "latitude": 4, "longitude": 7}},
         {"chunks": -1},
     ],
 )