WTR-SHR
Water Share / Composition Calculator
1. Identity
Depends on module:
Purpose
Computes water composition shares (ratios or percentages) with water-governed semantics, enforcing canonical source/stress identifiers, valid denominator choices, and disclosure-grade metadata for ESRS E3.
This engine is a domain adapter over MEID_CALC_SHARE.
2. Contract References (ZAR)
2.1 Input Schema
ZAR Address: schema.compute.water.share.inputs.v1_0_0
Required conceptual fields:
numerator_ref: water component identifier (source/stress/basis)denominator_ref: water total identifiershare_mode:RATIO|PERCENT(defaultPERCENT)alignment:BY_YEAR|BY_INDEX(defaultBY_YEAR)
And either:
numerator: scalar or time-seriesdenominator: scalar or time-series
(or resolvable signal refs, if your orchestration supports that pattern)
2.2 Options Schema
ZAR Address: schema.compute.water.share.options.v1_0_0
Common options:
denominator_floor: default1e-9cap_range:ENFORCE|ALLOW(defaultENFORCE)missing_policy:ERROR|SKIPsource_normalization:STRICT|LENIENT(defaultSTRICT)stress_bucket_normalization:STRICT|LENIENT(defaultSTRICT)rounding: optional digits
2.3 Output Schema
ZAR Address: schema.compute.water.share.output.v1_0_0
Outputs include:
share_seriesshare_unit(ratioorpercent)metadata(normalized refs, floors, caps, alignment)
3. Accepted Input Shapes
A. Source share of withdrawal (surface water / total withdrawal)
{
"numerator_ref": "source:surface_water",
"denominator_ref": "withdrawal_total",
"numerator": [[2025, 100000]],
"denominator": [[2025, 125000]],
"share_mode": "PERCENT"
}
B. Stress share of withdrawal (high-stress / total withdrawal)
{
"numerator_ref": "stress:high",
"denominator_ref": "withdrawal_total",
"numerator": [[2025, 45000]],
"denominator": [[2025, 125000]],
"share_mode": "RATIO"
}
C. Consumption ratio (consumption / withdrawal)
{
"numerator_ref": "consumption_total",
"denominator_ref": "withdrawal_total",
"numerator": [[2025, 15000]],
"denominator": [[2025, 125000]],
"share_mode": "PERCENT"
}
4. Water-Specific Normalization Rules (Normative)
4.1. Allowed numerator_ref values (v1)
Source shares
source:surface_watersource:groundwatersource:seawatersource:third_partysource:rainwater_harvestedsource:other
Stress shares
stress:highstress:mediumstress:lowstress:unknown
Totals
withdrawal_totalconsumption_totaldischarge_total
4.2. Allowed denominator_ref values (v1)
withdrawal_totalconsumption_totaldischarge_total
4.3. Pairing rules (governed)
The engine MUST enforce the following valid combinations:
- source:* MAY only be divided by
withdrawal_totalorconsumption_total(not discharge unless explicitly added later) - stress:* MAY only be divided by withdrawal_total or
consumption_total consumption_total/withdrawal_totalis allowed (consumption ratio)discharge_total/withdrawal_totalis allowed only if explicitly enabled by schema in later versions
Invalid pairings MUST error (v1 strict).
5. Compute Semantics (Normative)
For each aligned period :
Let be numerator and be denominator.
If share_mode = RATIO:
If share_mode = PERCENT:
If cap_range = ENFORCE:
- ratio: clamp to
- percent: clamp to
6. Validation & Error Model
Error codes (suggested)
WATER_SHARE_INVALID_REFWATER_SHARE_INVALID_PAIRINGWATER_SHARE_ALIGNMENT_MISMATCHWATER_SHARE_DENOMINATOR_ZERO_GUARDEDWATER_SHARE_NON_FINITE_VALUE
7. Dependencies
MEID_CALC_SHARE(primitive)- schema resolver (ZAR)
- canonical water source list
- canonical stress bucket list (if used)
Declared via ZAR dependencies.
8. Methods Served (v1)
Water.withdrawal.source.shareWater.consumption.source.shareWater.withdrawal.stress.shareWater.consumption.stress.share
Recommendation on naming
Use metric types (CSI) like:
water.withdrawal.by_source.sharewater.withdrawal.by_stress.share
…and keep the engine MEID generic: MEID_CALC_WATER_SHARE.