Title: | Modular Hydrological Model |
---|---|
Description: | The HBV hydrological model (Bergström, S. and Lindström, G., (2015) <doi:10.1002/hyp.10510>) has been split in modules to allow the user to build his/her own model. This version was developed by the author in IANIGLA-CONICET (Instituto Argentino de Nivologia, Glaciologia y Ciencias Ambientales - Consejo Nacional de Investigaciones Cientificas y Tecnicas) for hydroclimatic studies in the Andes. HBV.IANIGLA incorporates routines for clean and debris covered glacier melt simulations. |
Authors: | Ezequiel Toum <[email protected]> |
Maintainer: | Ezequiel Toum <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2.6.999 |
Built: | 2024-10-22 04:47:08 UTC |
Source: | https://gitlab.com/ezetoum27/hbv.ianigla |
A dataset containing all necessary information to simulate a three year
glacier surface mass balance. The ice body is located on Monte Tronador,
nearby the border between Argentina and Chile in the Andes of Northern Patagonia.
Alerce is a medium size mountain glacier with an area of about 2.33 km2 that
ranges between 1629 and 2358 masl
and it shows a SE aspect (IANIGLA-ING, 2018).
alerce_data
alerce_data
A list with five elements
data frame with the estimated annual mass balance and the acceptable uncertainty bounds.
data frame containing the first fix days of the winter and summer mass balances.
data frame with the precipitation gauge and air temperatures records. The former series is recorded at Puerto Montt's station (Chile) and the last one is measured at Bariloche's airport (Argentina)
data frame with: elevation zone number, minimum, maximum and mean altitude values for the elevation range and the relative area.
numeric vector with the stations heights. Air temperature refers to
Bariloche's airport and precipitation to Puerto Montt station. Units are in masl
(meters
above sea level).
IANIGLA-ING. IANIGLA-Inventario Nacional de Glaciares. 2018. Informe de las subcuencas de los ríos Manso, Villegas y Foyel. Cuenca de los ríos Manso y Puelo. IANIGLA-CONICET, Ministerio de Ambiente y Desarrollo Sustentable de la Nación. Technical report, IANIGLA, 2018b.[p8]
Computes crop reference evapotranspiration using Hargreaves equation (Hargreaves and Allen, 2003).
do_evap_hargreaves( m_tmean, m_tmax, m_tmin, m_kin )
do_evap_hargreaves( m_tmean, m_tmax, m_tmin, m_kin )
m_tmean |
numeric matrix with daily mean air temperature
|
m_tmax |
numeric matrix with daily maximum air temperature
|
m_tmin |
numeric matrix with daily minimum air temperature
|
m_kin |
numeric matrix with daily total incoming
extraterrestrial solar radiation |
List object with the following numeric matrices
(ncol = number of zones
):
evap_ref
.
The equation used by the model is:
if the temperature value is below , the model sets it to
. The
value is to convert
to
.
Allows you to simulate snow accumulation, snow and ice melting processes using a temperature index approach.
do_glacier( m_tair, m_rainfall, m_snowfall, v_glacier_vol, swe_init, m_param )
do_glacier( m_tair, m_rainfall, m_snowfall, v_glacier_vol, swe_init, m_param )
m_tair |
numeric matrix with air temperatures
|
m_rainfall |
numeric matrix with rainfall
|
m_snowfall |
numeric matrix with snowfall
|
v_glacier_vol |
numeric vector with glacier
volume |
swe_init |
double with initial snow water equivalent
over the glacier |
m_param |
numeric matrix with parameters
(
|
List object with the following numeric matrices
(ncol = number of zones
):
rainfall
.
snowfall
.
swe
.
snow_melt
.
ice_melt
.
total_melt = snow_melt + ice_melt
.
ice_vol
.
cum = snowfall - total_melt
.
water = rainfall + total_melt
.
Implement a conceptual water storage and
release formulation for glacier runoff
routing (Glacier_Disch
).
do_glacier_route( model, m_input, init_cond, v_param )
do_glacier_route( model, m_input, init_cond, v_param )
model |
numeric integer with the model's choice.
The current HBV.IANIGLA version only supports
the S08 approach (see |
m_input |
numeric matrix with two columns: Model 1
|
init_cond |
numeric value with the initial glacier reservoir
water content |
v_param |
numeric vector with the following values: Model 1 (S08)
|
Numeric matrix with the following columns:
Model 1 (S08)
Q
: glacier discharge .
SG
: glacier's bucket water storage
content series .
do_hbv
allows you to run a full
hydro-glaciological model at once. This function is
designed to facilitate the use of the package, internally
coupling all the modules that HBV.IANIGLA offers. The
user only has to take care of providing the
input data, initial conditions and parameters.
do_hbv(data_hipso, data_meteo, data_shortwave, station_altitude, rh_option = "e_vap", pphase_model = "harder", pphase_period = "1 day", tair_param, precip_param, snow_init, snow_param, glacier_init, glacier_param, glacier_route_init, glacier_route_param, soil_init, soil_param, route_model, route_init, route_param, transfer_param)
do_hbv(data_hipso, data_meteo, data_shortwave, station_altitude, rh_option = "e_vap", pphase_model = "harder", pphase_period = "1 day", tair_param, precip_param, snow_init, snow_param, glacier_init, glacier_param, glacier_route_init, glacier_route_param, soil_init, soil_param, route_model, route_init, route_param, transfer_param)
data_hipso |
data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr) with the following columns (respect the column names):
|
data_meteo |
data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr) with the following columns (respect the column names):
|
data_shortwave |
data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr) with the following columns (respect the column names):
|
station_altitude |
numeric vector with two elements:
The values are used to extrapolate these variables to other altitudes in the basin. |
rh_option |
string with assumption used to extrapolate relative humidity to other altitudes:
|
pphase_model |
string with model's choice: "harder" - "ding".
Default is set to |
pphase_period |
string with one of the following options
(just for * "15 min" * "1 hour" * "1 day" |
tair_param |
numeric vector with the following parameters:
|
precip_param |
numeric vector with the following parameters:
|
snow_init |
double with initial snow water equivalent
|
snow_param |
numeric matrix with the following
parameters (
|
glacier_init |
numeric vector with the following
initial values (see also
|
glacier_param |
numeric matrix with the following
parameters (
|
glacier_route_init |
numeric value with the initial
glacier reservoir water content |
glacier_route_param |
numeric vector with the
following parameters (see
|
soil_init |
double with initial soil water content
|
soil_param |
numeric matrix with the following
parameters (
|
route_model |
numeric integer indicating which
reservoir formulation to use (see |
route_init |
numeric vector with initial state variables
(see |
route_param |
numeric vector with model parameters
(see |
transfer_param |
numeric vector with the base transfer
function (see |
A list with the following elements:
Harder, P., Pomeroy, J.W., Westbrook, C.J., 2015. Hydrological resilience of a Canadian Rockies headwaters basin subject to changing climate, extreme weather, and forest management. Hydrological Processes 29, 3905–3924. https://doi.org/10.1002/hyp.10596
Ding, B., Yang, K., Qin, J., Wang, L., Chen, Y., He, X., 2014. The dependence of precipitation types on surface elevation and meteorological conditions and its parameterization. Journal of Hydrology 513, 154–163. https://doi.org/10.1016/j.jhydrol.2014.03.038
do_hbv_run
allows you to run a full
hydro-glaciological model at once. This function is
designed to facilitate the use of the package, internally
coupling all the modules that HBV.IANIGLA offers. The
user only has to take care of providing the
input data, initial conditions and parameters.
do_hbv_run( data_hipso, data_meteo, data_shortwave, station_altitude, rh_option, pphase_model, pphase_period, tair_param, precip_param, snow_init, snow_param, glacier_init, glacier_param, glacier_route_init, glacier_route_param, soil_init, soil_param, route_model, route_init, route_param, transfer_param)
do_hbv_run( data_hipso, data_meteo, data_shortwave, station_altitude, rh_option, pphase_model, pphase_period, tair_param, precip_param, snow_init, snow_param, glacier_init, glacier_param, glacier_route_init, glacier_route_param, soil_init, soil_param, route_model, route_init, route_param, transfer_param)
data_hipso |
data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr) with the following columns (respect the column names):
|
data_meteo |
data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr) with the following columns (respect the column names):
|
data_shortwave |
data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr) with the following columns (respect the column names):
|
station_altitude |
numeric vector with two elements:
The values are used to extrapolate these variables to other altitudes in the basin. |
rh_option |
string with assumption used to extrapolate relative humidity to other altitudes:
|
pphase_model |
string with model's choice: "harder" - "ding".
Default is set to |
pphase_period |
string with one of the following options
(just for
|
tair_param |
numeric vector with the following parameters:
|
precip_param |
numeric vector with the following parameters:
|
snow_init |
double with initial snow water equivalent
|
snow_param |
numeric matrix with the following
parameters (
|
glacier_init |
numeric vector with the following
initial values (see also
|
glacier_param |
numeric matrix with the following
parameters (
|
glacier_route_init |
numeric value with the initial
glacier reservoir water content |
glacier_route_param |
numeric vector with the
following parameters (see
|
soil_init |
double with initial soil water content
|
soil_param |
numeric matrix with the following
parameters (
|
route_model |
numeric integer indicating which
reservoir formulation to use (see |
route_init |
numeric vector with initial state variables
(see |
route_param |
numeric vector with model parameters
(see |
transfer_param |
numeric vector with the base transfer
function (see |
A list with the following elements:
Harder, P., Pomeroy, J.W., Westbrook, C.J., 2015. Hydrological resilience of a Canadian Rockies headwaters basin subject to changing climate, extreme weather, and forest management. Hydrological Processes 29, 3905–3924. https://doi.org/10.1002/hyp.10596
Ding, B., Yang, K., Qin, J., Wang, L., Chen, Y., He, X., 2014. The dependence of precipitation types on surface elevation and meteorological conditions and its parameterization. Journal of Hydrology 513, 154–163. https://doi.org/10.1016/j.jhydrol.2014.03.038
Allows you to estimate precipitation phase using a the model proposed by Ding et al. (2014).
do_pphase_ding( m_tair, m_rh, m_precip, v_altitude )
do_pphase_ding( m_tair, m_rh, m_precip, v_altitude )
m_tair |
numeric matrix with air temperatures
|
m_rh |
numeric matrix with relative
humidity |
m_precip |
numeric matrix with total precipitation
|
v_altitude |
numeric vector with the mean altitude
of each elevation zone |
List object with the following numeric matrices
(ncol = number of zones
):
rainfall
.
snowfall
.
The model was developed using daily data.
Allows you to estimate precipitation phase using a psychrometric energy balance method (Harder and Pomeroy, 2013).
do_pphase_harder( m_tair, m_rh, m_precip, period = "1 day" )
do_pphase_harder( m_tair, m_rh, m_precip, period = "1 day" )
m_tair |
numeric matrix with air temperatures
|
m_rh |
numeric matrix with relative
humidity |
m_precip |
numeric matrix with total precipitation
|
period |
string with the recorded precipitation time-step:
|
List object with the following numeric matrices
(ncol = number of zones
):
rainfall
.
snowfall
.
Computes precipitation using an extrapolation linear model.
do_precip_gradient( v_precip, station_alt, v_altitude, v_grad )
do_precip_gradient( v_precip, station_alt, v_altitude, v_grad )
v_precip |
numeric vector with precipitation series
|
station_alt |
altitude of the precipitation station
|
v_altitude |
numeric vector with target altitudes
|
v_grad |
numeric vector with the following elements:
|
List with extrapolated precipitation numeric matrix
(ncol = number of zones
).
Allows you to rescale the zone outputs (from
do_xx
routines) into a single response using relative
areas.
do_rescale( x, area )
do_rescale( x, area )
x |
list output coming from |
area |
numeric vector with relative area of every
zone ( |
Numeric matrix with do_xx
routine variables
scaled according to area
argument.
Computes relative humidity using an extrapolation linear model.
do_rh_gradient( v_tair, v_rh, station_alt, v_altitude, v_grad, option = "e_vap" )
do_rh_gradient( v_tair, v_rh, station_alt, v_altitude, v_grad, option = "e_vap" )
v_tair |
numeric vector with air temperatures series
|
v_rh |
numeric vector with relative humidity series
|
station_alt |
altitude of the air temperature and
relative humidity stations |
v_altitude |
numeric vector with target altitudes
|
v_grad |
numeric vector with the following elements:
|
option |
string with:
|
List with extrapolated relative humidity
numeric matrix with (ncol = number of zones
).
Implement one of the five different
bucket formulations for runoff routing. The output
of this function is the input series of the
transfer function (do_transfer
).
do_route( model, v_recharge, v_init_cond, v_param )
do_route( model, v_recharge, v_init_cond, v_param )
model |
numeric integer indicating which
reservoir formulation to use (see |
v_recharge |
numeric vector with recharge from soil routine
(after applying |
v_init_cond |
numeric vector with initial state variables
(see |
v_param |
numeric vector with model parameters
(see |
Numeric matrix with the columns depending upon
model
choice (see Routing_HBV
).
Allows you to simulate snow accumulation and melting processes using a temperature index approach.
do_snow( m_tair, m_rainfall, m_snowfall, swe_init, m_param )
do_snow( m_tair, m_rainfall, m_snowfall, swe_init, m_param )
m_tair |
numeric matrix with air temperatures
|
m_rainfall |
numeric matrix with rainfall
|
m_snowfall |
numeric matrix with snowfall
|
swe_init |
double with initial snow water equivalent
|
m_param |
numeric matrix with parameters
(
|
List object with the following numeric matrices
(ncol = number of zones
):
rainfall
.
snowfall
.
swe
.
melt
.
qflow
: rainfall + melt
.
Allows you to account for actual evapotranspiration, abstractions, antecedent conditions and effective runoff. The formulation enables non linear relationships between soil box water input (rainfall plus snowmelt) and the effective runoff.
do_soil( m_qflow, m_pet, m_swe, swc, m_param )
do_soil( m_qflow, m_pet, m_swe, swc, m_param )
m_qflow |
numeric matrix with total water generated
in |
m_pet |
numeric matrix with potential evapotranspiration
|
m_swe |
numeric matrix with snow water equivalent
simulations (from |
swc |
double with initial soil water content
|
m_param |
numeric matrix with parameters
(
|
List object with the following numeric matrices
(ncol = number of zones
):
soil_moisture
.
actual_evap
.
recharge
.
Computes air temperature using an extrapolation linear model.
do_tair_gradient( v_tair, station_alt, v_altitude, v_grad )
do_tair_gradient( v_tair, station_alt, v_altitude, v_grad )
v_tair |
numeric vector with air temperatures series
|
station_alt |
altitude of the air temperature station
|
v_altitude |
numeric vector with target altitudes
|
v_grad |
numeric vector with the following elements:
|
List with extrapolated air temperatures
numeric matrix (ncol = number of zones
).
Use a triangular transfer function to adjust the timing of the simulated streamflow discharge. This module represents the runoff routing in the streams.
do_transfer( model, v_qflow, v_param )
do_transfer( model, v_qflow, v_param )
model |
numeric integer with the transfer
function model (see |
v_qflow |
numeric vector with the water
that gets into the stream (see |
v_param |
numeric vector with the base transfer
function (see |
Numeric vector with the simulated streamflow discharge.
Creates a set of K
chains.
v_param_lwr |
numeric vector with lower bound parameters. |
v_param_upp |
numeric vector with upper bound parameters. |
K |
number of chains to create. |
List with K
initial matrices.
Decides which parameter to update
n_param |
integer with parameter vector size. |
CR |
integer with crossover values. It defines the size of the probability vector. |
Integer binary vector. A 1
value indicates
parameter update.
Binds a numeric vector v
as the new last row of the numeric matrix m
.
m |
numeric matrix |
v |
numeric vector |
Numeric matrix
Calculates e*
tair |
a double with air temperature |
A double with saturated water vapor pressure .
Implement the conceptual water storage and release formulation for glacier runoff routing. The current model version follows the approach proposed by Stahl et al. (2008) (hereafter S08) for the Bridge River basin. Note that the bucket storage and release concepts for glacier runoff modeling are also described in Jansson et al. (2002).
Glacier_Disch( model, inputData, initCond, param )
Glacier_Disch( model, inputData, initCond, param )
model |
numeric integer with the model's choice. The current HBV.IANIGLA version only supports the S08 approach.
|
inputData |
numeric matrix with two columns: Model 1
|
initCond |
numeric value with the initial glacier reservoir
water content |
param |
numeric vector with the following values: Model 1 (S08)
|
Numeric matrix with the following columns:
Model 1 (S08)
Q
: glacier discharge .
SG
: glacier's bucket water storage content series .
Jansson, P., Hock, R., Schneider, T., 2003. The concept of glacier storage: a review. J. Hydrol., Mountain Hydrology and Water Resources 282, 116–129. https://doi.org/10.1016/S0022-1694(03)00258-0
Stahl, K., Moore, R.D., Shea, J.M., Hutchinson, D., Cannon, A.J., 2008. Coupled modelling of glacier and streamflow response to future climate scenarios. Water Resour. Res. 44, W02422. https://doi.org/10.1029/2007WR005956
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Create an input data and run the module DataMatrix <- cbind( runif(n = 100, min = 0, max = 50), runif(n = 100, min = 0, max = 200) ) dischGl <- Glacier_Disch(model = 1, inputData = DataMatrix, initCond = 100, param = c(0.1, 0.9, 10))
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Create an input data and run the module DataMatrix <- cbind( runif(n = 100, min = 0, max = 50), runif(n = 100, min = 0, max = 200) ) dischGl <- Glacier_Disch(model = 1, inputData = DataMatrix, initCond = 100, param = c(0.1, 0.9, 10))
A dataset containing all the necessary information to simulate almost 15 year of catchment streamflow in a synthetic basin. This example was though to improve user's skills on the HBV.IANIGLA.
glacio_hydro_hbv
glacio_hydro_hbv
A list with five elements
data frame containing elevation band names and the hypsometric values for modeling the catchment.
numeric matrix with the air temperature series (columns) for the 15 elevation bands.
numeric matrix with the precipitation series (columns) for the 15 elevation bands.
numeric matrix with the potential evapotranspiration series (columns) for the 15 elevation bands.
numeric matrix containing the total basin discharge, the streamflow coming from the soil portion of the basin and the part that is generated in the glaciers.
Here you will find what I consider the starting point dataset to begin the modeling with HBV.IANIGLA. This data is for modeling the streamflow of a synthetic basin with a perfect fit. For running the model you will have to connect the different package's modules (or functions) in order to get what I consider the most simple hydrological model.
lumped_hbv
lumped_hbv
A data frame containing:
date series.
air temperature series.
total ammount of precipitation per day.
potential evapotranspiration series.
specific basin discharge. This are the values that you have to reproduce.
Calculate the atmospheric pressure using the altitude.
z |
a double representing the altitude |
A double with the atmospheric pressure .
Calculate your potential evapotranspiration series. This module was
design to provide a simple and straight forward way to calculate
one of the inputs for the soil routine (to show how does it works), but for real
world application I strongly recommend the use of the specialized
Evapotranspiration
package.
PET( model, hemis, inputData, elev, param )
PET( model, hemis, inputData, elev, param )
model |
numeric value with model option:
|
hemis |
numeric value indicating the hemisphere:
|
inputData |
numeric matrix with the following columns: Calder's model
|
elev |
numeric vector with the following values: Calder's model
|
param |
numeric vector with the following values: Calder's model
|
Numeric vector with the potential evapotranspiration series.
Calder, I.R., Harding, R.J., Rosier, P.T.W., 1983. An objective assessment of soil-moisture deficit models. J. Hydrol. 60, 329–355. https://doi.org/10.1016/0022-1694(83)90030-6
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Run the model for a year in the southern hemisphere potEvap <- PET(model = 1, hemis = 1, inputData = as.matrix(1:365), elev = c(1000, 1500), param = c(4, 0.5))
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Run the model for a year in the southern hemisphere potEvap <- PET(model = 1, hemis = 1, inputData = as.matrix(1:365), elev = c(1000, 1500), param = c(4, 0.5))
Extrapolate precipitation gauge measurements to another heights. In this package version you can use the classical linear gradient model or a modified version which sets a threshold altitude for precipitation increment (avoiding unreliable estimations).
Precip_model( model, inputData, zmeteo, ztopo, param )
Precip_model( model, inputData, zmeteo, ztopo, param )
model |
numeric value with model option:
|
inputData |
numeric vector with precipitation gauge series |
zmeteo |
numeric value indicating the altitude of the precipitation gauge |
ztopo |
numeric value with the target height |
param |
numeric vector with the following parameters: LP
LPM
|
Numeric vector with the extrapolated precipitation series.
For some interesting work on precipitation gradients at catchment and synoptic scale see:
Immerzeel, W.W., Petersen, L., Ragettli, S., Pellicciotti, F., 2014. The importance of observed gradients of air temperature and precipitation for modeling runoff from a glacierized watershed in the Nepalese Himalayas. Water Resour. Res. 50, 2212–2226. https://doi.org/10.1002/2013WR014506
Viale, M., Nuñez, M.N., 2010. Climatology of Winter Orographic Precipitation over the Subtropical Central Andes and Associated Synoptic and Regional Characteristics. J. Hydrometeorol. 12, 481–507. https://doi.org/10.1175/2010JHM1284.1
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## LP case set.seed(369) precLP <- Precip_model(model = 1, inputData = runif(n = 365, max = 30, min = 0), zmeteo = 3000, ztopo = 4700, param = c(5)) ## LPM case set.seed(369) precLPM <- Precip_model(model = 2, inputData = runif(n = 365, max = 30, min = 0), zmeteo = 3000, ztopo = 4700, param = c(5, 4500))
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## LP case set.seed(369) precLP <- Precip_model(model = 1, inputData = runif(n = 365, max = 30, min = 0), zmeteo = 3000, ztopo = 4700, param = c(5)) ## LPM case set.seed(369) precLPM <- Precip_model(model = 2, inputData = runif(n = 365, max = 30, min = 0), zmeteo = 3000, ztopo = 4700, param = c(5, 4500))
Estimate precipitation phase partioning based on Tair and RH
tair |
recorded air temperature |
rh |
relative humidity |
z |
double with meteorological station altitude |
A numeric vector with:
* the snowfall fraction
* the rainfall fraction
The model was developed using daily data.
Estimate precipitation phase partioning based on Tair and RH
tair |
recorded air temperature |
rh |
relative humidity |
error_thres |
double with absolute error. This value is used as a convergence criteria in the Newton-Raphson method. |
period |
integer value (1, 2 or 3), where: * 1 => 15 min record period * 2 => 1 hour record period * 3 => 1 day record period |
A numeric vector with:
* the snowfall fraction
* the rainfall fraction
* hydrometeor temperature
* the required number of iterations
Implement one of the five different bucket formulations for
runoff routing. The output of this function is the input series of the
transfer function (UH
).
Routing_HBV( model, lake, inputData, initCond, param )
Routing_HBV( model, lake, inputData, initCond, param )
model |
numeric integer indicating which reservoir formulation to use:
|
lake |
logical. A |
inputData |
numeric matrix with three columns (two of them depends on
|
initCond |
numeric vector with the following initial state variables.
|
param |
numeric vector. The length depends on the model's choice: Model 1
Model 2
Model 3
Model 4
Model 5
|
Numeric matrix with the following columns:
Model 1
Qg
: total buckets output discharge .
Q0
: top bucket discharge .
Q1
: intermediate bucket discharge .
Q2
: lower bucket discharge .
STZ
: top reservoir storage .
SUZ
: intermediate reservoir storage .
SLZ
: lower reservoir storage .
Model 2
Qg
: total buckets output discharge .
Q1
: intermediate bucket discharge .
Q2
: lower bucket discharge .
SUZ
: intermediate reservoir storage .
SLZ
: lower reservoir storage .
Model 3
Qg
: total buckets output discharge .
Q0
: intermediate bucket fast discharge .
Q1
: intermediate bucket discharge .
Q2
: lower bucket discharge .
SUZ
: intermediate reservoir storage .
SLZ
: lower reservoir storage .
Model 4
Qg
: total buckets output discharge .
Q1
: lower bucket intermediate discharge .
Q2
: lower bucket discharge .
SLZ
: lower reservoir storage .
Model 5
Qg
: total buckets output discharge .
Q0
: lower bucket fast discharge .
Q1
: lower bucket intermediate discharge .
Q2
: lower bucket discharge .
SLZ
: lower reservoir storage .
Bergström, S., Lindström, G., 2015. Interpretation of runoff processes in hydrological modelling—experience from the HBV approach. Hydrol. Process. 29, 3535–3545. https://doi.org/10.1002/hyp.10510
Beven, K.J., 2012. Rainfall - Runoff Modelling, 2 edition. ed. Wiley, Chichester.
Seibert, J., Vis, M.J.P., 2012. Teaching hydrological modeling with a user-friendly catchment-runoff-model software package. Hydrol Earth Syst Sci 16, 3315–3325. https://doi.org/10.5194/hess-16-3315-2012
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Case example with the first model inputMatrix <- cbind( runif(n = 200, max = 100, min = 0), runif(n = 200, max = 50, min = 5), runif(n = 100, max = 3, min = 1) ) routeMod1 <- Routing_HBV(model = 1, lake = TRUE, inputData = inputMatrix, initCond = c(10, 15, 20), param = c(0.1, 0.05, 0.001, 1, 0.8))
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Case example with the first model inputMatrix <- cbind( runif(n = 200, max = 100, min = 0), runif(n = 200, max = 50, min = 5), runif(n = 100, max = 3, min = 1) ) routeMod1 <- Routing_HBV(model = 1, lake = TRUE, inputData = inputMatrix, initCond = c(10, 15, 20), param = c(0.1, 0.05, 0.001, 1, 0.8))
Here you will find the lumped model's next step. A semi-distributed model seems more similar to what we try to simulate in real world hydrology. This dataset allows you to experiment with a synthetic HBV.IANIGLA semi-distributed exercise.
semi_distributed_hbv
semi_distributed_hbv
A list with five elements
data frame containing elevation band names and the hypsometric values for modeling the catchment.
numeric matrix with the air temperature series (columns) for the 15 elevation bands.
numeric matrix with the precipitation series (columns) for the 15 elevation bands.
numeric matrix with the potential evapotranspiration series (columns) for the 15 elevation bands.
numeric vector with the synthetic catchment discharge.
Allows you to simulate snow accumulation and melting processes using a temperature index approach. The function also incorporates options for clean and debris covered glacier surface mass balance simulations.
SnowGlacier_HBV( model, inputData, initCond, param )
SnowGlacier_HBV( model, inputData, initCond, param )
model |
numeric indicating which model you will use:
|
inputData |
numeric matrix being columns the input variables. As in the whole
package functions, Model 1:
Model 2:
Model 3:
|
initCond |
numeric vector with the following values.
|
param |
numeric vector with the following values:
|
Numeric matrix with the following columns:
Model 1
** if surface is soil,
Prain
: precip. as rainfall.
Psnow
: precip. as snowfall.
SWE
: snow water equivalent.
Msnow
: melted snow.
Total
: Prain
+ Msnow
.
** if surface is ice,
Prain
: precip. as rainfall.
Psnow
: precip. as snowfall.
SWE
: snow water equivalent.
Msnow
: melted snow.
Mice
: melted ice.
Mtot
: Msnow
+ Mice
.
Cum
: Psnow
- Mtot
.
Total
: Prain
+ Mtot
.
TotScal
: Total
* initCond[3].
Model 2
** if surface is soil,
Prain
: precip. as rainfall.
Psnow
: precip. as snowfall.
SWE
: snow water equivalent.
Msnow
: melted snow.
Total
: Prain
+ Msnow
.
TotScal
: Msnow
* SCA
+ Prain
.
** if surface is ice -> as in Model 1
Model 3
** if surface is soil -> as in Model 1
** if surface is ice,
Prain
: precip. as rainfall.
Psnow
: precip. as snowfall.
SWE
: snow water equivalent.
Msnow
: melted snow.
Mice
: melted ice.
Mtot
: Msnow
+ Mice
.
Cum
: Psnow
- Mtot
.
Total
: Prain
+ Mtot
.
TotScal
: Total
* inputData[i, 3].
Bergström, S., Lindström, G., 2015. Interpretation of runoff processes in hydrological modelling—experience from the HBV approach. Hydrol. Process. 29, 3535–3545. https://doi.org/10.1002/hyp.10510
DeWalle, D. R., & Rango, A. (2008). Principles of Snow Hydrology.
Parajka, J., Merz, R., Blöschl, G., 2007. Uncertainty and multiple objective calibration in regional water balance modelling: case study in 320 Austrian catchments. Hydrol. Process. 21, 435–446. https://doi.org/10.1002/hyp.6253
Seibert, J., Vis, M.J.P., 2012. Teaching hydrological modeling with a user-friendly catchment-runoff-model software package. Hydrol Earth Syst Sci 16, 3315–3325. https://doi.org/10.5194/hess-16-3315-2012
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Debris-covered ice ObsTemp <- sin(x = seq(0, 10*pi, 0.1)) ObsPrecip <- runif(n = 315, max = 50, min = 0) ObsGCA <- seq(1, 0.8, -0.2/314) ## Fine debris covered layer assumed. Note that the ice-melt factor is cumpulsory but harmless. DebrisCovGlac <- SnowGlacier_HBV(model = 3, inputData = cbind(ObsTemp, ObsPrecip, ObsGCA), initCond = c(10, 3, 1), param = c(1, 1, 0, 3, 1, 6))
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Debris-covered ice ObsTemp <- sin(x = seq(0, 10*pi, 0.1)) ObsPrecip <- runif(n = 315, max = 50, min = 0) ObsGCA <- seq(1, 0.8, -0.2/314) ## Fine debris covered layer assumed. Note that the ice-melt factor is cumpulsory but harmless. DebrisCovGlac <- SnowGlacier_HBV(model = 3, inputData = cbind(ObsTemp, ObsPrecip, ObsGCA), initCond = c(10, 3, 1), param = c(1, 1, 0, 3, 1, 6))
This module allows you to account for actual evapotranspiration,
abstractions, antecedent conditions and effective runoff. The formulation enables
non linear relationships between soil box water input (rainfall plus snowmelt) and
the effective runoff. This effective value is the input series to the routine function
(Routing_HBV
).
Soil_HBV( model, inputData, initCond, param )
Soil_HBV( model, inputData, initCond, param )
model |
numeric integer suggesting one of the following options:
|
inputData |
numeric matrix with the following series Model 1
Model 2
|
initCond |
numeric vector with the following values:
|
param |
numeric vector with the following values:
|
Numeric matrix with the following columns:
Rech
: recharge series . This is the input to
the
Routing_HBV
module.
Eact
: actual evapotranspiration series .
SM
: soil moisture series .
Bergström, S., Lindström, G., 2015. Interpretation of runoff processes in hydrological modelling—experience from the HBV approach. Hydrol. Process. 29, 3535–3545. https://doi.org/10.1002/hyp.10510
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA # HBV soil routine with variable area ## Calder's model potEvap <- PET(model = 1, hemis = 1, inputData = as.matrix(1:315), elev = c(1000, 1500), param = c(4, 0.5)) ## Debris-covered ice ObsTemp <- sin(x = seq(0, 10*pi, 0.1)) ObsPrecip <- runif(n = 315, max = 50, min = 0) ObsGCA <- seq(1, 0.8, -0.2/314) ## Fine debris covered layer assumed. Note that the ice-melt factor is cumpulsory but harmless. DebrisCovGlac <- SnowGlacier_HBV(model = 3, inputData = cbind(ObsTemp, ObsPrecip, ObsGCA), initCond = c(10, 3, 1), param = c(1, 1, 0, 3, 1, 6)) ## Soil routine ObsSoCA <- 1 - ObsGCA inputMatrix <- cbind(DebrisCovGlac[ , 9], potEvap, ObsSoCA) soil <- Soil_HBV(model = 2, inputData = inputMatrix, initCond = c(50), param = c(200, 0.5, 2))
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA # HBV soil routine with variable area ## Calder's model potEvap <- PET(model = 1, hemis = 1, inputData = as.matrix(1:315), elev = c(1000, 1500), param = c(4, 0.5)) ## Debris-covered ice ObsTemp <- sin(x = seq(0, 10*pi, 0.1)) ObsPrecip <- runif(n = 315, max = 50, min = 0) ObsGCA <- seq(1, 0.8, -0.2/314) ## Fine debris covered layer assumed. Note that the ice-melt factor is cumpulsory but harmless. DebrisCovGlac <- SnowGlacier_HBV(model = 3, inputData = cbind(ObsTemp, ObsPrecip, ObsGCA), initCond = c(10, 3, 1), param = c(1, 1, 0, 3, 1, 6)) ## Soil routine ObsSoCA <- 1 - ObsGCA inputMatrix <- cbind(DebrisCovGlac[ , 9], potEvap, ObsSoCA) soil <- Soil_HBV(model = 2, inputData = inputMatrix, initCond = c(50), param = c(200, 0.5, 2))
Accounts for actual evapotranspiration,
abstractions, antecedent conditions and effective runoff.
The formulation enables non linear relationships between
soil box water input (rainfall plus snowmelt) and the
effective runoff. This effective value is the input series
to the routine function (do_route
).
soil_hbv_pro( inputData, initCond, param )
soil_hbv_pro( inputData, initCond, param )
inputData |
numeric matrix with the following series:
|
initCond |
numeric vector with the following values:
|
param |
numeric vector with the following values:
|
Numeric matrix with the following columns:
Rech
: recharge series .
Eact
: actual evapotranspiration series .
SM
: soil moisture series .
Extrapolate air temperature records to another heights. In this package version you can use the classical linear gradient model or a modified version which sets an upper altitudinal threshold air temperature decrement (avoiding unreliable estimations).
Temp_model( model, inputData, zmeteo, ztopo, param )
Temp_model( model, inputData, zmeteo, ztopo, param )
model |
numeric value with model option:
|
inputData |
numeric vector with air temperature record series [ºC/ |
zmeteo |
numeric value indicating the altitude where the air temperature is recorded
|
ztopo |
numeric value with the target height |
param |
numeric vector with the following parameters: LT
LPM
|
Numeric vector with the extrapolated air temperature series.
Immerzeel, W.W., Petersen, L., Ragettli, S., Pellicciotti, F., 2014. The importance of observed gradients of air temperature and precipitation for modeling runoff from a glacierized watershed in the Nepalese Himalayas. Water Resour. Res. 50, 2212–2226. https://doi.org/10.1002/2013WR014506
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## simple linear model airTemp <- Temp_model( model = 1, inputData = runif(200, max = 25, min = -10), zmeteo = 2000, ztopo = 3500, param = c(-6.5) )
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## simple linear model airTemp <- Temp_model( model = 1, inputData = runif(200, max = 25, min = -10), zmeteo = 2000, ztopo = 3500, param = c(-6.5) )
A dataset containing a minimal information to simulate the streamflow discharge
of the Tupungato catchment. The basin is located in the north of the Mendoza province
(Argentina - 32.90º S; 69.76º W) and has an area of about 1769 . This catchment is
the main tributary of the Mendoza River basin (~50 % of the annual discharge), a stream that
supplies with water to most of the province population (~64 %).
tupungato_data
tupungato_data
A list with four elements
data frame with the air temperature, precipitation and streamflow (mean, lower and upper bounds) series.
data frame containing the snow cover (from MODIS) series for each elevation band.
data frame with: elevation zone number, minimum, maximum and mean altitude values for the elevation range and the relative area of each polygon.
numeric vector with the station (Toscas) height (in masl).
Use a triangular transfer function to adjust the timing of the simulated streamflow discharge. This module represents the runoff routing in the streams.
UH( model, Qg, param )
UH( model, Qg, param )
model |
numeric integer with the transfer function model. The current HBV.IANIGLA model only allows for a single option.
|
Qg |
numeric vector with the water that gets into the stream.
If you are not modeling glaciers is the output of the
|
param |
numeric vector with the following values, Model 1
|
Numeric vector with the simulated streamflow discharge.
Bergström, S., Lindström, G., 2015. Interpretation of runoff processes in hydrological modelling—experience from the HBV approach. Hydrol. Process. 29, 3535–3545. https://doi.org/10.1002/hyp.10510
Parajka, J., Merz, R., & Blöschl, G. (2007). Uncertainty and multiple objective calibration in regional water balance modelling: Case study in 320 Austrian catchments. Hydrological Processes, 21(4), 435-446. https://doi.org/10.1002/hyp.6253
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Routing example inputMatrix <- cbind(runif(n = 200, max = 100, min = 0), runif(n = 200, max = 50, min = 5), runif(n = 100, max = 3, min = 1)) routeMod1 <- Routing_HBV(model = 1, lake = TRUE, inputData = inputMatrix, initCond = c(10, 15, 20), param = c(0.1, 0.05, 0.001, 1, 0.8)) ## UH dischOut <- UH(model = 1, Qg = routeMod1[ , 1], param = 2.2)
# The following is a toy example. I strongly recommend to see # the package vignettes in order to improve your skills on HBV.IANIGLA ## Routing example inputMatrix <- cbind(runif(n = 200, max = 100, min = 0), runif(n = 200, max = 50, min = 5), runif(n = 100, max = 3, min = 1)) routeMod1 <- Routing_HBV(model = 1, lake = TRUE, inputData = inputMatrix, initCond = c(10, 15, 20), param = c(0.1, 0.05, 0.001, 1, 0.8)) ## UH dischOut <- UH(model = 1, Qg = routeMod1[ , 1], param = 2.2)
Estimate precipitation phase partioning based on Tair and RH. Vectorised version.
tair |
rnumeric vecto with recorded air temperature |
rh |
numeric vector with relative humidity |
z |
double with meteorological station altitude |
A numeric vector with:
* the snowfall fraction
* the rainfall fraction
The model was developed using daily data.
Estimate precipitation phase partioning based on Tair and RH (vectorised version).
tair |
numeric vector with recorded
air temperature |
rh |
numeric vector with relative humidity |
delta_x |
double with increment to derivate using the limit's concept. |
error_thres |
double with absolute error. This value is used as a convergence criteria in the Newton-Raphson (secant) method. |
period |
character with: * "15 min" => 1 * "1 hour" => 2 * "1 day" => 3 |
A numeric matrix with two columns:
* 1. the snowfall fraction
* 2. the rainfall fraction