$ conda install notebook pymt_hydrotrend
Command to download a local copy:
$ curl -O https://raw.githubusercontent.com/csdms/pymt/master/docs/demos/hydrotrend.ipynb
HydroTrend is a 2D hydrological water balance and transport model that simulates water discharge and sediment load at a river outlet. You can read more about the model, find references or download the source code at: https://csdms.colorado.edu/wiki/Model:HydroTrend.
This notebook is meant to give you a better understanding of what the model is capable of. In this example we are using a theoretical river basin of ~1990 km2, with 1200m of relief and a river length of ~100 km. All parameters that are shown by default once the HydroTrend Model is loaded are based on a present-day, temperate climate. Whereas these runs are not meant to be specific, we are using parameters that are realistic for the Waiapaoa River in New Zealand. The Waiapaoa River is located on North Island and receives high rain and has erodible soils, so the river sediment loads are exceptionally high. It has been called the "dirtiest small river in the world".
To learn more about HydroTrend and its approach to sediment supply modeling, you can download this presentation.
A more detailed description of applying HydroTrend to the Waipaoa basin, New Zealand has been published in WRR: hydrotrend_waipaoa_paper.
A more detailed description of applying HydroTrend to the Waipaoa basin, New Zealand has been published in WRR: hydrotrend_waipaoa_paper.
In [1]:
import matplotlib.pyplot as plt
import numpy as np
And load the HydroTrend plugin.
In [2]:
import pymt.models
hydrotrend = pymt.models.Hydrotrend()
HydroTrend will now be activated in PyMT.
In [3]:
# Set up Hydrotrend model by indicating the number of years to run
config_file, config_folder = hydrotrend.setup(run_duration=100)
In [4]:
hydrotrend.initialize(config_file, config_folder)
In [5]:
hydrotrend.output_var_names
Out[5]:
In [6]:
hydrotrend.start_time, hydrotrend.time, hydrotrend.end_time, hydrotrend.time_step, hydrotrend.time_units
Out[6]:
In [7]:
n_days = int(hydrotrend.end_time)
q = np.empty(n_days)
qs = np.empty(n_days)
cs = np.empty(n_days)
qb = np.empty(n_days)
for i in range(n_days):
hydrotrend.update()
q[i] = hydrotrend.get_value("channel_exit_water__volume_flow_rate")
qs[i] = hydrotrend.get_value("channel_exit_water_sediment~suspended__mass_flow_rate")
cs[i] = hydrotrend.get_value("channel_exit_water_sediment~suspended__mass_concentration")
qb[i] = hydrotrend.get_value("channel_exit_water_sediment~bedload__mass_flow_rate")
In [8]:
plt.plot(qs)
Out[8]:
In [9]:
(
(q.mean(), hydrotrend.get_var_units("channel_exit_water__volume_flow_rate")),
(cs.mean(), hydrotrend.get_var_units("channel_exit_water_sediment~suspended__mass_flow_rate")),
(qs.mean(), hydrotrend.get_var_units("channel_exit_water_sediment~suspended__mass_concentration")),
(qb.mean(), hydrotrend.get_var_units("channel_exit_water_sediment~bedload__mass_flow_rate"))
)
Out[9]:
In [10]:
hydrotrend.get_var_units("channel_exit_water__volume_flow_rate")
Out[10]:
In [11]:
flood_day = q.argmax()
flood_year = flood_day // 365
plt.plot(q[flood_year * 365: (flood_year + 1) * 365])
Out[11]:
In [12]:
q.max()
Out[12]:
In [13]:
qs_by_year = qs.reshape((-1, 365))
qs_annual = qs_by_year.sum(axis=1)
plt.plot(qs_annual)
Out[13]:
In [14]:
qs_annual.mean()
Out[14]:
To compare the mean annual load to other river systems you will need to calculate its sediment yield. Sediment Yield is defined as sediment load normalized for the river drainage area; so it can be reported in T/km2/yr.
A1d:
Now we will look at changing climatic conditions in a small river basin. We'll change temperature and precipitation regimes and compare discharge and sediment load characteristics to the original basecase. And we will look at the are potential implications of changes in the peak events.
Modify the mean annual temperature T, the mean annual precipitation P, and its the variability of the yearly means through the standard deviation. You can specify trends over time, by modifying the parameter ‘change in mean annual temperature’ or ‘change in mean annual precipitation’. HydroTrend runs at daily timestep, and thus can deal with seasonal variations in temperature and precipitation for a basin. The model ingests monthly mean input values for these two climate parameters and their monthly standard deviations, ideally the values would be derived from analysis of a longterm record of daily climate data. You can adapt seasonal trends by using the monthly values.
Here we will look at the effect of human in a river basin. Humans can accelerate erosion processes, or reduce the sediment loads traveling through a river system. Both concepts can be simulated, first run 3 simulations systematically increasing the anthropogenic factor (0.5-8.0 is the range).
Model a scenario of a drinking water supply reservoir to be planned in the coastal area of the basin. The reservoir would have 800 km 2of contributing drainage area and be 3 km long, 200m wide and 100m deep. Set up a simulation with these parameters.
In [ ]: