Created 07/03/2023
IMPORTANT NOTE: It is highly recommended that you upgrade your APSIM Next Gen version to at least version 2023.2.7164.0 or later.
In this exercise you will use sowing rules to plant Chickpea crops and observe yield probabilities for a 40 year period given a half full soil moisture profile at sowing. We will compare two sowing rate strategies for these conditions with the goal of maximising yield. The weather will be different each year but the soil starting conditions will be the same.
By default, in long term simulations (i.e. longer than one year), the end of one years’ simulation becomes the starting point of the next year. This is useful if you are interested in seeing the degradation or improvement of the soil over a long time period. But what if you wanted to work out what the best strategy would be for the current year using weather scenarios from the past 40 years? To do this we could create 40 different simulations all with the same starting conditions but a different weather file (which would be a lot of work), or we could run the same simulation over 40 years and just reset the starting conditions each year (much simpler).
We can then try different management strategies to see which one would have worked best under the past 10 years weather scenarios.
Wheat
example.simulation
as Chickpea
and save the simulation as Module5
.Clock
nodes’ start and end date values to: 1/01/1940
and 31/12/1980
Heavy clay
soil from the Training toolbox
and delete the exisiting Soil
node.Water
to 50%
full - filled from top.Depth
to 0-1800
and initial value
to 20kg/ha
(right-click heading to change units).Depth
to 0-1800
and initial value
to 0kg/ha
.SurfaceOrganicMatter
node’s type to sorghum (don’t forget to rename the pool name to sorghum
as well),
initial surface residue: 550 kg/ha
, Carbon:Nitrogen ratio of 76
, leave the Fraction of residue standing as is.Field
and add a Chickpea
plant node.SowingRule1
change the values to match the following:
Clear the script completely and copy and paste this script into the Script
input for SowingRule1
:
using Models.Interfaces;
using System.Linq;
using System;
using Models.Core;
using Models.PMF;
using Models.Soils;
using Models.Soils.Nutrients;
using Models.Utilities;
using APSIM.Shared.Utilities;
using Models.Climate;
namespace Models
{
[Serializable]
public class Script : Model
{
[Link] private Clock Clock;
[Link] private Fertiliser Fertiliser;
[Link] private Summary Summary;
[Link(ByName = true)] private Plant Chickpea;
[Link] private Soil Soil;
private Accumulator accumulatedRain;
[Link]
private ISoilWater waterBalance;
[Description("Start of sowing window (d-mmm)")]
public string StartDate { get; set;}
[Description("End of sowing window (d-mmm)")]
public string EndDate { get; set;}
[Description("Minimum extractable soil water for sowing (mm)")]
public double MinESW { get; set;}
[Description("Accumulated rainfall required for sowing (mm)")]
public double MinRain { get; set;}
[Description("Duration of rainfall accumulation (d)")]
public int RainDays { get; set;}
[Description("Cultivar to be sown")]
[Display(Type=DisplayType.CultivarName, PlantName = "Chickpea")]
public string CultivarName { get; set;}
[Description("Sowing depth (mm)")]
public double SowingDepth { get; set;}
[Description("Row spacing (mm)")]
public double RowSpacing { get; set;}
[Description("Plant population (/m2)")]
public double Population { get; set;}
[EventSubscribe("StartOfSimulation")]
private void OnSimulationCommencing(object sender, EventArgs e)
{
accumulatedRain = new Accumulator(this, "[Weather].Rain", RainDays);
}
[EventSubscribe("DoManagement")]
private void OnDoManagement(object sender, EventArgs e)
{
accumulatedRain.Update();
if (DateUtilities.WithinDates(StartDate,Clock.Today,EndDate) &&
!Chickpea.IsAlive &&
MathUtilities.Sum(waterBalance.ESW) > MinESW &&
accumulatedRain.Sum > MinRain)
{
Chickpea.Sow(population:Population, cultivar:CultivarName, depth:SowingDepth, rowSpacing:RowSpacing);
}
}
}
}
Run the simulation.
You should get an error with the message: Cannot find a soil crop parameterisation called ChickpeaSoil
SoilCrop
node (located under Physical
) with the same name as the plant node you are using.To fix this error, copy and paste the WheatSoil
node, located under Heavy Clay
> Physical
. Rename WheatSoil1
to ChickpeaSoil
.
Your simulation should now run successfully and you should have data in your DataStore
node.
Add a management script called Reset on date
to the Chickpea
simulation (found in Management Toolbox
under Other
)
Leave all parameters as yes and change the date to reset on
to 1-may
.
Add the below to the Report variables.
[Clock].Today
[Chickpea].Grain.Total.Wt*10 as Yield
Make report frequency as:
[Chickpea].Harvesting
Remove SowingFertiliser
management node.
Rename the Chickpea
simulation as Chickpea 10 plants
.
Copy Chickpea 10 plants
and rename it Chickpea 15 plants
.
Change the Plant population(/m2)
to 15
in the SowingRule1
management script.
Run the simulations.
Create a graph. Rename it Total chickpea yield time series
with a series that plots [Clock].Today
and Yield
.
Now you have a graph showing yield when comparing differing plant density of 40 years.