Skip to content

Commit

Permalink
Use ColdStart flag, remove WarmStart flag
Browse files Browse the repository at this point in the history
  • Loading branch information
StefaniaGrimaldi committed Nov 28, 2024
1 parent 5501537 commit 284c695
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 19 deletions.
8 changes: 3 additions & 5 deletions src/lisflood/global_modules/default_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
default_options = {'EnKF': False,
'InitLisflood': True,
'InitLisfloodwithoutSplit': False,
'WarmStart': False,
'ColdStart': False,
'MonteCarlo': False,
'SplitRouting': False,
'TemperatureInKelvin': False,
Expand Down Expand Up @@ -87,6 +87,7 @@
'repWaterDepthMaps': False,
'repWaterLevelMaps': False,
'repWaterLevelTs': False,
'repEtactBudykoTs': False,
'reportedmaps': {'AreaTotalAbstractionFromSurfaceWaterM3': ReportedMap(
name='AreaTotalAbstractionFromSurfaceWaterM3',
output_var='areatotal_withdrawal_SW_actual_M3', unit='m3', end=[],
Expand Down Expand Up @@ -1470,10 +1471,7 @@
restrictoption=['nonInit', 'wateruse'], operation=['']),
'WaterUseTS': TimeSeries(name='WaterUseTS', output_var='WUseSumM3', where='Gauges',
repoption=['repwateruseGauges'],
restrictoption=['nonInit', 'wateruse'], operation=['']),
#'Theta2AvUpsTS': TimeSeries(name='WaterUseTS', output_var='WUseSumM3', where='Gauges',
# repoption=['repStateGauges'],
# restrictoption=['nonInit'], operation=['']),
restrictoption=['nonInit', 'wateruse'], operation=['']),
'actETPUpsTS': TimeSeries(name='actETPUpsTS',
output_var='ESActPixel+self.var.TaPixel+self.var.TaInterceptionAll+self.var.EvaAddM3*self.var.M3toMM',
where='Gauges', repoption=['repRateUpsGauges'], restrictoption=['nonInit'],
Expand Down
4 changes: 2 additions & 2 deletions src/lisflood/hydrological_modules/soil.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def splitlanduse(array1, array2=None, array3=None):
# Set to zero if soil depth is zero.
# IMPORTANT: WInit1 and WInit2 represent the soil moisture in the *permeable* fraction of the pixel *only*
# (since all soil moisture-related calculations are done for permeable fraction only!).
if not option['InitLisflood'] and not option['WarmStart']:
if option['ColdStart']:
self.var.SeepTopToSubBAv[0] = loadmap('SeepTopToSubBAverageOtherMap')
self.var.SeepTopToSubBAv[1] = loadmap('SeepTopToSubBAverageForestMap')
self.var.SeepTopToSubBAv[2] = loadmap('SeepTopToSubBAverageIrrigationMap')
Expand All @@ -293,7 +293,7 @@ def splitlanduse(array1, array2=None, array3=None):
self.var.W2[iveg] = np.where(self.var.PoreSpaceNotZero2[iluse], ini_2, 0)


if not option['InitLisflood'] and not option['WarmStart']:
if option['ColdStart']:
check_prerun_results1 = np.min(ThetaInit2Value[iveg])
check_prerun_results2 = np.min(self.var.SeepTopToSubBAv[iluse])
check_prerun_results = np.min([check_prerun_results1,check_prerun_results2])
Expand Down
7 changes: 6 additions & 1 deletion src/lisfloodSettings_reference.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can use builtin path variables in this template and reference to other paths
# option to initialize Lisflood
<setoption choice="0" name="InitLisflood"/>
<setoption choice="0" name="InitLisfloodwithoutsplit"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="1" name="ColdStart"/>

# option to read/write NetCDF
<setoption choice="1" name="readNetcdfStack"/>
Expand Down Expand Up @@ -4054,6 +4054,11 @@ Days since last rain [days]
</comment>
</textvar>

<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
9 changes: 7 additions & 2 deletions tests/data/LF_ETRS89_UseCase/settings/base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<setoption choice="0" name="simulatePF"/>
<setoption choice="0" name="SplitRouting"/>
<setoption choice="0" name="InitLisflood"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="1" name="ColdStart"/>
<setoption choice="0" name="repEndMaps"/>
<setoption choice="0" name="repStateMaps"/>
<setoption choice="0" name="repDischargeTs"/>
Expand Down Expand Up @@ -3788,7 +3788,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Days since last rain [days]
</comment>
</textvar>


<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
9 changes: 7 additions & 2 deletions tests/data/LF_ETRS89_UseCase/settings/cold.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

# option to initialize Lisflood
<setoption choice="0" name="InitLisflood"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="1" name="ColdStart"/>

# option to read/write NetCDF
<setoption choice="1" name="readNetcdfStack"/>
Expand Down Expand Up @@ -3830,7 +3830,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Days since last rain [days]
</comment>
</textvar>


<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
7 changes: 6 additions & 1 deletion tests/data/LF_ETRS89_UseCase/settings/full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<setoption choice="1" name="simulatePF"/>
<setoption choice="1" name="SplitRouting"/>
<setoption choice="0" name="InitLisflood"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="1" name="ColdStart"/>
<setoption choice="0" name="cropsEPIC"/>

# report end maps and state maps
Expand Down Expand Up @@ -6081,6 +6081,11 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT

</textvar>

<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
7 changes: 6 additions & 1 deletion tests/data/LF_ETRS89_UseCase/settings/inflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<setoption choice="0" name="simulatePF"/>
<setoption choice="1" name="SplitRouting"/>
<setoption choice="0" name="InitLisflood"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="1" name="ColdStart"/>
<setoption choice="0" name="repEndMaps"/>
<setoption choice="0" name="repStateMaps"/>
<setoption choice="1" name="repDischargeTs"/>
Expand Down Expand Up @@ -3768,6 +3768,11 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
</comment>
</textvar>

<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
7 changes: 6 additions & 1 deletion tests/data/LF_ETRS89_UseCase/settings/prerun.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<setoption choice="0" name="simulatePF"/>
<setoption choice="1" name="SplitRouting"/>
<setoption choice="1" name="InitLisflood"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="0" name="ColdStart"/>
<setoption choice="0" name="repEndMaps"/>
<setoption choice="1" name="repStateMaps"/>
<setoption choice="1" name="repDischargeTs"/>
Expand Down Expand Up @@ -3764,6 +3764,11 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
</comment>
</textvar>

<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
7 changes: 6 additions & 1 deletion tests/data/LF_ETRS89_UseCase/settings/warm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# option to initialize Lisflood
<setoption choice="0" name="InitLisflood"/>
<setoption choice="1" name="WarmStart"/>
<setoption choice="0" name="ColdStart"/>

# option to read/write NetCDF
<setoption choice="1" name="readNetcdfStack"/>
Expand Down Expand Up @@ -3810,6 +3810,11 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
</comment>
</textvar>

<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
9 changes: 7 additions & 2 deletions tests/data/LF_lat_lon_UseCase/prerun_lat_lon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<setoption choice="1" name="SplitRouting"/>
<setoption choice="1" name="InitLisflood"/>
<setoption choice="0" name="InitLisfloodwithoutSplit"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="0" name="ColdStart"/>

<setoption choice="0" name="repEndMaps"/>
<setoption choice="0" name="repTopSoilMoistureMaps"/>
Expand Down Expand Up @@ -3597,7 +3597,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Days since last rain [days]
</comment>
</textvar>


<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down
7 changes: 6 additions & 1 deletion tests/data/LF_lat_lon_UseCase/run_lat_lon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<setoption choice="1" name="SplitRouting"/>
<setoption choice="0" name="InitLisflood"/>
<setoption choice="0" name="InitLisfloodwithoutSplit"/>
<setoption choice="0" name="WarmStart"/>
<setoption choice="1" name="ColdStart"/>

<setoption choice="0" name="repEndMaps"/>
<setoption choice="0" name="repTopSoilMoistureMaps"/>
Expand Down Expand Up @@ -3563,6 +3563,11 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
</comment>
</textvar>

<textvar name="actETPBUDYKOUpsTS" value="$(PathOut)/actETPBUDYKOUpsTS.tss">
<comment>
actual evapotranspiration (Budyko) [mm]
</comment>
</textvar>

</group>

Expand Down

0 comments on commit 284c695

Please sign in to comment.