diff --git a/tests/unit/preprocessor/_multimodel/test_multimodel.py b/tests/unit/preprocessor/_multimodel/test_multimodel.py index 16794a2665..98d17b0582 100644 --- a/tests/unit/preprocessor/_multimodel/test_multimodel.py +++ b/tests/unit/preprocessor/_multimodel/test_multimodel.py @@ -541,6 +541,26 @@ def test_return_products(): assert result4 == result2 +def test_ignore_tas_scalar_height_coord(): + """Ignore conflicting aux_coords for height in tas.""" + tas_2m = generate_cube_from_dates("monthly") + tas_1p5m = generate_cube_from_dates("monthly") + + for cube, height in zip([tas_2m, tas_1p5m], [2., 1.5]): + cube.rename("air_temperature") + cube.attributes["short_name"] = "tas" + cube.add_aux_coord( + iris.coords.AuxCoord([height], var_name="height", units="m")) + + result = mm.multi_model_statistics([tas_2m, tas_2m.copy(), tas_1p5m], + statistics=['mean'], + span='full') + + # iris automatically averages the value of the scalar coordinate. + assert len(result['mean'].coords("height")) == 1 + assert result["mean"].coord("height").points == 1.75 + + def test_daily_inconsistent_calendars(): """Determine behaviour for inconsistent calendars.