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

Make code clearer

parent f4e92a8e
Branches
No related tags found
No related merge requests found
...@@ -272,14 +272,14 @@ function setphase!(cs::CropState, phase::GrowthPhase) ...@@ -272,14 +272,14 @@ function setphase!(cs::CropState, phase::GrowthPhase)
height = curve.height[cs.phase] height = curve.height[cs.phase]
LAItotal = curve.LAItotal[cs.phase] LAItotal = curve.LAItotal[cs.phase]
LAIgreen = curve.LAIgreen[cs.phase] LAIgreen = curve.LAIgreen[cs.phase]
if (length(GDD) == 0 if (length(GDD) == 0
|| length(height) == 0 || length(height) == 0
|| length(LAItotal) == 0 || length(LAItotal) == 0
|| length(LAIgreen) == 0) || length(LAIgreen) == 0)
error("One of these has length zero:\n GDD = $GDD\n height = $height\n LAItotal = $LAItotal\n LAIgreen = $LAIgreen") error("One of these has length zero:\n GDD = $GDD\n height = $height\n LAItotal = $LAItotal\n LAIgreen = $LAIgreen")
end end
if GDD[1] == -1.0 is_valid_start = GDD[1] == -1
if is_valid_start
# set height, LAItotal, LAIgreen # set height, LAItotal, LAIgreen
# TODO: what about when # TODO: what about when
# GDD[1] == curve.GDD[cs.phase][1] == 99999.0 # GDD[1] == curve.GDD[cs.phase][1] == 99999.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment