{
  "schemaVersion": 1,
  "slug": "snowfall-accumulation-calculator",
  "category": "weather",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "d7223726764a56afed44ea16da785d6fd8ce603e83ca1e5220cd5c84b95c876c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/snowfall-accumulation-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": "F = r×h; D = F×(1 − s÷100) + e; W_eq = F÷R(T); cm = 2.54D",
    "vars": [
      [
        "r",
        "Snowfall rate (in/h)"
      ],
      [
        "h",
        "Duration (h)"
      ],
      [
        "s",
        "Settling loss (%)"
      ],
      [
        "e",
        "Existing depth (in)"
      ],
      [
        "T",
        "Temperature (°F)"
      ],
      [
        "D",
        "Final depth (in)"
      ],
      [
        "F",
        "Fresh snowfall (in)"
      ],
      [
        "R",
        "Snow-to-water ratio by temperature (see note)"
      ],
      [
        "W_eq",
        "Water equivalent (in)"
      ],
      [
        "cm",
        "Final depth (cm)"
      ]
    ],
    "note": "Fallen snow = rate × duration; settled depth = fallen snow × (1 − entered settling fraction) + existing depth. Water equivalent uses a coarse temperature band, not a forecast."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const fallen = ratePerHour*hours; const settled = fallen*(1 - settlingPct/100); const ratio = temperature >= 32 ? 7 : temperature >= 25 ? 10 : temperature >= 15 ? 14 : 18; return { totalFallen: fallen, settledDepth: settled, finalDepth: settled + existingDepth, depthCm: (settled + existingDepth)*2.54, waterEquivalent: fallen/ratio, category: fallen < 2 ? 'Light' : fallen < 6 ? 'Moderate' : fallen < 12 ? 'Heavy' : 'Major storm' };",
    "inputs": [
      {
        "name": "ratePerHour",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 30,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "hours",
        "type": "number",
        "default": 6,
        "min": 0.1,
        "max": 120,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "settlingPct",
        "type": "number",
        "default": 15,
        "min": 0,
        "max": 80,
        "step": 1,
        "slider": true
      },
      {
        "name": "existingDepth",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 200,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "temperature",
        "type": "number",
        "default": 25,
        "min": -40,
        "max": 40,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "totalFallen",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "settledDepth",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "finalDepth",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "depthCm",
        "precision": 1,
        "unit": "cm"
      },
      {
        "name": "waterEquivalent",
        "precision": 2,
        "unit": "in"
      },
      {
        "name": "category",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
