Hi all,
Previously, I added a 2060 perturbation for non-co2 gasses (CH4 and N2O) to estimate SC-Xs further into the century (to 2060, specifically). To do this, I:
-
added the corresponding path of 2060 radiative forcings to the input file:
MimiIWG \\ data \\ IWG_inputs \\ PAGE \\ Non-co2 perturbation data - 1 Mt.xlsx
. -
updated the inputs in
MimiIWG \\ src \\ core \\ PAGE_other_ghg.jl
to include the new perturbations:
_page_ch4_shocks = Dict()
_page_ch4_shocks[2010] = _page_xf["Sheet1"]["I4:M13"]
...
_page_ch4_shocks[2060] = _page_xf["Sheet1"]["AR4:AV13"]
_page_n2o_shocks = Dict()
_page_n2o_shocks[2010] = _page_xf["Sheet1"]["I18:M27"]
...
_page_n2o_shocks[2060] = _page_xf["Sheet1"]["AR18:AV27"]
This all worked great. Now, I would like to extend this exercise to 2070. However, PAGE timsteps jump 2070 (…,2050, 2060, 2080, 2100…), which is fine, but I believe this just means that I will need to add perturbation data for 2080 (not the 2070 of interest) since MimiIWG
interpolates in between timesteps during the SC-X calculation. However, when going about this in a similar fashion as before, I:
-
added 2080 perturbation data to
MimiIWG \\ data \\ IWG_inputs \\ PAGE \\ Non-co2 perturbation data - 1 Mt.xlsx
. -
updated the inputs in
MimiIWG \\ src \\ core \\ PAGE_other_ghg.jl
to include the new perturbations:
_page_ch4_shocks = Dict()
_page_ch4_shocks[2010] = _page_xf["Sheet1"]["I4:M13"]
...
_page_ch4_shocks[2080] = _page_xf["Sheet1"]["AY4:BC13"]
_page_n2o_shocks = Dict()
_page_n2o_shocks[2010] = _page_xf["Sheet1"]["I18:M27"]
...
_page_n2o_shocks[2080] = _page_xf["Sheet1"]["AY18:BC27"]
But now, when estimating SC-CH4/N2O through 2070 (or 2080) with run_scc_mcs()
or even deterministically with compute_scc()
, I am getting the error:
...
start_task at /cygdrive/c/buildbot/worker/package_win64/build/src\task.c:839
ERROR: KeyError: key 2080 not found
Stacktrace:
[1] getindex(h::Dict{Any, Any}, key::Int64)
@ Base .\dict.jl:482
[2] _get_page_forcing_shock(scenario_num::Int64, gas::Symbol, year::Int64)
@ MimiIWG C:\Users\bparthum\.julia\packages\MimiIWG\37nQw\src\core\PAGE_other_ghg.jl:37
[3] perturb_marginal_page_emissions!(base::Mimi.Model, marginal::Mimi.Model, gas::Symbol, emissionyear::Int64)
@ MimiIWG C:\Users\bparthum\.julia\packages\MimiIWG\37nQw\src\core\PAGE_main.jl:352
[4] page_post_trial_func(mcs::Mimi.LatinHypercubeSimulationInstance, trialnum::Int64, ntimesteps::Int64, tup::Tuple{MimiIWG.scenario_choice, Float64})
@ MimiIWG C:\Users\bparthum\.julia\packages\MimiIWG\37nQw\src\montecarlo\PAGE_mcs.jl:222
[5] run(sim_def::Mimi.LatinHypercubeSimulationDef, models::Vector{Mimi.Model}, samplesize::Int64; ntimesteps::Int64, trials_output_filename::Nothing, results_output_dir::Nothing, pre_trial_func::Nothing, post_trial_func::typeof(MimiIWG.page_post_trial_func), scenario_func::typeof(MimiIWG.page_scenario_func), scenario_placement::Mimi.ScenarioLoopPlacement, scenario_args::Vector{Pair{Symbol, Vector{T} where T}}, results_in_memory::Bool)
@ Mimi C:\Users\bparthum\.julia\packages\Mimi\SnUU7\src\mcs\montecarlo.jl:626
[6] run_scc_mcs(model::MimiIWG.model_choice; gas::Union{Nothing, Symbol}, trials::Int64, perturbation_years::Vector{Int64}, discount_rates::Vector{Float64}, domestic::Bool, output_dir::Union{Nothing, String}, save_trials::Bool, save_md::Bool, tables::Bool)
@ MimiIWG C:\Users\bparthum\.julia\packages\MimiIWG\37nQw\src\montecarlo\run_scc_mcs.jl:154
[7] top-level scope
@ REPL[151]:1
Is there another location where I need to specify the 2080
input? If so, why would this not be needed for the 2060
addition? Any thoughts on what this error is pointing to?
Thanks!!
enviro:
(MimiIWG-env) pkg> st
Status `~\environments\MimiIWG-env\Project.toml`
[b1d80750] MimiIWG v1.0.4-DEV `~\.julia\dev\MimiIWG`
[295af30f] Revise v3.1.16
[9a3f8284] Random