{
  "$type": "Models.Core.Simulations, Models",
  "ExplorerWidth": 296,
  "Version": 100,
  "ApsimVersion": "0.0.0.0",
  "Name": "Simulations",
  "Children": [
    {
      "$type": "Models.Core.Simulation, Models",
      "IsRunning": false,
      "Name": "Simulation",
      "Children": [
        {
          "$type": "Models.Clock, Models",
          "Start": "1990-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.Weather, Models",
          "FileName": "%root%\\Examples\\WeatherFiles\\Dalby.met",
          "ExcelWorkSheetName": null,
          "Name": "Weather",
          "Children": [],
          "IncludeInDocumentation": true,
          "Enabled": true,
          "ReadOnly": false
        },
        {
          "$type": "Models.Soils.Arbitrator.SoilArbitrator, Models",
          "Name": "Soil Arbitrator",
          "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",
                "[Maize].Phenology.CurrentStageName",
                "[Maize].AboveGround.Wt",
                "[Maize].AboveGround.N",
                "[Maize].Grain.Wt",
                "[Maize].Grain.Size",
                "[Maize].Grain.NumberFunction",
                "[Maize].Grain.N",
                "[Maize].Total.Wt"
              ],
              "EventNames": [
                "[Maize].Harvesting"
              ],
              "GroupByVariableName": null,
              "Name": "Report",
              "Children": [],
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Fertiliser, Models",
              "Name": "Fertiliser",
              "Children": [],
              "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",
              "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,
                  "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,
                  "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": "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,
                  "Slope": "NaN",
                  "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
                  ],
                  "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,
                  "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
                  ],
                  "NO3N": null,
                  "NH4N": 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": "CERESSoilTemperature",
                  "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": "Maize",
              "Name": "Maize",
              "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;\r\nusing Models.Core;\r\nusing System;\r\nnamespace Models\r\n{\r\n    [Serializable]\r\n    public class Script : Model\r\n    {\r\n        [Link] Clock Clock;\r\n        [Link] Fertiliser Fertiliser;\r\n        [Link] Summary Summary;\r\n        \r\n        \r\n        [Description(\"Amount of fertiliser to be applied (kg/ha)\")]\r\n        public double Amount { get; set; }\r\n        \r\n        [Description(\"Crop to be fertilised\")]\r\n        public string CropName { get; set; }\r\n        \r\n        \r\n        \r\n\r\n        [EventSubscribe(\"Sowing\")]\r\n        private void OnSowing(object sender, EventArgs e)\r\n        {\r\n            Model crop = sender as Model;\r\n            if (crop.Name.ToLower() == CropName.ToLower())\r\n                Fertiliser.Apply(Amount: Amount, Type: Fertiliser.Types.NO3N);\r\n        }\r\n        \r\n    }\r\n}\r\n",
              "Parameters": [
                {
                  "Key": "Amount",
                  "Value": "160"
                },
                {
                  "Key": "CropName",
                  "Value": "maize"
                }
              ],
              "Name": "SowingFertiliser",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Manager, Models",
              "Code": "using APSIM.Shared.Utilities;\r\nusing Models.Utilities;\r\nusing Models.Soils.Nutrients;\r\nusing Models.Soils;\r\nusing Models.PMF;\r\nusing Models.Core;\r\nusing System;\r\n\r\nnamespace Models\r\n{\r\n    [Serializable]\r\n    public class Script : Model\r\n    {\r\n        [Link] Clock Clock;\r\n        [Link] Fertiliser Fertiliser;\r\n        [Link] Summary Summary;\r\n        [Link(ByName = true)] Plant Maize;\r\n        [Link] Soil Soil;\r\n        Accumulator accumulatedRain;\r\n        \r\n        [Description(\"Start of sowing window (d-mmm)\")]\r\n        public string StartDate { get; set; }\r\n        [Description(\"End of sowing window (d-mmm)\")]\r\n        public string EndDate { get; set; }\r\n        [Description(\"Minimum extractable soil water for sowing (mm)\")]\r\n        public double MinESW { get; set; }\r\n        [Description(\"Accumulated rainfall required for sowing (mm)\")]\r\n        public double MinRain { get; set; }\r\n        [Description(\"Duration of rainfall accumulation (d)\")]\r\n        public int RainDays { get; set; }\r\n        [Description(\"Cultivar to be sown\")]\r\n        [Display(Type=DisplayType.CultivarName, PlantName = \"Maize\")]\r\n        public string CultivarName { get; set; }\r\n        [Description(\"Sowing depth (mm)\")]\r\n        public double SowingDepth { get; set; }\r\n        [Description(\"Row spacing (mm)\")]\r\n        public double RowSpacing { get; set; }\r\n        [Description(\"Plant population (/m2)\")]\r\n        public double Population { get; set; }\r\n        \r\n        \r\n        [EventSubscribe(\"StartOfSimulation\")]\r\n        private void OnSimulationCommencing(object sender, EventArgs e)\r\n        {\r\n            accumulatedRain = new Accumulator(this, \"[Weather].Rain\", RainDays);\r\n        }\r\n        \r\n\r\n        [EventSubscribe(\"DoManagement\")]\r\n        private void OnDoManagement(object sender, EventArgs e)\r\n        {\r\n            accumulatedRain.Update();\r\n            \r\n            if (DateUtilities.WithinDates(StartDate, Clock.Today, EndDate) &&\r\n                !Maize.IsAlive &&\r\n                MathUtilities.Sum(Soil.SoilWater.ESW) > MinESW &&\r\n                accumulatedRain.Sum > MinRain)\r\n            {\r\n                Maize.Sow(population: Population, cultivar: CultivarName, depth: SowingDepth, rowSpacing: RowSpacing);    \r\n            }\r\n        \r\n        }\r\n        \r\n    }\r\n}\r\n",
              "Parameters": [
                {
                  "Key": "StartDate",
                  "Value": "1-nov"
                },
                {
                  "Key": "EndDate",
                  "Value": "10-jan"
                },
                {
                  "Key": "MinESW",
                  "Value": "100"
                },
                {
                  "Key": "MinRain",
                  "Value": "25"
                },
                {
                  "Key": "RainDays",
                  "Value": "7"
                },
                {
                  "Key": "CultivarName",
                  "Value": "Dekalb_XL82"
                },
                {
                  "Key": "SowingDepth",
                  "Value": "30"
                },
                {
                  "Key": "RowSpacing",
                  "Value": "750"
                },
                {
                  "Key": "Population",
                  "Value": "6"
                }
              ],
              "Name": "SowingRule",
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            },
            {
              "$type": "Models.Manager, Models",
              "Code": "using APSIM.Shared.Utilities;\r\nusing System.Xml.Serialization;\r\nusing Models;\r\nusing Models.PMF;\r\nusing Models.Soils.Nutrients;\r\nusing Models.Soils;\r\nusing System.Text;\r\nusing System.Collections.Generic;\r\nusing Models.Core;\r\nusing System;\r\n\r\nnamespace Models\r\n{\r\n    [Serializable] \r\n    public class Script : Model\r\n    {\r\n        [Link(ByName = true)] Plant Maize;\r\n        [Link] Zone zone;\r\n                    \r\n        \r\n        [EventSubscribe(\"StartOfSimulation\")]\r\n        private void OnSimulationCommencing(object sender, EventArgs e)\r\n        {\r\n        }\r\n        \r\n        [EventSubscribe(\"DoManagement\")]\r\n        private void OnDoManagement(object sender, EventArgs e)\r\n        {\r\n            if (Maize.Phenology.CurrentPhaseName == \"ReadyForHarvesting\")\r\n            {\r\n                Maize.Harvest();\r\n                Maize.EndCrop();\r\n            }\r\n        }\r\n        \r\n        [EventSubscribe(\"DoManagementCalculations\")]\r\n        private void OnDoManagementCalculations(object sender, EventArgs e)\r\n        {\r\n            \r\n        }\r\n    }\r\n}\r\n       \r\n",
              "Parameters": [],
              "Name": "Harvesting",
              "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": null,
              "Inverted": false,
              "Minimum": "NaN",
              "Maximum": "NaN",
              "Interval": "NaN",
              "DateTimeAxis": false,
              "CrossesAtZero": false
            }
          ],
          "LegendPosition": 0,
          "LegendOrientation": 0,
          "DisabledSeries": [],
          "LegendOutsideGraph": false,
          "Name": "Maize Yield Time Series",
          "Children": [
            {
              "$type": "Models.Series, Models",
              "Type": 1,
              "XAxis": 3,
              "YAxis": 0,
              "ColourArgb": -16776961,
              "FactorToVaryColours": null,
              "FactorToVaryMarkers": null,
              "FactorToVaryLines": null,
              "Marker": 0,
              "MarkerSize": 0,
              "Line": 0,
              "LineThickness": 0,
              "TableName": "Report",
              "XFieldName": "Clock.Today",
              "YFieldName": "Maize.Grain.Wt",
              "X2FieldName": "",
              "Y2FieldName": "",
              "ShowInLegend": true,
              "IncludeSeriesNameInLegend": false,
              "Cumulative": false,
              "CumulativeX": false,
              "Filter": null,
              "Name": "Maize Yield",
              "Children": [],
              "IncludeInDocumentation": true,
              "Enabled": true,
              "ReadOnly": false
            }
          ],
          "IncludeInDocumentation": false,
          "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
}