Skip to content

Commit dead90c

Browse files
authored
Add fallbacks for CMIP7 tasmax handling in ref/recipe_ref_fire.yml (#4423)
1 parent a3fe024 commit dead90c

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

esmvaltool/diag_scripts/fire/diagnostic_run_confire.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,11 @@ def _read_variable_from_netcdf(
458458
callback=_sort_time,
459459
)
460460
else:
461+
# Fallback for CMIP7 data for tasmax
462+
var = "tas" if "tasmax/tas_tmaxavg" in filename[0] else filename[1]
461463
dataset = iris.load_raw(
462464
Path(directory) / filename[0],
463-
filename[1],
465+
var,
464466
callback=_sort_time,
465467
)
466468
dataset = dataset[0]

esmvaltool/diag_scripts/fire/fire_diagnostic.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,15 @@ def main(cfg: dict) -> None:
341341
vars_file = {}
342342
for i, attributes in enumerate(group):
343343
logger.info("Variable %s", attributes["short_name"])
344-
vars_file[attributes["short_name"]] = attributes
344+
# Fallback for CMIP7 data for tasmax
345+
short_name_key = (
346+
"tasmax"
347+
if attributes.get("branding_suffix")
348+
and attributes["short_name"] == "tas"
349+
and "tmax" in attributes["branding_suffix"]
350+
else attributes["short_name"]
351+
)
352+
vars_file[short_name_key] = attributes
345353
# Save model information for output plot name
346354
if i == 0:
347355
plot_file_info = "_".join(

0 commit comments

Comments
 (0)