James T. Peterson
U.S. Geological Survey, Oregon Cooperative Fish and Wildlife
Research Unit, Oregon State University
Corvallis, Oregon 97331-3803, jt.peterson@oregonstate.edu
Adam Duarte
USDA Forest Service, Pacific Northwest Research Station
Olympia, Washington 98512
adam.duarte@usda.gov
Although this code has been processed successfully on a computer system at the U.S. Geological Survey (USGS), no warranty expressed or implied is made regarding the display or utility of the code for other purposes, nor on all computer systems, nor shall the act of distribution constitute any such warranty. The USGS or the U.S. Government shall not be held liable for improper or incorrect use of the code described and/or contained herein.
The winterRunDSM
package depends on a number of packages developed by the CVPIA Open Science Collaborative. To install winterRunDSM
and additional CVPIA-OSC
packages use the remotes::install_github()
function.
# install.packages("remotes")
remotes::install_github("CVPIA-OSC/winterRunDSM")
remotes::install_github("CVPIA-OSC/DSMscenario")
# optional - need if calibrating model
remotes::install_github("CVPIA-OSC/DSMCalibrationData")
# optional - need if wanting to explore or modify flow, habitat, and temperature inputs
remotes::install_github("CVPIA-OSC/DSMflow")
remotes::install_github("CVPIA-OSC/DSMhabitat")
remotes::install_github("CVPIA-OSC/DSMtemperature")
The winter_run_model()
is a Winter Run Chinook life cycle model used for CVPIA’s Structured Decision Making Process. Running the model simulates Winter Run Chinook population dynamics across 31 watersheds in California over a 20 year period.
The following code runs the winter run model with SIT defined scenario 1:
# seed the model
winter_run_seeds <- winter_run_model(mode = "seed")
# run the 20 year simulation
results <- winter_run_model(scenario = DSMscenario::scenarios$ONE,
mode = "simulate",
seeds = winter_run_seeds)
The following code runs the winter run model with a custom scenario defined in scenario_df
:
# define scenario
scenario_df <- data.frame(watershed = c("Upper Sacramento River", "Battle Creek"),
action = c(3, 2),
start_year = c(1980, 1979),
end_year = c(1989, 1988),
units_of_effort = c(1, 2))
# create scenario input
scenario <- DSMscenario::get_action_matrices(scenario_df)
# seed model
winter_run_seeds <- winter_run_model(mode = "seed")
# evaluate the impact of your scenario over the 20 year simulation
results <- winter_run_model(scenario = scenario,
mode = "simulate",
seeds = winter_run_seeds)
The winterRunDSM
package uses data from several other packages within the CVPIA Open Science Collaborative. These relationships are visualized in the dependency graph below.
All data used in the winterRunDSM
is passed in as a argument to winter_run_model()
from a winterRunDSM::params
data list that is composed of data objects from the following packages:
winterRunDSM
are generated using CalSim 2 data.Running scenarios through the winter_run_model()
model the impact of restoration actions on Winter Run Chinook populations. The CVPIA SIT (Science Integration Team) has developed restoration action portfolios composed of actions preformed on watersheds over a set time period.
There are seven predefined scenarios that were developed by the CVPIA SIT. Additional scenarios can be defined by creating a scenario_df
describing watershed, action, start year, end year, and units of effort. The function get_action_matrices()
takes a user defined scenario_df
and returns a scenario in the correct format to be used as the scenario
input for winter_run_model()
. For additional description on how to build a scenario view load_scenario()
documentation by searching ?DSMscenario::load_scenario()
We prepared additional datasets in the DSMCalibration
package for model calibration:
GrandTab estimated escapement data for the years 1998-2017. The GrandTab data is prepared as DSMCalibrationData::grandtab_observed
and is used to measure the difference between model predictions and observed escapements. Grandtab data is additionally prepared as DSMCalibrationData::grandtab_imputed
and is used to calculate the number of juveniles during the 20 year simulation.
Proxy years are used to select Habitat, Flow, and Temperature data for 1998-2017 to correspond with the years of GrandTab escapement data. The data inputs to the DSM are for years 1980-1999. We selected proxy years for 1998-2017 from the 1980-1999 model inputs by comparing the DWR water year indices.
For a detailed overview of the calibration process see the calibration markdown.