Type: | Package |
Title: | Modular Hydrological Model |
Version: | 0.2.6 |
Date: | 2022-11-23 |
Author: | Ezequiel Toum <etoum@mendoza-conicet.gob.ar> |
Maintainer: | Ezequiel Toum <etoum@mendoza-conicet.gob.ar> |
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. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
Imports: | Rcpp |
URL: | https://gitlab.com/ezetoum27/hbv.ianigla |
BugReports: | https://gitlab.com/ezetoum27/hbv.ianigla/-/issues |
Depends: | R (≥ 3.5.0) |
LinkingTo: | Rcpp |
RoxygenNote: | 7.2.1 |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | yes |
Packaged: | 2022-11-23 13:08:41 UTC; eze |
Repository: | CRAN |
Date/Publication: | 2022-11-23 23:50:02 UTC |
Glacier discharge conceptual model
Description
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).
Usage
Glacier_Disch(
model,
inputData,
initCond,
param
)
Arguments
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)
|
Value
Numeric matrix with the following columns:
Model 1 (S08)
-
Q
: glacier discharge[mm/\Delta t]
. -
SG
: glacier's bucket water storage content series[1/\Delta t]
.
References
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
Examples
# 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))
Potential evapotranspiration models
Description
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.
Usage
PET(
model,
hemis,
inputData,
elev,
param
)
Arguments
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
|
Value
Numeric vector with the potential evapotranspiration series.
References
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
Examples
# 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))
Altitude gradient based precipitation models
Description
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).
Usage
Precip_model(
model,
inputData,
zmeteo,
ztopo,
param
)
Arguments
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
|
Value
Numeric vector with the extrapolated precipitation series.
References
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
Examples
# 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))
Routing bucket type models
Description
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
).
Usage
Routing_HBV(
model,
lake,
inputData,
initCond,
param
)
Arguments
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
|
Value
Numeric matrix with the following columns:
Model 1
-
Qg
: total buckets output discharge[mm/\Delta t]
. -
Q0
: top bucket discharge[mm/\Delta t]
. -
Q1
: intermediate bucket discharge[mm/\Delta t]
. -
Q2
: lower bucket discharge[mm/\Delta t]
. -
STZ
: top reservoir storage[mm]
. -
SUZ
: intermediate reservoir storage[mm]
. -
SLZ
: lower reservoir storage[mm]
.
Model 2
-
Qg
: total buckets output discharge[mm/\Delta t]
. -
Q1
: intermediate bucket discharge[mm/\Delta t]
. -
Q2
: lower bucket discharge[mm/\Delta t]
. -
SUZ
: intermediate reservoir storage[mm]
. -
SLZ
: lower reservoir storage[mm]
.
Model 3
-
Qg
: total buckets output discharge[mm/\Delta t]
. -
Q0
: intermediate bucket fast discharge[mm/\Delta t]
. -
Q1
: intermediate bucket discharge[mm/\Delta t]
. -
Q2
: lower bucket discharge[mm/\Delta t]
. -
SUZ
: intermediate reservoir storage[mm]
. -
SLZ
: lower reservoir storage[mm]
.
Model 4
-
Qg
: total buckets output discharge[mm/\Delta t]
. -
Q1
: lower bucket intermediate discharge[mm/\Delta t]
. -
Q2
: lower bucket discharge[mm/\Delta t]
. -
SLZ
: lower reservoir storage[mm]
.
Model 5
-
Qg
: total buckets output discharge[mm/\Delta t]
. -
Q0
: lower bucket fast discharge[mm/\Delta t]
. -
Q1
: lower bucket intermediate discharge[mm/\Delta t]
. -
Q2
: lower bucket discharge[mm/\Delta t]
. -
SLZ
: lower reservoir storage[mm]
.
References
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
Examples
# 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))
Snow and ice-melt models
Description
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.
Usage
SnowGlacier_HBV(
model,
inputData,
initCond,
param
)
Arguments
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:
|
Value
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].
References
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
Examples
# 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))
Empirical soil moisture routine
Description
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
).
Usage
Soil_HBV(
model,
inputData,
initCond,
param
)
Arguments
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:
|
Value
Numeric matrix with the following columns:
-
Rech
: recharge series[mm/\Delta t]
. This is the input to theRouting_HBV
module. -
Eact
: actual evapotranspiration series[mm/\Delta t]
. -
SM
: soil moisture series[mm/\Delta t]
.
References
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
Examples
# 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))
Altitude gradient base air temperature models
Description
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).
Usage
Temp_model(
model,
inputData,
zmeteo,
ztopo,
param
)
Arguments
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
|
Value
Numeric vector with the extrapolated air temperature series.
References
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
Examples
# 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)
)
Transfer function
Description
Use a triangular transfer function to adjust the timing of the simulated streamflow discharge. This module represents the runoff routing in the streams.
Usage
UH(
model,
Qg,
param
)
Arguments
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
|
Value
Numeric vector with the simulated streamflow discharge.
References
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
Examples
# 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)
Alerce's glacier data for modeling
Description
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).
Usage
alerce_data
Format
A list with five elements
- mass_balance
data frame with the estimated annual mass balance and the acceptable uncertainty bounds.
- mb_dates
data frame containing the first fix days of the winter and summer mass balances.
- meteo_data
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)
- topography
data frame with: elevation zone number, minimum, maximum and mean altitude values for the elevation range and the relative area.
- station_height
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).
References
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]
Synthetic glacio-hydrological data for modeling
Description
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.
Usage
glacio_hydro_hbv
Format
A list with five elements
- basin
data frame containing elevation band names and the hypsometric values for modeling the catchment.
- tair
numeric matrix with the air temperature series (columns) for the 15 elevation bands.
- prec
numeric matrix with the precipitation series (columns) for the 15 elevation bands.
- pet
numeric matrix with the potential evapotranspiration series (columns) for the 15 elevation bands.
- qout
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.
Lumped HBV catchment data
Description
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.
Usage
lumped_hbv
Format
A data frame containing:
- Date
date series.
- T(ºC)
air temperature series.
- P(mm/d)
total ammount of precipitation per day.
- PET(mm/d)
potential evapotranspiration series.
- qout(mm/d)
specific basin discharge. This are the values that you have to reproduce.
Semi-distributed HBV model data
Description
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.
Usage
semi_distributed_hbv
Format
A list with five elements
- basin
data frame containing elevation band names and the hypsometric values for modeling the catchment.
- tair
numeric matrix with the air temperature series (columns) for the 15 elevation bands.
- prec
numeric matrix with the precipitation series (columns) for the 15 elevation bands.
- pet
numeric matrix with the potential evapotranspiration series (columns) for the 15 elevation bands.
- qout
numeric vector with the synthetic catchment discharge.
Tupungato River basin data
Description
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 km^2
. 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 %).
Usage
tupungato_data
Format
A list with four elements
- hydro_meteo
data frame with the air temperature, precipitation and streamflow (mean, lower and upper bounds) series.
- snow_cover
data frame containing the snow cover (from MODIS) series for each elevation band.
- topography
data frame with: elevation zone number, minimum, maximum and mean altitude values for the elevation range and the relative area of each polygon.
- station_height
numeric vector with the station (Toscas) height (in masl).