From 4f413e9518a0977ca3a20e96f3f7809ca3c6e624 Mon Sep 17 00:00:00 2001 From: Marco Matthies <71844+marcom@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:08:33 +0100 Subject: [PATCH] ALMaSS: temporarily always return false for maturity --- src/crop/almass.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/crop/almass.jl b/src/crop/almass.jl index c90108c..2eaa2ee 100644 --- a/src/crop/almass.jl +++ b/src/crop/almass.jl @@ -130,7 +130,6 @@ part of a `FarmPlot`. # `VegElement` from `Landscape/Elements.h`, line 601 croptype::CropType events::Vector{Management} = Management[] - mature::Bool = false #TODO how do we determine this? phase::GrowthPhase vegddegs::Float64 = 0 # Vegetation growing degree days since sowing @@ -161,7 +160,9 @@ cropname(cs::CropState) = cropname(croptype(cs)) cropheight(cs::CropState) = cs.veg_height cropcover(cs::CropState) = cs.veg_cover cropyield(cs::CropState) = cs.veg_biomass # TODO: correct? units? dry or wet? -isharvestable(cs::CropState) = cs.mature +function isharvestable(cs::CropState) + return false +end # Constant in original ALMaSS code: # `EL_VEG_START_LAIT` from `Landscape/Elements.cpp`, line 238-239 @@ -813,10 +814,9 @@ function sow!(cs::CropState, model::SimulationModel, cropname::String) @warn "$(model.date) is earlier than the minimum sowing date for $(cropname)." cs.croptype = model.crops[cropname] setphase!(cs, sow, model) - cs.mature = false # TODO: is this correct to remove all events? this would # e.g. remove fertilising event? - empty!(cs.events) + #empty!(cs.events) # cs.vegddegs = 0.0 # cs.ddegs = 0.0 @@ -834,7 +834,6 @@ Harvest the crop of this cropstate. function harvest!(cs::CropState, model::SimulationModel) phase = (cs.phase in (ALMaSS.harvest1, ALMaSS.harvest2) ? ALMaSS.harvest2 : ALMaSS.harvest1) setphase!(cs, phase, model) - cs.mature = false # height & LAI will be automatically adjusted by the growth function return cs.veg_biomass # TODO: units ok of cs.veg_biomass ? end -- GitLab