simpleDailyWater: Aggregates simple CRHM model output flows to daily values

View source: R/simpleDailyWater.R

simpleDailyWaterR Documentation

Aggregates simple CRHM model output flows to daily values

Description

Calculates daily values of the CRHM outputs of water storages and fluxes, for models without sub-basins, for each HRU by its area, and calculates the net fluxes for the basin and each sub-basin. Note that this function requires a built-in dataframe CRHM_vars which contains information about CRHM variables. If your model uses a variable which is not in the dataframe, then you will get an error message.

Usage

simpleDailyWater(
  CRHMoutput,
  vars = "all",
  prjFile = "",
  basinMean = TRUE,
  summarize = TRUE,
  units = "mm",
  quiet = TRUE,
  logfile = ""
)

Arguments

CRHMoutput

Required. The CRHM model output as a standard CRHMr dataframe (obs, export or output data)

vars

Optional. Variable column numbers to be used (not including the datetime). The default all selects all columns.

prjFile

Required. The CRHM .prj file.

basinMean

Optional. If TRUE (the default) then the fluxes and storages will be reported as depths over the entire basin. If FALSE, then fluxes and storages are reported as depths over each HRU's area.

summarize

Optional. If TRUE (the default), then a single basin-wide value of each flux and storage is returned. If FALSE then the values of the fluxes and storages are returned for each HRU.

units

Optional. The units for output. The default is mm, but m3/s can also be specified.

quiet

Optional. Suppresses display of messages, except for errors. The default is TRUE. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not used.

Value

If successful returns a data frame containing the daily values of all of the water fluxes and storages.

Author(s)

Kevin Shook

See Also

cumulDailyWater

Examples

## Not run: 
b <- readOutputFile('Bologna1984_30y_output.txt', timezone='MST')
# get daily values without aggregation; values calculated w.r.t the HRU area
dailyHRU <- simpleDailyWater(b, prjFile='Bologna1984_02.prj', basinMean=FALSE)

# get daily values without aggregation; values calculated w.r.t the basin area
dailyHRU_per_basin <- simpleDailyWater(b, prjFile='Bologna1984_02.prj', basinMean=TRUE)

get daily basin values
daily_basin <- simpleDailyWater(b, prjFile='Bologna1984_02.prj', basinMean=TRUE, summarize=TRUE)


## End(Not run)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.