How to run the AR6 workflow¶
Here we demonstrate how to run the workflow that was used in AR6. This is intended to demonstrate how to use the package in a familiar context. If you want a simpler interface for doing this, please see the climate-assessment package, which is a facade around gcages.
Imports¶
import multiprocessing
import os
import platform
from functools import partial
from pathlib import Path
import numpy as np
import openscm_units
import pandas as pd
import pandas_indexing as pix
import pandas_openscm
import pint
import seaborn as sns
from gcages.ar6 import (
AR6Harmoniser,
AR6Infiller,
AR6PostProcessor,
AR6PreProcessor,
AR6SCMRunner,
get_ar6_full_historical_emissions,
)
# Setup pint
pint.set_application_registry(openscm_units.unit_registry)
pandas_openscm.register_pandas_accessors()
Starting point¶
The starting point is some emissions scenario.
This must be in a format like the below,
i.e. a pandas DataFrame with a MultiIndex with levels:
["model", "scenario", "region", "variable", "unit"]
and years as the columns.
Naming conventions¶
A complete discussion on naming conventions is provided in
or our docs on naming conventions.
In short, we use the gcages naming conventions throughout.
However, AR6 used the IAMC naming convention as its starting point.
Hence, we start from the IAMC naming convention here.
However, the pre-processing step alters the naming convention to gcages names.
# All the code to generate these demo timeseries
# (this is obviously a scrappy demo,
# you would normally use output from somewhere else
# and be much more careful than this :)).
time = np.arange(2015, 2100 + 1)
co2_flatline = np.ones_like(time) * 38.5
co2_flatline[np.logical_and(time > 2040, time < 2075)] = 38.5 * (
1 - 1 / (1 + np.exp(-(np.arange(2075 - 2041) - 15) / 3.0))
)
co2_flatline[time >= 2075] = 0.0
co2_flatline *= 1000.0
ch4_flatline = np.ones_like(time) * 410
ch4_flatline[np.logical_and(time > 2040, time < 2075)] = (
(410.0 - 200.0) * (1 - 1 / (1 + np.exp(-(np.arange(2075 - 2041) - 15) / 3.0)))
) + 200.0
ch4_flatline[time >= 2075] = 200.0
co2_decline = np.ones_like(time) * 38.5
co2_decline[np.logical_and(time > 2030, time < 2050)] = 38.5 * (
1 - 1.2 / (1 + np.exp(-(np.arange(2050 - 2031) - 10) / 3.0))
)
co2_decline[time >= 2050] = np.nan
co2_decline[time == 2100] = 0.0
co2_decline *= 1000.0
ch4_decline = np.ones_like(time) * 410
ch4_decline[np.logical_and(time > 2030, time < 2060)] = (
(410.0 - 150.0) * (1 - 1 / (1 + np.exp(-(np.arange(2060 - 2031) - 10) / 3.0)))
) + 150.0
ch4_decline[time >= 2050] = 150.0
# Put it altogether into a DataFrame
start = pd.DataFrame(
np.vstack(
[
co2_flatline,
ch4_flatline,
co2_flatline,
co2_decline,
ch4_decline,
co2_decline * 0.85,
co2_decline * 0.13
+ np.arange(co2_decline.size) * 10.0
+ 500.0 * np.ones_like(co2_decline),
]
),
columns=time,
index=pd.MultiIndex.from_tuples(
# Note the use of IAMC names here
[
(
"demo",
"flatline",
"World",
"Emissions|CO2|Energy and Industrial Processes",
"Mt CO2/yr",
),
("demo", "flatline", "World", "Emissions|CH4", "Mt CH4/yr"),
(
"demo",
"flatline-co2-only",
"World",
"Emissions|CO2|Energy and Industrial Processes",
"Mt CO2/yr",
),
(
"demo",
"decline",
"World",
"Emissions|CO2|Energy and Industrial Processes",
"Mt CO2/yr",
),
("demo", "decline", "World", "Emissions|CH4", "Mt CH4/yr"),
(
"demo",
"decline_co2_fossil_split",
"World",
"Emissions|CO2|Energy",
"Mt CO2/yr",
),
(
"demo",
"decline_co2_fossil_split",
"World",
"Emissions|CO2|Industrial Processes",
"Mt CO2/yr",
),
],
names=["model", "scenario", "region", "variable", "unit"],
),
)
start = start.T.interpolate("index").T
start
| 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | scenario | region | variable | unit | |||||||||||||||||||||
| demo | flatline | World | Emissions|CO2|Energy and Industrial Processes | Mt CO2/yr | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 |
| Emissions|CH4 | Mt CH4/yr | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | ... | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.0 | |||
| flatline-co2-only | World | Emissions|CO2|Energy and Industrial Processes | Mt CO2/yr | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | |
| decline | World | Emissions|CO2|Energy and Industrial Processes | Mt CO2/yr | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | ... | -829.133715 | -737.007747 | -644.881779 | -552.755810 | -460.629842 | -368.503873 | -276.377905 | -184.251937 | -92.125968 | 0.0 | |
| Emissions|CH4 | Mt CH4/yr | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | ... | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.0 | |||
| decline_co2_fossil_split | World | Emissions|CO2|Energy | Mt CO2/yr | 32725.0 | 32725.0 | 32725.0 | 32725.0 | 32725.0 | 32725.0 | 32725.0 | 32725.0 | 32725.0 | 32725.0 | ... | -704.763658 | -626.456585 | -548.149512 | -469.842439 | -391.535366 | -313.228292 | -234.921219 | -156.614146 | -78.307073 | 0.0 | |
| Emissions|CO2|Industrial Processes | Mt CO2/yr | 5505.0 | 5515.0 | 5525.0 | 5535.0 | 5545.0 | 5555.0 | 5565.0 | 5575.0 | 5585.0 | 5595.0 | ... | 1152.212617 | 1174.188993 | 1196.165369 | 1218.141745 | 1240.118121 | 1262.094496 | 1284.070872 | 1306.047248 | 1328.023624 | 1350.0 |
7 rows × 86 columns
relplot_in_emms = partial(
sns.relplot,
kind="line",
linewidth=2.0,
alpha=0.7,
facet_kws=dict(sharey=False),
x="year",
y="value",
col="variable",
col_wrap=2,
)
fg = relplot_in_emms(
data=start.melt(ignore_index=False, var_name="year").reset_index(),
hue="scenario",
)
fg.axes.flatten()[0].axhline(0.0, linestyle="--", color="gray")
fg.axes.flatten()[1].set_ylim(ymin=0.0)
(0.0, 423.0)
Pre-process¶
If you want to run in exactly the same way as AR6, the first step is pre-processing the emissions scenario(s) (if you just want the same logic as AR6 for other steps, it is possible to skip this step and just go straight to harmonisation). This step does some variable aggregation that was needed in AR6 and extracts only those variables that are understood by the workflow.
pre_processor = AR6PreProcessor.from_ar6_config(
n_processes=None, # run serially for this demo
)
# These are the variables (using the IAMC naming convention)
# understood by the workflow as was used in AR6.
pre_processor.emissions_out
('Emissions|BC',
'Emissions|PFC|C2F6',
'Emissions|PFC|C6F14',
'Emissions|PFC|CF4',
'Emissions|CO',
'Emissions|CO2',
'Emissions|CO2|AFOLU',
'Emissions|CO2|Energy and Industrial Processes',
'Emissions|CH4',
'Emissions|HFC|HFC125',
'Emissions|HFC|HFC134a',
'Emissions|HFC|HFC143a',
'Emissions|HFC|HFC227ea',
'Emissions|HFC|HFC23',
'Emissions|HFC|HFC32',
'Emissions|HFC|HFC43-10',
'Emissions|N2O',
'Emissions|NH3',
'Emissions|NOx',
'Emissions|OC',
'Emissions|SF6',
'Emissions|Sulfur',
'Emissions|VOC')
Here we run the pre-processing and get the pre-processed data. Note a few things which were done:
- renaming of variables
- aggregation of the scenario which provided energy and industrial emissions separately
pre_processed = pre_processor(start)
pre_processed
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html from .autonotebook import tqdm as notebook_tqdm
For each model-scenario, calculating conditional sums: 0it [00:00, ?it/s]
For each model-scenario, calculating conditional sums: 4it [00:00, 600.02it/s]
For each model-scenario, reclassifying variables: 0it [00:00, ?it/s]
For each model-scenario, reclassifying variables: 4it [00:00, 1057.37it/s]
For each model-scenario, conditionally removing variables: 0it [00:00, ?it/s]
For each model-scenario, conditionally removing variables: 4it [00:00, 1356.39it/s]
For each model-scenario, dropping variables if they are identical: 0it [00:00, ?it/s]
For each model-scenario, dropping variables if they are identical: 4it [00:00, 1386.66it/s]
| 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | scenario | region | variable | unit | |||||||||||||||||||||
| demo | decline | World | Emissions|CO2|Fossil | Mt CO2/yr | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | ... | -829.133715 | -737.007747 | -644.881779 | -552.755810 | -460.629842 | -368.503873 | -276.377905 | -184.251937 | -92.125968 | 0.0 |
| Emissions|CH4 | Mt CH4/yr | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | ... | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.0 | |||
| decline_co2_fossil_split | World | Emissions|CO2|Fossil | Mt CO2/yr | 38230.0 | 38240.0 | 38250.0 | 38260.0 | 38270.0 | 38280.0 | 38290.0 | 38300.0 | 38310.0 | 38320.0 | ... | 447.448959 | 547.732408 | 648.015857 | 748.299306 | 848.582755 | 948.866204 | 1049.149653 | 1149.433102 | 1249.716551 | 1350.0 | |
| flatline | World | Emissions|CO2|Fossil | Mt CO2/yr | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | |
| Emissions|CH4 | Mt CH4/yr | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | 410.0 | ... | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.0 | |||
| flatline-co2-only | World | Emissions|CO2|Fossil | Mt CO2/yr | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | 38500.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 |
6 rows × 86 columns
fg = relplot_in_emms(
data=pre_processed.melt(ignore_index=False, var_name="year").reset_index(),
hue="scenario",
)
fg.axes.flatten()[0].axhline(0.0, linestyle="--", color="gray")
fg.axes.flatten()[1].set_ylim(ymin=0.0)
(0.0, 423.0)
Harmonisation¶
The next step is harmonisation. This is the process of aligning the scenarios with historical emissions estimates.
In AR6, a specific set of historical emissions was used. There is no official home for this, but a copy is stored in the path below (and, as above, if you want something that pre-packages everything, see the climate-assessment package).
Under the hood, the AR6 harmonisation uses the aneris package.
AR6_HISTORICAL_EMISSIONS_FILE = Path(
"tests/regression/ar6/ar6-workflow-inputs/history_ar6.csv"
)
With this file, we can initialise a harmoniser exactly like that used in AR6.
harmoniser = AR6Harmoniser.from_ar6_config(
ar6_historical_emissions_file=AR6_HISTORICAL_EMISSIONS_FILE,
n_processes=None, # run serially for this demo
)
And harmonise
harmonised = harmoniser(pre_processed)
harmonised
0it [00:00, ?it/s]
INFO:root:Harmonizing with reduce_ratio_2080
1it [00:00, 2.45it/s]
INFO:root:Harmonizing with reduce_ratio_2080
INFO:root:Harmonizing with reduce_ratio_2080
3it [00:00, 7.00it/s]
INFO:root:Harmonizing with reduce_ratio_2080
4it [00:00, 7.30it/s]
| 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | scenario | region | variable | unit | |||||||||||||||||||||
| demo | decline | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | -829.133715 | -737.007747 | -644.881779 | -552.755810 | -460.629842 | -368.503873 | -276.377905 | -184.251937 | -92.125968 | 0.0 |
| Emissions|CH4 | Mt CH4/yr | 388.072796 | 388.410137 | 388.747479 | 389.084821 | 389.422162 | 389.759504 | 390.096845 | 390.434187 | 390.771529 | 391.108870 | ... | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.0 | |||
| decline_co2_fossil_split | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35684.536703 | 35733.807989 | 35783.100158 | 35832.413211 | 35881.747147 | 35931.101967 | 35980.477670 | 36029.874257 | 36079.291727 | ... | 447.448959 | 547.732408 | 648.015857 | 748.299306 | 848.582755 | 948.866204 | 1049.149653 | 1149.433102 | 1249.716551 | 1350.0 | |
| flatline | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | |
| Emissions|CH4 | Mt CH4/yr | 388.072796 | 388.410137 | 388.747479 | 389.084821 | 389.422162 | 389.759504 | 390.096845 | 390.434187 | 390.771529 | 391.108870 | ... | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.0 | |||
| flatline-co2-only | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 |
6 rows × 86 columns
You can see the modification to the pathways as a result of the harmonisation in the plot below. In scenarios that have more emissions, the same idea is applied to all variables.
pdf = (
pix.concat(
[
pre_processed.pix.assign(stage="pre_processed"),
harmonised.pix.assign(stage="harmonised"),
harmoniser.historical_emissions.pix.assign(
stage="history", scenario="history", model="history"
).loc[pix.isin(variable=pre_processed.pix.unique("variable"))],
]
)
.melt(ignore_index=False, var_name="year")
.reset_index()
)
fg = relplot_in_emms(
data=pdf,
hue="scenario",
style="stage",
dashes={
"history": (1, 1),
"pre_processed": (3, 3),
"harmonised": "",
},
)
fg.axes.flatten()[0].axhline(0.0, linestyle="--", color="gray")
fg.axes.flatten()[1].set_ylim(ymin=0.0)
(0.0, 423.1851264903377)
Infilling¶
The next step is infilling. This is the process of inferring any emissions which are not included in the scenarios, but are needed for running climate models. In our example, this is things like N2O, black carbon, sulfates.
In AR6, a specific infilling database was used. There is no official home for all of this, but a copy is stored in the path below (and, as above, if you want something that pre-packages everything, see the climate-assessment package).
Under the hood, the AR6 infilling uses the silicone package.
AR6_INFILLING_DB_FILE = Path(
"tests/regression/ar6/ar6-workflow-inputs/infilling_db_ar6.csv"
)
AR6_INFILLING_DB_CFCS_FILE = Path(
"tests/regression/ar6/ar6-workflow-inputs/infilling_db_ar6_cfcs.csv"
)
With the infilling databases, we can initialise our infiller.
infiller = AR6Infiller.from_ar6_config(
ar6_infilling_db_file=AR6_INFILLING_DB_FILE,
ar6_infilling_db_cfcs_file=AR6_INFILLING_DB_CFCS_FILE,
n_processes=None, # run serially for this demo
# To make sure that our outputs remain harmonised
# (also, turns out that the historical emissions
# are the same as the CFCs database)
historical_emissions=get_ar6_full_historical_emissions(AR6_INFILLING_DB_CFCS_FILE),
harmonisation_year=harmoniser.harmonisation_year,
)
[WARNING] 09:39:42 - pint.util: Redefining 'kt' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'EUR_2005' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'EUR' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'C' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'N' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'NOX' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'gNOX' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'tNOX' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:42 - pint.util: Redefining 'S' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'yr' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'a' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'h' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'd' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'degreeC' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'degreeF' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'kt' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'Tt' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
[WARNING] 09:39:43 - pint.util: Redefining 'ppm' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>)
And infill
harmonised
| 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | scenario | region | variable | unit | |||||||||||||||||||||
| demo | decline | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | -829.133715 | -737.007747 | -644.881779 | -552.755810 | -460.629842 | -368.503873 | -276.377905 | -184.251937 | -92.125968 | 0.0 |
| Emissions|CH4 | Mt CH4/yr | 388.072796 | 388.410137 | 388.747479 | 389.084821 | 389.422162 | 389.759504 | 390.096845 | 390.434187 | 390.771529 | 391.108870 | ... | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.0 | |||
| decline_co2_fossil_split | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35684.536703 | 35733.807989 | 35783.100158 | 35832.413211 | 35881.747147 | 35931.101967 | 35980.477670 | 36029.874257 | 36079.291727 | ... | 447.448959 | 547.732408 | 648.015857 | 748.299306 | 848.582755 | 948.866204 | 1049.149653 | 1149.433102 | 1249.716551 | 1350.0 | |
| flatline | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | |
| Emissions|CH4 | Mt CH4/yr | 388.072796 | 388.410137 | 388.747479 | 389.084821 | 389.422162 | 389.759504 | 390.096845 | 390.434187 | 390.771529 | 391.108870 | ... | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.0 | |||
| flatline-co2-only | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 |
6 rows × 86 columns
infilled = infiller(harmonised)
infilled
Scenarios to infill: 0it [00:00, ?it/s]
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
Scenarios to infill: 1it [00:38, 38.95s/it]
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/silicone/database_crunchers/quantile_rolling_windows.py:182: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. wide_db = wide_db.applymap(lambda x: np.nan if isinstance(x, str) else x)
Scenarios to infill: 2it [00:43, 18.66s/it]
Scenarios to infill: 3it [00:46, 11.37s/it]
Scenarios to infill: 4it [00:48, 7.88s/it]
Scenarios to infill: 4it [00:48, 12.16s/it]
| 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | scenario | region | variable | unit | |||||||||||||||||||||
| demo | decline | World | Emissions|BC | Mt BC/yr | 9.727424 | 9.564061 | 9.401881 | 9.240866 | 9.081004 | 8.922277 | 8.685341 | 8.705159 | 8.516012 | 8.392241 | ... | 2.011126 | 1.934743 | 1.867127 | 1.840313 | 1.857182 | 1.859431 | 1.838243 | 1.811239 | 1.767023 | 1.736738 |
| Emissions|CO2|Biosphere | Mt CO2/yr | 3517.440000 | 3480.237715 | 3443.005653 | 3405.743780 | 3368.452064 | 3331.130471 | 3080.261088 | 2915.893438 | 2797.841161 | 2637.810556 | ... | -2438.632223 | -2432.661660 | -2468.082193 | -2494.773144 | -2480.293405 | -2501.699275 | -2503.906392 | -2547.456889 | -2589.320757 | -2647.317321 | |||
| Emissions|CO | Mt CO/yr | 934.349885 | 922.094402 | 909.821169 | 897.596560 | 885.397506 | 873.198440 | 865.136527 | 855.366801 | 850.678222 | 844.114675 | ... | 341.415033 | 337.727682 | 332.581101 | 329.010905 | 326.072438 | 323.085590 | 319.795103 | 317.001125 | 313.858938 | 310.880515 | |||
| Emissions|N2O | kt N2O/yr | 10900.000000 | 11026.740972 | 11154.624955 | 11282.911591 | 11413.351199 | 11544.291932 | 11380.715604 | 11305.954853 | 11285.326441 | 11243.493856 | ... | 7122.040000 | 7099.081154 | 7074.093619 | 7053.353999 | 7045.696238 | 7034.066705 | 7029.109720 | 7028.755739 | 7009.095071 | 6986.439981 | |||
| Emissions|NH3 | Mt NH3/yr | 65.279703 | 65.407914 | 65.523298 | 65.623864 | 65.725851 | 65.844146 | 64.818786 | 65.242753 | 65.502840 | 65.578378 | ... | 45.353082 | 43.947514 | 42.428801 | 40.867488 | 39.398676 | 40.952544 | 42.506413 | 43.868729 | 44.683288 | 44.258182 | |||
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | |
| flatline-co2-only | World | Emissions|C7F16 | kt C7F16/yr | 0.233800 | 0.245713 | 0.257660 | 0.269573 | 0.281487 | 0.293400 | 0.277319 | 0.261282 | 0.245246 | 0.229209 | ... | 0.003650 | 0.003400 | 0.003150 | 0.002900 | 0.002650 | 0.002400 | 0.002150 | 0.001900 | 0.001650 | 0.001400 | |
| Emissions|C8F18 | kt C8F18/yr | 0.101400 | 0.106577 | 0.111769 | 0.116946 | 0.122123 | 0.127300 | 0.120317 | 0.113352 | 0.106388 | 0.099424 | ... | 0.001590 | 0.001480 | 0.001370 | 0.001260 | 0.001150 | 0.001040 | 0.000930 | 0.000820 | 0.000710 | 0.000600 | |||
| Emissions|cC4F8 | kt cC4F8/yr | 1.267200 | 1.307930 | 1.348772 | 1.389503 | 1.430233 | 1.470964 | 1.413476 | 1.356145 | 1.298815 | 1.241484 | ... | 0.134054 | 0.131128 | 0.128195 | 0.125269 | 0.122343 | 0.119418 | 0.116484 | 0.113559 | 0.110633 | 0.107708 | |||
| Emissions|SO2F2 | kt SO2F2/yr | 2.531700 | 2.613054 | 2.694631 | 2.775986 | 2.857340 | 2.938694 | 2.823824 | 2.709268 | 2.594712 | 2.480156 | ... | 0.267860 | 0.262030 | 0.256185 | 0.250355 | 0.244526 | 0.238696 | 0.232851 | 0.227021 | 0.221192 | 0.215362 | |||
| Emissions|HFC245fa | kt HFC245fa/yr | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
202 rows × 86 columns
You can see infilled pathways compared to raw pathways in the below. A few things to notice:
- only required variables are infilled
(e.g. CH4 is only infilled for
flatline-co2-only, notflatline) and there can be notable differences in the emissions used without infilling - the infilling is largely CO2 driven,
but it's not as simple as 'higher CO2' means higher everything else
(see e.g. the N2O plot where
flatlinehas lower N2O thandeclinein 2060)
This is not a deep analysis. If you want to see the full details of how the infilling worked in AR6, see Lamboll et al., 2020.
pdf = (
pix.concat(
[
pre_processed.pix.assign(stage="pre_processed"),
harmonised.pix.assign(stage="harmonised"),
infilled.pix.assign(stage="infilled"),
]
)
.loc[pix.ismatch(variable=["**CO2|Fossil", "**CH4", "**N2O", "**SOx"])]
.melt(ignore_index=False, var_name="year")
.reset_index()
)
fg = relplot_in_emms(
data=pdf,
hue="scenario",
style="stage",
dashes={
"pre_processed": (3, 3),
"harmonised": "",
"infilled": (1, 1),
},
)
fg.axes.flatten()[0].axhline(0.0, linestyle="--", color="gray")
fg.axes.flatten()[1].set_ylim(ymin=0.0)
(0.0, 423.1851264903377)
The returned data is just the infilled timeseries. We can combine these with the harmonised data to create complete scenarios, ready for running our simple climate models.
complete_scenarios = pd.concat([harmonised, infilled])
complete_scenarios
| 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | scenario | region | variable | unit | |||||||||||||||||||||
| demo | decline | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | -829.133715 | -737.007747 | -644.881779 | -552.755810 | -460.629842 | -368.503873 | -276.377905 | -184.251937 | -92.125968 | 0.000000 |
| Emissions|CH4 | Mt CH4/yr | 388.072796 | 388.410137 | 388.747479 | 389.084821 | 389.422162 | 389.759504 | 390.096845 | 390.434187 | 390.771529 | 391.108870 | ... | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | 150.000000 | |||
| decline_co2_fossil_split | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35684.536703 | 35733.807989 | 35783.100158 | 35832.413211 | 35881.747147 | 35931.101967 | 35980.477670 | 36029.874257 | 36079.291727 | ... | 447.448959 | 547.732408 | 648.015857 | 748.299306 | 848.582755 | 948.866204 | 1049.149653 | 1149.433102 | 1249.716551 | 1350.000000 | |
| flatline | World | Emissions|CO2|Fossil | Mt CO2/yr | 35635.286300 | 35679.358818 | 35723.431337 | 35767.503855 | 35811.576374 | 35855.648892 | 35899.721411 | 35943.793929 | 35987.866448 | 36031.938966 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | |
| Emissions|CH4 | Mt CH4/yr | 388.072796 | 388.410137 | 388.747479 | 389.084821 | 389.422162 | 389.759504 | 390.096845 | 390.434187 | 390.771529 | 391.108870 | ... | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | 200.000000 | |||
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | |
| flatline-co2-only | World | Emissions|C7F16 | kt C7F16/yr | 0.233800 | 0.245713 | 0.257660 | 0.269573 | 0.281487 | 0.293400 | 0.277319 | 0.261282 | 0.245246 | 0.229209 | ... | 0.003650 | 0.003400 | 0.003150 | 0.002900 | 0.002650 | 0.002400 | 0.002150 | 0.001900 | 0.001650 | 0.001400 | |
| Emissions|C8F18 | kt C8F18/yr | 0.101400 | 0.106577 | 0.111769 | 0.116946 | 0.122123 | 0.127300 | 0.120317 | 0.113352 | 0.106388 | 0.099424 | ... | 0.001590 | 0.001480 | 0.001370 | 0.001260 | 0.001150 | 0.001040 | 0.000930 | 0.000820 | 0.000710 | 0.000600 | |||
| Emissions|cC4F8 | kt cC4F8/yr | 1.267200 | 1.307930 | 1.348772 | 1.389503 | 1.430233 | 1.470964 | 1.413476 | 1.356145 | 1.298815 | 1.241484 | ... | 0.134054 | 0.131128 | 0.128195 | 0.125269 | 0.122343 | 0.119418 | 0.116484 | 0.113559 | 0.110633 | 0.107708 | |||
| Emissions|SO2F2 | kt SO2F2/yr | 2.531700 | 2.613054 | 2.694631 | 2.775986 | 2.857340 | 2.938694 | 2.823824 | 2.709268 | 2.594712 | 2.480156 | ... | 0.267860 | 0.262030 | 0.256185 | 0.250355 | 0.244526 | 0.238696 | 0.232851 | 0.227021 | 0.221192 | 0.215362 | |||
| Emissions|HFC245fa | kt HFC245fa/yr | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
208 rows × 86 columns
SCM Running¶
The next step is running a simple climate model (SCM). This provides information about the climate implications of the scenario(s).
In AR6, MAGICCv7.5.3 was used for categorisation, but other climate models were also available. MAGICCv7.5.3 can be downloaded from magicc.org, but a copy is also stored in the path below so we can run these docs. Please go and download from magicc.org to help the MAGICC developers see the usage of their model.
Under the hood, the AR6 SCM running uses the OpenSCM-Runner package.
MAGICC_EXE_PATH = Path("tests/regression/ar6/ar6-workflow-inputs/magicc-v7.5.3/bin")
MAGICC_AR6_PROBABILISTIC_CONFIG_FILE = Path(
"tests/regression/ar6/ar6-workflow-inputs/magicc-ar6-0fd0f62-f023edb-drawnset/0fd0f62-derived-metrics-id-f023edb-drawnset.json"
)
if platform.system() == "Darwin":
if platform.processor() == "arm":
MAGICC_EXE = MAGICC_EXE_PATH / "magicc-darwin-arm64"
os.environ["DYLD_LIBRARY_PATH"] = "/opt/homebrew/lib/gcc/current/"
elif platform.system() == "Linux":
MAGICC_EXE = MAGICC_EXE_PATH / "magicc"
elif platform.system() == "Windows":
MAGICC_EXE = MAGICC_EXE_PATH / "magicc.exe"
With the MAGICC executable and config file, we can initialise our SCM runner.
scm_runner = AR6SCMRunner.from_ar6_config(
# Generally, you want to run SCMs in parallel
n_processes=multiprocessing.cpu_count(),
magicc_exe_path=MAGICC_EXE,
magicc_prob_distribution_path=MAGICC_AR6_PROBABILISTIC_CONFIG_FILE,
historical_emissions=get_ar6_full_historical_emissions(AR6_INFILLING_DB_CFCS_FILE),
harmonisation_year=2015,
output_variables=("Surface Air Temperature Change", "Effective Radiative Forcing"),
)
If you're reading this on RtD, note that we run a greatly reduced number of ensemble members. You will likely want to skip this step if running yourself.
if os.environ.get("READTHEDOCS", False):
scm_runner.climate_models_cfgs["MAGICC7"] = scm_runner.climate_models_cfgs[
"MAGICC7"
][:10]
And then run
scm_results = scm_runner(complete_scenarios)
scm_results
Climate models: 0%| | 0/1 [00:00<?, ?it/s]
Scenario batch: 0%| | 0/1 [00:00<?, ?it/s]
Climate models: 0%| | 0.00/1.00 [00:00<?, ?it/s]
[WARNING] 09:40:35 - openscm_runner.adapters.magicc7.magicc7: Historical data has not been checked
/home/docs/checkouts/readthedocs.org/user_builds/gcages/envs/latest/lib/python3.11/site-packages/scmdata/run.py:2632: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
pd.concat([ret._meta.to_frame(), *to_join_metas]).astype("category")
Writing SCEN7 files: 0%| | 0.00/4.00 [00:00<?, ?it/s]
Writing SCEN7 files: 100%|██████████| 4.00/4.00 [00:00<00:00, 7.53it/s]
Front serial: 0%| | 0.00/2.00 [00:00<?, ?it/s]
Front serial: 100%|██████████| 2.00/2.00 [00:01<00:00, 1.61it/s]
Front parallel: 0%| | 0.00/2.00 [00:00<?, ?it/s]
Front parallel: 100%|██████████| 2.00/2.00 [00:01<00:00, 1.79it/s]
Parallel runs: 0%| | 0.00/36.0 [00:00<?, ?it/s]
Parallel runs: 25%|██▌ | 9.00/36.0 [00:05<00:16, 1.64it/s]
Parallel runs: 50%|█████ | 18.0/36.0 [00:10<00:10, 1.71it/s]
Parallel runs: 75%|███████▌ | 27.0/36.0 [00:16<00:05, 1.68it/s]
Parallel runs: 100%|██████████| 36.0/36.0 [00:21<00:00, 1.72it/s]
Parallel runs: 100%|██████████| 36.0/36.0 [00:21<00:00, 1.71it/s]
Climate models: 100%|██████████| 1.00/1.00 [00:26<00:00, 26.8s/it]
Climate models: 100%|██████████| 1.00/1.00 [00:26<00:00, 26.8s/it]
Scenario batch: 100%|██████████| 1/1 [00:26<00:00, 26.82s/it]
Scenario batch: 100%|██████████| 1/1 [00:26<00:00, 26.82s/it]
Climate models: 100%|██████████| 1/1 [00:26<00:00, 26.83s/it]
Climate models: 100%|██████████| 1/1 [00:26<00:00, 26.83s/it]
| time | 1750 | 1751 | 1752 | 1753 | 1754 | 1755 | 1756 | 1757 | 1758 | 1759 | ... | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | 2100 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| climate_model | model | region | run_id | scenario | unit | variable | |||||||||||||||||||||
| MAGICCv7.5.3 | demo | World | 0 | decline | W/m^2 | Effective Radiative Forcing | 0.024862 | 0.118897 | 0.116943 | 0.101121 | 0.073664 | 0.010479 | -0.012348 | 0.037891 | 0.084870 | 0.115642 | ... | 2.507267 | 2.514207 | 2.511824 | 2.505728 | 2.498638 | 2.487797 | 2.483538 | 2.479657 | 2.480580 | 2.484025 |
| K | Surface Air Temperature Change | 0.000000 | 0.025523 | 0.035245 | 0.038705 | 0.037403 | 0.035409 | 0.028824 | 0.013995 | 0.019164 | 0.031390 | ... | 1.735712 | 1.738574 | 1.740756 | 1.741576 | 1.741184 | 1.739511 | 1.737953 | 1.736753 | 1.736441 | 1.737189 | |||||
| 1 | decline | W/m^2 | Effective Radiative Forcing | 0.040476 | 0.188135 | 0.175385 | 0.153909 | 0.121071 | 0.013471 | -0.034662 | 0.058462 | 0.133571 | 0.179039 | ... | 2.447416 | 2.461051 | 2.457011 | 2.446263 | 2.435107 | 2.418911 | 2.412117 | 2.405989 | 2.408235 | 2.415898 | |||
| K | Surface Air Temperature Change | 0.000000 | 0.031040 | 0.042205 | 0.048116 | 0.050462 | 0.050914 | 0.043648 | 0.027046 | 0.034479 | 0.048696 | ... | 2.842276 | 2.849517 | 2.855698 | 2.859535 | 2.861623 | 2.862003 | 2.862165 | 2.862608 | 2.864175 | 2.867480 | |||||
| 2 | decline | W/m^2 | Effective Radiative Forcing | 0.045260 | 0.197474 | 0.192773 | 0.165397 | 0.121218 | 0.011162 | -0.031142 | 0.057258 | 0.136335 | 0.189962 | ... | 2.593371 | 2.605526 | 2.597954 | 2.584181 | 2.571334 | 2.553665 | 2.545758 | 2.538146 | 2.539882 | 2.548180 | |||
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | |||
| 7 | flatline-co2-only | K | Surface Air Temperature Change | 0.000000 | 0.027917 | 0.037654 | 0.038351 | 0.031970 | 0.024944 | 0.016686 | 0.002665 | 0.008787 | 0.025196 | ... | 2.727328 | 2.736132 | 2.741962 | 2.743607 | 2.742882 | 2.740108 | 2.737626 | 2.735960 | 2.736296 | 2.739440 | |||
| 8 | flatline-co2-only | W/m^2 | Effective Radiative Forcing | 0.027534 | 0.145660 | 0.143361 | 0.126693 | 0.097244 | 0.016528 | -0.014465 | 0.051436 | 0.107386 | 0.143041 | ... | 3.391445 | 3.389782 | 3.376594 | 3.361716 | 3.348160 | 3.331062 | 3.320102 | 3.308980 | 3.302919 | 3.300152 | |||
| K | Surface Air Temperature Change | 0.000000 | 0.021493 | 0.027976 | 0.030634 | 0.030421 | 0.029793 | 0.024080 | 0.012661 | 0.018823 | 0.028366 | ... | 1.828989 | 1.829130 | 1.828113 | 1.826124 | 1.823665 | 1.820430 | 1.817394 | 1.814462 | 1.812108 | 1.810528 | |||||
| 9 | flatline-co2-only | W/m^2 | Effective Radiative Forcing | 0.089170 | 0.247113 | 0.224403 | 0.175709 | 0.109414 | -0.024954 | -0.078921 | 0.031023 | 0.144344 | 0.230172 | ... | 3.295516 | 3.317332 | 3.295804 | 3.262913 | 3.235503 | 3.202411 | 3.187120 | 3.172362 | 3.176341 | 3.193911 | |||
| K | Surface Air Temperature Change | 0.000000 | 0.038188 | 0.048259 | 0.050171 | 0.046314 | 0.041752 | 0.030263 | 0.011439 | 0.022490 | 0.041930 | ... | 2.167417 | 2.175027 | 2.178616 | 2.177330 | 2.173765 | 2.168354 | 2.163687 | 2.159884 | 2.158575 | 2.160791 |
80 rows × 351 columns
With these outputs, we can look at raw (i.e. before pre-processing) variables.
scm_results.loc[
pix.isin(variable=["Effective Radiative Forcing"])
].openscm.plot_plume_after_calculating_quantiles(
style_var="variable",
quantile_over="run_id",
quantiles_plumes=(
(0.5, 0.8),
((0.05, 0.95), 0.3),
),
)
<Axes: xlabel='time', ylabel='W/m^2'>
Post-processing¶
The last step is post-processing. This handles calculation of key pieces of metadata.
post_processor = AR6PostProcessor.from_ar6_config(n_processes=None)
post_processed_results = post_processor(scm_results)
For example, the scenario category.
post_processed_results.metadata_categories.unstack("metric")
| metric | category | category_name | ||
|---|---|---|---|---|
| climate_model | model | scenario | ||
| MAGICCv7.5.3 | demo | decline | C3 | C3: limit warming to 2°C (>67%) |
| decline_co2_fossil_split | C3 | C3: limit warming to 2°C (>67%) | ||
| flatline | C5 | C5: limit warming to 2.5°C (>50%) | ||
| flatline-co2-only | C5 | C5: limit warming to 2.5°C (>50%) |
Exceedance thresholds.
post_processed_results.metadata_exceedance_probabilities.unstack("threshold")
| threshold | 1.0 | 1.5 | 2.0 | 2.5 | 3.0 | 3.5 | 4.0 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| climate_model | model | region | scenario | unit | variable | threshold_unit | |||||||
| MAGICCv7.5.3 | demo | World | decline | % | Exceedance probability | K | 100.0 | 90.0 | 30.0 | 10.0 | 0.0 | 0.0 | 0.0 |
| decline_co2_fossil_split | % | Exceedance probability | K | 100.0 | 80.0 | 20.0 | 10.0 | 0.0 | 0.0 | 0.0 | |||
| flatline | % | Exceedance probability | K | 100.0 | 100.0 | 60.0 | 20.0 | 10.0 | 10.0 | 0.0 | |||
| flatline-co2-only | % | Exceedance probability | K | 100.0 | 90.0 | 60.0 | 20.0 | 10.0 | 10.0 | 0.0 |
Key warming metrics.
post_processed_results.metadata_quantile.loc[
pix.isin(quantile=[0.05, 0.5, 0.95])
].unstack(["quantile", "metric"]).round(2).sort_index(axis="columns")
| quantile | 0.05 | 0.50 | 0.95 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| metric | 2100 | max | max_year | 2100 | max | max_year | 2100 | max | max_year | |||||
| climate_model | model | region | scenario | unit | variable | |||||||||
| MAGICCv7.5.3 | demo | World | decline | K | Surface Temperature (GSAT) | 1.07 | 1.40 | NaN | 1.61 | 1.82 | NaN | 2.45 | 2.52 | NaN |
| yr | Surface Temperature (GSAT) | NaN | NaN | 2042.25 | NaN | NaN | 2047.0 | NaN | NaN | 2076.60 | ||||
| decline_co2_fossil_split | K | Surface Temperature (GSAT) | 1.13 | 1.37 | NaN | 1.69 | 1.79 | NaN | 2.56 | 2.57 | NaN | |||
| yr | Surface Temperature (GSAT) | NaN | NaN | 2042.70 | NaN | NaN | 2048.0 | NaN | NaN | 2077.05 | ||||
| flatline | K | Surface Temperature (GSAT) | 1.44 | 1.66 | NaN | 2.11 | 2.20 | NaN | 3.29 | 3.29 | NaN | |||
| yr | Surface Temperature (GSAT) | NaN | NaN | 2059.45 | NaN | NaN | 2061.0 | NaN | NaN | 2100.00 | ||||
| flatline-co2-only | K | Surface Temperature (GSAT) | 1.38 | 1.58 | NaN | 2.05 | 2.11 | NaN | 3.20 | 3.20 | NaN | |||
| yr | Surface Temperature (GSAT) | NaN | NaN | 2058.45 | NaN | NaN | 2061.0 | NaN | NaN | 2097.30 | ||||
Assessed surface temperatures.
post_processed_results.timeseries_quantile.loc[:, 2000:].openscm.plot_plume(
style_var="variable",
quantiles_plumes=(
(0.5, 0.8),
((0.05, 0.95), 0.3),
),
)
<Axes: xlabel='time', ylabel='K'>