{
  "schemaVersion": 1,
  "slug": "weather-severity-index-calculator",
  "category": "weather",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "481cf6712e4e6dffbc9c91d7933a149f3ba9077aead327902e1b6c5053a2ae69",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/weather-severity-index-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": "I = min(100, s_T + min(25, 0.75 v) + min(25, 10 p + b) + s_V + s_H)",
    "vars": [
      [
        "s_T",
        "Temperature score (lookup)"
      ],
      [
        "v",
        "Wind speed"
      ],
      [
        "p",
        "Precipitation"
      ],
      [
        "b",
        "Condition bonus: ice 15, storm 12, snow 5"
      ],
      [
        "s_V",
        "Visibility score: 0 / 5 / 12 / 20"
      ],
      [
        "s_H",
        "Humidity score (0 or 6)"
      ]
    ],
    "note": "Illustrative unvalidated model, not an official or safety index. T points: <0°F 25, <20 18, <32 10, >100 22, >90 14, else 2; wind=min(25,0.75×mph); precipitation=min(25,10×inches+bonus), bonus ice 15/storm 12/snow 5; visibility: ≥10 mi 0, ≥5 5, ≥2 12, else 20; humidity adds 6 only when RH>85% and T>75°F. Total capped at 100."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const tScore = temperature < 0 ? 25 : temperature < 20 ? 18 : temperature < 32 ? 10 : temperature > 100 ? 22 : temperature > 90 ? 14 : 2; const wScore = Math.min(25, windSpeed*0.75); const pScore = Math.min(25, precipitation*10 + (condition === 'ice' ? 15 : condition === 'storm' ? 12 : condition === 'snow' ? 5 : 0)); const vScore = visibility >= 10 ? 0 : visibility >= 5 ? 5 : visibility >= 2 ? 12 : 20; const hScore = humidity > 85 && temperature > 75 ? 6 : 0; const idx = Math.min(100, Math.round(tScore + wScore + pScore + vScore + hScore)); return { severityIndex: idx, temperatureScore: Math.round(tScore), windScore: Math.round(wScore), precipitationScore: Math.round(pScore), visibilityScore: vScore, humidityScore: hScore };",
    "inputs": [
      {
        "name": "temperature",
        "type": "number",
        "default": 35,
        "min": -60,
        "max": 130,
        "step": 1,
        "slider": true
      },
      {
        "name": "windSpeed",
        "type": "number",
        "default": 20,
        "min": 0,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "precipitation",
        "type": "number",
        "default": 0.5,
        "min": 0,
        "max": 20,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "visibility",
        "type": "number",
        "default": 5,
        "min": 0,
        "max": 20,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "humidity",
        "type": "number",
        "default": 80,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "condition",
        "type": "select",
        "default": "rain",
        "options": [
          {
            "value": "none"
          },
          {
            "value": "rain"
          },
          {
            "value": "snow"
          },
          {
            "value": "ice"
          },
          {
            "value": "storm"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "severityIndex",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "temperatureScore",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "windScore",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "precipitationScore",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "visibilityScore",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "humidityScore",
        "precision": 0,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
