This all looks very good and thorough to me! The only thing I would add is that I would highly encourage you to take the second approach. This will allow you to continue to use Jupyter, and not have to worry about modifying the actual MimiFUND package.
Below I’ve included an example in more detail of what this approach of modifying the model could look like. I’ve used the update_param!
function instead of the set_param!
function Lisa mentioned, which in this case does the same thing:
using DelimitedFiles
using MimiFUND
# Write a function for getting your modified version of a MimiFUND model using
# files in a specified data directory
function get_quirins_ssp_model(datadir)
m = MimiFUND.get_model() # start with the regular FUND model
# change the population growth parameter
ssp_pop_growth = readdlm(joinpath(datadir, "pgrowth.csv"), ',')
update_param!(m, :pgrowth, ssp_pop_growth)
# change the gdp per capita growth parameter
ssp_ypc_growth = readdlm(joinpath(datadir, "ypcgrowth.csv"), ',')
update_param!(m, :ypcgrowth, ssp_ypc_growth)
# Change the energy intensity improvement parameter
ssp_aeei_growth = readdlm(joinpath(datadir, "aeei.csv"), ',')
update_param!(m, :aeei, ssp_aeei_growth)
# Change the carbon intensity improvement parameter
ssp_acei_growth = readdlm(joinpath(datadir, "acei.csv"), ',')
update_param!(m, :acei, ssp_acei_growth)
# change any other input parameters you need to
...
return m
end
# Get your modified model from an SSP3 data directory, then calculate the SCC
m_ssp3 = get_quirins_ssp_model("data/SSP3")
scc_ssp3 = MimiFUND.compute_scco2(m_ssp3, year=2020, ...)
# Get your modified model from an SSP5 data directory, then calculate the SCC
m_ssp5 = get_quirins_ssp_model("data/SSP5")
scc_ssp5 = MimiFUND.compute_scco2(m_ssp5, year=2020, ...)
Extra notes on this approach:
- Here I’ve shown how to read-in data from a CSV file using the
readdlm
function from theDelimitedFiles
package. The first argument toreaddlm
is the file path to the data file, and the second argument is the character','
, which specifies that it is a comma-delimited file. - In the way I’ve written this function, you need to pass as an argument to the function a file path to a data directory that contains the necessary CSV files “pgrowth.csv”, “ypcgrowth.csv”, “aeei.csv”, “acei.csv”, and any others you might add.
- Related to that, if you are going to create SSP scenarios for FUND, you will need to construct these population growth and other parameter files yourself for the 16 regions of FUND. These files need to have 1051 rows (for the year 1950 through 3000) and 16 columns (for the regions, listed here in Table R).
- I believe that the SSP scenarios only extend to the year 2100, but FUND is set up to run to the year 3000. So your input files still need to have 1051 rows, but they could just be zeros beyond the year 2100, and then make sure to use the
last_year
argument to when computing the SCC:MimiFUND.compute_scco2(m_ssp3, year=2020, last_year=2100)