{
  "$type": "Models.Core.Simulations, Models",
  "ExplorerWidth": 300,
  "Version": 130,
  "ApsimVersion": "2021.4.1.6228",
  "Name": "Simulations",
  "Children": [
    {
      "$type": "Models.Core.Simulation, Models",
      "IsRunning": false,
      "Descriptors": null,
      "Name": "Simulation",
      "Children": [
        {
          "$type": "Models.Clock, Models",
          "Start": "1900-01-01T00:00:00",
          "End": "2000-12-31T00:00:00",
          "Name": "Clock",
          "Children": [],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        },
        {
          "$type": "Models.Summary, Models",
          "CaptureErrors": true,
          "CaptureWarnings": true,
          "CaptureSummaryText": true,
          "Name": "SummaryFile",
          "Children": [],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        },
        {
          "$type": "Models.Climate.Weather, Models",
          "ConstantsFile": null,
          "FileName": "%root%\\Examples\\WeatherFiles\\Dalby.met",
          "ExcelWorkSheetName": null,
          "Name": "Weather",
          "Children": [],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        },
        {
          "$type": "Models.Soils.Arbitrator.SoilArbitrator, Models",
          "Name": "SoilArbitrator",
          "Children": [],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        },
        {
          "$type": "Models.Core.Zone, Models",
          "Area": 1.0,
          "Slope": 0.0,
          "AspectAngle": 0.0,
          "Altitude": 50.0,
          "Name": "Field",
          "Children": [
            {
              "$type": "Models.Report, Models",
              "VariableNames": [
                "[Clock].Today",
                "[Wheat].Phenology.Zadok.Stage",
                "[Wheat].Phenology.CurrentStageName",
                "[Wheat].AboveGround.Wt",
                "[Wheat].AboveGround.N",
                "[Wheat].Grain.Total.Wt*10 as Yield",
                "[Wheat].Grain.Protein",
                "[Wheat].Grain.Size",
                "[Wheat].Grain.Number",
                "[Wheat].Grain.Total.Wt",
                "[Wheat].Grain.Total.N",
                "[Wheat].Total.Wt"
              ],
              "EventNames": [
                "[Wheat].Harvesting"
              ],
              "GroupByVariableName": null,
              "Name": "Report",
              "Children": [],
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Fertiliser, Models",
              "ResourceName": "Fertiliser",
              "Name": "Fertiliser",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Soils.Soil, Models",
              "RecordNumber": 0,
              "ASCOrder": "Vertosol",
              "ASCSubOrder": "Black",
              "SoilType": "Clay",
              "LocalName": null,
              "Site": "Norwin",
              "NearestTown": "Norwin",
              "Region": "Darling Downs and Granite Belt",
              "State": "Queensland",
              "Country": "Australia",
              "NaturalVegetation": "Qld. Bluegrass, possible Qld. Blue gum",
              "ApsoilNumber": "900",
              "Latitude": -27.581836,
              "Longitude": 151.320206,
              "LocationAccuracy": " +/- 20m",
              "YearOfSampling": null,
              "DataSource": "CSIRO Sustainable Ecosystems, Toowoomba; Characteriesd as part of the GRDC funded project\"Doing it better, doing it smarter, managing soil water in Australian agriculture' 2011",
              "Comments": "OC, CLL for all crops estimated-based on Bongeen Mywybilla Soil No1",
              "Name": "Soil",
              "Children": [
                {
                  "$type": "Models.Soils.Physical, Models",
                  "Depth": [
                    "0-15",
                    "15-30",
                    "30-60",
                    "60-90",
                    "90-120",
                    "120-150",
                    "150-180"
                  ],
                  "Thickness": [
                    150.0,
                    150.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0
                  ],
                  "ParticleSizeClay": null,
                  "ParticleSizeSand": null,
                  "ParticleSizeSilt": null,
                  "Rocks": null,
                  "Texture": null,
                  "BD": [
                    1.01056473311131,
                    1.07145631083388,
                    1.09393858528057,
                    1.15861335018721,
                    1.17301160318016,
                    1.16287303586874,
                    1.18749547755906
                  ],
                  "AirDry": [
                    0.130250054518252,
                    0.198689390775399,
                    0.28,
                    0.28,
                    0.28,
                    0.28,
                    0.28
                  ],
                  "LL15": [
                    0.260500109036505,
                    0.248361738469248,
                    0.28,
                    0.28,
                    0.28,
                    0.28,
                    0.28
                  ],
                  "DUL": [
                    0.52100021807301,
                    0.496723476938497,
                    0.488437607673005,
                    0.480296969355493,
                    0.471583596524955,
                    0.457070570557793,
                    0.452331759845006
                  ],
                  "SAT": [
                    0.588654817693846,
                    0.565676863836273,
                    0.557192986686577,
                    0.532787415023694,
                    0.527354112007486,
                    0.531179986464627,
                    0.521888499034317
                  ],
                  "KS": [
                    20.0,
                    20.0,
                    20.0,
                    20.0,
                    20.0,
                    20.0,
                    20.0
                  ],
                  "BDMetadata": null,
                  "AirDryMetadata": null,
                  "LL15Metadata": null,
                  "DULMetadata": null,
                  "SATMetadata": null,
                  "KSMetadata": null,
                  "RocksMetadata": null,
                  "TextureMetadata": null,
                  "ParticleSizeSandMetadata": null,
                  "ParticleSizeSiltMetadata": null,
                  "ParticleSizeClayMetadata": null,
                  "Name": "Physical",
                  "Children": [
                    {
                      "$type": "Models.Soils.SoilCrop, Models",
                      "LL": [
                        0.261,
                        0.248,
                        0.28,
                        0.306,
                        0.36,
                        0.392,
                        0.446
                      ],
                      "KL": [
                        0.06,
                        0.06,
                        0.06,
                        0.04,
                        0.04,
                        0.02,
                        0.01
                      ],
                      "XF": [
                        1.0,
                        1.0,
                        1.0,
                        1.0,
                        1.0,
                        1.0,
                        1.0
                      ],
                      "LLMetadata": null,
                      "KLMetadata": null,
                      "XFMetadata": null,
                      "Name": "WheatSoil",
                      "Children": [],
                      "IncludeInDocumentation": true,
                      "Enabled": true,
                      "ReadOnly": false
                    },
                    {
                      "$type": "Models.Soils.SoilCrop, Models",
                      "LL": [
                        0.261,
                        0.248,
                        0.28,
                        0.306,
                        0.36,
                        0.392,
                        0.446
                      ],
                      "KL": [
                        0.06,
                        0.06,
                        0.06,
                        0.04,
                        0.04,
                        0.02,
                        0.01
                      ],
                      "XF": [
                        1.0,
                        1.0,
                        1.0,
                        1.0,
                        1.0,
                        1.0,
                        1.0
                      ],
                      "LLMetadata": null,
                      "KLMetadata": null,
                      "XFMetadata": null,
                      "Name": "MaizeSoil",
                      "Children": [],
                      "IncludeInDocumentation": true,
                      "Enabled": true,
                      "ReadOnly": false
                    }
                  ],
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.WaterModel.WaterBalance, Models",
                  "SummerDate": "1-Nov",
                  "SummerU": 5.0,
                  "SummerCona": 5.0,
                  "WinterDate": "1-Apr",
                  "WinterU": 5.0,
                  "WinterCona": 5.0,
                  "DiffusConst": 40.0,
                  "DiffusSlope": 16.0,
                  "Salb": 0.12,
                  "CN2Bare": 73.0,
                  "CNRed": 20.0,
                  "CNCov": 0.8,
                  "DischargeWidth": "NaN",
                  "CatchmentArea": "NaN",
                  "Thickness": [
                    150.0,
                    150.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0
                  ],
                  "SWCON": [
                    0.3,
                    0.3,
                    0.3,
                    0.3,
                    0.3,
                    0.3,
                    0.3
                  ],
                  "KLAT": null,
                  "ResourceName": "WaterBalance",
                  "Name": "SoilWater",
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.Soils.Organic, Models",
                  "Depth": [
                    "0-15",
                    "15-30",
                    "30-60",
                    "60-90",
                    "90-120",
                    "120-150",
                    "150-180"
                  ],
                  "FOMCNRatio": 40.0,
                  "Thickness": [
                    150.0,
                    150.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0
                  ],
                  "Carbon": [
                    1.2,
                    0.96,
                    0.6,
                    0.3,
                    0.18,
                    0.12,
                    0.12
                  ],
                  "SoilCNRatio": [
                    12.0,
                    12.0,
                    12.0,
                    12.0,
                    12.0,
                    12.0,
                    12.0
                  ],
                  "FBiom": [
                    0.04,
                    0.02,
                    0.02,
                    0.02,
                    0.01,
                    0.01,
                    0.01
                  ],
                  "FInert": [
                    0.4,
                    0.6,
                    0.8,
                    1.0,
                    1.0,
                    1.0,
                    1.0
                  ],
                  "FOM": [
                    347.12903231275641,
                    270.3443621919937,
                    163.97214434990104,
                    99.454132887040629,
                    60.321980831124677,
                    36.587130828674873,
                    22.1912165985086
                  ],
                  "CarbonMetadata": null,
                  "FOMMetadata": null,
                  "Name": "Organic",
                  "Children": [],
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.Soils.Chemical, Models",
                  "Depth": [
                    "0-15",
                    "15-30",
                    "30-60",
                    "60-90",
                    "90-120",
                    "120-150",
                    "150-180"
                  ],
                  "Thickness": [
                    150.0,
                    150.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0
                  ],
                  "NO3N": [
                    1.0,
                    1.0,
                    1.0,
                    1.0,
                    1.0,
                    1.0,
                    1.0
                  ],
                  "NH4N": [
                    0.1,
                    0.1,
                    0.1,
                    0.1,
                    0.1,
                    0.1,
                    0.1
                  ],
                  "PH": [
                    8.0,
                    8.0,
                    8.0,
                    8.0,
                    8.0,
                    8.0,
                    8.0
                  ],
                  "CL": null,
                  "EC": null,
                  "ESP": null,
                  "ECMetadata": null,
                  "CLMetadata": null,
                  "ESPMetadata": null,
                  "PHMetadata": null,
                  "Name": "Chemical",
                  "Children": [],
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.Soils.InitialWater, Models",
                  "PercentMethod": 1,
                  "FractionFull": 1.0,
                  "DepthWetSoil": "NaN",
                  "RelativeTo": null,
                  "Name": "InitialWater",
                  "Children": [],
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.Soils.Sample, Models",
                  "Depth": [
                    "0-15",
                    "15-30",
                    "30-60",
                    "60-90",
                    "90-120",
                    "120-150",
                    "150-180"
                  ],
                  "Thickness": [
                    150.0,
                    150.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0,
                    300.0
                  ],
                  "NO3": null,
                  "NH4": null,
                  "SW": [
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN"
                  ],
                  "OC": [
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN"
                  ],
                  "EC": [
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN"
                  ],
                  "CL": [
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN"
                  ],
                  "ESP": [
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN"
                  ],
                  "PH": [
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN",
                    "NaN"
                  ],
                  "SWUnits": 0,
                  "OCUnits": 0,
                  "PHUnits": 0,
                  "Name": "InitialN",
                  "Children": [],
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.Soils.CERESSoilTemperature, Models",
                  "Name": "Temperature",
                  "Children": [],
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                },
                {
                  "$type": "Models.Soils.Nutrients.Nutrient, Models",
                  "ResourceName": "Nutrient",
                  "Name": "Nutrient",
                  "IncludeInDocumentation": true,
                  "Enabled": true,
                  "ReadOnly": false
                }
              ],
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Surface.SurfaceOrganicMatter, Models",
              "InitialResidueName": "wheat_stubble",
              "InitialResidueType": "wheat",
              "InitialResidueMass": 500.0,
              "InitialStandingFraction": 0.0,
              "InitialCPR": 0.0,
              "InitialCNR": 100.0,
              "ResourceName": "SurfaceOrganicMatter",
              "Name": "SurfaceOrganicMatter",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.PMF.Plant, Models",
              "ResourceName": "Wheat",
              "Name": "Wheat",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.MicroClimate, Models",
              "a_interception": 0.0,
              "b_interception": 1.0,
              "c_interception": 0.0,
              "d_interception": 0.0,
              "soil_albedo": 0.3,
              "SoilHeatFluxFraction": 0.4,
              "MinimumHeightDiffForNewLayer": 0.0,
              "NightInterceptionFraction": 0.5,
              "ReferenceHeight": 2.0,
              "Name": "MicroClimate",
              "Children": [],
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Manager, Models",
              "Code": "using Models.PMF;\nusing Models.Core;\nusing System;\nnamespace Models\n{\n    [Serializable]\n    public class Script : Model\n    {\n        [Link] Clock Clock;\n        [Link] Fertiliser Fertiliser;\n        [Link] Summary Summary;\n        \n        \n        [Description(\"Amount of fertiliser to be applied (kg/ha)\")]\n        public double Amount { get; set;}\n        \n        [Description(\"Crop to be fertilised\")]\n        public string CropName { get; set;}\n        \n        \n        \n\n        [EventSubscribe(\"Sowing\")]\n        private void OnSowing(object sender, EventArgs e)\n        {\n            Model crop = sender as Model;\n            if (crop.Name.ToLower()==CropName.ToLower())\n                Fertiliser.Apply(Amount: Amount, Type: Fertiliser.Types.NO3N);\n        }\n        \n    }\n}\n",
              "Parameters": [
                {
                  "Key": "Amount",
                  "Value": "160"
                },
                {
                  "Key": "CropName",
                  "Value": "wheat"
                }
              ],
              "Name": "SowingFertiliser",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Manager, Models",
              "Code": "using Models.Soils.Nutrients;\nusing System;\nusing Models.Core;\nusing Models.PMF;\nusing Models.Soils;\nusing Models.Soils.Nutrients;\nusing Models.Utilities;\nusing APSIM.Shared.Utilities;\n\nnamespace Models\n{\n    [Serializable]\n    public class Script : Model\n    {\n        [Link] Plant Wheat;\n\n        [EventSubscribe(\"DoManagement\")]\n        private void OnDoManagement(object sender, EventArgs e)\n        {\n            if (Wheat.IsReadyForHarvesting)\n            {\n               Wheat.Harvest();\n               Wheat.EndCrop();    \n            }\n        \n        }\n        \n    }\n}\n",
              "Parameters": null,
              "Name": "Harvest",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Manager, Models",
              "Code": "using Models.Interfaces;\nusing System;\nusing Models.Core;\nusing Models.PMF;\nusing Models.Soils;\nusing Models.Soils.Nutrients;\nusing Models.Utilities;\nusing APSIM.Shared.Utilities;\nusing Models.Climate;\n\nnamespace Models\n{\n    [Serializable]\n    public class Script : Model\n    {\n        [Link] private Clock Clock;\n        [Link] private Fertiliser Fertiliser;\n        [Link] private Summary Summary;\n        [Link(ByName = true)] private Plant Wheat;\n        [Link] private Soil Soil;\n        private Accumulator accumulatedRain;\n        [Link]\n        private ISoilWater waterBalance;\n        \n        [Description(\"Start of sowing window (d-mmm)\")]\n        public string StartDate { get; set;}\n        [Description(\"End of sowing window (d-mmm)\")]\n        public string EndDate { get; set;}\n        [Description(\"Minimum extractable soil water for sowing (mm)\")]\n        public double MinESW { get; set;}\n        [Description(\"Accumulated rainfall required for sowing (mm)\")]\n        public double MinRain { get; set;}\n        [Description(\"Duration of rainfall accumulation (d)\")]\n        public int RainDays { get; set;}\n        [Description(\"Cultivar to be sown\")]\n        [Display(Type=DisplayType.CultivarName, PlantName = \"Wheat\")]\n        public string CultivarName { get; set;}\n        [Description(\"Sowing depth (mm)\")]\n        public double SowingDepth { get; set;}        \n        [Description(\"Row spacing (mm)\")]\n        public double RowSpacing { get; set;}    \n        [Description(\"Plant population (/m2)\")]\n        public double Population { get; set;}    \n        \n        \n        [EventSubscribe(\"StartOfSimulation\")]\n        private void OnSimulationCommencing(object sender, EventArgs e)\n        {\n            accumulatedRain = new Accumulator(this, \"[Weather].Rain\", RainDays);\n        }\n        \n\n        [EventSubscribe(\"DoManagement\")]\n        private void OnDoManagement(object sender, EventArgs e)\n        {\n            accumulatedRain.Update();\n            \n            if (DateUtilities.WithinDates(StartDate,Clock.Today,EndDate) &&\n                !Wheat.IsAlive &&\n                MathUtilities.Sum(waterBalance.ESW) > MinESW &&\n                accumulatedRain.Sum > MinRain)\n            {\n               Wheat.Sow(population:Population, cultivar:CultivarName, depth:SowingDepth, rowSpacing:RowSpacing);    \n            }\n        \n        }\n        \n    }\n}\n",
              "Parameters": [
                {
                  "Key": "StartDate",
                  "Value": "1-may"
                },
                {
                  "Key": "EndDate",
                  "Value": "10-jul"
                },
                {
                  "Key": "MinESW",
                  "Value": "100"
                },
                {
                  "Key": "MinRain",
                  "Value": "25"
                },
                {
                  "Key": "RainDays",
                  "Value": "7"
                },
                {
                  "Key": "CultivarName",
                  "Value": "Hartog"
                },
                {
                  "Key": "SowingDepth",
                  "Value": "30"
                },
                {
                  "Key": "RowSpacing",
                  "Value": "250"
                },
                {
                  "Key": "Population",
                  "Value": "120"
                }
              ],
              "Name": "SowingRule1",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            }
          ],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        },
        {
          "$type": "Models.Graph, Models",
          "Caption": null,
          "Axis": [
            {
              "$type": "Models.Axis, Models",
              "Type": 3,
              "Title": "Date",
              "Inverted": false,
              "Minimum": "NaN",
              "Maximum": "NaN",
              "Interval": "NaN",
              "DateTimeAxis": false,
              "CrossesAtZero": false
            },
            {
              "$type": "Models.Axis, Models",
              "Type": 0,
              "Title": "Yield (kg/ha)",
              "Inverted": false,
              "Minimum": "NaN",
              "Maximum": "NaN",
              "Interval": "NaN",
              "DateTimeAxis": false,
              "CrossesAtZero": false
            }
          ],
          "LegendPosition": 0,
          "LegendOrientation": 0,
          "DisabledSeries": null,
          "LegendOutsideGraph": false,
          "Name": "Wheat Yield Time Series",
          "Children": [
            {
              "$type": "Models.Series, Models",
              "Type": 1,
              "XAxis": 3,
              "YAxis": 0,
              "ColourArgb": -16777216,
              "FactorToVaryColours": null,
              "FactorToVaryMarkers": null,
              "FactorToVaryLines": null,
              "Marker": 0,
              "MarkerSize": 0,
              "Line": 0,
              "LineThickness": 0,
              "TableName": "Report",
              "XFieldName": "Clock.Today",
              "YFieldName": "Yield",
              "X2FieldName": "",
              "Y2FieldName": "",
              "ShowInLegend": true,
              "IncludeSeriesNameInLegend": false,
              "Cumulative": false,
              "CumulativeX": false,
              "Filter": null,
              "Name": "Wheat Yield",
              "Children": [],
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            }
          ],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        }
      ],
      "IncludeInDocumentation": true,
      "Enabled": true,
      "ReadOnly": false
    },
    {
      "$type": "Models.Storage.DataStore, Models",
      "useFirebird": false,
      "CustomFileName": null,
      "Name": "DataStore",
      "Children": [],
      "IncludeInDocumentation": true,
      "Enabled": true,
      "ReadOnly": false
    }
  ],
  "IncludeInDocumentation": true,
  "Enabled": true,
  "ReadOnly": false
}