distributed-buffer-resilience-utac 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+ """distributed-buffer-resilience-utac -- distributed hydrological/ecosystem buffer resilience.
2
+
3
+ GenesisAeon Package 103. Companion to glacier-buffer-utac (P99, the
4
+ loss) and glacier-buffer-replacement-utac (P100, technical
5
+ replacement): P103 covers the broader "distributed functional
6
+ resilience" idea -- a portfolio of reservoirs, groundwater, wetlands
7
+ and demand management, each with different response times, rather than
8
+ one storage type trying to replace the glacier alone. Deliberately no
9
+ UTAC/CREP/AFET bridge -- see DISCLAIMER.md.
10
+
11
+ Two explicit confidence tiers, kept separate in every module:
12
+ - CORE (drought_buffer, storage_portfolio, water_towers,
13
+ ecosystem_services): real, peer-reviewed findings independently
14
+ re-verified 2026-08-14.
15
+ - OPTIONAL/SPECULATIVE (gbr): a ratio-style metric this ecosystem
16
+ itself constructed from a source document's own proposed formula,
17
+ not a published metric, always exposed with an explicit warning.
18
+ """
19
+
20
+ from .constants import (
21
+ ALPINE_RESERVOIR_SUMMER_DEFICIT_CEILING_FRACTION,
22
+ CASALLAS_2025_CITATION,
23
+ FARINOTTI_2016_CITATION,
24
+ FARINOTTI_2019_CITATION,
25
+ HUSS_HOCK_2018_CITATION,
26
+ IMMERZEEL_2020_CITATION,
27
+ PACKAGE_ID,
28
+ PRITCHARD_2017_CITATION,
29
+ VAN_TIEL_2026_CITATION,
30
+ WATER_TOWER_DEPENDENT_POPULATION_BILLIONS,
31
+ )
32
+ from .drought_buffer import (
33
+ SWISS_2022_DROUGHT,
34
+ DroughtBufferObservation,
35
+ buffer_functions_while_eroding,
36
+ )
37
+ from .ecosystem_services import (
38
+ ECOSYSTEM_SERVICES_CITATION,
39
+ NBS_DESIGN_RULE,
40
+ nbs_effect_is_guaranteed_positive,
41
+ )
42
+ from .gbr import (
43
+ GBR_NOT_PEER_REVIEWED_WARNING,
44
+ glacier_buffer_replacement_score,
45
+ )
46
+ from .storage_portfolio import (
47
+ GLOBAL_STORAGE_POTENTIAL,
48
+ STORAGE_PORTFOLIO_NOTE,
49
+ GlobalStoragePotential,
50
+ reservoir_summer_deficit_ceiling_fraction,
51
+ theoretical_vs_realistic_gap_fraction,
52
+ )
53
+ from .water_towers import (
54
+ is_disproportionate_drought_buffer,
55
+ water_tower_dependent_population_billions,
56
+ )
57
+
58
+ __version__ = "1.0.0"
59
+
60
+ __all__ = [
61
+ "ALPINE_RESERVOIR_SUMMER_DEFICIT_CEILING_FRACTION",
62
+ "CASALLAS_2025_CITATION",
63
+ "ECOSYSTEM_SERVICES_CITATION",
64
+ "FARINOTTI_2016_CITATION",
65
+ "FARINOTTI_2019_CITATION",
66
+ "GBR_NOT_PEER_REVIEWED_WARNING",
67
+ "GLOBAL_STORAGE_POTENTIAL",
68
+ "HUSS_HOCK_2018_CITATION",
69
+ "IMMERZEEL_2020_CITATION",
70
+ "NBS_DESIGN_RULE",
71
+ "PACKAGE_ID",
72
+ "PRITCHARD_2017_CITATION",
73
+ "STORAGE_PORTFOLIO_NOTE",
74
+ "SWISS_2022_DROUGHT",
75
+ "VAN_TIEL_2026_CITATION",
76
+ "WATER_TOWER_DEPENDENT_POPULATION_BILLIONS",
77
+ "DroughtBufferObservation",
78
+ "GlobalStoragePotential",
79
+ "buffer_functions_while_eroding",
80
+ "glacier_buffer_replacement_score",
81
+ "is_disproportionate_drought_buffer",
82
+ "nbs_effect_is_guaranteed_positive",
83
+ "reservoir_summer_deficit_ceiling_fraction",
84
+ "theoretical_vs_realistic_gap_fraction",
85
+ "water_tower_dependent_population_billions",
86
+ ]
@@ -0,0 +1,186 @@
1
+ """Verified constants for distributed hydrological/ecosystem buffer resilience.
2
+
3
+ Companion to glacier-buffer-utac (P99, the natural loss) and
4
+ glacier-buffer-replacement-utac (P100, technical replacement). P103
5
+ covers the broader "distributed functional resilience" idea from
6
+ P102.md: instead of one storage type replacing the glacier, a portfolio
7
+ of reservoirs, groundwater, wetlands and demand management, each with
8
+ different response times, is what actually buffers a deglacierizing
9
+ catchment.
10
+
11
+ Two explicit confidence tiers, kept separate throughout this package:
12
+ - CORE: real, peer-reviewed findings independently re-verified via
13
+ direct paper/DOI lookup on 2026-08-14.
14
+ - OPTIONAL/SPECULATIVE (see gbr.py): a ratio-style metric this
15
+ ecosystem itself constructed (following P102.md's own proposal),
16
+ not a published, peer-reviewed formula -- exposed with an explicit
17
+ warning constant, same pattern as P100's RRF.
18
+ """
19
+
20
+ PACKAGE_ID = 103
21
+
22
+ # =====================================================================
23
+ # CORE -- independently re-verified 2026-08-14
24
+ # =====================================================================
25
+
26
+ # --- van Tiel, Huss, Zappa, Jonas & Farinotti 2026: the empirical anchor ---
27
+
28
+ VAN_TIEL_2026_CITATION = (
29
+ "van Tiel, M., Huss, M., Zappa, M., Jonas, T., Farinotti, D. "
30
+ "(2026). Swiss glacier mass loss during the 2022 drought: "
31
+ "persistent streamflow contributions amid declining melt water "
32
+ "volumes. Hydrology and Earth System Sciences, 30, 23-43. "
33
+ "DOI: 10.5194/hess-30-23-2026"
34
+ )
35
+ VAN_TIEL_2026_DOI = "10.5194/hess-30-23-2026"
36
+
37
+ # Number of glacierized Swiss catchments analyzed
38
+ VAN_TIEL_CATCHMENT_COUNT = 88
39
+ # Swiss glacier mass lost during 2022 alone, percent of remaining volume
40
+ VAN_TIEL_2022_MASS_LOSS_PCT = 6.0
41
+
42
+ VAN_TIEL_NOTE = (
43
+ "This is currently the strongest single empirical anchor for the "
44
+ "whole P99-P103 series: during the extreme, hot, dry summer of "
45
+ "2022, glacier melt across 88 Swiss catchments STILL substantially "
46
+ "buffered precipitation/snowmelt deficits -- yet in roughly "
47
+ "two-thirds of the studied catchments, the absolute summer "
48
+ "meltwater volume was already LOWER than in the comparably extreme "
49
+ "2003 summer, because shrinking glacier area increasingly "
50
+ "outweighs higher specific melt rates. The buffer still works, but "
51
+ "its physical capacity is measurably eroding -- not a hypothetical "
52
+ "future transition, an already-observed one."
53
+ )
54
+
55
+ # --- Farinotti, Pistocchi & Huss 2016: reservoir ceiling (reused from P100) ---
56
+
57
+ FARINOTTI_2016_CITATION = (
58
+ "Farinotti, D., Pistocchi, A., Huss, M. (2016). From dwindling ice "
59
+ "to headwater lakes: could dams replace glaciers in the European "
60
+ "Alps? Environmental Research Letters, 11(5), 054022. "
61
+ "DOI: 10.1088/1748-9326/11/5/054022"
62
+ )
63
+ FARINOTTI_2016_DOI = "10.1088/1748-9326/11/5/054022"
64
+
65
+ # Ceiling on the fraction of the projected end-of-century Alpine
66
+ # summer-runoff CHANGE (not total hydrological loss) a reservoir
67
+ # strategy could offset -- a specific, regional, scenario-bound
68
+ # estimate, NOT a universal replacement constant. See P100's
69
+ # mass_balance module for the same figure applied to reservoirs alone;
70
+ # here it anchors the "technical storage" layer of the wider portfolio.
71
+ ALPINE_RESERVOIR_SUMMER_DEFICIT_CEILING_FRACTION = 0.65
72
+
73
+ FARINOTTI_2016_SCOPE_NOTE = (
74
+ "Farinotti et al. (2016) found NO general physical upper bound of "
75
+ "65% for technical glacier replacement. They estimated that, for a "
76
+ "specific European Alps scenario to 2100, reservoir management "
77
+ "could offset up to ~65% of the EXPECTED CHANGE in summer runoff "
78
+ "from presently glacierized areas -- and explicitly state that "
79
+ "reservoirs cannot compensate the annual non-renewable runoff share "
80
+ "lost as glacier ice permanently disappears. Treat 65% as a "
81
+ "modeled, regional, scenario-bound ceiling, never as a portable "
82
+ "'universal replacement fraction'."
83
+ )
84
+
85
+ # --- Farinotti et al. 2019: global storage potential in ice-free basins ---
86
+
87
+ FARINOTTI_2019_CITATION = (
88
+ "Farinotti, D., Round, V., Huss, M., Compagno, L., Zekollari, H. "
89
+ "(2019). Large hydropower and water-storage potential in future "
90
+ "glacier-free basins. Nature, 575, 341-344. "
91
+ "DOI: 10.1038/s41586-019-1740-z"
92
+ )
93
+ FARINOTTI_2019_DOI = "10.1038/s41586-019-1740-z"
94
+
95
+ # Global theoretical storage potential in future ice-free glacier
96
+ # basins, km^3 (based on ~185,000 glaciers analyzed)
97
+ GLOBAL_THEORETICAL_STORAGE_POTENTIAL_KM3 = 875.0
98
+ GLOBAL_THEORETICAL_STORAGE_POTENTIAL_KM3_UNCERTAINTY = 260.0
99
+ GLOBAL_THEORETICAL_HYDROPOWER_POTENTIAL_TWH_PER_YR = 1350.0
100
+
101
+ # After a first technical/ecological/economic suitability screen, the
102
+ # fraction of the theoretical potential judged "potentially" realistic
103
+ REALISTIC_STORAGE_FRACTION_OF_THEORETICAL = 0.40
104
+ REALISTIC_STORAGE_POTENTIAL_KM3 = 355.0
105
+ REALISTIC_HYDROPOWER_POTENTIAL_TWH_PER_YR = 533.0
106
+
107
+ FARINOTTI_2019_NOTE = (
108
+ "875 +/- 260 km3 is a global THEORETICAL maximum across ~185,000 "
109
+ "glaciers; only ~40% (355 km3) passed a first-pass technical, "
110
+ "ecological and economic suitability screen. The paper itself "
111
+ "stresses this remains theoretical and requires site-specific "
112
+ "assessment before any real project -- do not read 875 km3 as "
113
+ "'available' storage."
114
+ )
115
+
116
+ # --- Huss & Hock 2018: peak water (reused from P99) ---
117
+
118
+ HUSS_HOCK_2018_CITATION = (
119
+ "Huss, M., Hock, R. (2018). Global-scale hydrological response to "
120
+ "future glacier mass loss. Nature Climate Change, 8, 135-140. "
121
+ "DOI: 10.1038/s41558-017-0049-x"
122
+ )
123
+ HUSS_HOCK_2018_DOI = "10.1038/s41558-017-0049-x"
124
+
125
+ # --- Pritchard 2017: glaciers as a regional drought buffer ---
126
+
127
+ PRITCHARD_2017_CITATION = (
128
+ "Pritchard, H.D. (2017). Asia's glaciers are a regionally important "
129
+ "buffer against drought. Nature, 545, 169-174. "
130
+ "DOI: 10.1038/nature22062"
131
+ )
132
+ PRITCHARD_2017_DOI = "10.1038/nature22062"
133
+
134
+ PRITCHARD_NOTE = (
135
+ "Pritchard (2017) is the explicit origin of the 'glaciers as "
136
+ "drought buffer' framing this whole package series builds on: "
137
+ "glacier meltwater contribution to river flow is disproportionately "
138
+ "important precisely during low-flow/drought years in High Mountain "
139
+ "Asia, even in basins where glacier melt is a small share of the "
140
+ "long-term mean flow."
141
+ )
142
+
143
+ # --- Immerzeel et al. 2020: Water Tower Index ---
144
+
145
+ IMMERZEEL_2020_CITATION = (
146
+ "Immerzeel, W.W., Lutz, A.F., Andrade, M. et al. (2020). "
147
+ "Importance and vulnerability of the world's water towers. Nature, "
148
+ "577, 364-369. DOI: 10.1038/s41586-019-1822-y"
149
+ )
150
+ IMMERZEEL_2020_DOI = "10.1038/s41586-019-1822-y"
151
+
152
+ # Global population living in or immediately downstream of mountain
153
+ # water-tower regions, billions
154
+ WATER_TOWER_DEPENDENT_POPULATION_BILLIONS = 1.9
155
+
156
+ IMMERZEEL_NOTE = (
157
+ "The Water Tower Index ranks mountain water systems not just by "
158
+ "hydrological importance but also by water stress, governance "
159
+ "quality, hydropolitical tension, and climatic/socioeconomic "
160
+ "change -- some of the world's most important water towers "
161
+ "(Indus, Amu Darya, Tarim) are simultaneously among the most "
162
+ "vulnerable, precisely because high dependence coincides with weak "
163
+ "governance capacity."
164
+ )
165
+
166
+ # --- Velasquez Casallas, Khelidj, Moran-Ordonez & Losapio 2025: ecosystem services ---
167
+
168
+ CASALLAS_2025_CITATION = (
169
+ "Velasquez Casallas, L.M., Khelidj, N., Moran-Ordonez, A., "
170
+ "Losapio, G. (2025). Global impacts of glacier retreat on "
171
+ "ecosystem services provided by soil and vegetation in mountain "
172
+ "regions: A literature review. Ecosystem Services, 73, 101730. "
173
+ "DOI: 10.1016/j.ecoser.2025.101730"
174
+ )
175
+ CASALLAS_2025_DOI = "10.1016/j.ecoser.2025.101730"
176
+
177
+ CASALLAS_NOTE = (
178
+ "This systematic review found that regulating ecosystem services "
179
+ "(e.g. climate regulation, erosion control) can INCREASE in "
180
+ "postglacial landscapes as vegetation establishes -- but the "
181
+ "effects are spatially and temporally heterogeneous, with real "
182
+ "trade-offs against other services, not a uniform net benefit. "
183
+ "Nature-based solutions should be selected by measured local "
184
+ "function, never assumed positive purely from their 'natural' "
185
+ "label -- see ecosystem_services.py."
186
+ )
@@ -0,0 +1,52 @@
1
+ """The empirical anchor: glacier drought buffering is real but eroding.
2
+
3
+ Core module -- van Tiel, Huss, Zappa, Jonas & Farinotti (2026)'s Swiss
4
+ 2022-drought analysis, the strongest current empirical evidence for
5
+ this whole package series' central claim: the natural buffer still
6
+ functions during extreme events, even as its physical capacity shrinks.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from dataclasses import dataclass
12
+
13
+ from .constants import (
14
+ VAN_TIEL_2022_MASS_LOSS_PCT,
15
+ VAN_TIEL_2026_CITATION,
16
+ VAN_TIEL_CATCHMENT_COUNT,
17
+ VAN_TIEL_NOTE,
18
+ )
19
+
20
+
21
+ @dataclass(frozen=True)
22
+ class DroughtBufferObservation:
23
+ """A real, dated observation of glacier drought-buffering under extreme conditions."""
24
+
25
+ catchment_count: int
26
+ mass_loss_pct: float
27
+ note: str
28
+ citation: str
29
+
30
+
31
+ SWISS_2022_DROUGHT = DroughtBufferObservation(
32
+ catchment_count=VAN_TIEL_CATCHMENT_COUNT,
33
+ mass_loss_pct=VAN_TIEL_2022_MASS_LOSS_PCT,
34
+ note=VAN_TIEL_NOTE,
35
+ citation=VAN_TIEL_2026_CITATION,
36
+ )
37
+
38
+
39
+ def buffer_functions_while_eroding() -> bool:
40
+ """The core van Tiel et al. (2026) finding: both things are true at once.
41
+
42
+ Always True. During the extreme 2022 Swiss drought, glacier melt
43
+ still substantially buffered precipitation/snowmelt deficits AND
44
+ the absolute meltwater volume was already below the comparable 2003
45
+ extreme in roughly two-thirds of studied catchments. A buffer that
46
+ still 'works' in the present is not evidence its capacity isn't
47
+ shrinking -- this is the empirical basis for treating resilience
48
+ loss as something that can precede visible system failure (see
49
+ P102.md's Adaptive Option Capacity discussion, not implemented here
50
+ as code -- too undefined for that, see DISCLAIMER.md).
51
+ """
52
+ return True
@@ -0,0 +1,38 @@
1
+ """Postglacial ecosystem services: real, but heterogeneous and trade-off-laden.
2
+
3
+ Core module -- Velasquez Casallas, Khelidj, Moran-Ordonez & Losapio
4
+ (2025)'s systematic literature review. The key discipline this module
5
+ encodes: Nature-based Solutions are selected by measured local
6
+ function, never assumed positive purely from their "natural" label.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from .constants import CASALLAS_2025_CITATION, CASALLAS_NOTE
12
+
13
+ NBS_DESIGN_RULE = (
14
+ "Nature-based Solutions are selected by measured local hydrological "
15
+ "function, not by their label. A wetland, a paramo, or reforestation "
16
+ "project is not automatically hydrologically beneficial -- see "
17
+ "CASALLAS_NOTE."
18
+ )
19
+
20
+
21
+ def nbs_effect_is_guaranteed_positive() -> bool:
22
+ """Whether a Nature-based Solution's hydrological effect can be assumed positive by its label.
23
+
24
+ Always False. Velasquez Casallas et al. (2025)'s systematic review
25
+ found regulating ecosystem services (climate regulation, erosion
26
+ control) can increase after glacier retreat as vegetation
27
+ establishes -- but the effects are spatially/temporally
28
+ heterogeneous with real trade-offs, not a uniform net benefit. Some
29
+ land-use changes framed as 'natural' (e.g. converting paramo to
30
+ pine plantation) measurably REDUCE total and base flow. This
31
+ function exists to make that non-guarantee an explicit, testable
32
+ fact rather than an assumption buried in prose.
33
+ """
34
+ return False
35
+
36
+
37
+ ECOSYSTEM_SERVICES_CITATION = CASALLAS_2025_CITATION
38
+ ECOSYSTEM_SERVICES_NOTE = CASALLAS_NOTE
@@ -0,0 +1,77 @@
1
+ """The Glacier Buffer Replacement (GBR) score.
2
+
3
+ OPTIONAL / SPECULATIVE module -- READ THIS BEFORE USING ANYTHING BELOW.
4
+
5
+ GBR is NOT a peer-reviewed, published metric. It is this ecosystem's
6
+ own discretized implementation of a formula P102.md itself proposes as
7
+ its own synthesis (not a literature citation) for scoring how much of a
8
+ drought-period flow deficit a set of adaptation measures actually
9
+ closes. Same honesty pattern as glacier-buffer-replacement-utac (P100)'s
10
+ Resilience Replacement Factor -- see RRF_NOT_PEER_REVIEWED_WARNING
11
+ there for the analogous precedent.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ from collections.abc import Sequence
17
+
18
+ GBR_NOT_PEER_REVIEWED_WARNING = (
19
+ "The Glacier Buffer Replacement (GBR) score is NOT a peer-reviewed "
20
+ "or published metric. It is a discretized implementation of a "
21
+ "formula P102.md proposes as its own synthesis, built on top of "
22
+ "this ecosystem's real, verified drought/streamflow data -- but the "
23
+ "scoring formula itself carries no primary citation. Do not present "
24
+ "GBR outputs as a measured or literature-validated quantity."
25
+ )
26
+
27
+
28
+ def glacier_buffer_replacement_score(
29
+ deficit_without_adaptation: Sequence[float],
30
+ flow_gain_from_adaptation: Sequence[float],
31
+ ) -> float:
32
+ """Speculative GBR = sum(min(gain[t], deficit[t])) / sum(deficit[t]) over a drought period.
33
+
34
+ See GBR_NOT_PEER_REVIEWED_WARNING. Both sequences must be the same
35
+ length, one value per time step across the drought/heat period
36
+ being evaluated:
37
+
38
+ - deficit_without_adaptation[t]: D(t), the flow deficit (versus a
39
+ no-deficit baseline) that WOULD exist without any adaptation
40
+ measures at time t. Must be >= 0.
41
+ - flow_gain_from_adaptation[t]: the additional flow (Q_adaptive(t)
42
+ - Q_no_adaptation(t)) contributed by the adaptation portfolio
43
+ (reservoirs, MAR, wetlands, demand management, ...) at time t.
44
+ May be negative (adaptation measures can occasionally reduce
45
+ flow, e.g. reservoir filling).
46
+
47
+ Returns 1.0 for full compensation of the defined deficit -- capped
48
+ there by construction, since each term is min(gain, deficit) <=
49
+ deficit, so overshooting gain in one period cannot offset
50
+ undershooting in another (matching P102.md's own integral
51
+ definition). Can go negative if the adaptation portfolio nets out
52
+ to REDUCING flow during the deficit period (e.g. reservoir filling
53
+ at the wrong time) -- that is a real, meaningful failure mode, not
54
+ a bug, and is deliberately not clamped to zero.
55
+ """
56
+ if len(deficit_without_adaptation) != len(flow_gain_from_adaptation):
57
+ raise ValueError(
58
+ "deficit_without_adaptation and flow_gain_from_adaptation must "
59
+ f"have equal length, got {len(deficit_without_adaptation)} and "
60
+ f"{len(flow_gain_from_adaptation)}"
61
+ )
62
+ if len(deficit_without_adaptation) == 0:
63
+ raise ValueError("input sequences must be non-empty")
64
+ if any(d < 0 for d in deficit_without_adaptation):
65
+ raise ValueError("deficit_without_adaptation values must all be non-negative")
66
+
67
+ total_deficit = sum(deficit_without_adaptation)
68
+ if total_deficit == 0:
69
+ raise ValueError(
70
+ "sum(deficit_without_adaptation) is zero -- GBR is undefined "
71
+ "with no deficit to compensate"
72
+ )
73
+ compensated = sum(
74
+ min(gain, deficit)
75
+ for deficit, gain in zip(deficit_without_adaptation, flow_gain_from_adaptation, strict=True)
76
+ )
77
+ return compensated / total_deficit
@@ -0,0 +1,93 @@
1
+ """Storage portfolio: technical reservoirs plus complementary response-time buffers.
2
+
3
+ Core module -- Farinotti et al. (2016, 2019) for the quantified
4
+ reservoir/storage figures. The response-time categorization is a
5
+ qualitative, widely-used framing in mountain hydrology (not itself tied
6
+ to one paper) illustrating why P102.md argues for a PORTFOLIO of
7
+ buffers rather than a single largest-volume one -- see
8
+ STORAGE_PORTFOLIO_NOTE.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from dataclasses import dataclass
14
+
15
+ from .constants import (
16
+ ALPINE_RESERVOIR_SUMMER_DEFICIT_CEILING_FRACTION,
17
+ FARINOTTI_2016_CITATION,
18
+ FARINOTTI_2016_SCOPE_NOTE,
19
+ FARINOTTI_2019_CITATION,
20
+ FARINOTTI_2019_NOTE,
21
+ GLOBAL_THEORETICAL_HYDROPOWER_POTENTIAL_TWH_PER_YR,
22
+ GLOBAL_THEORETICAL_STORAGE_POTENTIAL_KM3,
23
+ GLOBAL_THEORETICAL_STORAGE_POTENTIAL_KM3_UNCERTAINTY,
24
+ REALISTIC_HYDROPOWER_POTENTIAL_TWH_PER_YR,
25
+ REALISTIC_STORAGE_FRACTION_OF_THEORETICAL,
26
+ REALISTIC_STORAGE_POTENTIAL_KM3,
27
+ )
28
+
29
+ STORAGE_PORTFOLIO_NOTE = (
30
+ "A moor, a floodplain, an aquifer and a reservoir can all 'store "
31
+ "water', but their impulse responses differ fundamentally: snow "
32
+ "(seasonal), reservoirs (managed, fast release), soil moisture "
33
+ "(days-weeks), wetlands (weeks-months), groundwater (months-years). "
34
+ "Two systems with identical total storage volume can have very "
35
+ "different drought resilience because accessibility, retention "
36
+ "time, evaporation exposure, spatial position and release dynamics "
37
+ "differ. This is a widely-used qualitative framing in mountain "
38
+ "hydrology, not a single-paper citation -- see P99/P100 for the "
39
+ "component-specific quantified figures (sedimentation, MAR "
40
+ "retention time, floating-solar evaporation mitigation, etc.)."
41
+ )
42
+
43
+
44
+ def reservoir_summer_deficit_ceiling_fraction(
45
+ with_citation: bool = False,
46
+ ) -> float | tuple[float, str]:
47
+ """The Farinotti et al. (2016) reservoir-strategy ceiling on Alpine summer-deficit compensation.
48
+
49
+ A specific, regional, scenario-bound estimate (European Alps, to
50
+ 2100) -- NOT a universal replacement constant. See
51
+ FARINOTTI_2016_SCOPE_NOTE.
52
+ """
53
+ if with_citation:
54
+ return ALPINE_RESERVOIR_SUMMER_DEFICIT_CEILING_FRACTION, FARINOTTI_2016_CITATION
55
+ return ALPINE_RESERVOIR_SUMMER_DEFICIT_CEILING_FRACTION
56
+
57
+
58
+ @dataclass(frozen=True)
59
+ class GlobalStoragePotential:
60
+ """Farinotti et al. (2019)'s global theoretical vs. realistic storage potential."""
61
+
62
+ theoretical_km3: float
63
+ theoretical_km3_uncertainty: float
64
+ theoretical_hydropower_twh_per_yr: float
65
+ realistic_fraction: float
66
+ realistic_km3: float
67
+ realistic_hydropower_twh_per_yr: float
68
+ citation: str
69
+
70
+
71
+ GLOBAL_STORAGE_POTENTIAL = GlobalStoragePotential(
72
+ theoretical_km3=GLOBAL_THEORETICAL_STORAGE_POTENTIAL_KM3,
73
+ theoretical_km3_uncertainty=GLOBAL_THEORETICAL_STORAGE_POTENTIAL_KM3_UNCERTAINTY,
74
+ theoretical_hydropower_twh_per_yr=GLOBAL_THEORETICAL_HYDROPOWER_POTENTIAL_TWH_PER_YR,
75
+ realistic_fraction=REALISTIC_STORAGE_FRACTION_OF_THEORETICAL,
76
+ realistic_km3=REALISTIC_STORAGE_POTENTIAL_KM3,
77
+ realistic_hydropower_twh_per_yr=REALISTIC_HYDROPOWER_POTENTIAL_TWH_PER_YR,
78
+ citation=FARINOTTI_2019_CITATION,
79
+ )
80
+
81
+
82
+ def theoretical_vs_realistic_gap_fraction() -> float:
83
+ """Fraction of the theoretical global storage potential judged NOT realistically suitable.
84
+
85
+ 1 - realistic_fraction, i.e. how much of Farinotti et al. (2019)'s
86
+ theoretical 875 km3 figure falls away after a first-pass technical/
87
+ ecological/economic suitability screen. See FARINOTTI_2019_NOTE.
88
+ """
89
+ return 1.0 - GLOBAL_STORAGE_POTENTIAL.realistic_fraction
90
+
91
+
92
+ FARINOTTI_2016_NOTE = FARINOTTI_2016_SCOPE_NOTE
93
+ FARINOTTI_2019_SCOPE_NOTE = FARINOTTI_2019_NOTE
@@ -0,0 +1,49 @@
1
+ """Mountain water towers: importance, vulnerability, and disproportionate drought buffering.
2
+
3
+ Core module -- Immerzeel et al. (2020)'s Water Tower Index and
4
+ Pritchard (2017)'s drought-buffer framing, the original source of this
5
+ whole package series' central idea.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from .constants import (
11
+ IMMERZEEL_2020_CITATION,
12
+ IMMERZEEL_NOTE,
13
+ PRITCHARD_2017_CITATION,
14
+ PRITCHARD_NOTE,
15
+ WATER_TOWER_DEPENDENT_POPULATION_BILLIONS,
16
+ )
17
+
18
+
19
+ def water_tower_dependent_population_billions() -> float:
20
+ """Global population living in or immediately downstream of mountain water-tower regions."""
21
+ return WATER_TOWER_DEPENDENT_POPULATION_BILLIONS
22
+
23
+
24
+ def is_disproportionate_drought_buffer(
25
+ mean_contribution_pct: float, drought_year_contribution_pct: float
26
+ ) -> bool:
27
+ """Whether glacier melt contributes disproportionately more during drought than on average.
28
+
29
+ Operationalizes Pritchard (2017)'s core finding: glacier melt's
30
+ share of river flow is often small in the long-term mean but much
31
+ larger specifically in low-flow/drought years. True whenever the
32
+ drought-year contribution exceeds the mean contribution.
33
+ """
34
+ if not 0.0 <= mean_contribution_pct <= 100.0:
35
+ raise ValueError(
36
+ f"mean_contribution_pct must be in [0, 100], got {mean_contribution_pct}"
37
+ )
38
+ if not 0.0 <= drought_year_contribution_pct <= 100.0:
39
+ raise ValueError(
40
+ "drought_year_contribution_pct must be in [0, 100], got "
41
+ f"{drought_year_contribution_pct}"
42
+ )
43
+ return drought_year_contribution_pct > mean_contribution_pct
44
+
45
+
46
+ WATER_TOWER_CITATION = IMMERZEEL_2020_CITATION
47
+ WATER_TOWER_VULNERABILITY_NOTE = IMMERZEEL_NOTE
48
+ DROUGHT_BUFFER_CITATION = PRITCHARD_2017_CITATION
49
+ DROUGHT_BUFFER_NOTE = PRITCHARD_NOTE
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.5
2
+ Name: distributed-buffer-resilience-utac
3
+ Version: 1.0.0
4
+ Summary: Distributed hydrological/ecosystem buffer resilience for deglacierizing catchments -- van Tiel et al. 2026's drought-buffer evidence, Farinotti et al. 2016/2019's storage-portfolio figures, Immerzeel/Pritchard water-tower science, Casallas et al. 2025 ecosystem-service trade-offs, plus a clearly-flagged speculative GBR score -- companion to glacier-buffer-utac (P99) and glacier-buffer-replacement-utac (P100), no UTAC/CREP bridge
5
+ Project-URL: Homepage, https://github.com/GenesisAeon/distributed-buffer-resilience-utac
6
+ Project-URL: Repository, https://github.com/GenesisAeon/distributed-buffer-resilience-utac
7
+ Author: Römer, Johann
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.11
11
+ Provides-Extra: dev
12
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
13
+ Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
14
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
15
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
16
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # distributed-buffer-resilience-utac
20
+
21
+ GenesisAeon Package 103 — distributed hydrological/ecosystem buffer
22
+ resilience for deglacierizing catchments. Companion to
23
+ [glacier-buffer-utac](https://github.com/GenesisAeon/glacier-buffer-utac)
24
+ (P99, the loss) and
25
+ [glacier-buffer-replacement-utac](https://github.com/GenesisAeon/glacier-buffer-replacement-utac)
26
+ (P100, technical replacement). **Deliberately has no UTAC/CREP/AFET
27
+ bridge** — see [DISCLAIMER.md](DISCLAIMER.md).
28
+
29
+ ## The core idea
30
+
31
+ A single storage type can't replace a glacier. What actually buffers a
32
+ deglacierizing catchment is a **portfolio** of reservoirs, groundwater,
33
+ wetlands, snow, and demand management, each with a different response
34
+ time — not one component sized to do the whole job.
35
+
36
+ ## Two explicit confidence tiers
37
+
38
+ - **Core** (`drought_buffer`, `storage_portfolio`, `water_towers`,
39
+ `ecosystem_services`): real, peer-reviewed findings independently
40
+ re-verified 2026-08-14.
41
+ - **Optional / speculative** (`gbr`): a ratio-style score this
42
+ ecosystem constructed from a source document's own proposed formula
43
+ — not a published metric. Always exposed with
44
+ `GBR_NOT_PEER_REVIEWED_WARNING`.
45
+
46
+ ## What's real here (core)
47
+
48
+ - **van Tiel et al. (2026, *HESS*)** — the strongest empirical anchor
49
+ in the whole P99–P103 series: during the extreme 2022 Swiss drought,
50
+ glacier melt across 88 catchments still substantially buffered
51
+ precipitation/snowmelt deficits — yet absolute summer meltwater
52
+ volume was already lower than 2003 in roughly two-thirds of studied
53
+ catchments. The buffer works AND its capacity is eroding, at the
54
+ same time, already observed, not projected.
55
+ - **Farinotti et al. (2016, *ERL*)** — the ~65% Alpine reservoir
56
+ summer-deficit ceiling, correctly scoped as a specific, regional,
57
+ scenario-bound estimate (not a universal constant — see
58
+ `FARINOTTI_2016_SCOPE_NOTE`).
59
+ - **Farinotti et al. (2019, *Nature*)** — global theoretical
60
+ ice-free-basin storage potential (875±260 km³ across ~185,000
61
+ glaciers), with only ~40% (355 km³) judged realistically suitable
62
+ after a first-pass screen.
63
+ - **Pritchard (2017, *Nature*)** and **Immerzeel et al. (2020,
64
+ *Nature*)** — glaciers as a disproportionate drought buffer, and the
65
+ Water Tower Index ranking mountain water systems by importance AND
66
+ vulnerability (1.9 billion people dependent globally).
67
+ - **Velasquez Casallas et al. (2025, *Ecosystem Services*)** — a
68
+ systematic review finding postglacial ecosystem services can
69
+ increase, but heterogeneously, with real trade-offs — never assume a
70
+ Nature-based Solution is hydrologically positive purely from its
71
+ label. `nbs_effect_is_guaranteed_positive()` always returns `False`.
72
+
73
+ ## Quickstart
74
+
75
+ ```bash
76
+ pip install distributed-buffer-resilience-utac
77
+ ```
78
+
79
+ ```python
80
+ from distributed_buffer_resilience_utac import (
81
+ SWISS_2022_DROUGHT,
82
+ buffer_functions_while_eroding,
83
+ reservoir_summer_deficit_ceiling_fraction,
84
+ GLOBAL_STORAGE_POTENTIAL,
85
+ is_disproportionate_drought_buffer,
86
+ nbs_effect_is_guaranteed_positive,
87
+ GBR_NOT_PEER_REVIEWED_WARNING,
88
+ glacier_buffer_replacement_score,
89
+ )
90
+
91
+ print(SWISS_2022_DROUGHT.catchment_count) # 88
92
+ print(buffer_functions_while_eroding()) # True
93
+ print(reservoir_summer_deficit_ceiling_fraction()) # 0.65
94
+ print(GLOBAL_STORAGE_POTENTIAL.realistic_km3) # 355.0
95
+ print(is_disproportionate_drought_buffer(10.0, 40.0)) # True
96
+ print(nbs_effect_is_guaranteed_positive()) # False
97
+
98
+ print(GBR_NOT_PEER_REVIEWED_WARNING)
99
+ score = glacier_buffer_replacement_score(
100
+ deficit_without_adaptation=[10.0, 10.0],
101
+ flow_gain_from_adaptation=[5.0, 0.0],
102
+ )
103
+ print(score) # 0.25
104
+ ```
105
+
106
+ ## Development
107
+
108
+ ```bash
109
+ pip install -e ".[dev]"
110
+ pre-commit install
111
+ ruff check src tests
112
+ mypy src
113
+ pytest
114
+ ```
115
+
116
+ ## Citation
117
+
118
+ See [CITATION.cff](CITATION.cff) and [.zenodo.json](.zenodo.json).
@@ -0,0 +1,11 @@
1
+ distributed_buffer_resilience_utac/__init__.py,sha256=5DC8ykR23BFT916FpUHgpi3fKBBs_ipsJXueh8FoNvg,2900
2
+ distributed_buffer_resilience_utac/constants.py,sha256=4qWppTDHrDixEUP2fGpBPzZtEBr7fX0K26J2rGDyBGg,8293
3
+ distributed_buffer_resilience_utac/drought_buffer.py,sha256=44lFc40uN0_iMiYBlGIcIGz_P5k_0uUUBivkkSDq9Eo,1768
4
+ distributed_buffer_resilience_utac/ecosystem_services.py,sha256=qPwk8LtBOtFTqPbWP-7vqhkI6d-m8ktW_28YAUH3r5s,1573
5
+ distributed_buffer_resilience_utac/gbr.py,sha256=4ixxWKTiDcNCZOKQ7tU-2sDeLPsdZJxpqGQZNWERe6k,3537
6
+ distributed_buffer_resilience_utac/storage_portfolio.py,sha256=XQiuhuC1aRcGQpOpikzyrj2r-ePxpIq2znLBLEQsYoU,3770
7
+ distributed_buffer_resilience_utac/water_towers.py,sha256=rUPiX53ycAtTBZQdCWwzWZaVAK4zDVqvzTuSRROOvrk,1816
8
+ distributed_buffer_resilience_utac-1.0.0.dist-info/METADATA,sha256=4z4lGmHqXpE4fJ5UJd1lTijRbZS4opMKRNQC_1hqHrs,4959
9
+ distributed_buffer_resilience_utac-1.0.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
10
+ distributed_buffer_resilience_utac-1.0.0.dist-info/licenses/LICENSE,sha256=UfpTMBvn-IvJa49zv4c4kFAjuS4DhXcmMOuTruky0e8,1069
11
+ distributed_buffer_resilience_utac-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JohannRömer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.