diff --git a/changelog/702.fix.md b/changelog/702.fix.md new file mode 100644 index 000000000..f15e8e499 --- /dev/null +++ b/changelog/702.fix.md @@ -0,0 +1 @@ +Made the transient climate response to cumulative CO2 emissions (TCRE) diagnostic compatible with CMIP7 data. diff --git a/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/tcre.py b/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/tcre.py index dfff19d2d..809796830 100644 --- a/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/tcre.py +++ b/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/tcre.py @@ -12,7 +12,7 @@ from climate_ref_core.datasets import ExecutionDatasetCollection, FacetFilter, SourceDatasetType from climate_ref_core.diagnostics import DataRequirement from climate_ref_core.esgf import CMIP6Request, CMIP7Request -from climate_ref_core.metric_values.typing import FileDefinition +from climate_ref_core.metric_values.typing import FileDefinition, SeriesDefinition from climate_ref_core.pycmec.metric import CMECMetric, MetricCV from climate_ref_core.pycmec.output import CMECOutput from climate_ref_core.testing import TestCase, TestDataSpecification @@ -32,7 +32,8 @@ class TransientClimateResponseEmissions(ESMValToolDiagnostic): name = "Transient Climate Response to Cumulative CO2 Emissions" slug = "transient-climate-response-emissions" - base_recipe = "recipe_tcre.yml" + version = 2 + base_recipe = "ref/recipe_ref_tcre.yml" variables = ( "tas", @@ -78,21 +79,10 @@ class TransientClimateResponseEmissions(ESMValToolDiagnostic): DataRequirement( source_type=SourceDatasetType.CMIP7, filters=( - FacetFilter( - facets={ - "branded_variable": ( - "fco2antt_tavg-u-hxy-u", - "tas_tavg-h2m-hxy-u", - ), - "experiment_id": "esm-1pctCO2", - "frequency": "mon", - "region": "glb", - }, - ), FacetFilter( facets={ "branded_variable": "tas_tavg-h2m-hxy-u", - "experiment_id": "esm-piControl", + "experiment_id": "esm-flat10", "frequency": "mon", "region": "glb", }, @@ -100,24 +90,47 @@ class TransientClimateResponseEmissions(ESMValToolDiagnostic): ), group_by=("source_id", "variant_label", "grid_label"), constraints=( + AddParentDataset.from_defaults(SourceDatasetType.CMIP7), + AddSupplementaryDataset( + supplementary_facets={ + "branded_variable": "fco2antt_tavg-u-hxy-u", + "experiment_id": "esm-flat10", + "frequency": "mon", + "region": "glb", + }, + matching_facets=( + "source_id", + "variant_label", + "grid_label", + ), + optional_matching_facets=("version",), + ), RequireContiguousTimerange(group_by=("instance_id",)), - RequireFacets("experiment_id", ("esm-1pctCO2", "esm-piControl")), - RequireFacets("variable_id", variables), + RequireFacets("variable_id", ("tas", "fco2antt")), AddSupplementaryDataset.from_defaults("areacella", SourceDatasetType.CMIP7), ), ), ), ) facets = ("grid_label", "member_id", "variant_label", "source_id", "region", "metric") - # TODO: the ESMValTool diagnostic script does not save the data for the timeseries. - series = tuple() + series = ( + SeriesDefinition( + file_pattern="tcre/calculate/{source_id}.nc", + dimensions={ + "statistic": "global annual mean anomaly of tas vs cumulative fco2antt", + }, + values_name="tas", + index_name="cumulative_fco2antt", + attributes=[], + ), + ) files = ( FileDefinition( - file_pattern="plots/tcre/calculate_tcre/*.png", + file_pattern="plots/tcre/calculate/*.png", dimensions={"statistic": "tcre"}, ), FileDefinition( - file_pattern="work/tcre/calculate_tcre/tcre.nc", + file_pattern="work/tcre/calculate/tcre.nc", dimensions={"metric": "tcre"}, ), ) @@ -147,7 +160,7 @@ class TransientClimateResponseEmissions(ESMValToolDiagnostic): CMIP7Request( slug="cmip7", facets={ - "experiment_id": ["esm-1pctCO2", "esm-piControl"], + "experiment_id": ["esm-flat10", "esm-piControl"], "source_id": "MPI-ESM1-2-LR", "variable_id": ["areacella", "fco2antt", "tas"], "branded_variable": [ @@ -173,31 +186,35 @@ def update_recipe( ) -> None: """Update the recipe.""" # Prepare updated datasets section in recipe. It contains three - # datasets, "tas" and "fco2antt" for the "esm-1pctCO2" and just "tas" - # for the "esm-piControl" experiment. + # datasets, "tas" and "fco2antt" for a scenario with steady CO2 + # increase (i.e., "esm-flat10" for CMIP7 and "esm-1pctCO2" for CMIP6) + # and just "tas" for the "esm-piControl" experiment. cmip_source = get_cmip_source_type(input_files) df = input_files[cmip_source] - tas_esm_1pctCO2, tas_esm_piControl = get_child_and_parent_dataset( + if cmip_source == SourceDatasetType.CMIP6: + exp_duration_in_years = 65 + else: + exp_duration_in_years = 110 + tas_co2_increase, tas_esm_piControl = get_child_and_parent_dataset( df[df.variable_id == "tas"], parent_experiment="esm-piControl", - child_duration_in_years=65, + child_duration_in_years=exp_duration_in_years, parent_offset_in_years=0, - parent_duration_in_years=65, + parent_duration_in_years=exp_duration_in_years, ) recipe_variables = dataframe_to_recipe(df[df.variable_id == "fco2antt"]) fco2antt_esm_1pctCO2 = next( ds for ds in recipe_variables["fco2antt"]["additional_datasets"] if ds["exp"] == "esm-1pctCO2" ) - fco2antt_esm_1pctCO2["timerange"] = tas_esm_1pctCO2["timerange"] + fco2antt_esm_1pctCO2["timerange"] = tas_co2_increase["timerange"] recipe["diagnostics"]["tcre"]["variables"] = { - "tas_esm-1pctCO2": { - "short_name": "tas", + "tas": { "preprocessor": "global_annual_mean_anomaly", - "additional_datasets": [tas_esm_1pctCO2], + "additional_datasets": [tas_co2_increase], }, - "tas_esm-piControl": { + "tas_control": { "short_name": "tas", "preprocessor": "global_annual_mean_anomaly", "additional_datasets": [tas_esm_piControl], @@ -207,18 +224,21 @@ def update_recipe( "additional_datasets": [fco2antt_esm_1pctCO2], }, } - recipe["diagnostics"].pop("barplot") - # Update descriptions. - dataset = tas_esm_1pctCO2["dataset"] - ensemble = tas_esm_1pctCO2["ensemble"] - settings = recipe["diagnostics"]["tcre"]["scripts"]["calculate_tcre"] - settings["caption"] = ( - settings["caption"].replace("MPI-ESM1-2-LR", dataset).replace("r1i1p1f1", ensemble) - ) - settings["pyplot_kwargs"]["title"] = ( - settings["pyplot_kwargs"]["title"].replace("MPI-ESM1-2-LR", dataset).replace("r1i1p1f1", ensemble) - ) + # For CMIP6, some special settings are necessary because the esm-flat10 + # experiment does not exist + if cmip_source == SourceDatasetType.CMIP6: + diag_settings = recipe["diagnostics"]["tcre"]["scripts"]["calculate"] + diag_settings["calc_tcre_period"] = [45, 65] + diag_settings["caption"] = ( + "Global annual mean near-surface air temperature anomaly ΔT vs. " + "global annual cumulative CO2 emissions E of the emission-driven " + "1% CO2 increase per year experiment. The transient climate " + "response to cumulative CO2 Emissions (TCRE) is defined as the " + "20-year average ΔT centered at the time where cumulative CO2 " + "emissions E reach 1000 PgC (i.e., after 55 years)." + ) + diag_settings["exp_target"] = "esm-1pctCO2" @staticmethod def format_result( @@ -228,7 +248,7 @@ def format_result( output_args: OutputBundleArgs, ) -> tuple[CMECMetric, CMECOutput]: """Format the result.""" - tcre_ds = xarray.open_dataset(result_dir / "work" / "tcre" / "calculate_tcre" / "tcre.nc") + tcre_ds = xarray.open_dataset(result_dir / "work" / "tcre" / "calculate" / "tcre.nc") tcre = float(fillvalues_to_nan(tcre_ds["tcre"].values)[0]) # Update the diagnostic bundle arguments with the computed diagnostics. diff --git a/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py b/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py index 036ad3956..411da063c 100644 --- a/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py +++ b/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py @@ -302,7 +302,7 @@ def get_child_and_parent_dataset( return [child_dataset, parent_dataset] -_ESMVALTOOL_COMMIT = "dead90ca848d3892ed90785b3940909d58d27780" +_ESMVALTOOL_COMMIT = "12cb5309bd64ca4189bc0ef63bcf25e82664e45f" _ESMVALTOOL_VERSION = f"2.14.0.dev65+g{_ESMVALTOOL_COMMIT[:9]}" _ESMVALTOOL_URL = f"git+https://github.com/ESMValGroup/ESMValTool.git@{_ESMVALTOOL_COMMIT}" diff --git a/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipes.txt b/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipes.txt index 54ac7b692..6b666a400 100644 --- a/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipes.txt +++ b/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipes.txt @@ -3,15 +3,15 @@ recipe_calculate_gwl_exceedance_stats.yml 9f28304b85f7043fb76eb29ee84da46e0849 recipe_ecs.yml 0cc57034fcb64e32015b4ff949ece5df8cdb8c6f493618b50ceded119fb37918 recipe_seaice_sensitivity.yml 07270818ebf04a58713dc989720cc9ace77f28d42b1ea189c3bdaf22f5d64577 recipe_tcr.yml 35f9ef035a4e71aff5cac5dd26c49da2162fc00291bf3b0bd16b661b7b2f606b -recipe_tcre.yml 48fc9e3baf541bbcef7491853ea3a774053771dca33352b41466425faeaa38af recipe_zec.yml b0af7f789b7610ab3f29a6617124aa40c40866ead958204fc199eaf82863de51 ref/recipe_enso_basicclimatology.yml 9ea7deb7ee668e39ac44618b96496d898bd82285c22dcee4fce4695e0c9fa82b ref/recipe_enso_characteristics.yml 34c2518b138068ac96d212910b979d54a8fcedee2c0089b5acd56a42c41dc3e4 ref/recipe_ref_annual_cycle_region.yml 88e0c2f07a76c4de4276547badcc74091516e03840eddb1f0e62469c67a0a86d ref/recipe_ref_cre.yml 4375f262479c3b3e1b348b71080a6d758e195bda76516a591182045a3a29aa32 ref/recipe_ref_fire.yml 2ad82effaca4e742d8abe6a0aa07bb46e1e92ef0d2d240760f7623b0ba045926 -ref/recipe_ref_ozone.yml 388aaf01721c0856ab7143b47b9d2f1efeaaae4ef57e11572c1e133b49aad0a6 +ref/recipe_ref_ozone.yml 09ded4946ecd762ba000916c9f8618120a2e6269930427ae5129da466165f3e5 ref/recipe_ref_sea_ice_area_basic.yml 7d01a8527880663ca28284772f83a8356d9972fb4f022a4000e50a56ce044b09 ref/recipe_ref_scatterplot.yml b99d1736e16256d161847b025811d7088ad9f892d4887fb009fa99c4079135a0 +ref/recipe_ref_tcre.yml 85bd9ffc42a4eb70dc7e3d984f0f7c1085232ac8dd977d04d58b27a982254ebd ref/recipe_ref_timeseries_region.yml deee4403ea25867401e163f6c9d7fcc4fee09d3088009007fcad6a29d01247a8 ref/recipe_ref_trend_regions.yml 18fe246a51474bd12172ab1ba141efac999a247de7774822f77ae6ef144645fe diff --git a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/manifest.json b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/manifest.json index 98b884f3a..33455b26a 100644 --- a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/manifest.json +++ b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/manifest.json @@ -2,40 +2,44 @@ "catalog_hash": "b613fa1005fc988c79aa0fbf950bc77cdabfa48c", "committed": { "diagnostic.json": "7ab48ab04e69764ede371f1fccc138b0fbda081bb7c8467d5bd1f0e290751a98", - "output.json": "666d10cf64bf489e34d726b6cad954dbd05b92cff0cb61b054b3a06d036c7558", - "series.json": "37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570" + "output.json": "e1dd1235434cecfbafce398569bcea49ca13bd12a1e91f27b2bddf05dbcfd33c", + "series.json": "b9fa8c422920a79713d7099109895ff0517132ce69e744ce50fa90da13a1a195" }, - "diagnostic_version": 1, + "diagnostic_version": 2, "native": { "diagnostic.json": { "sha256": "0afbce145a1ba1dfe5fba69d3c49102d63d9b859722644a449accd7ea4f57fb6", "size": 604 }, "executions/recipe/index.html": { - "sha256": "7e07bcb94c7b63c199def3235aa68d52387b190c62c9473a7a88f1bc42e0c343", - "size": 13707 + "sha256": "1c62c1b064cda409351eed28c4aaf19a5df536f3582742b3890931566c3c0621", + "size": 14390 }, - "executions/recipe/plots/tcre/calculate_tcre/tcre.png": { - "sha256": "d50c684a93bc6b05eaa2dfe174010cb5d0a0fa1338ac4f08b604197772a9236e", - "size": 118352 + "executions/recipe/plots/tcre/calculate/tcre.png": { + "sha256": "6145f02a740c3e1ac90cf2f809cc701a5d0e173e06ca982e3e7953b8f8ce0f40", + "size": 111737 }, - "executions/recipe/run/tcre/calculate_tcre/diagnostic_provenance.yml": { - "sha256": "bf24ddd1df4e219cfd58a0c7bb28bfc4bf84a7f438e71034465725b2dc769c5a", - "size": 1749 + "executions/recipe/run/tcre/calculate/diagnostic_provenance.yml": { + "sha256": "343266f6eb2f8fce3fa2a1c8e356e51c49338faeb2f0d7ffc6e75dda67b0b0b7", + "size": 2645 }, - "executions/recipe/work/tcre/calculate_tcre/tcre.nc": { - "sha256": "d277f87e14cb5450049be9a6d51b2634ca5f0082d3cd16cd590747777a9c8c61", + "executions/recipe/work/tcre/calculate/MPI-ESM1-2-LR.nc": { + "sha256": "5072c7ef38ca520f9dbe290d016dfb5fba0a8cc457e64d0b880017d2123cf685", + "size": 28705 + }, + "executions/recipe/work/tcre/calculate/tcre.nc": { + "sha256": "83b852855e229a0982207e72fc19ffa80c58e3140e3b7be3eebb6ff0b4d614d5", "size": 9232 }, "output.json": { - "sha256": "28f6049b2890b0e7826f54f21c1dc3df7ca6611e0f62235fee89feeb89cf6fe6", - "size": 1527 + "sha256": "e391a64ec1d0a7099b9301f77d465012027c26eb28425482799d4c6abb13843e", + "size": 2138 }, "series.json": { - "sha256": "4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945", - "size": 2 + "sha256": "46dfb1c1dd0dfb16ece7e53ffcb15257509093519fa76aec8d1a3fce7bca87c3", + "size": 4257 } }, "schema": 2, - "test_case_version": 1 + "test_case_version": 2 } diff --git a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/output.json b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/output.json index a0abaa3db..ff6be599a 100644 --- a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/output.json +++ b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/output.json @@ -1,11 +1,19 @@ { "data": { - "executions/recipe/work/tcre/calculate_tcre/tcre.nc": { + "executions/recipe/work/tcre/calculate/MPI-ESM1-2-LR.nc": { + "description": "", + "dimensions": { + "statistic": "global annual mean anomaly of tas vs cumulative fco2antt" + }, + "filename": "executions/recipe/work/tcre/calculate/MPI-ESM1-2-LR.nc", + "long_name": "Global annual mean near-surface air temperature anomaly ΔT vs. global annual cumulative CO2 emissions E of the emission-driven 1% CO2 increase per year experiment. The transient climate response to cumulative CO2 Emissions (TCRE) is defined as the 20-year average ΔT centered at the time where cumulative CO2 emissions E reach 1000 PgC (i.e., after 55 years)." + }, + "executions/recipe/work/tcre/calculate/tcre.nc": { "description": "", "dimensions": { "metric": "tcre" }, - "filename": "executions/recipe/work/tcre/calculate_tcre/tcre.nc", + "filename": "executions/recipe/work/tcre/calculate/tcre.nc", "long_name": "Transient Climate Response to Cumulative CO2 Emissions (TCRE) for multiple datasets." } }, @@ -21,13 +29,13 @@ "index": "/executions/recipe/index.html", "metrics": null, "plots": { - "executions/recipe/plots/tcre/calculate_tcre/tcre.png": { + "executions/recipe/plots/tcre/calculate/tcre.png": { "description": "", "dimensions": { "statistic": "tcre" }, - "filename": "executions/recipe/plots/tcre/calculate_tcre/tcre.png", - "long_name": "Global annual mean near-surface air temperature anomaly ΔT vs.\nglobal annual cumulative CO2 emissions E of the emission-driven 1%\nCO2 increase per year experiment for model MPI-ESM1-2-LR (ensemble\nmember r1i1p1f1). The transient climate response to cumulative CO2\nEmissions (TCRE) is defined as the 20-year average ΔT centered at\nthe time where cumulative CO2 emissions E reach 1000 PgC.\n" + "filename": "executions/recipe/plots/tcre/calculate/tcre.png", + "long_name": "Global annual mean near-surface air temperature anomaly ΔT vs. global annual cumulative CO2 emissions E of the emission-driven 1% CO2 increase per year experiment. The transient climate response to cumulative CO2 Emissions (TCRE) is defined as the 20-year average ΔT centered at the time where cumulative CO2 emissions E reach 1000 PgC (i.e., after 55 years)." } }, "provenance": { diff --git a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/series.json b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/series.json index fe51488c7..5541c08ee 100644 --- a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/series.json +++ b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip6/regression/series.json @@ -1 +1,155 @@ -[] +[ + { + "attributes": { + "caption": "Global annual mean near-surface air temperature anomaly ΔT vs. global annual cumulative CO2 emissions E of the emission-driven 1% CO2 increase per year experiment. The transient climate response to cumulative CO2 Emissions (TCRE) is defined as the 20-year average ΔT centered at the time where cumulative CO2 emissions E reach 1000 PgC (i.e., after 55 years).", + "index_long_name": "Cumulative Carbon Mass Flux into Atmosphere Due to All Anthropogenic Emissions of CO2 [kgC m-2 s-1]", + "index_name": "cumulative_fco2antt", + "index_units": "Pg", + "value_long_name": "Near-Surface Air Temperature Anomaly", + "value_standard_name": "air_temperature", + "value_units": "K", + "values_name": "tas" + }, + "dimensions": { + "grid_label": "gn", + "member_id": "r1i1p1f1", + "source_id": "MPI-ESM1-2-LR", + "statistic": "global annual mean anomaly of tas vs cumulative fco2antt" + }, + "index": [ + 0.2013377, + 1.416652, + 8.688466, + 13.34004, + 19.39229, + 28.83159, + 38.76964, + 50.23255, + 62.42121, + 74.87341, + 86.36916, + 95.46938, + 106.5819, + 118.5027, + 129.4877, + 140.9191, + 153.5482, + 167.7635, + 182.6074, + 195.4021, + 206.9933, + 220.594, + 237.5355, + 252.3148, + 267.6204, + 282.0691, + 296.196, + 312.1739, + 327.7825, + 345.357, + 363.0674, + 379.027, + 394.491, + 411.1049, + 427.8766, + 447.8357, + 466.2372, + 483.77, + 499.2878, + 517.2466, + 536.5285, + 552.5174, + 572.2668, + 593.4716, + 612.8889, + 631.8699, + 652.6718, + 670.7904, + 691.1319, + 711.4244, + 730.6212, + 747.7416, + 764.6149, + 786.1887, + 807.3903, + 829.3917, + 849.1311, + 869.6793, + 889.6285, + 911.2205, + 932.4928, + 952.1559, + 972.6133, + 993.9204, + 1015.761 + ], + "index_name": "cumulative_fco2antt", + "values": [ + -0.1372375, + -0.1194153, + 0.008575439, + 0.01486206, + -0.1615601, + -0.1539307, + -0.05749512, + 0.1296082, + 0.1743774, + 0.0428772, + -0.002929688, + 0.03637695, + 0.1427307, + 0.3305054, + 0.365387, + 0.1690063, + 0.1687622, + 0.3038635, + 0.2469177, + 0.5115051, + 0.4413757, + 0.3639221, + 0.3919983, + 0.3261108, + 0.2859802, + 0.3563232, + 0.3682251, + 0.5244141, + 0.4899597, + 0.5166931, + 0.6110229, + 0.6600342, + 0.6838379, + 0.6711426, + 0.5995178, + 0.7131042, + 0.8457031, + 0.8269653, + 0.7090454, + 0.7571106, + 0.9005127, + 0.7940674, + 0.7283325, + 0.770752, + 1.023102, + 1.164825, + 1.177582, + 1.037781, + 1.047028, + 1.138031, + 1.022766, + 1.098419, + 1.275391, + 1.301025, + 1.273773, + 1.429718, + 1.435089, + 1.291748, + 1.362518, + 1.467987, + 1.479584, + 1.651123, + 1.533112, + 1.559814, + 1.664368 + ] + } +] diff --git a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip7/manifest.json b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip7/manifest.json index 7945b5bf5..22431df23 100644 --- a/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip7/manifest.json +++ b/packages/climate-ref-esmvaltool/tests/test-data/transient-climate-response-emissions/cmip7/manifest.json @@ -5,7 +5,7 @@ "output.json": "666d10cf64bf489e34d726b6cad954dbd05b92cff0cb61b054b3a06d036c7558", "series.json": "37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570" }, - "diagnostic_version": 1, + "diagnostic_version": 2, "native": {}, "schema": 2, "test_case_version": 1 diff --git a/packages/climate-ref-esmvaltool/tests/unit/diagnostics/recipes/recipe_transient_climate_response_emissions_cmip6.yml b/packages/climate-ref-esmvaltool/tests/unit/diagnostics/recipes/recipe_transient_climate_response_emissions_cmip6.yml index f9017c0ad..b612ef04d 100644 --- a/packages/climate-ref-esmvaltool/tests/unit/diagnostics/recipes/recipe_transient_climate_response_emissions_cmip6.yml +++ b/packages/climate-ref-esmvaltool/tests/unit/diagnostics/recipes/recipe_transient_climate_response_emissions_cmip6.yml @@ -11,25 +11,6 @@ documentation: - schlund_manuel references: - sanderson24gmd - domains: - - global - realms: - - atmos - themes: - - carbon - - bgphys -datasets_target_exp: -- project: CMIP6 - dataset: MPI-ESM1-2-LR - ensemble: r1i1p1f1 - grid: gn - timerange: 1850/1914 -datasets_control_exp: -- project: CMIP6 - dataset: MPI-ESM1-2-LR - ensemble: r1i1p1f1 - grid: gn - timerange: 1850/1914 preprocessors: global_annual_mean_anomaly: custom_order: true @@ -53,8 +34,7 @@ preprocessors: diagnostics: tcre: variables: - tas_esm-1pctCO2: - short_name: tas + tas: preprocessor: global_annual_mean_anomaly additional_datasets: - project: CMIP6 @@ -66,7 +46,7 @@ diagnostics: grid: gn mip: Amon timerange: 1850/1914 - tas_esm-piControl: + tas_control: short_name: tas preprocessor: global_annual_mean_anomaly additional_datasets: @@ -92,20 +72,18 @@ diagnostics: mip: Amon timerange: 1850/1914 scripts: - calculate_tcre: + calculate: script: climate_metrics/tcre.py - calc_tcre_period: - - 45 - - 65 caption: "Global annual mean near-surface air temperature anomaly \u0394T\ - \ vs.\nglobal annual cumulative CO2 emissions E of the emission-driven 1%\n\ - CO2 increase per year experiment for model MPI-ESM1-2-LR (ensemble\nmember\ - \ r1i1p1f1). The transient climate response to cumulative CO2\nEmissions\ - \ (TCRE) is defined as the 20-year average \u0394T centered at\nthe time\ - \ where cumulative CO2 emissions E reach 1000 PgC.\n" - exp_target: esm-1pctCO2 - legend_kwargs: false + \ vs. global annual cumulative CO2 emissions E of the emission-driven 1%\ + \ CO2 increase per year experiment. The transient climate response to cumulative\ + \ CO2 Emissions (TCRE) is defined as the 20-year average \u0394T centered\ + \ at the time where cumulative CO2 emissions E reach 1000 PgC (i.e., after\ + \ 55 years)." pyplot_kwargs: - title: MPI-ESM1-2-LR (ensemble member r1i1p1f1) xlabel: E [PgC] ylabel: "\u0394T [K]" + calc_tcre_period: + - 45 + - 65 + exp_target: esm-1pctCO2 diff --git a/packages/climate-ref-esmvaltool/tests/unit/test_solve_regression/test_solve_regression_transient_climate_response_emissions_.yml b/packages/climate-ref-esmvaltool/tests/unit/test_solve_regression/test_solve_regression_transient_climate_response_emissions_.yml index f27cb98a1..bb79809a0 100644 --- a/packages/climate-ref-esmvaltool/tests/unit/test_solve_regression/test_solve_regression_transient_climate_response_emissions_.yml +++ b/packages/climate-ref-esmvaltool/tests/unit/test_solve_regression/test_solve_regression_transient_climate_response_emissions_.yml @@ -4,9 +4,3 @@ cmip6_gn_r1i1p1f1_MPI-ESM1-2-LR: - CMIP6.C4MIP CDRMIP.MPI-M.MPI-ESM1-2-LR.esm-1pctCO2.r1i1p1f1.Amon.tas.gn.v20190815 - CMIP6.CMIP.MPI-M.MPI-ESM1-2-LR.1pctCO2.r1i1p1f1.fx.areacella.gn.v20190710 - CMIP6.CMIP.MPI-M.MPI-ESM1-2-LR.esm-piControl.r1i1p1f1.Amon.tas.gn.v20190815 -cmip7_gn_MPI-ESM1-2-LR_r1i1p1f1: - cmip7: - - CMIP7.C4MIP CDRMIP.MPI-M.MPI-ESM1-2-LR.esm-1pctCO2.r1i1p1f1.glb.mon.fco2antt.tavg-u-hxy-u.gn.v20190815 - - CMIP7.C4MIP CDRMIP.MPI-M.MPI-ESM1-2-LR.esm-1pctCO2.r1i1p1f1.glb.mon.tas.tavg-h2m-hxy-u.gn.v20190815 - - CMIP7.CMIP.MPI-M.MPI-ESM1-2-LR.1pctCO2.r1i1p1f1.glb.fx.areacella.ti-u-hxy-u.gn.v20190710 - - CMIP7.CMIP.MPI-M.MPI-ESM1-2-LR.esm-piControl.r1i1p1f1.glb.mon.tas.tavg-h2m-hxy-u.gn.v20190815