From 6002d05f47d73f21988f8b49d50cef5322a572c0 Mon Sep 17 00:00:00 2001 From: MetNoMarvinK <139860704+MetNoMarvinK@users.noreply.github.com> Date: Thu, 3 Oct 2024 08:01:55 +0200 Subject: [PATCH 1/2] Update configuration.py Avoid crash in case non-integer TRUNC values are used, e.g. when trunc is set to custom. TRUNC will still be handled as an integer in pysurfex. --- pysurfex/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysurfex/configuration.py b/pysurfex/configuration.py index 413233b..5f4e86c 100644 --- a/pysurfex/configuration.py +++ b/pysurfex/configuration.py @@ -550,7 +550,7 @@ def __init__(self, env, conf): gsize = float(env["LGSIZE"]) trunc = 2 # linear if "TRUNC" in env: - trunc = int(env["TRUNC"]) + trunc = int(float(env["TRUNC"])) domain_dict = { "nam_pgd_grid": {"cgrid": "CONF PROJ"}, "nam_conf_proj": { From 0b474da0a7991e60482d8e9b3148a3e4c330708c Mon Sep 17 00:00:00 2001 From: MetNoMarvinK <139860704+MetNoMarvinK@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:54:26 +0200 Subject: [PATCH 2/2] Update configuration.py TRUNC can now be a float. --- pysurfex/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysurfex/configuration.py b/pysurfex/configuration.py index 5f4e86c..3bf238f 100644 --- a/pysurfex/configuration.py +++ b/pysurfex/configuration.py @@ -550,7 +550,7 @@ def __init__(self, env, conf): gsize = float(env["LGSIZE"]) trunc = 2 # linear if "TRUNC" in env: - trunc = int(float(env["TRUNC"])) + trunc = float(env["TRUNC"]) domain_dict = { "nam_pgd_grid": {"cgrid": "CONF PROJ"}, "nam_conf_proj": {