waterBalance: Water Balance Utility for CE-QUAL-W2 model

View source: R/waterBalanceGeneric.r

waterBalanceR Documentation

Water Balance Utility for CE-QUAL-W2 model

Description

This function will compare measured and modeled lake elevation output, then write a new inflow file to be run on the next W2 model run to help achieve simulated flows that match the measured flows. This version setup for River models

Usage

waterBalance(
  opt.txt = NA,
  seg = NA,
  wb = NA,
  new.npt.filename = NA,
  rule.curve.filename = NA,
  daystep = 1,
  path = "/*",
  meas.elvs = "***.npt",
  elvVolCrvFl = NA,
  write.files = T,
  save.plot = F,
  version = 4,
  append.filename = NULL,
  maxElvDif_m = 0.75
)

Arguments

opt.txt

Defaults to reading in the wl.opt file, but can specify a "*.tsr" output from W2

seg

numeric; which segment to get wselv from W2 output

wb

numeric; which water body to get from W2 model output

new.npt.filename

string new balance flow file to write

rule.curve.filename

string filename for the optional Lake rule curve (csv format); if none then NA

daystep

numeric number of days of averaging window; default to use the smallest timestep in model output

meas.elvs

string filename for the measured elevations (csv format)

elvVolCrvFl

string #Elevation - Volume Curve filename

write.files

logical Write a new distributed tributary inflow file? TRUE or FALSE

save.plot

logical Save a plot of the output? TRUE or FALSE

version

numeric CE-QUAL-W2 version number; if 4 or greater, output is csv format!; otherwise, it's fixed width (8 space columns)

append.filename

logical will append the named file with the new water balance file; if NULL, new.npt.filename will be used to write a new QDT file

maxElvDif_m

numeric (meters) threshold in which to ignore water balance changes

Value

fit

a data.frame of the model to observed fit statistics

compElvs

a data.frame of the daily elevations

compVol

a data.frame of the daily volumes and flows

Author(s)

Norman Buccola

Examples

waterBalance()

nbuccola/w2r documentation built on June 2, 2025, 2:12 a.m.