diff --git a/src/crop/almass.jl b/src/crop/almass.jl index 25d6c4deb1045e42798ac13cb1433f0b34e0b061..eff3ad0d574cd70f09d73384bbb755acead0bcc5 100644 --- a/src/crop/almass.jl +++ b/src/crop/almass.jl @@ -796,13 +796,17 @@ supply_global_radiation(model::SimulationModel) = Change the cropstate to sow the specified crop. """ -function sow!(cs::CropState, model::SimulationModel, cropname::String) +function sow!(cs::CropState, model::SimulationModel, cropname::String; + highnutrients::Bool=false) !ismissing(cs.croptype.minsowdate) && model.date < cs.croptype.minsowdate && @warn "$(model.date) is earlier than the minimum sowing date for $(cropname)." + empty!(cs.events) + if highnutrients + push!(cs.events, fertiliser) + end cs.croptype = model.crops[cropname] setphase!(cs, sow, model) cs.mature = false - empty!(cs.events) # cs.vegddegs = 0.0 # cs.ddegs = 0.0 diff --git a/src/crop/farmplot.jl b/src/crop/farmplot.jl index c44d6ad85d2c56f37784ae7df9c9cab89f3d361d..d11b2ff2e635e68d5fd9e5b45ea7362217aa62a5 100644 --- a/src/crop/farmplot.jl +++ b/src/crop/farmplot.jl @@ -36,9 +36,9 @@ end Sow the specified crop on the farmplot. """ -function sow!(farmplot::FarmPlot, model::SimulationModel, cropname::String) +function sow!(farmplot::FarmPlot, model::SimulationModel, cropname::String; kwargs...) createevent!(model, farmplot.pixels, sowing) - sow!(farmplot.cropstate, model, cropname) + sow!(farmplot.cropstate, model, cropname; kwargs...) @debug "Farmer $(farmplot.farmer) sowed $(cropname) on farmplot $(farmplot.id)." end