Tutorial Objectives#
In this tutorial, you will learn about Integrated Assessment Models (IAMs), a class of models that combine climatology, economics, and social science, reflecting the intertwined nature of these domains in addressing climate change. Based on these models the IPCC established the socioeconomic pathway framework. You are going to learn how these pathways differ from one another in both climate and socioeconomic variables as well as assumptions.
After finishing this tutorial, you will know how to
filter data series of interest from a rich
pandas
data frame that contains various variables for different SSPs,tell what the abbreviation SPA stands for,
explain the differences and similarities of the SSP1-26 and SSP5-85, and
sketch the modeling approach of IAMs.
Setup#
# installations ( uncomment and run this cell ONLY when using google colab or kaggle )
# imports
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import pooch
import os
import tempfile
Figure settings#
Show code cell source
# @title Figure settings
import ipywidgets as widgets # interactive display
plt.style.use(
"https://raw.githubusercontent.com/neuromatch/climate-course-content/main/cma.mplstyle"
)
Helper functions#
Show code cell source
# @title Helper functions
def pooch_load(filelocation=None, filename=None, processor=None):
shared_location = "/home/jovyan/shared/Data/tutorials/W2D3_FutureClimate-IPCCII&IIISocio-EconomicBasis" # this is different for each day
user_temp_cache = tempfile.gettempdir()
if os.path.exists(os.path.join(shared_location, filename)):
file = os.path.join(shared_location, filename)
else:
file = pooch.retrieve(
filelocation,
known_hash=None,
fname=os.path.join(user_temp_cache, filename),
processor=processor,
)
return file
def legend_without_duplicate_labels(ax):
handles, labels = ax.get_legend_handles_labels()
unique = [(h, l) for i, (h, l) in enumerate(zip(handles, labels)) if l not in labels[:i]]
ax.legend(*zip(*unique))
Section 1.3: Differences of SSP1 and SSP5#
Major differences are visible when you contrast emissions and assume direct causation with ecosystem health. Increasing emissions then translate into decreasing ecosystem health.
Coding exercise 1.3#
Choose two variables to emphasize ecosystem health differences in the SSP1 and SSP5 scenarios and assign them to
vars
. Then assign axis labels with the correct units for plotting to theval_name
variable.Explain to your pod why the chosen variables emphasize a difference in the scenarios and describe this difference based on your current knowledge of the narratives.
# put two variables of interest in a list
vars = ...
# create new names for structured data series and plot labels
val_name = ...
# choose scenarios of interest and a color for plotting
scenarios = ['SSP1-26', 'SSP5-Baseline']
colors = ['darkblue','darkorange']
#################################################
## TODO for students:
## Put two variables of interest in a list and assign it to 'vars'.
## Create new names for the structured data series and axes labels,
## put them in a list and assign it to 'val_name'.
## Remove the following line of code once you have completed the exercise:
raise NotImplementedError("Student exercise: Put two variables of interest in a list and assign it to vars. Create new names for the structured data series and axes labels, put them in a list and assign it to val_name.")
#################################################
# init figure and axis
fig, axs = plt.subplots(2,1)
# loop over all variables and new names
for var, val, ax in zip(vars,val_name, axs.flatten()):
# loop over scenarios and their color
for sc, col in zip(scenarios, colors):
# retrieve SSP for the respective variable from rich dataframe
ds_unstrct = get_SSPs_for_variable(df,sc,var)
# restructure dataframe for plotting
ds_strct = pd.melt(ds_unstrct, id_vars=["MODEL"], value_vars=['2010','2020','2030','2040','2050','2060','2070','2080','2090','2100'], var_name="YEAR", value_name =val)
#print(ds_strct)
# plot variable vs. time, add label incl. scenario and model
ax.plot(ds_strct['YEAR'],ds_strct[val],label=f'{sc},\n{ds_strct.MODEL[0]}', color=col)
# altern. plotting procedure w/o the color distinction
#sns.lineplot(ds_strct, x='YEAR', y=val, hue='MODEL', ax=ax, palette='flare')
# aesthetics
ax.set_ylabel(fr'{val}')
ax.set_xlabel('Time (years)')
plt.setp(ax.get_xticklabels(), rotation=45)
plt.setp(ax.get_xticklabels()[::2], visible=False)
ax.grid(True)
axs[0].legend()
Example output:
![Solution hint](https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D3_FutureClimate-IPCCII&IIISocio-EconomicBasis/static/W2D3_Tutorial4_Solution_a4ef74b1_0.png)
Summary#
In this tutorial, you’ve gained a first understanding of the Shared Socioeconomic Pathways and their creation, the application of Integrated Assessment Models in climate economics. You’ve learned how SSPs share policy assumptions. Furthermore, you compared SSP1 and SSP5 with respect to their view on the development of humanity and their ecosystem health.
In the next tutorial, you dissect and analyze the SSP narratives in more detail.
Resources#
It is possible to download the SSP data used in this tutorial, when you provide an email address, from this IIASA database, where all data from the main simulations of the IAMs used in the IPCC reports is freely available.
Find a summary of all SSP narratives in this paper by Oneill et al. (2017).
Find even more information in