diff --git a/pysurfex/configuration.py b/pysurfex/configuration.py index 3bf238f..77b307c 100644 --- a/pysurfex/configuration.py +++ b/pysurfex/configuration.py @@ -735,6 +735,8 @@ def __init__(self, env, conf): self.update_setting("SURFEX#ASSIM#SCHEMES#ISBA", "EKF") if anasurf == "ENKF": self.update_setting("SURFEX#ASSIM#SCHEMES#ISBA", "ENKF") + if anasurf == "ISBA_NONE": + self.update_setting("SURFEX#ASSIM#SCHEMES#ISBA", "NONE") # Active EKF control variables from CVAR_M if "NNCV" in env: diff --git a/pysurfex/geo.py b/pysurfex/geo.py index 3647cff..7e4ffe4 100644 --- a/pysurfex/geo.py +++ b/pysurfex/geo.py @@ -912,6 +912,21 @@ def get_geo_object(from_json): raise KeyError("nam_pgd_grid not set!") +def get_geo_object_from_json_file(fname): + """Get a surfex geometry object from a dictionary. + + Args: + fname (str): Domain definition file. + + Returns: + surfex.Geo: Surfex geometry. + + """ + with open(fname, mode="r", encoding="utf8") as fh: + domain_dict = json.load(fh) + return get_geo_object(domain_dict) + + def set_domain(settings, domain, hm_mode=False): """Set domain. diff --git a/pysurfex/variable.py b/pysurfex/variable.py index 464c240..f3cecf8 100644 --- a/pysurfex/variable.py +++ b/pysurfex/variable.py @@ -7,7 +7,7 @@ from .datetime_utils import as_timedelta from .fa import Fa from .file import SurfexFileVariable, get_surfex_io_object -from .geo import get_geo_object +from .geo import get_geo_object_from_json_file from .grib import Grib, Grib1Variable, Grib2Variable from .input_methods import get_datasources from .netcdf import Netcdf, NetCDFReadVariable @@ -127,7 +127,7 @@ def get_filehandler(self, validtime, cache=None, previoustime=None): geo_in = self.var_dict["geo_input"] elif "geo_input_file" in self.var_dict: geo_in_file = self.var_dict["geo_input_file"] - geo_in = get_geo_object(open(geo_in_file, "r", encoding="utf-8")) + geo_in = get_geo_object_from_json_file(geo_in_file) file_handler = get_surfex_io_object( filename, fileformat=fileformat, filetype=filetype, geo=geo_in