ewatercycle.esmvaltool.run ========================== .. py:module:: ewatercycle.esmvaltool.run .. autoapi-nested-parse:: Run ESMValTool recipes. Module Contents --------------- .. py:data:: logger .. py:function:: run_recipe(recipe: ewatercycle.esmvaltool.schema.Recipe, output_dir: pathlib.Path | None = None) -> dict[str, str] Run an ESMValTool recipe. :param recipe: ESMValTool recipe :param output_dir: Directory where output should be written to. If None then output is written to generated timestamped directory. :returns: Dictionary with forcing data variables as keys and file names as values and a key called directory with value the parent directory of the file names. .. rubric:: Example To run a recipe that generates a distributed forcing dataset: >>> from ewatercycle.testing import rhine_shape >>> from ewatercycle.esmvaltool.builder import ( ... build_generic_distributed_forcing_recipe ... ) >>> from ewatercycle.esmvaltool.run import run_recipe >>> shape = rhine_shape() >>> recipe = build_generic_distributed_forcing_recipe( ... start_year=2000, ... end_year=2001, ... shape=shape, ... dataset='ERA5', ... ) >>> output = run_recipe(recipe) >>> output diagnostic/script: DataFile('OBS6_ERA5_reanaly_*_day_pr_2000-2001.nc') DataFile('OBS6_ERA5_reanaly_*_day_tas_2000-2001.nc') DataFile('OBS6_ERA5_reanaly_*_day_tasmax_2000-2001.nc') DataFile('OBS6_ERA5_reanaly_*_day_tasmin_2000-2001.nc') diagnostic/pr: DataFile('OBS6_ERA5_reanaly_*_day_pr_2000-2001.nc') diagnostic/tas: DataFile('OBS6_ERA5_reanaly_*_day_tas_2000-2001.nc') diagnostic/tasmin: DataFile('OBS6_ERA5_reanaly_*_day_tasmin_2000-2001.nc') diagnostic/tasmax: DataFile('OBS6_ERA5_reanaly_*_day_tasmax_2000-2001.nc')