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
import zenodo_get
import openairclim as oac

xr.set_options(display_expand_attrs=False)
<xarray.core.options.set_options at 0x7f484a09b0e0>

Input files

In order to be able to execute this example simulation, two types of input are required.

  • Configuration file multi_inv.toml

  • Emission 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
zenodo_get.zenodo_get(["https://doi.org/10.5281/zenodo.11442322", "-g", "emi_inv_20[3-5]0.nc", "-o", "source/demos/input/"])

Simulation run

oac.run("source/demos/03_multi_inv/multi_inv.toml")
read_config ln. 254 in check_against_template INFO: Get default value for: responses CO2 rf method 
read_config ln. 254 in check_against_template INFO: Get default value for: responses cont method 
read_config ln. 520 in check_metrics_time ERROR: Metrics time settings with t_0 = 2020 and H = 21 are outside defined time range.
read_config ln. 532 in check_metrics_time WARNING: Last year in metrics time with t_0 = 2020 and H = 21 is earlier than last year in time range.
read_config ln. 185 in check_config ERROR: Configuration is not valid.
read_config ln. 376 in create_output_dir INFO: Create new output directory source/demos/03_multi_inv/results/
read_netcdf ln. 173 in open_inventories INFO: Emission inventories openend, attribute sections and time constraints checked successfully.
read_netcdf ln. 220 in split_inventory_by_aircraft WARNING: No ac coordinate found in emission inventory for year 2030. Reverting to 'DEFAULT' aircraft from config file.
read_netcdf ln. 220 in split_inventory_by_aircraft WARNING: No ac coordinate found in emission inventory for year 2040. Reverting to 'DEFAULT' aircraft from config file.
read_netcdf ln. 220 in split_inventory_by_aircraft WARNING: No ac coordinate found in emission inventory for year 2050. Reverting to 'DEFAULT' aircraft from config file.
main ln. 264 in run INFO: No subsequent species (PMO) defined in config.
main ln. 277 in run INFO: Execution time: 1.8726160526275635 sec
main ln. 280 in run WARNING: 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.
../../_images/multi_inv_2_13.png ../../_images/multi_inv_2_14.png ../../_images/multi_inv_2_15.png ../../_images/multi_inv_2_16.png ../../_images/multi_inv_2_17.png

Results

Time series

  • Emission sums

  • Concentrations

  • Radiative forcings

  • Temperature changes

results_ds = xr.load_dataset("source/demos/03_multi_inv/results/multi_inv.nc")
display(results_ds)
<xarray.Dataset> Size: 4kB
Dimensions:        (ac: 2, time: 21)
Coordinates:
  * time           (time) int64 168B 2030 2031 2032 2033 ... 2047 2048 2049 2050
  * ac             (ac) <U7 56B 'DEFAULT' 'TOTAL'
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.001642 0.003213 ... 0.02954 0.03104
    RF_cont        (ac, time) float64 336B 0.04683 0.04708 ... 0.05769 0.05863
    RF_H2O         (ac, time) float64 336B 0.002381 0.002407 ... 0.003386
    dT_CO2         (ac, time) float64 336B 0.0001251 0.0003559 ... 0.01398
    dT_cont        (ac, time) float64 336B 0.002105 0.003987 ... 0.01958 0.02008
    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 0x7f4846b08a50>
../../_images/multi_inv_4_1.png