Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Persefone.jl
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Persefone
Persefone.jl
Commits
fc6b78c3
Commit
fc6b78c3
authored
Nov 6, 2024
by
Marco Matthies
Browse files
Options
Downloads
Patches
Plain Diff
ALMaSS: avoid missing growth curves for low/high nutrients
parent
b077630d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/crop/almass.jl
+14
-6
14 additions, 6 deletions
src/crop/almass.jl
with
14 additions
and
6 deletions
src/crop/almass.jl
+
14
−
6
View file @
fc6b78c3
...
@@ -600,13 +600,21 @@ get_dddegs(model::SimulationModel) = bounds(supply_temperature(model))
...
@@ -600,13 +600,21 @@ get_dddegs(model::SimulationModel) = bounds(supply_temperature(model))
# TODO efficiency: the fertiliser check is done in many places
# TODO efficiency: the fertiliser check is done in many places
function
growthcurve
(
cs
::
CropState
)
function
growthcurve
(
cs
::
CropState
)
curve
=
if
fertiliser
in
cs
.
events
if
ismissing
(
cs
.
croptype
.
lownutrientgrowth
)
&&
ismissing
(
cs
.
croptype
.
highnutrientgrowth
)
cs
.
croptype
.
highnutrientgrowth
error
(
"No growth curves available for cropstate:
\n
$
cs"
)
else
cs
.
croptype
.
lownutrientgrowth
end
end
if
fertiliser
in
cs
.
events
curve
=
cs
.
croptype
.
highnutrientgrowth
if
ismissing
(
curve
)
if
ismissing
(
curve
)
error
(
"Growth curve is missing for cropstate:
\n
$
cs"
)
@warn
"fertiliser used, but highnutrient growth curve is missing. Using lownutrient growth curve."
curve
=
cs
.
croptype
.
lownutrientgrowth
end
else
curve
=
cs
.
croptype
.
lownutrientgrowth
if
ismissing
(
curve
)
# @warn "fertiliser not used, but lownutrient growth curve is missing. Using highnutrient growth curve."
curve
=
cs
.
croptype
.
highnutrientgrowth
end
end
end
return
curve
return
curve
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment