Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
new FUSE and HYDROMAD
# install/load dependent libraries
if(!require(zoo)) install.packages("zoo")
library(zoo)
if(!require(tgp)) install.packages("tgp")
library(tgp)
if(!require(qualV)) install.packages("qualV")
library(qualV)
if(!require(hydromad)) install.packages("hydromad",repos="http://hydromad.catchment.org")
library(hydromad)
if(!require(devtools)) install.packages("devtools")
library(devtools)
# install the fuse package directly from GitHub
install_github("ICHydro/r_fuse", subdir = "fuse")
library(fuse)
# Load sample data
data(DATA)
# Set the parameter ranges
hydromad.options(fusesma=fusesma.ranges(),fuserouting=fuserouting.ranges())
# Set model
modspec <- hydromad(DATA, sma = "fusesma", routing = "fuserouting", mid = 1:1248, deltim = 1)
# Randomly generate 1 parameter set
myNewParameterSet <- parameterSets( coef(modspec, warn=FALSE), 1, method="random")
# Run a simulation using the parameter set generated above
modx <- update(modspec, newpars = myNewParameterSet)
# Generate a summary of the result
summary(modx)
# Plot results
hydromad:::xyplot.hydromad(modx, with.P=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment