# Changing input scenarios to MimiFUND

**URL:** <https://forum.mimiframework.org/t/changing-input-scenarios-to-mimifund/98>\
**Category:** Uncategorized\
**Created:** [October 2, 2019, 5:32pm UTC](https://forum.mimiframework.org/t/changing-input-scenarios-to-mimifund/98 "2019-10-02T17:32:05Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ckingdon95](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.mimiframework.org/ckingdon95/32/15_2.png) [@ckingdon95](https://forum.mimiframework.org/u/ckingdon95)\
**Post date:** [October 28, 2019, 2:08pm UTC](https://forum.mimiframework.org/t/changing-input-scenarios-to-mimifund/98/7 "2019-10-28T14:08:03Z")

</div>

@lrennels @Quirin

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:

```auto
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 the `DelimitedFiles` package. The first argument to `readdlm` 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](http://www.fund-model.org/files/documentation/Fund-3-9-Scientific-Tables.pdf) 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)`

---

_[View the full topic](https://forum.mimiframework.org/t/changing-input-scenarios-to-mimifund/98)._
