Crop submodel
Persefone reimplements two different crop models for different purposes. AquaCrop is a well-established crop growth model developed by the FAO, which provides quite reliable estimates of plant growth but is data-intensive to parameterise. The vegetation submodel of ALMaSS is much simpler, but also less reliable. Accordingly, we use AquaCrop for our main crop types, and ALMaSS for the rest (especially grass growth).
farmplot.jl
This file is responsible for the farm plots, i.e. the indidivual fields that farmers manage.
Persefone.FarmPlot
— TypeFarmPlot
A struct representing a single field, on which a crop can be grown.
Persefone.averagefieldsize
— Methodaveragefieldsize(model)
Calculate the average field size in hectares for the model landscape.
Persefone.cropcover
— Methodcropcover(model, position)
Return the crop cover of the crop at this position, or nothing if there is no crop here (utility wrapper).
Persefone.cropgroup
— Methodcropgroup(model, position)
Return the group of the crop at this position, or an empty string if there is no crop here (utility wrapper).
Persefone.cropheight
— Methodcropheight(model, position)
Return the height of the crop at this position, or nothing if there is no crop here (utility wrapper).
Persefone.cropname
— Methodcropname(model, position)
Return the name of the crop at this position, or NA if there is no crop here (utility wrapper).
Persefone.croptype
— Methodcroptype(model, position)
Return the crop at this position, or nothing if there is no crop here (utility wrapper).
Persefone.harvest!
— Methodharvest!(farmplot, model)
Harvest the crop of this farmplot.
Persefone.sow!
— Methodsow!(farmplot, model, cropname)
Sow the specified crop on the farmplot.
Persefone.stepagent!
— Methodstepagent!(farmplot, model)
Update a farm plot by one day.
Persefone.@harvest
— Macro@harvest()
Harvest the current field. Requires the variables field
and model
.
Persefone.@sow
— Macro@sow(cropname)
Sow the named crop on the current field. Requires the variables field
and model
.
cropmodels.jl
This initialises the crop models and the farmplots at the beginning of the simulation.
Persefone.initcropmodels
— Methodinitcropmodels(cropmodels, cropdirectory; region)
Initialise the crop models given as a comma-delimited string (e.g. "almass,aquacrop"). The crop model parameters are read from the cropdirectories
, also a comma-delimited string. Returns the crop types available in the simulation.
Persefone.initfields!
— Methodinitfields!(model)
Initialise the farm plots in the simulation model.
almass.jl
This file reimplements the ALMaSS vegetation submodel.
Persefone.ALMaSS.temperature_to_solar_conversion_c3
— ConstantTemperature to solar conversion factor for C3 plants.
Persefone.ALMaSS.temperature_to_solar_conversion_c4
— ConstantTemperature to solar conversion factor for C4 plants.
Persefone.ALMaSS.CropCurveParams
— TypeCropCurveParams
The values in this struct define one crop growth curve.
Persefone.ALMaSS.CropState
— TypeCropState
The state data for an ALMaSS vegetation point calculation. Usually part of a FarmPlot
.
Persefone.ALMaSS.CropType
— TypeCropType
The type struct for all crops. Currently follows the crop growth model as implemented in ALMaSS.
Persefone.ALMaSS.GrowthPhase
— TypeGrowthPhase
ALMaSS crop growth curves are split into five phases, triggered by seasonal dates or agricultural events.
Base.tryparse
— MethodBase.tryparse(type, str)
Extend tryparse
to allow parsing GrowthPhase values. (Needed to read in the CSV parameter file.)
Persefone.ALMaSS.buildgrowthcurve
— Methodbuildgrowthcurve(data)
Convert a list of rows from the crop growth data into a CropCurveParams object.
Persefone.ALMaSS.readcropparameters
— Methodreadcropparameters(cropdirectory)
Parse a CSV file containing the required parameter values for each crop (as produced from the original ALMaSS file by convert_almass_data.py
).
Persefone.ALMaSS.setphase!
— Methodsetphase!(cropstate, phase)
Set the growth phase
of an ALMaSS cropstate
.
Persefone.ALMaSS.solar_conversion_c3
— Methodsolar_conversion_c3(temperature)
Solar conversion factor (no units) for C3 plants.
Persefone.ALMaSS.solar_conversion_c4
— Methodsolar_conversion_c3(temperature)
Solar conversion factor (no units) for C4 plants.
Persefone.harvest!
— Methodharvest!(cropstate, model)
Harvest the crop of this cropstate.
Persefone.sow!
— Methodsow!(cropstate, model, cropname)
Change the cropstate to sow the specified crop.
Persefone.stepagent!
— Methodstepagent!(cropstate, model)
Update a farm plot by one day.
aquacrop.jl
This file integrates the AquaCrop model (implemented in a separate pacakge) into Persefone.
Persefone.AquaCropWrapper.readcropparameters
— Methodreadcropparameters(cropdirectory; region)
Read parameters needed for the AquaCrop crop module in Persefone:
- a CSV file crop_data.csv containing some parameters required to map
AquaCrop crop names to Persefone crop names, as well as additional crop data needed for Persefone (cropgroup, minsowdate, maxsowdate)
- modified crop parameters for each region, e.g. the file
data/crop/aquacrop/regions/jena/winter_wheat.toml
can be used to overload the parameters of the Persefone crop "winter wheat" for the "jena" region
Persefone.harvest!
— Methodharvest!(cropstate, model)
Harvest the crop of this cropstate.
Persefone.sow!
— Methodsow!(cropstate, model, cropname)
Change the cropstate to sow the specified crop.
Persefone.stepagent!
— Methodstepagent!(cropstate, model)
Update a crop state by one day.