calc_biomass_age: Calculate biomass in t per age-structured-groups per polygon,...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/calc_biomass_age.R

Description

Calculate biomass in t per age-structured-groups per polygon, time and ageclass.

Usage

1
calc_biomass_age(nums, resn, structn, biolprm)

Arguments

nums

A data.frame containing the numbers per functional-group ("species") per timesetp, ageclass, layer and polygon. The data.frame has to origininate from load_nc using select_variable = "Nums".

resn

A data.frame containing the reserve nitrogen per functional-group ("species") per timestep, ageclass, layer and polygon. The data.frame has to origininate from load_nc using select_variable = "ResN".

structn

A data.frame containing the structural nitrogen per functional-group ("species") per timestep, ageclass, layer and polygon. The data.frame has to origininate from load_nc using select_variable = "StructN".

biolprm

A list of biological parameters available from the [...]_Biol.prm file, as read in by load_biolprm.

Details

This functions converts the ATLANTIS output to a data.frame which can be processed in R.

Value

A data.frame in tidy format with the following columns: species, agecl, time, polygon and atoutput. Atoutput is the total biomass in t. At this point biomass was aggregated (sum) per layer!

Author(s)

Alexander Keth

See Also

Other calc functions: calc_Z, calc_pred_diet, calc_stage2age, calc_timestep2time

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Set up the example with input files
d <- system.file("extdata", "INIT_VMPA_Jan2015", package = "atlantisom")
fgs <- load_fgs(d, "functionalGroups.csv")
bps <- load_bps(dir = d, fgs = fgs,
  file_init = paste0(tail(strsplit(d, "/")[[1]], 1), ".nc"))
runprm <- load_runprm(d, "VMPA_setas_run_fishing_F_Trunk.xml")
biolprm <- load_biolprm(dir = d,
  file_biolprm = "VMPA_setas_biol_fishing_Trunk.prm")
boxes <- get_boundary(load_box(dir = d, file_bgm = "VMPA_setas.bgm"))

# Get the catch values
catch <- load_nc(dir = d, file_nc = "outputSETASCATCH.nc",
  bps = bps, fgs = fgs, select_groups = fgs[fgs$IsTurnedOn > 0, "Name"],
  select_variable = "Catch", check_acronyms = TRUE, bboxes = boxes)
structn <- load_nc(dir = d, file_nc = "outputSETAS.nc",
  bps = bps, fgs = fgs, select_groups = fgs[fgs$IsTurnedOn > 0, "Name"],
  select_variable = "StructN", check_acronyms = TRUE, bboxes = boxes)
resn <- load_nc(dir = d, file_nc = "outputSETAS.nc",
  bps = bps, fgs = fgs, select_groups = fgs[fgs$IsTurnedOn > 0, "Name"],
  select_variable = "ResN", check_acronyms = TRUE, bboxes = boxes)

biomassatage <- calc_biomass_age(nums = catch,
  resn = resn, structn = structn, biolprm = biolprm)

r4atlantis/atlantisom documentation built on Aug. 13, 2019, 12:58 p.m.