From cbf5d84350d61712baab12bda0dca4232cd02302 Mon Sep 17 00:00:00 2001 From: Marco Matthies <71844+marcom@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:01:54 +0200 Subject: [PATCH] Add some docstrings and comments --- src/crop/cropmodels.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/crop/cropmodels.jl b/src/crop/cropmodels.jl index 0cc9477..bbbd925 100644 --- a/src/crop/cropmodels.jl +++ b/src/crop/cropmodels.jl @@ -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) -- GitLab