From 69391ed77eb7daea0e981f40ff56f3fcc2eb61cc Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Fri, 17 Sep 2021 06:04:37 +0000
Subject: [PATCH] Convert total precipitation to mm.

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

diff --git a/climax/main/preprocess/preprocess_ERA5.py b/climax/main/preprocess/preprocess_ERA5.py
index 89cf258..3f061fb 100644
--- a/climax/main/preprocess/preprocess_ERA5.py
+++ b/climax/main/preprocess/preprocess_ERA5.py
@@ -94,7 +94,8 @@ if __name__ == '__main__':
 
                 # compute daily averages/sums
                 if var == 'total_precipitation':
-                    ds = ds.resample(time='D').sum(dim='time')
+                    # convert from m to mm
+                    ds = ds.resample(time='D').sum(dim='time') * 1000
                 else:
                     ds = ds.resample(time='D').mean(dim='time')
 
-- 
GitLab