Skip to content
Snippets Groups Projects
Commit cbf5d843 authored by Marco Matthies's avatar Marco Matthies
Browse files

Add some docstrings and comments

parent aa8f47e9
Branches
Tags
No related merge requests found
......@@ -3,6 +3,12 @@
### Functions for switchable crop models.
###
"""
initfields!(cropmodel, cropfile, growthfile)
Initialise the crop model. Returns the crop types available in the
simulation, as well as the types `Tcroptype` and `Tcropstate`.
"""
function initcropmodel(cropmodel::AbstractString, cropfile::AbstractString, growthfile::AbstractString)
if cropmodel == "almass"
Tcroptype = ALMaSS.CropType
......@@ -22,7 +28,7 @@ end
"""
initfields!(model)
Initialise the model with its farm plots.
Initialise the farm plots in the simulation model.
"""
function initfields!(model::SimulationModel)
n = 0
......@@ -56,6 +62,7 @@ function initfields!(model::SimulationModel)
@info "Initialised $n farm plots."
end
# internal utility function
function make_cropstate(model::SimulationModel, cropmodel::AbstractString)
if cropmodel == "almass"
phase = (month(model.date) < 3 ? ALMaSS.janfirst : ALMaSS.marchfirst)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment