Multiple emission inventories
In this example, no time evolution file is given, but multiple emission inventories are given as input. OpenAirClim will interpolate between discrete inventory years.
Imports
If the openairclim package cannot be imported, make sure that you have
installed the package with pip or added the oac source folder to PYTHONPATH.
import xarray as xr
import matplotlib.pyplot as plt
from openairclim.utils.download_zenodo import download
import openairclim as oac
xr.set_options(display_expand_attrs=False)
WARNING:root:O3 response surface is not validated!
<xarray.core.options.set_options at 0x7f2382e93b60>
Input files
In order to be able to execute this example simulation, two types of input are required.
Configuration file
multi_inv.tomlEmission inventories
emi_inv_20XX.nc
Emission inventories
Source: DLR research study DEPA 2050
Inventory years: 2030, 2040, 2050
Available for download in suitable OpenAirClim format
%%capture
# Download inventories from zenodo
download(
record_or_doi="https://doi.org/10.5281/zenodo.11442322",
file_glob="emi_inv_20[3-5]0.nc",
output_dir="../input/",
)
Simulation run
oac.run("multi_inv.toml")
WARNING:root:Found 31451 'plev' values outside the allowed range [70, 1000]. Observed plev values min=148.2, max=1013.25. Values were automatically clamped into the allowed range. Use results with caution.
WARNING:root:OpenAirClim is currently in development phase.
The computed output is not for scientific purposes until release of our publication.
Amongst others, the climate impact of longer species lifetimes in the stratosphere is not considered.
Results
Time series
Emission sums
Concentrations
Radiative forcings
Temperature changes
results_ds = xr.load_dataset("results/multi_inv.nc")
display(results_ds)
<xarray.Dataset> Size: 4kB
Dimensions: (ac: 2, time: 21)
Coordinates:
* ac (ac) <U7 56B 'DEFAULT' 'TOTAL'
* time (time) int64 168B 2030 2031 2032 2033 ... 2047 2048 2049 2050
Data variables:
emis_CO2 (ac, time) float64 336B 1.075e+03 1.101e+03 ... 1.712e+03
emis_distance (ac, time) float64 336B 6.371e+10 6.478e+10 ... 8.757e+10
emis_H2O (ac, time) float64 336B 431.4 441.9 452.5 ... 671.8 686.8
conc_CO2 (ac, time) float64 336B 0.1379 0.2718 0.4038 ... 2.823 2.984
RF_CO2 (ac, time) float64 336B 0.00208 0.004084 ... 0.03992 0.04207
RF_cont (ac, time) float64 336B 0.02978 0.02977 ... 0.03398 0.03446
RF_H2O (ac, time) float64 336B 0.002381 0.002407 ... 0.003386
dT_CO2 (ac, time) float64 336B 0.0001585 0.000452 ... 0.01868
dT_cont (ac, time) float64 336B 0.001338 0.002528 ... 0.01172 0.012
dT_H2O (ac, time) float64 336B 0.0002068 0.0003929 ... 0.002155
Attributes: (4)# Plot Radiative Forcing and Temperature Changes
ac = "TOTAL"
rf_cont = results_ds.RF_cont.sel(ac=ac) * 1000
rf_co2 = results_ds.RF_CO2.sel(ac=ac) * 1000
rf_h2o = results_ds.RF_H2O.sel(ac=ac) * 1000
dt_cont = results_ds.dT_cont.sel(ac=ac) * 1000
dt_co2 = results_ds.dT_CO2.sel(ac=ac) * 1000
dt_h2o = results_ds.dT_H2O.sel(ac=ac) * 1000
fig, ax = plt.subplots(ncols=2, figsize=(10,5))
ax[0].grid(True)
ax[1].grid(True)
rf_cont.plot(ax=ax[0], color="deepskyblue", label="cont")
rf_co2.plot(ax=ax[0], color="k", label="CO2")
rf_h2o.plot(ax=ax[0], color="steelblue", label="H2O")
dt_cont.plot(ax=ax[1], color="deepskyblue", label="cont")
dt_co2.plot(ax=ax[1], color="k", label="CO2")
dt_h2o.plot(ax=ax[1], color="steelblue", label="H2O")
ax[0].set_ylabel("Radiative Forcing [mW/m²]")
ax[1].set_ylabel("Temperature Change [mK]")
ax[0].legend()
ax[1].legend()
<matplotlib.legend.Legend at 0x7f2381ca4cd0>