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

ALMaSS crop model: remove commented out code

parent 5e4cdaa9
Branches
Tags
No related merge requests found
...@@ -843,51 +843,4 @@ end ...@@ -843,51 +843,4 @@ end
#TODO spray!() #TODO spray!()
#TODO till!() #TODO till!()
# """
# growcrop!(cropstate, gdd, model)
# Apply the relevant crop growth model to update the plants crop state
# on this farm plot. Implements the ALMaSS crop growth model by Topping
# et al. (see `ALMaSS/Landscape/plant.cpp:PlantGrowthData::FindDiff()` and
# `ALMaSS/Landscape/elements.cpp:VegElement::DoDevelopment()`).
# """
# function growcrop!(cs::CropState, gdd::Float64, model::SimulationModel)
# fertiliser in cs.events ?
# curve = cs.croptype.lownutrientgrowth :
# curve = cs.croptype.highnutrientgrowth
# points = curve.GDD[cs.phase] #FIXME what if the curve is empty?
# for p in 1:length(points)
# if points[p] == 99999
# !(cs.phase in (janfirst, sow)) && (cs.mature = true) #FIXME only in the last phase?
# return # the marker that there is no further growth this phase
# elseif points[p] == -1 # the marker to set all variables to specified values
# cs.height = curve.height[cs.phase][p]
# cs.LAItotal = curve.LAItotal[cs.phase][p]
# cs.LAIgreen = curve.LAIgreen[cs.phase][p]
# return
# else
# gdd = cs.growingdegreedays
# # figure out which is the correct slope value to use for growth
# if p == length(points) || gdd < points[p+1]
# #FIXME it appears to me from the ALMaSS source code that the curve value
# # for the day is multiplied with that day's growingdegreedays to give the
# # diff, which is then added to the previous values. However, this results
# # in values that are staggeringly too large. I'm not quite sure what the
# # issue is here...
# cs.height += bounds(curve.height[cs.phase][p]*gdd)
# cs.LAItotal += bounds(curve.LAItotal[cs.phase][p]*gdd)
# cs.LAIgreen += bounds(curve.LAIgreen[cs.phase][p]*gdd)
# return
# end
# #XXX To be precise, we ought to figure out if one or more inflection
# # points have been passed between yesterday and today, and calculate the
# # growth exactly up to the inflection point with the old slope, and onward
# # with the new slope. Not doing so will introduce a small amount of error,
# # although I think this is acceptable.
# end
# end
# end
end # module ALMaSS end # module ALMaSS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment