Skip to contents

Multi-panel time-series plots of either ecology state variable data, or fishery landings and discards, for the full duration of a model run generated by the e2ep_run() function.

Usage

e2ep_plot_ts(model, results, selection = "ECO")

Arguments

model

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

results

R-list object containing model results generated by the e2ep_run() function.

selection

Text string from a list identifying whether ecology state variable or fishery catches are to be plotted. Select from: "ECO", "CATCH", default = "ECO". Remember to include the phrase within "" quotes.

Value

Graphical display in a new graphics window.

Details

The function plots a multi-panel page of time series plots of either a) daily ecology state variable values aggregated over the inshore and offshore zones of the domain and over sediment classes, or b) annual landings and discards by zone for each model guild, for the full duration of a model run. Currently the masses of macrophytes, corpses and discards are not included in the state varibale plots due to space constraints.

Be warned that if the run is more than about 10 years then the plot becomes extremely compressed and messy. It is not intended to be of publication quality. The intention is to provide a quick-look diagnostic of trends in the state variables. This is useful to assess whether the model is close to stationary state or not.

Units of the plotted state varaiables mMN i.e. mass in the model domain without any scaling to zone-area or layer thickness. Similarly, units of catches are mMN/y from the whole model domain without any scaling to zone-area. The assumed area of the whole model domain is 1 m2.

Selection of either ecology state variable or catches to plot is by a function argument.

A separate set of functions is provided for plotting more detailed visualizations of just the final year from a model run, e.g. e2ep_plot_eco(), e2ep_plot_catch().

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 and generate the results object, with csv output suppressed
    results <- e2ep_run(model,nyears=2, csv.output=FALSE)
# Plot the time series of ecology state variable outputs
    e2ep_plot_ts(model, results, selection="ECO")

# Time series plot of catches in a new window leaving the existing window open
    dev.new()
    e2ep_plot_ts(model, results, selection="CATCH")

#Direct the graphics output to a file (Windows OS)... 
# or jpeg("plot.jpg"), png("plot.png")
    pdf(file.path(tempdir(), "plot.pdf"),width=8,height=6)
    e2ep_plot_ts(model, results, selection="ECO")
    dev.off()
#> agg_png 
#>       6 

# \donttest{
# Demonstrate transient behaviour in the time-series outputs (run for 10 years).
# Read the Barents Sea/2011-2019 model and set the identifier for output files to "baseline",
# run the model and plot the full length output
    model <- e2ep_read("Barents_Sea", "2011-2019",model.ident="baseline")
#> 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/'
    results <- e2ep_run(model,nyears=10, csv.output=FALSE)
    e2ep_plot_ts(model, results, selection="ECO")
    dev.new()
    e2ep_plot_ts(model, results, selection="CATCH")
# Create a new scenario version of the Barents Sea/2011-2019 model by increasing the activity
# rate of gear 1 (pelagic trawls and seines) by a factor of 3
    scenario_model <- model
    scenario_model$data$fleet.model$gear_mult[1] <- 3
    scenario_model$setup$model.ident <- "gear1x3"    # Set a new identifier for the outputs
    scenario_results <- e2ep_run(scenario_model,nyears=10, csv.output=FALSE)
    dev.new() 
    e2ep_plot_ts(scenario_model, scenario_results, selection="ECO")
    dev.new()
    e2ep_plot_ts(scenario_model, scenario_results, selection="CATCH")
# }