From ace58406ae273a6834a1ca58a78c4274db66c61c Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Fri, 21 May 2021 15:18:00 +0200
Subject: [PATCH] Load dataset to memory before saving.

---
 climax/main/preprocess.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/climax/main/preprocess.py b/climax/main/preprocess.py
index bf396b6..23bce1a 100644
--- a/climax/main/preprocess.py
+++ b/climax/main/preprocess.py
@@ -174,7 +174,7 @@ if __name__ == '__main__':
                     ['{}'.format(file) for file in group]))
 
                 # read multiple netcdf files using xarray and dask
-                ds = xr.open_mfdataset(group)
+                ds = xr.open_mfdataset(group).load()
 
                 # save aggregated netcdf file
                 LOGGER.info('Saving aggregated NetCDF: {}'.format(filename))
-- 
GitLab