load_nc: Load Atlantis outputfiles (netcdf)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/load-nc.R

Description

This function loads Atlantis outputfiles (any netcdf file) and converts them to a data.frame.

Usage

1
2
load_nc(nc, fgs, bps, select_groups, select_variable, prm_run, bboxes,
  check_acronyms = TRUE, warn_zeros = FALSE, report = TRUE)

Arguments

nc

Character string giving the connection of the netcdf file to read in. The filename usually contains output and ends in .nc".

fgs

Character string giving the connection to the functional groups file. The filename usually contains Groups and does end in .csv.

bps

Vector of character strings giving the complete list of epibenthic functional groups (Only present in the sediment layer). The names have to match the column 'Name' in the 'functionalGroups.csv' file. Can be created with load_bps.#'

select_groups

Character vector of funtional groups which shall be read in. Names have to match the ones used in the netcdf file. Check column "Name" in "functionalGroups.csv" for clarification.

select_variable

Character value specifying which variable to load. Only one variable of the options available (i.e., c( "N", "Nums", "ResN", "StructN", "Eat", "Growth", "Prodn", "Grazing") ) can be loaded at a time.

prm_run

Character string giving the connection of the run parameterfile. The filename usually contains run_fishing and ends in .prm".

bboxes

Integer vector giving the box-id of the boundary boxes. Can be created with get_boundary.

check_acronyms

Logical testing if functional-groups in select_groups are inactive in the current model run. They will be omitted in the output.

warn_zeros

Logical indicating if check for actual zeros in the data shall be printed or not. Default is FALSE.

report

Logical indicating if progress bars shall be printed (TRUE) or not (FALSE). Default is TRUE.

Value

A data.frame in long format with the following column names: species, timestep, polygon, agecl, and atoutput (i.e., variable).

Author(s)

Alexander Keth

See Also

Other load functions: load_box, load_bps, load_dietcheck, load_fgs, load_init_age, load_init, load_nc_physics, load_rec, load_spec_mort, load_txt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools")

nc <- file.path(d, "outputSETAS.nc")
fgs <- file.path(d, "SETasGroupsDem_NoCep.csv")
bps <- load_bps(init = file.path(d, "INIT_VMPA_Jan2015.nc"), fgs = fgs)
bboxes <- get_boundary(boxinfo = load_box(bgm = file.path(d, "VMPA_setas.bgm")))
prm_run <- file.path(d, "VMPA_setas_run_fishing_F_Trunk.prm")

test <- load_nc(nc = nc, bps = bps, fgs = fgs, prm_run = prm_run, bboxes = bboxes,
  select_groups = c("Planktiv_S_Fish", "Cephalopod", "Diatom"),
  select_variable = "ResN")

test <- load_nc(nc = nc, bps = bps, fgs = fgs, prm_run = prm_run, bboxes = bboxes,
  select_groups = c("Planktiv_S_Fish", "Cephalopod", "Diatom"),
  select_variable = "Nums")

atlantistools documentation built on Aug. 16, 2017, 9:05 a.m.