Effective radiative forcing of short-lived climate forcer (Figure 2.8)

Notebook sr15_2.3.3_short-lived_climate_forcers_radiative_forcing

This notebook is based on the Release 1.1 of the IAMC 1.5C Scenario Explorer and Data and refers to the published version of the IPCC Special Report on Global Warming of 1.5C (SR15).

The notebook is run with pyam release 0.5.0.

The source code of this notebook is available on GitHub (release 2.0.2).

sr15_2.3.3_short-lived_climate_forcers_radiative_forcing

IPCC SR15 scenario assessment

Analysis of radiative forcing from short-lived climate-forcers

This notebook plots the radiative forcing from short-lived climate forcers (SLCF) shown in Figure 2.8 of the IPCC's "Special Report on Global Warming of 1.5°C".

The scenario data used in this analysis can be accessed and downloaded at https://data.ene.iiasa.ac.at/iamc-1.5c-explorer.

Load pyam package and other dependencies

In [1]:
import pandas as pd
import numpy as np
import io
import itertools
import yaml
import math
import matplotlib.pyplot as plt
plt.style.use('style_sr15.mplstyle')
%matplotlib inline
import pyam

from utils import boxplot_by_cat
pyam - INFO: Running in a notebook, setting `pyam` logging level to `logging.INFO` and adding stderr handler

Import scenario data, categorization and specifications files

The metadata file with scenario categorisation and quantitative indicators can be downloaded at https://data.ene.iiasa.ac.at/iamc-1.5c-explorer.
Alternatively, it can be re-created using the notebook sr15_2.0_categories_indicators.

The last cell of this section loads and assigns a number of auxiliary lists as defined in the categorization notebook.

In [2]:
sr1p5 = pyam.IamDataFrame(data='../data/iamc15_scenario_data_world_r2.0.xlsx')
pyam.utils - INFO: Reading `../data/iamc15_scenario_data_world_r2.0.xlsx`
In [3]:
sr1p5.load_meta('sr15_metadata_indicators.xlsx')
pyam.core - INFO: Importing metadata for 416 scenarios (for total of 416)
In [4]:
with open("sr15_specs.yaml", 'r') as stream:
    specs = yaml.load(stream, Loader=yaml.FullLoader)

rc = pyam.run_control()
for item in specs.pop('run_control').items():
    rc.update({item[0]: item[1]})
cats = specs.pop('cats')
all_cats = specs.pop('all_cats')
subcats = specs.pop('subcats')
all_subcats = specs.pop('all_subcats')
plotting_args = specs.pop('plotting_args')
marker= specs.pop('marker')

Downselect scenario ensemble to categories of interest for this assessment

In [5]:
years = [2010, 2020, 2030, 2050, 2100]
In [6]:
cats.remove('Above 2C')
In [7]:
sr1p5.meta.rename(columns={'Kyoto-GHG|2010 (SAR)': 'kyoto_ghg_2010'}, inplace=True)
In [8]:
df = sr1p5.filter(kyoto_ghg_2010='in range', category=cats, year=years)

Set specifications for filter and plotting

In [9]:
save_name = 'output/fig2.8_effective_radiative_forcing.{}'
In [10]:
filter_args = dict(df=sr1p5, category=cats, marker=None, join_meta=True)
In [11]:
def plotting_args(filetype='png'):
    return {'categories': cats, 'column': 'category',
            'years': years, 'add_marker': marker,
            'save': save_name.format(filetype)}

Compute radiative forcing from short-lived climate forcers

In [12]:
df.filter(variable='AR5 climate diagnostics|Forcing|CO2|*').variables()
Out[12]:
0       AR5 climate diagnostics|Forcing|CO2|FAIR|MED
1    AR5 climate diagnostics|Forcing|CO2|MAGICC6|MED
Name: variable, dtype: object
In [13]:
rf_llcf_vars = [
    'AR5 climate diagnostics|Forcing|CO2|FAIR|MED',
    'AR5 climate diagnostics|Forcing|N2O|FAIR|MED'
]
In [14]:
for v in ['AR5 climate diagnostics|Forcing|FAIR|MED'] + rf_llcf_vars:
    df.require_variable(v, exclude_on_fail=True)

df.filter(exclude=False, inplace=True)
pyam.core - INFO: 1 scenario does not include required variable `AR5 climate diagnostics|Forcing|FAIR|MED`, marked as `exclude: True` in metadata
pyam.core - INFO: 1 scenario does not include required variable `AR5 climate diagnostics|Forcing|CO2|FAIR|MED`, marked as `exclude: True` in metadata
pyam.core - INFO: 1 scenario does not include required variable `AR5 climate diagnostics|Forcing|N2O|FAIR|MED`, marked as `exclude: True` in metadata
In [15]:
rf_all = df.filter(variable='AR5 climate diagnostics|Forcing|FAIR|MED').timeseries()
rf_all.index = rf_all.index.droplevel([2, 3, 4])
In [16]:
rf_llcf = df.filter(variable=rf_llcf_vars).timeseries()
rf_llcf = rf_llcf.groupby(pyam.META_IDX).sum()
In [17]:
rf_slcf = rf_all - rf_llcf
In [18]:
data = pyam.filter_by_meta(rf_slcf, **filter_args)
boxplot_by_cat(data, **plotting_args(),
               ylabel='Effective radiative forcing (W/m2)', )

Export timeseries data to xlsx

In [19]:
data.reset_index().to_excel('output/fig2.8_data_table.xlsx')
In [ ]: