Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing warm start and updating reference results for MCT #182

Merged
merged 32 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f8c882e
Reverted to using ChanM3Kin for first iteration in evapowater
Dec 11, 2024
282d6b6
Updating avg river discharge when instantaneous discharge is zero
Dec 16, 2024
9cc5e12
Fix to warm start when river channel is empty
Dec 17, 2024
651a226
Fixed water balance in mct when ql<0
Dec 17, 2024
e905da5
bugfix
Dec 18, 2024
df2fffc
removing reference results
Dec 18, 2024
dbfef19
updating reference results for MCT results test (slow)
Dec 18, 2024
09252ab
updating MCT results test (slow)
Dec 18, 2024
d5ebb4d
updating reference results for MCT results test (fast)
Dec 18, 2024
e052a4a
Fixing warm start for MCT and updating reference results
Dec 18, 2024
e126022
Reverting back to using ChanM3Kin to calculate openwaterevapo. This s…
Jan 10, 2025
b7ffcb1
Fixed WB calculation for reservoirs when using MCT
Jan 10, 2025
4b9979a
Using average flow in WB calculation for lakes
Jan 13, 2025
b89d35b
Refactored lakes computation using average inflow and outflow
Jan 13, 2025
400eda1
Adding PrevDischargeAvg to the state files.
Jan 17, 2025
0045cac
Implementing use of average discharge for reservoirs and lakes with b…
Jan 24, 2025
4daba4b
Differentiating evapowater calculation between kin-mct ans split rou…
Jan 28, 2025
c2f9afb
Updating MCT reference results for fast tests.
Jan 28, 2025
19be99d
Updating MCT reference results for slow tests
Jan 29, 2025
1867eed
Restoring test_results and bugfix
Jan 30, 2025
ca58569
Updated reference files for tests with MCT off
doc78 Feb 3, 2025
9bf9419
Removed output files
doc78 Feb 3, 2025
5d4987c
Restoring water abstraction from first line of routing when using spl…
Feb 6, 2025
bf55623
Updating documentation
Feb 7, 2025
0cf0271
Fixing conflicts
Feb 7, 2025
ca5afe6
Merge branch 'feature/mct_optim' into feature/mct_optim_results_update
doc78 Feb 11, 2025
be362ce
Updated references with new reservoir routine (before water abstracti…
doc78 Feb 11, 2025
534da40
Merge water abstraction changes
doc78 Feb 11, 2025
19d6f73
Merge branch 'feature/mct_optim_results_update' of https://github.com…
doc78 Feb 11, 2025
b0f9d05
Minor xml clean up
doc78 Feb 11, 2025
40d436c
Updated unit test reference files
doc78 Feb 12, 2025
88650b6
Added warning for reservoir negative values. Minor cleanup
doc78 Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,778 changes: 892 additions & 886 deletions docs/4_annex_settings_and_options/index.md

Large diffs are not rendered by default.

75 changes: 38 additions & 37 deletions docs/4_annex_state-variables/index.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
**Table:** *State variables.*

| Key | LISFLOOD file name | LISFLOOD variable | Unit | Description |
| ------------------------------ | ------------------ | --------------------- | ---- | ------------------------------------------------------------ |
| OFDirectState | ofdir | OFM3Direct | m3 | Water volume on catchment surface for direct fraction [m3] |
| OFOtherState | ofoth | OFM3Other | m3 | Water volume on catchment surface for other fraction [m3] |
| OFForestState | offor | OFM3Forest | m3 | Water volume on catchment surface for forest fraction [m3] |
| ChanCrossSectionState | chcro | TotalCrossSectionArea | m | Total cross-section area of channel |
| DSLRState | dslr | DSLR[0] | day | Reported days since last rain |
| DSLRForestState | dslf | DSLR[1] | day | Reported days since last rain for forest |
| DSLRIrrigationState | dsli | DSLR[2] | day | Reported days since last rain irrigation |
| SnowCoverAState | scova | SnowCoverS[0] | mm | Reported snow cover in snow zone A [mm] |
| SnowCoverBState | scovb | SnowCoverS[1] | mm | Reported snow cover in snow zone B [mm] |
| SnowCoverCState | scovc | SnowCoverS[2] | mm | Reported snow cover in snow zone C [mm] |
| FrostIndexState | frost | FrostIndex | C/day| Reported frost index |
| CumInterceptionState | cum | CumInterception[0] | mm | Reported interception storage |
| CumInterceptionForestState | cumf | CumInterception[1] | mm | Reported interception storage for forest |
| CumInterceptionIrrigationState | cumi | CumInterception[2] | mm | Reported interception storage for irrigation |
| Theta1State | tha | Theta1a[0] | - | Reported volumetric soil moisture content for top soil layer 1a [V/V] |
| Theta1ForestState | thfa | Theta1a[1] | - | Reported volumetric soil moisture content for top soil layer 1a forest fraction [V/V] |
| Key | LISFLOOD file name | LISFLOOD variable | Unit | Description |
|--------------------------------|--------------------|-----------------------| ---- |---------------------------------------------------------------------------------------------|
| OFDirectState | ofdir | OFM3Direct | m3 | Water volume on catchment surface for direct fraction [m3] |
| OFOtherState | ofoth | OFM3Other | m3 | Water volume on catchment surface for other fraction [m3] |
| OFForestState | offor | OFM3Forest | m3 | Water volume on catchment surface for forest fraction [m3] |
| ChanCrossSectionState | chcro | TotalCrossSectionArea | m | Total cross-section area of channel |
| DSLRState | dslr | DSLR[0] | day | Reported days since last rain |
| DSLRForestState | dslf | DSLR[1] | day | Reported days since last rain for forest |
| DSLRIrrigationState | dsli | DSLR[2] | day | Reported days since last rain irrigation |
| SnowCoverAState | scova | SnowCoverS[0] | mm | Reported snow cover in snow zone A [mm] |
| SnowCoverBState | scovb | SnowCoverS[1] | mm | Reported snow cover in snow zone B [mm] |
| SnowCoverCState | scovc | SnowCoverS[2] | mm | Reported snow cover in snow zone C [mm] |
| FrostIndexState | frost | FrostIndex | C/day| Reported frost index |
| CumInterceptionState | cum | CumInterception[0] | mm | Reported interception storage |
| CumInterceptionForestState | cumf | CumInterception[1] | mm | Reported interception storage for forest |
| CumInterceptionIrrigationState | cumi | CumInterception[2] | mm | Reported interception storage for irrigation |
| Theta1State | tha | Theta1a[0] | - | Reported volumetric soil moisture content for top soil layer 1a [V/V] |
| Theta1ForestState | thfa | Theta1a[1] | - | Reported volumetric soil moisture content for top soil layer 1a forest fraction [V/V] |
| Theta1IrrigationState | thia | Theta1a[2] | - | Reported volumetric soil moisture content for top soil layer 1a irrigation fraction [V/V] |
| Theta2State | thb | Theta1b[0] | - | Reported volumetric soil moisture content for soil layer 1b [V/V] |
| Theta2ForestState | thfb | Theta1b[1] | - | Reported volumetric soil moisture content for soil layer 1b forest fraction [V/V] |
| Theta2IrrigationState | thib | Theta1b[2] | - | Reported volumetric soil moisture content for soil layer 1b irrigation fraction [V/V] |
| Theta3State | thc | Theta2[0] | - | Reported volumetric soil moisture content for soil layer 2 [V/V] |
| Theta3ForestState | thfc | Theta2[1] | - | Reported volumetric soil moisture content for soil layer 2 forest fraction [V/V] |
| Theta3IrrigationState | thic | Theta2[2] | - | Reported volumetric soil moisture content for soil layer 2 irrigation fraction [V/V] |
| UZState | uz | UZ[0] | mm | Reported storage in upper groundwater zone response box [mm] |
| UZForestState | uzf | UZ[1] | mm | Reported storage in upper groundwater zone response box for forest [mm] |
| UZIrrigationState | uzi | UZ[2] | mm | Reported storage in upper groundwater zone response box for irrigation [mm] |
| LZState | lz | LZ | mm | Reported storage in lower response box [mm] |
| CumIntSealedState | cseal | CumInterSealed | mm | Reported cumulative depressions storage [mm] |
| DischargeMaps | dis | ChanQAvg | m3/s | Reported discharge [cu m/s] (average over the timesteps) (not used for warm start) |
| ChanQState | chanq | ChanQ | m3/s | Reported istantaneous discarge at end of time step |
| LakeLevelState | lakeh | LakeLevel | m | Output map(s) with lake level [m] |
| LakePrevInflowState | lakeprevinq | LakeInflowOld | m3/s | Output map with lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] |
| LakePrevOutflowState | lakeprevoutq | LakeOutflow | m3/s | Output map with lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] |
| ReservoirFillState | rsfil | ReservoirFill | - | Output map(s) with Reservoir Filling [V/V] |
| CrossSection2State | ch2cr | CrossSection2Area | m2 | Cross section area for split routing [m2] |
| ChSideState | chside | Sideflow1Chan | m2/s | Sideflow to channel for 1st line of routing [m2/s] |
| Theta2State | thb | Theta1b[0] | - | Reported volumetric soil moisture content for soil layer 1b [V/V] |
| Theta2ForestState | thfb | Theta1b[1] | - | Reported volumetric soil moisture content for soil layer 1b forest fraction [V/V] |
| Theta2IrrigationState | thib | Theta1b[2] | - | Reported volumetric soil moisture content for soil layer 1b irrigation fraction [V/V] |
| Theta3State | thc | Theta2[0] | - | Reported volumetric soil moisture content for soil layer 2 [V/V] |
| Theta3ForestState | thfc | Theta2[1] | - | Reported volumetric soil moisture content for soil layer 2 forest fraction [V/V] |
| Theta3IrrigationState | thic | Theta2[2] | - | Reported volumetric soil moisture content for soil layer 2 irrigation fraction [V/V] |
| UZState | uz | UZ[0] | mm | Reported storage in upper groundwater zone response box [mm] |
| UZForestState | uzf | UZ[1] | mm | Reported storage in upper groundwater zone response box for forest [mm] |
| UZIrrigationState | uzi | UZ[2] | mm | Reported storage in upper groundwater zone response box for irrigation [mm] |
| LZState | lz | LZ | mm | Reported storage in lower response box [mm] |
| CumIntSealedState | cseal | CumInterSealed | mm | Reported cumulative depressions storage [mm] |
| DischargeMaps | dis | ChanQAvg | m3/s | Reported average discharge over the model time step (not used for warm start) [m3/s] |
| ChanQState | chanq | ChanQ | m3/s | Reported istantaneous discarge at end of the model time step [m3/s] |
| ChanQAvgDtState | chanqavgdt | ChanQAvgDt | m3/s | Reported average discarge for the last routing sub-step [m3/s] |
| LakeLevelState | lakeh | LakeLevel | m | Output map(s) with lake level [m] |
| LakePrevInflowState | lakeprevinq | LakeInflowOld | m3/s | Output map with lake average inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] |
| LakePrevOutflowState | lakeprevoutq | LakeOutflow | m3/s | Output map with lake average outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] |
| ReservoirFillState | rsfil | ReservoirFill | - | Output map(s) with Reservoir Filling [V/V] |
| CrossSection2State | ch2cr | CrossSection2Area | m2 | Cross section area for split routing [m2] |
| ChSideState | chside | Sideflow1Chan | m2/s | Sideflow to channel for 1st line of routing [m2/s] |
Original file line number Diff line number Diff line change
Expand Up @@ -4959,7 +4959,7 @@ Map with location of reservoirs (number)
</comment>
</textvar>

<textvar name="ReservoirInitialFillValue" value="$(ReservoirInitialFillValue)">
<textvar name="ReservoirInitialFill" value="$(ReservoirInitialFill)">
<comment>
Initial reservoir storage (fraction)
</comment>
Expand Down
19 changes: 14 additions & 5 deletions src/lisflood/global_modules/default_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,20 @@
yearly=False),
'ChanQEnd': ReportedMap(name='ChanQEnd', output_var='ChanQ', unit='m3/s',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
restrictoption=['simulateReservoirs','simulateLakes'], monthly=False, yearly=False),
'ChanQState': ReportedMap(name='ChanQState', output_var='ChanQ', unit='m3/s',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),

'ChanQAvgDtEnd': ReportedMap(name='ChanQAvgDtEnd', output_var='ChanQAvgDt', unit='m3/s',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
'ChanQAvgDtState': ReportedMap(name='ChanQAvgDtState', output_var='ChanQAvgDt', unit='m3/s',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),

'consumption_required_domestic_M3MonthRegion': ReportedMap(name='consumption_required_domestic_M3MonthRegion',
output_var='consumption_required_domestic_M3MonthRegion',
unit='M3', end=[],
Expand Down Expand Up @@ -681,17 +690,17 @@
yearly=False),
'PrevCmMCTEnd': ReportedMap(name='PrevCmMCTEnd', output_var='PrevCm0', unit='-',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
restrictoption=['nonInit','MCTRouting'], monthly=False, yearly=False),
'PrevCmMCTState': ReportedMap(name='PrevCmMCTState', output_var='PrevCm0', unit='-',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
restrictoption=['nonInit','MCTRouting'], monthly=False,
yearly=False),
'PrevDmMCTEnd': ReportedMap(name='PrevDmMCTEnd', output_var='PrevDm0', unit='-',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
restrictoption=['nonInit','MCTRouting'], monthly=False, yearly=False),
'PrevDmMCTState': ReportedMap(name='PrevDmMCTState', output_var='PrevDm0', unit='-',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
restrictoption=['nonInit','MCTRouting'], monthly=False,
yearly=False),
'PolderLevelEnd': ReportedMap(name='PolderLevelEnd', output_var='PolderLevel',
unit='m', end=['repEndMaps'], steps=[],
Expand Down
11 changes: 9 additions & 2 deletions src/lisflood/hydrological_modules/evapowater.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,15 @@ def dynamic(self):
UpstreamEva = self.var.EWRef * self.var.MMtoM3 * self.var.WaterFraction
# evaporation for loop is amount of water per timestep [cu m]
# Volume of potential evaporation from water surface per time step (conversion to [m3])
# ChanMIter = self.var.ChanM3Kin.copy()
ChanMIter = self.var.ChanM3.copy()

if (not (option['InitLisflood'])) and (option['SplitRouting']):
ChanMIter = self.var.ChanM3Kin.copy()
# for Iteration loop: First value is amount of water in the channel
# amount of water in bankful (first line of routing)
else:
ChanMIter = self.var.ChanM3.copy() # generates error in mBE
# for Iteration loop: First value is amount of water in the channel
# amount of water in channel

ChanLeft = ChanMIter * 0.1
# 10% of the volume must stay in the river
Expand All @@ -157,6 +163,7 @@ def dynamic(self):

self.var.EvaAddM3Dt = self.var.EvaAddM3 * self.var.InvNoRoutSteps
# splitting water use per timestep into water use per sub time step

self.var.EvaCumM3 += self.var.EvaAddM3
self.var.EvaWBM3 = self.var.EvaAddM3
# summing up for water balance calculation
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def solve1Pixel(
# If old discharge, upstream inflow and lateral inflow are below accuracy: set discharge to 0 and exit
if upstream_inflow <= NEWTON_TOL:
discharge[pix] = 0
return False
return True

# Initial discharge guess using analytically derived boundary values
a_cpui_pow_b_m_1 = b_a_dx_div_dt * upstream_inflow**b_minus_1
Expand All @@ -125,7 +125,7 @@ def solve1Pixel(
# If iterations converge to NEWTON_TOL, set value to 0
if dis == NEWTON_TOL:
discharge[pix] = 0
return False
return True

discharge[pix] = dis
return True
Expand Down Expand Up @@ -164,6 +164,7 @@ def solve1PixelAvg(
# integration on control volume to calc average outflow (channel water mass balance)
discharge_avg[pix] = upstream_inflow_avg + lateral_inflow + a_dx*(channel_volume_start - channel_volume_end) * inv_time_delta


# avoid negative average discharge
if discharge_avg[pix] < 0:
discharge_avg[pix] = 0
Expand Down
Loading