run_truth: Load Atlantis scenario output

View source: R/run_truth.R

run_truthR Documentation

Load Atlantis scenario output

Description

Reads in data generated from an Atlantis scenario and returns a list containing the desired information. The list contains the 'truth' as known from the Atlantis scenario. The truth can later be sampled from to create a data set with observation error. Currently, the run_truth depends on the following files being in your working directory (dir):

  • "functionalGroups.csv"

  • "[...]TOTCATCH.nc"

  • "[...]DietCheck.txt"

, where [...] specifies the entry used for the scenario argument.

Usage

run_truth(
  scenario,
  dir = getwd(),
  file_fgs,
  file_bgm,
  select_groups,
  file_init,
  file_biolprm,
  file_runprm,
  file_fish,
  verbose = FALSE,
  save = TRUE,
  annage = FALSE
)

Arguments

scenario

A character value, specifying the Atlantis scenario name. More specifically the name which Atlantis uses to name all of the output files. The value will be used to search for files specified in dir, if dir is also a function argument.

dir

The directory of the atlantis model output, where the default is getwd().

file_fgs

A character value specifying the file name of the Atlantis functional groups file. The file should be located in your current working directory or the folder you specify in dir. The argument can also be specified as the full path name, just as long as argument dir is specified as NULL. Usually, the filename is "functionalGroups.csv".

file_bgm

A character value specifying the file name of a .bgm file, which contains information on box locations for an Atlantis scenario. The file should be located in your current working directory or the folder you specify in dir. The argument can also be specified as the full path name, just as long as argument dir is specified as NULL.

select_groups

Character vector of funtional groups to select. Names have to match the ones used in the ncdf file, and therefore must be in the column "Name" in the fgs.

file_init

A character value giving the file name of the intial conditions file. The file should be located in your current working directory or the folder you specify in dir. The argument can also be specified as the full path name, just as long as argument dir is specified as NULL. Usually the file is named "init[...].nc"., but it must end in .nc.

file_biolprm

A character value giving the file name of the biology .prm file. The file should be located in your current working directory or the folder you specify in dir. The argument can also be specified as the full path name, just as long as argument dir is specified as NULL. Usually the file is named "[...]_Biol.prm"..

file_runprm

A character value giving the file name of the biology .xml file. The file should be located in your current working directory or the folder you specify in dir. The argument can also be specified as the full path name, just as long as argument dir is specified as NULL. Usually the file is named "[...]_run.xml".. This file is output from an Atlantis run in a standard format and is based on input from the "[...]_run.prm" file.

verbose

A logical value specifying if output should be written to the screen or not. The default value is FALSE.

A

logical value specifying if the function should save the output to the disk or not. The default is TRUE.

Value

Returns a list object.

Author(s)

Sean Lucey, Kelli Faye Johnson

Examples

d <- system.file("extdata", "SETAS_Example", package = "atlantisom")
groups <- load_fgs(dir = d, "Functional_groups.csv")
truth <- run_truth(scenario = "outputs",
  dir = d,
  file_fgs = "Functional_groups.csv",
  file_bgm = "Geography.bgm",
  select_groups = groups[groups$IsTurnedOn > 0, "Name"],
  file_init = "Initial_condition.nc",
  file_biolprm = "Biology.prm",
  file_runprm = "Run_settings.xml",
  file_fish = "Fisheries.csv")
str(truth)
rm(truth)


r4atlantis/atlantisom documentation built on Nov. 12, 2023, 2:59 a.m.