diff --git a/README.md b/README.md index f13d0cb..d238404 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,39 @@ This is a work-in-progress respository for a Julia-Mimi implementation of the FAIRv2.0 simple climate model. The model description paper can be found at [FaIRv2.0.0: A Generalized Impulse Response Model for Climate Uncertainty and Future Scenario Exploration](https://gmd.copernicus.org/articles/14/3007/2021/gmd-14-3007-2021.html). -## Running Mimi-FAIRv2 -To run the model, execute the following code: +## Preparing the Software Environment + +To add the package without necessarily downloading the full repository, run the following command at the julia package REPL: + +```julia +pkg> add https://github.com/FrankErrickson/MimiFAIRv2.jl.git # add MimiFAIRv2 module on main branch +``` + +To work locally assuming you have downloaded the full repository and want to work with that version, likely only if you want to actively develope the MimiFAIRv2 package itself, ou will later run the following command at the julia REPL, but do not need to call `add`. + +```julia +include("src/MimiFAIRv2.jl") # load the MimiFAIRv2 module +``` + +You probably also want to install the Mimi package into your julia environment, so that you can use some of the tools in there: + +```julia +pkg> add Mimi +``` +## Running the Model + +The model uses the Mimi framework and it is highly recommended to read the Mimi documentation first to understand the code structure. The basic way to access a copy of the default MimiFAIRv2 model and explore the resuts is the following: ```julia +using Mimi +using MimiFAIRv2 # if you used the `pkg> add` syntax above and thus have the module in your environment -# Load the model code. -include("src/MimiFAIRv2.jl") # load the MimiFAIRv2 module -using Main.MimiFAIRv2 # bring the module into your namespace +# note that instead of the line above one could call the following line, which +# may be particularly helpful for package development +# include("src/MimiFAIRv2.jl") -# Create an instance of Mimi-FAIRv2. -m = get_model() +# Create an instance of MimiFAIRv2. +m = MimiFAIRv2.get_model() # Run the model. run(m) diff --git a/src/MimiFAIRv2.jl b/src/MimiFAIRv2.jl index de77963..b913b29 100644 --- a/src/MimiFAIRv2.jl +++ b/src/MimiFAIRv2.jl @@ -14,8 +14,6 @@ include("components/aerosol_plus_gas_cycles.jl") include("components/radiative_forcing.jl") include("components/temperature.jl") -export get_model - """ get_model(;emissions_forcing_scenario::String="ssp585", start_year::Int=1750, end_year::Int=2500, TCR::Float64=1.79, RWF::Float64=0.552, diff --git a/test/runtests.jl b/test/runtests.jl index 0b870db..e510133 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ using CSVFiles using Test include(joinpath(@__DIR__, "..", "src", "MimiFAIRv2.jl")) -using Main.MimiFAIRv2 +using MimiFAIRv2: get_model # load `get_model` function to avoid need for `MimiFAIRv2.` prefix @testset "UI" begin