{
  "schemaVersion": 1,
  "slug": "irrigation-calculator",
  "category": "gardening",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "02f93ca7e466c60265702173423ce6bf625bf0c76bdc68d39cad08bd6a548cae",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/irrigation-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "net depth = max(0, weekly need − effective rainfall); net gallons = area × net depth × 0.623; pumped gallons = net gallons ÷ efficiency",
    "vars": [
      [
        "G_p",
        "Pumped water per week (gal)"
      ],
      [
        "A",
        "Irrigated area (sq ft)"
      ],
      [
        "W",
        "Target water per week (in)"
      ],
      [
        "e",
        "System efficiency (%)"
      ],
      [
        "Q",
        "Flow rate (gpm)"
      ],
      [
        "s",
        "Sessions per week"
      ]
    ],
    "note": "Rainfall is only deducted at the effective amount you enter; runtime uses entered flow and efficiency."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "EPA WaterSense — Irrigation systems and site-specific watering",
        "url": "https://www.epa.gov/watersense/watering-tips"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "02f93ca7e466c60265702173423ce6bf625bf0c76bdc68d39cad08bd6a548cae",
    "basis": "net depth = max(0, weekly need − effective rainfall); net gallons = area × net depth × 0.623; pumped gallons = net gallons ÷ efficiency",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const netDepth=Math.max(0,waterPerWeek-effectiveRainfall); const weeklyGallons=area*netDepth*0.623; const pumpedGallons = weeklyGallons/(efficiency/100); const minutesPerSession = flowRate > 0 && sessions > 0 ? pumpedGallons/flowRate/sessions : 0; return { weeklyGallons, pumpedGallons, minutesPerSession, hoursPerWeek: pumpedGallons/(flowRate || 1)/60, note: system === 'drip' ? 'Drip runs long and slow — split into several sessions so water soaks in instead of running off' : 'Water early in the morning to cut evaporation losses' };",
    "inputs": [
      {
        "name": "area",
        "type": "number",
        "default": 1000,
        "min": 1,
        "max": 500000,
        "step": 10
      },
      {
        "name": "waterPerWeek",
        "type": "number",
        "default": 1,
        "min": 0.1,
        "max": 4,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "system",
        "type": "select",
        "default": "drip",
        "options": [
          {
            "value": "drip"
          },
          {
            "value": "soaker"
          },
          {
            "value": "impact"
          },
          {
            "value": "rotor"
          },
          {
            "value": "spray"
          }
        ]
      },
      {
        "name": "flowRate",
        "type": "number",
        "default": 10,
        "min": 0.1,
        "max": 500,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "efficiency",
        "type": "number",
        "default": 90,
        "min": 30,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "sessions",
        "type": "number",
        "default": 3,
        "min": 1,
        "max": 7,
        "step": 1
      },
      {
        "name": "effectiveRainfall",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 4,
        "step": 0.1
      }
    ],
    "outputs": [
      {
        "name": "weeklyGallons",
        "precision": 1,
        "unit": "gal"
      },
      {
        "name": "pumpedGallons",
        "precision": 1,
        "unit": "gal"
      },
      {
        "name": "minutesPerSession",
        "precision": 1,
        "unit": "min"
      },
      {
        "name": "hoursPerWeek",
        "precision": 1,
        "unit": "h"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
