Skip to contents

Perform a single deterministic run of the StrathE2EPolar model for a configuration defined by an R-list object compiled by a prior call of the e2ep_read() function.

Usage

e2ep_run(model, nyears = 20, quiet = TRUE, csv.output = TRUE)

Arguments

model

R-list object defining the model configuration and compiled by the e2e_read() function.

nyears

Number of years (integer) to run the model (default=20).

quiet

Logical. If FALSE then see status outputs during the model run (default=TRUE).

csv.output

Logical. If TRUE then enable writing of csv output files (default=FALSE).

Value

Model outputs as an R-list object and optionally csv files.

Details

The function solves a network of Ordinary Differential Equations using the lsoda function in the R deSolve package. The equations represent a shelf-sea food web and its connections to the physical and chemical environment, and to a set of fishing fleets.

The outputs from the run are time series (daily intervals) of the masses of each of the state variables, the fluxes between all state variable, and the fluxes in and out of the model including fishery landings. In addition, a range of derived quantities are generated for the final year of the run, including annual averages, maxima and minima of state variables, annual fluxes between state variables, annual landings and discards of each guild of taxa by each fleet of fishing gears, and a set of network indices generated by the R NetIndices package.

Examples

# Load the 2011-2019 version of the Barents Sea model supplied with the package:
    model <- e2ep_read("Barents_Sea", "2011-2019")
#> Current working directory is... 
#> 'C:/Users/jackl/OneDrive - University of Strathclyde/Documents/StrathE2E/strath-e-2-e-polar-webdev/docs/reference'
#> No 'results.path' specified so any csv data requested
#> will be directed to/from the temporary directory...
#> 'C:\Users\jackl\AppData\Local\Temp\RtmpSgdWsc'
#> 
#> Model setup and parameters gathered from ...
#> StrathE2E2 package folder
#> Model results will be directed to/from ...
#> 'C:\Users\jackl\AppData\Local\Temp\RtmpSgdWsc/Barents_Sea/2011-2019/'

# Run the model for 2 years and generate the results object
    results <- e2ep_run(model,nyears=2)
# Set csv.output=TRUE to save results to csv files to the directory
# specified in the e2ep_read() function call.

# Time series plot of state varaiables over the full length of the run
    e2ep_plot_ts(model, results,selection="ECO")

    dev.new()
    e2ep_plot_ts(model, results,selection="CATCH")