model_wrapper: Wrapper for running snow and hydrological model

Description Usage Arguments Value Examples

View source: R/model_wrapper.R

Description

Wrapper for running snow and hydrological model

Usage

1
model_wrapper(indata)

Arguments

indata

List with following items:

  • Time Vector with times

  • Prec Matrix with precipitation, dimensions Ntimes * NZones

  • Tair Matrix with air temperature, dimensions Ntimes * NZones

  • PET Vector with potential evapotranspiration, dimensions Ntimes

  • SWE Initial state of snow water equivalent

  • St Initial state of storages

  • StUH1 Initial state of first unit hydrograph

  • StUH2 Initial state of second unit hydrograph

  • Param Model parameters

  • frac_elev_band Fraction of watershed area for each elevation band

Value

A list with state variables and simulated runoff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
iwsh <- 3

indata = list(Time           = sample_data[[iwsh]]$time_vec,
              Prec           = sample_data[[iwsh]]$Prec,
              Tair           = sample_data[[iwsh]]$Tair,
              PET            = rep(0, nrow(sample_data[[iwsh]]$Prec)),
              SWE            = matrix(0, nrow = 1, ncol = ncol(sample_data[[iwsh]]$Prec)),
              St             = matrix(0, nrow = 2, ncol = 1),
              StUH1          = matrix(0, 20, ncol = 1),
              StUH2          = matrix(0, 40, ncol = 1),
              Param          = c(74.59, 0.81, 214.98, 1.24, 3.69, 1.02),
              frac_elev_band = sample_data[[iwsh]]$frac_elev_band)

res_sim <- model_wrapper(indata)

plot(sample_data[[iwsh]]$Runoff, type = 'l', col = 'black', lwd = 2)
lines(res_sim$Q, col = 'red')

jmgnve/HMOD documentation built on May 19, 2019, 1:53 p.m.