Impulse Response Model API¶
Module containing the impulse response model
The 2-timescale impulse response model is mathematically equivalent to the two-layer model without state dependence.
- class openscm_twolayermodel.impulse_response_model.ImpulseResponseModel(q1=<Quantity(0.3, 'delta_degree_Celsius * meter ** 2 / watt')>, q2=<Quantity(0.4, 'delta_degree_Celsius * meter ** 2 / watt')>, d1=<Quantity(9.0, 'a')>, d2=<Quantity(400.0, 'a')>, efficacy=<Quantity(1.0, 'dimensionless')>, delta_t=<Quantity(0.0833333333, 'a')>)¶
Bases:
openscm_twolayermodel.base.TwoLayerVariant
TODO: top line and paper references
This implementation uses a forward-differencing approach. This means that temperature and ocean heat uptake values are start of timestep values. For example, temperature[i] is only affected by drivers from the i-1 timestep. In practice, this means that the first temperature and ocean heat uptake values will always be zero and the last value in the input drivers has no effect on model output.
- property d1¶
pint.Quantity
Response timescale of first box
- property d2¶
pint.Quantity
Response timescale of second box
- property delta_t¶
pint.Quantity
Time step for forward-differencing approximation
- property efficacy¶
pint.Quantity
Efficacy factor
- property erf¶
pint.Quantity
Effective radiative forcing
- get_two_layer_parameters()¶
Get equivalent two-layer model parameters
For details on how the equivalence is calculated, please see the notebook
impulse-response-equivalence.ipynb
in the OpenSCM Two Layer model repository.- Returns
dict of str – Input arguments to initialise an
openscm_twolayermodel.TwoLayerModel
with the same temperature response asself
- Return type
pint.Quantity
- property q1¶
pint.Quantity
Sensitivity of first box response to radiative forcing
- property q2¶
pint.Quantity
Sensitivity of second box response to radiative forcing
- reset()¶
Reset everything so that a new run can be performed.
Called as late as possible before
run()
.
- run()¶
Run the model.
- run_scenarios(scenarios, driver_var='Effective Radiative Forcing', progress=True)¶
Run scenarios.
The model timestep is automatically adjusted based on the timestep used in
scenarios
. The timestep used inscenarios
must be constant because this implementation has a constant timestep. Pull requests to upgrade the implementation to support variable timesteps are welcome https://github.com/openscm/openscm-twolayermodel/pulls.- Parameters
scenarios (
ScmDataFrame
orScmRun
orpyam.IamDataFrame
orpd.DataFrame
ornp.ndarray
or str) – Scenarios to run. The input will be converted to anScmRun
before the run takes place.driver_var (str) – The variable in
scenarios
to use as the driver of the modelprogress (bool) – Whether to display a progress bar
- Returns
Results of the run (including drivers)
- Return type
ScmRun
- Raises
ValueError – No data is available for
driver_var
in the"World"
region inscenarios
.
- set_drivers(erf)¶
Set drivers for a model run
- Parameters
erf (
pint.Quantity
) – Effective radiative forcing (W/m^2) to use to drive the model- Raises
AssertionError –
erf
is not one-dimensional
- step()¶
Do a single time step.