Nitrate Network Model

Function documentation

NitrateNetworkModel.StreamModelType
StreamModel(
    mc::ModelConstants,
    nc::NetworkConstants,
    mv::ModelVariables
)

The StreamModel structure is a wrapper around three other structures. ModelConstants holds values of physical and process constants that do not change during the run. NetworkConstants holds the specification of the links, their characteristics, and nitrate concentrations from the landscape. It will not change during the run, but is expected to be adapted for each management scenario. Finally, ModelVariables holds the values that are calculated during the model run. All WatershedSim functions will take the entire StreamModel as an argument, so there is no need to pull out the component structures. It is also expected that users will use the file-based constructor StreamModel(::String, ::String).

source
NitrateNetworkModel.StreamModelMethod
StreamModel(baseparams_file::String, network_file::String)

Constructs a StreamModel based on inputs in two csv files. The files should be structured as follows:

  • baseparams_file: columns "variable" and "value".
  • network_file: many more columns.
source
NitrateNetworkModel.evaluate!Method
evaluate!(model::StreamModel; qgage::Float64, contrib_n_load_reduction::Union{nothing,Array{Float64,1}})

Main model function. Assumes that model.nc has already been updated to reflect the desired management scenario, e.g. updates to model.nc.contrib_n_load_factor or model.nc.feature and model.nc.wetland_area.

If a value for qgage is provided, the model will be run using that value as the flow measured at the link model.nc.gage_link, which is used to assign flow values to all other links. Otherwise, the model will be run using model.nc.gage_flow.

#TODO: the reason I'm doing it this way is because the nc struct is currently immutable. I could switch it to mutable, but I've been avoiding that due to potential performance regressions. I should test that, since this is introduces a funny assymetry in how different model parameters are handled.

source

Results access

These functions give ways of extracting key results from the model structure.