Run Modes

Running MAGICC in different modes can be non-trivial. In this notebook we show how to set MAGICC's config flags so that it will run as desired for a few different cases.


In [1]:
# NBVAL_IGNORE_OUTPUT
from os.path import join
import datetime
import dateutil
from copy import deepcopy


import numpy as np
import pandas as pd

from pymagicc import MAGICC6, rcp26, zero_emissions
from pymagicc.io import MAGICCData


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

In [2]:
%matplotlib inline
from matplotlib import pyplot as plt

plt.style.use("ggplot")
plt.rcParams["figure.figsize"] = (12, 6)

Concentration to emissions hybrid

This is MAGICC's default run mode. In this run mode, MAGICC will run with prescribed concentrations (or a quantity which scales linearly with radiative forcing for aerosol species) until a given point in time and will then switch to running in emissions driven mode.


In [3]:
with MAGICC6() as magicc:
    res = magicc.run(rcp26)

In [4]:
# NBVAL_IGNORE_OUTPUT
res.head()


Out[4]:
time 1765-01-01 1766-01-01 1767-01-01 1768-01-01 1769-01-01 1770-01-01 1771-01-01 1772-01-01 1773-01-01 1774-01-01 ... 2091-01-01 2092-01-01 2093-01-01 2094-01-01 2095-01-01 2096-01-01 2097-01-01 2098-01-01 2099-01-01 2100-01-01
climate_model model scenario variable todo unit region
MAGICC6 IMAGE RCP26 Radiative Forcing|Greenhouse Gases not_relevant W / m^2 World 0.0 0.030727 0.033519 0.036425 0.039374 0.042338 0.045352 0.048441 0.051598 0.054815 ... 3.091970 3.083903 3.075915 3.068000 3.060151 3.052359 3.044620 3.036928 3.029278 3.029278
World|Northern Hemisphere|Ocean 0.0 0.031154 0.033979 0.036917 0.039898 0.042894 0.045941 0.049062 0.052251 0.055501 ... 3.134965 3.126769 3.118651 3.110604 3.102621 3.094694 3.086819 3.078989 3.071201 3.071201
World|Northern Hemisphere|Land 0.0 0.029018 0.031691 0.034476 0.037306 0.040152 0.043049 0.046020 0.049058 0.052157 ... 2.989655 2.981804 2.974026 2.966316 2.958666 2.951070 2.943522 2.936018 2.928553 2.928553
World|Southern Hemisphere|Ocean 0.0 0.032503 0.035423 0.038457 0.041534 0.044625 0.047766 0.050982 0.054267 0.057612 ... 3.204502 3.196197 3.187978 3.179838 3.171769 3.163762 3.155811 3.147912 3.140057 3.140057
World|Southern Hemisphere|Land 0.0 0.027911 0.030492 0.033183 0.035918 0.038670 0.041471 0.044344 0.047284 0.050282 ... 2.869368 2.861846 2.854401 2.847025 2.839711 2.832454 2.825246 2.818084 2.810963 2.810963

5 rows × 336 columns


In [5]:
plt.figure()
res.filter(variable="Emis*CO2*", region="World").line_plot(hue="variable")
plt.figure()
res.filter(variable="Atmos*Conc*CO2", region="World").line_plot(hue="variable");


The switches which control the time at which MAGICC switches from concentrations driven to emissions driven are all in the form GAS_SWITCHFROMXXX2EMIS_YEAR e.g. CO2_SWITCHFROMCONC2EMIS_YEAR and BCOC_SWITCHFROMRF2EMIS_YEAR.

Changing the value of these switches will alter how MAGICC runs.


In [6]:
# NBVAL_IGNORE_OUTPUT
df = deepcopy(rcp26)
df["scenario"] = "RCP26_altered_co2_switch"
with MAGICC6() as magicc:
    res = res.append(magicc.run(df, co2_switchfromconc2emis_year=1850))

In [7]:
plt.figure()
res.filter(variable="Emis*CO2*", region="World").line_plot(hue="variable")
plt.figure()
res.filter(variable="Atmos*Conc*CO2", region="World").line_plot(hue="variable");



In [8]:
# NBVAL_IGNORE_OUTPUT
res.timeseries()


Out[8]:
time 1765-01-01 1766-01-01 1767-01-01 1768-01-01 1769-01-01 1770-01-01 1771-01-01 1772-01-01 1773-01-01 1774-01-01 ... 2091-01-01 2092-01-01 2093-01-01 2094-01-01 2095-01-01 2096-01-01 2097-01-01 2098-01-01 2099-01-01 2100-01-01
climate_model model scenario variable todo unit region
MAGICC6 IMAGE RCP26 Radiative Forcing|Greenhouse Gases not_relevant W / m^2 World 0.0 0.030727 0.033519 0.036425 0.039374 0.042338 0.045352 0.048441 0.051598 0.054815 ... 3.091970 3.083903 3.075915 3.068000 3.060151 3.052359 3.044620 3.036928 3.029278 3.029278
World|Northern Hemisphere|Ocean 0.0 0.031154 0.033979 0.036917 0.039898 0.042894 0.045941 0.049062 0.052251 0.055501 ... 3.134965 3.126769 3.118651 3.110604 3.102621 3.094694 3.086819 3.078989 3.071201 3.071201
World|Northern Hemisphere|Land 0.0 0.029018 0.031691 0.034476 0.037306 0.040152 0.043049 0.046020 0.049058 0.052157 ... 2.989655 2.981804 2.974026 2.966316 2.958666 2.951070 2.943522 2.936018 2.928553 2.928553
World|Southern Hemisphere|Ocean 0.0 0.032503 0.035423 0.038457 0.041534 0.044625 0.047766 0.050982 0.054267 0.057612 ... 3.204502 3.196197 3.187978 3.179838 3.171769 3.163762 3.155811 3.147912 3.140057 3.140057
World|Southern Hemisphere|Land 0.0 0.027911 0.030492 0.033183 0.035918 0.038670 0.041471 0.044344 0.047284 0.050282 ... 2.869368 2.861846 2.854401 2.847025 2.839711 2.832454 2.825246 2.818084 2.810963 2.810963
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
RCP26_altered_co2_switch Emissions|CO2|MAGICC AFOLU not_relevant Gt C / yr World 0.0 0.005338 0.010677 0.016015 0.021353 0.026691 0.032030 0.037368 0.042706 0.048045 ... 0.593290 0.584180 0.575070 0.565960 0.556850 0.547740 0.538630 0.529520 0.520410 0.511300
World|Northern Hemisphere|Ocean 0.0 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
World|Northern Hemisphere|Land 0.0 0.004731 0.009462 0.014193 0.018924 0.023655 0.028386 0.033117 0.037848 0.042579 ... 0.432813 0.427926 0.423039 0.418152 0.413265 0.408378 0.403491 0.398604 0.393717 0.388830
World|Southern Hemisphere|Ocean 0.0 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
World|Southern Hemisphere|Land 0.0 0.000607 0.001215 0.001822 0.002429 0.003037 0.003644 0.004251 0.004859 0.005466 ... 0.160477 0.156254 0.152031 0.147808 0.143585 0.139362 0.135139 0.130916 0.126693 0.122470

130 rows × 336 columns

As we can see, the emissions remain unchanged but the concentrations are altered as MAGICC is now running emissions driven from 1850 rather than 2005 (the default).

To get a fully emissions driven run, you need to change all of the relevant GAS_SWITCHXXX2EMIS_YEAR flags.

CO$_2$ Emissions Driven Only

We can get a CO$_2$ emissions only driven run like shown.


In [9]:
df = zero_emissions.timeseries()

time = zero_emissions["time"]
df.loc[
    (
        df.index.get_level_values("variable")
        == "Emissions|CO2|MAGICC Fossil and Industrial"
    ),
    :,
] = np.linspace(0, 30, len(time))

scen = MAGICCData(df)
scen.filter(variable="Em*CO2*Fossil*").line_plot(
    x="time", label="CO2 Fossil", hue=None
)
scen.filter(variable="Em*CO2*Fossil*", keep=False).line_plot(
    x="time", label="Everything else", hue=None
);



In [10]:
# NBVAL_IGNORE_OUTPUT
with MAGICC6() as magicc:
    co2_only_res = magicc.run(
        scen,
        endyear=scen["time"].max().year,
        rf_total_constantafteryr=5000,
        rf_total_runmodus="CO2",
        co2_switchfromconc2emis_year=min(scen["time"]).year,
    )


/home/jared/code/uom/pymagicc/pymagicc/io/scen.py:254: UserWarning: Ignoring input data which is not required for .SCEN file
  warnings.warn("Ignoring input data which is not required for .SCEN file")

In [11]:
for v in [
    "Emis*CO2*",
    "Atmos*Conc*CO2",
    "Radiative Forcing",
    "Surface Temperature",
]:
    plt.figure()
    co2_only_res.filter(variable=v, region="World").line_plot(hue="variable")


Prescribed Forcing Driven Only

It is also possible to examine MAGICC's response to a prescribed radiative forcing only.


In [12]:
time = zero_emissions["time"]

forcing_external = 2.0 * np.arange(0, len(time)) / len(time)
forcing_ext = MAGICCData(
    forcing_external,
    index=time,
    columns={
        "scenario": ["idealised"],
        "model": ["unspecified"],
        "climate_model": ["unspecified"],
        "variable": ["Radiative Forcing|Extra"],
        "unit": ["W / m^2"],
        "todo": ["SET"],
        "region": ["World"],
    },
)
forcing_ext.metadata = {
    "header": "External radiative forcing with linear increase"
}
forcing_ext.line_plot(x="time");



In [13]:
with MAGICC6() as magicc:
    forcing_ext_filename = "CUSTOM_EXTRA_RF.IN"
    forcing_ext.write(
        join(magicc.run_dir, forcing_ext_filename), magicc.version
    )
    ext_forc_only_res = magicc.run(
        rf_extra_read=1,
        file_extra_rf=forcing_ext_filename,
        rf_total_runmodus="QEXTRA",
        endyear=max(time).year,
        rf_initialization_method="ZEROSTARTSHIFT",  # this is default but to be sure
        rf_total_constantafteryr=5000,
    )

In [14]:
ext_forc_only_res.filter(
    variable=["Radiative Forcing", "Surface Temperature"], region="World"
).line_plot(hue="variable")


Zero Temperature Output

Getting MAGICC to return zero for its temperature output is surprisingly difficult. To help address this, we add the set_zero_config method to our MAGICC classes.


In [15]:
print(MAGICC6.set_zero_config.__doc__)


Set config such that radiative forcing and temperature output will be zero

        This method is intended as a convenience only, it does not handle everything in
        an obvious way. Adjusting the parameter settings still requires great care and
        may behave unepexctedly.
        

In [16]:
# NBVAL_IGNORE_OUTPUT
with MAGICC6() as magicc:
    magicc.set_zero_config()
    res_zero = magicc.run()


/home/jared/code/uom/pymagicc/pymagicc/io/scen.py:254: UserWarning: Ignoring input data which is not required for .SCEN file
  warnings.warn("Ignoring input data which is not required for .SCEN file")

In [17]:
res_zero.filter(
    variable=["Surface Temperature", "Radiative Forcing"], region="World"
).line_plot(x="time");


CO$_2$ Emissions and Prescribed Forcing

It is also possible to run MAGICC in a mode which is CO$_2$ emissions driven but also includes a prescribed external forcing.


In [18]:
df = zero_emissions.timeseries()

time = zero_emissions["time"]
emms_fossil_co2 = (
    np.linspace(0, 3, len(time))
    - (1 + (np.arange(len(time)) - 500) / 500) ** 2
)
df.loc[
    (
        df.index.get_level_values("variable")
        == "Emissions|CO2|MAGICC Fossil and Industrial"
    ),
    :,
] = emms_fossil_co2

scen = MAGICCData(df)
scen.filter(variable="Em*CO2*Fossil*").line_plot(x="time", hue="variable")
scen.filter(variable="Em*CO2*Fossil*", keep=False).line_plot(
    x="time", label="Everything Else"
)

forcing_external = 3.0 * np.arange(0, len(time)) / len(time)
forcing_ext = MAGICCData(
    forcing_external,
    index=time,
    columns={
        "scenario": ["idealised"],
        "model": ["unspecified"],
        "climate_model": ["unspecified"],
        "variable": ["Radiative Forcing|Extra"],
        "unit": ["W / m^2"],
        "todo": ["SET"],
        "region": ["World"],
    },
)
forcing_ext.metadata = {
    "header": "External radiative forcing with linear increase"
}
forcing_ext.line_plot(x="time", hue="variable");



In [19]:
# NBVAL_IGNORE_OUTPUT
scen.timeseries()


Out[19]:
time 1765-01-01 00:00:00 1766-01-01 00:00:00 1767-01-01 00:00:00 1768-01-01 00:00:00 1769-01-01 00:00:00 1770-01-01 00:00:00 1771-01-01 00:00:00 1772-01-01 00:00:00 1773-01-01 00:00:00 1774-01-01 00:00:00 ... 2491-01-01 00:00:00 2492-01-01 00:00:00 2493-01-01 00:00:00 2494-01-01 00:00:00 2495-01-01 00:00:00 2496-01-01 00:00:00 2497-01-01 00:00:00 2498-01-01 00:00:00 2499-01-01 00:00:00 2500-01-01 00:00:00
model scenario region variable unit climate_model todo
unspecified idealised World Emissions|CO2|MAGICC Fossil and Industrial Gt C / yr unspecified SET 0.0 0.004078 0.008147 0.012209 0.016263 0.020308 0.024346 0.028375 0.032397 0.036411 ... 0.854961 0.853231 0.851493 0.849746 0.847992 0.846229 0.844459 0.842681 0.840894 0.8391
Emissions|CO2|MAGICC AFOLU Gt C / yr unspecified SET 0.0 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.0000
Emissions|CH4 Mt CH4 / yr unspecified SET 0.0 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.0000
Emissions|N2O Mt N2ON / yr unspecified SET 0.0 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.0000
Emissions|SOx Mt S / yr unspecified SET 0.0 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.0000
Emissions|CO Mt CO / yr unspecified SET 0.0 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.0000
Emissions|NMVOC Mt NMVOC / yr unspecified SET 0.0 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.0000
Emissions|NOx Mt N / yr unspecified SET 0.0 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.0000
Emissions|BC Mt BC / yr unspecified SET 0.0 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.0000
Emissions|OC Mt OC / yr unspecified SET 0.0 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.0000
Emissions|NH3 Mt N / yr unspecified SET 0.0 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.0000
Emissions|CF4 kt CF4 / yr unspecified SET 0.0 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.0000
Emissions|C2F6 kt C2F6 / yr unspecified SET 0.0 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.0000
Emissions|C6F14 kt C6F14 / yr unspecified SET 0.0 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.0000
Emissions|HFC23 kt HFC23 / yr unspecified SET 0.0 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.0000
Emissions|HFC32 kt HFC32 / yr unspecified SET 0.0 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.0000
Emissions|HFC4310 kt HFC4310 / yr unspecified SET 0.0 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.0000
Emissions|HFC125 kt HFC125 / yr unspecified SET 0.0 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.0000
Emissions|HFC134a kt HFC134a / yr unspecified SET 0.0 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.0000
Emissions|HFC143a kt HFC143a / yr unspecified SET 0.0 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.0000
Emissions|HFC227ea kt HFC227ea / yr unspecified SET 0.0 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.0000
Emissions|HFC245fa kt HFC245fa / yr unspecified SET 0.0 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.0000
Emissions|SF6 kt SF6 / yr unspecified SET 0.0 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.0000

23 rows × 736 columns


In [20]:
with MAGICC6() as magicc:
    magicc.set_zero_config()  # very important, try commenting this out and see what happens
    forcing_ext_filename = "CUSTOM_EXTRA_RF.IN"
    forcing_ext.write(
        join(magicc.run_dir, forcing_ext_filename), magicc.version
    )
    co2_emms_ext_forc_res = magicc.run(
        scen,
        endyear=scen["time"].max().year,
        co2_switchfromconc2emis_year=min(scen["time"]).year,
        rf_extra_read=1,
        file_extra_rf=forcing_ext_filename,
        rf_total_runmodus="ALL",  # default but just in case
        rf_initialization_method="ZEROSTARTSHIFT",  # this is default but to be sure
        rf_total_constantafteryr=5000,
    )

In [21]:
plt.figure()
co2_emms_ext_forc_res.filter(variable="Emis*CO2*", region="World").line_plot(
    x="time", hue="variable"
)
plt.figure()
co2_emms_ext_forc_res.filter(
    variable="Atmos*Conc*CO2", region="World"
).line_plot(x="time")
plt.figure()
co2_emms_ext_forc_res.filter(
    variable="Radiative Forcing", region="World"
).line_plot(x="time")
plt.figure()
co2_emms_ext_forc_res.filter(
    variable="Surface Temperature", region="World"
).line_plot(x="time");


If we adjust MAGICC's CO$_2$ temperature feedback start year, it is easier to see what is going on.


In [22]:
with MAGICC6() as magicc:
    magicc.set_zero_config()

    forcing_ext_filename = "CUSTOM_EXTRA_RF.IN"
    forcing_ext.write(
        join(magicc.run_dir, forcing_ext_filename), magicc.version
    )
    for temp_feedback_year in [2000, 2100, 3000]:
        scen["scenario"] = "idealised_{}_CO2_temperature_feedback".format(
            temp_feedback_year
        )

        co2_emms_ext_forc_res.append(
            magicc.run(
                scen,
                endyear=scen["time"].max().year,
                co2_switchfromconc2emis_year=min(scen["time"]).year,
                rf_extra_read=1,
                file_extra_rf=forcing_ext_filename,
                rf_total_runmodus="ALL",
                rf_initialization_method="ZEROSTARTSHIFT",
                rf_total_constantafteryr=5000,
                co2_tempfeedback_yrstart=temp_feedback_year,
            )
        )

In [23]:
co2_emms_ext_forc_res.filter(variable="Emis*CO2*", region="World").line_plot(
    x="time", hue="variable"
)
plt.figure()
co2_emms_ext_forc_res.filter(
    variable="Atmos*Conc*CO2", region="World"
).line_plot(x="time")
plt.figure()
co2_emms_ext_forc_res.filter(
    variable="Radiative Forcing", region="World"
).line_plot(x="time")
plt.figure()
co2_emms_ext_forc_res.filter(
    variable="Surface Temperature", region="World"
).line_plot(x="time");


CO$_2$ Concentrations Driven


In [24]:
time = zero_emissions["time"]

co2_concs = 278 * np.ones_like(time)
co2_concs[105:] = 278 * 1.01 ** (np.arange(0, len(time[105:])))

co2_concs = MAGICCData(
    co2_concs,
    index=time,
    columns={
        "scenario": ["1%/yr CO2"],
        "model": ["unspecified"],
        "climate_model": ["unspecified"],
        "variable": ["Atmospheric Concentrations|CO2"],
        "unit": ["ppm"],
        "todo": ["SET"],
        "region": ["World"],
    },
)
co2_concs = co2_concs.filter(year=range(1700, 2001))
time = co2_concs["time"]
co2_concs.metadata = {"header": "1%/yr atmospheric CO2 concentration increase"}
co2_concs.line_plot(x="time");



In [25]:
with MAGICC6() as magicc:
    co2_conc_filename = "1PCT_CO2_CONC.IN"
    co2_concs.write(join(magicc.run_dir, co2_conc_filename), magicc.version)
    co2_conc_driven_res = magicc.run(
        file_co2_conc=co2_conc_filename,
        co2_switchfromconc2emis_year=max(time).year,
        co2_tempfeedback_switch=1,
        co2_tempfeedback_yrstart=1870,
        co2_fertilization_yrstart=1870,
        rf_total_runmodus="CO2",
        rf_total_constantafteryr=max(time).year,
        endyear=max(time).year,
        out_inverseemis=1,
    )

In [26]:
plt.figure()
co2_conc_driven_res.filter(
    variable="Inverse Emis*CO2*", region="World"
).line_plot()
plt.figure()
co2_conc_driven_res.filter(
    variable="Atmos*Conc*CO2", region="World"
).line_plot()
plt.figure()
co2_conc_driven_res.filter(
    variable="Radiative Forcing", region="World"
).line_plot()
plt.figure()
co2_conc_driven_res.filter(
    variable="Surface Temperature", region="World"
).line_plot();



In [ ]: