Using MimiIWG.jl

Hi,
I’m new to this forum and to Mimi in general. But great work you’ve done with the open source API model!

I’ve been following the tutorials, but also the MimiIWG.jl readme.md. Ran into the following below, for example.

julia> MimiIWG.get_model(DICE, USG1)

ERROR: MethodError: no method matching update_params!(::Model, ::Dict{Any,Any}; update_timesteps=true)
Closest candidates are:
  update_params!(::Model, ::Dict) at /Users/dtsadmin/.julia/packages/Mimi/xMoYL/src/core/delegate.jl:54 got unsupported keyword argument "update_timesteps"
  update_params!(::Mimi.AbstractCompositeComponentDef, ::Dict) at /Users/dtsadmin/.julia/packages/Mimi/xMoYL/src/core/connections.jl:582 got unsupported keyword argument "update_timesteps"
Stacktrace:
 [1] get_dice_model(::MimiIWG.scenario_choice) at /Users/dtsadmin/.julia/packages/MimiIWG/q6aGG/src/core/DICE_main.jl:25
 [2] get_model(::MimiIWG.model_choice, ::MimiIWG.scenario_choice) at /Users/dtsadmin/.julia/packages/MimiIWG/q6aGG/src/core/main.jl:31
 [3] top-level scope at none:1

For the PAGE model, the call worked, but I got a negative number:

julia> MimiIWG.compute_scc(PAGE,USG1)

"bunch of warnings"

-2231.162720095173

Thanks,
Gui

Hi Gui, welcome and thank you for your question! @ckingdon95 I’ll pass this one to you as our resident MimiIWG.jl expert, but also am happy to help dig in!

@glarange just following up here that this was a problem on my part when we moved to a new version of Mimi (v1.1.1 → v1.2.0) and I will work on fixes asap and be in touch as soon as they are done

Thank you for the reply and follow up!

No problem, both issues have been diagnosed and fixed in a PR in Mimi. If you’re in a rush I can give you short term instructions to get the updated version before it is tagged, or if you have a little time I will ping you here, probably sometime tomorrow afternoon, when we have tagged a new version.

No rush, thanks again.

Hi @glarange these issues should be fixed, give it a few hours for the new package versions to be tagged and then you can call

pkg> up

to update to the latest versions of Mimi and MimiIWG, after which you should see that

pkg> st

shows that you have Mimi v1.2.1 and MimiIWG v1.0.2

It’s working, thanks! Minor comment is that if I’m not mistaken the FUND SCC, $8.6/tCO2, is too low, no?

All our tests are passing, which in part “Test the deterministic (non Monte Carlo) results from a modal run of FUND against values from the EPA” with the following code referencing data in the validation folder, so I believe we can be confident that the output values from compute_scc match expectation.

  @testset "Deterministic SC-CO2 validation" begin
        
        for scen in MimiIWG.scenarios
            @info("Testing FUND SC-CO2 $(MimiIWG.fund_scenario_convert[scen])...")
            file_idx = findfirst(x -> occursin("$(MimiIWG.fund_scenario_convert[scen]) - C", x), validation_files)
            scen_file = validation_files[file_idx]
            scen_validation_values = readdlm(joinpath(validation_dir, scen_file), ',')[3, 2:16]
        
            idx = 1
            for year in 2010:10:2050, dr in [0.025, 0.03, 0.05]
                mimi_scc = MimiIWG.compute_scc(FUND, scen, gas=:CO2, year=year, discount=dr)
                iwg_scc = scen_validation_values[idx]
                @test mimi_scc ≈ iwg_scc atol = _atol
                idx += 1
            end
        end
    end