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

View source: R/calc_biomass_age.R

calc_biomass_ageR Documentation

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

Description

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

Usage

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_age2length(), calc_avgwtstage2age(), calc_biomass_pool(), calc_pred_cons(), calc_pred_diet(), calc_stage2age(), calc_timestep2time()

Examples

# Set up the example with input files
d <- system.file("extdata", "SETAS_Example", package = "atlantisom")
fgs <- load_fgs(d, "Functional_groups.csv")
bps <- load_bps(dir = d, fgs = "Functional_groups.csv",
  file_init = "Initial_condition.nc")
runprm <- load_runprm(d, "Run_settings.xml")
biolprm <- load_biolprm(dir = d,
  file_biolprm = "Biology.prm")
boxes <- get_boundary(load_box(dir = d, file_bgm = "Geography.bgm"))

# Get the catch values
catch <- load_nc(dir = d, file_nc = "outputsCATCH.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 = "outputs.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 = "outputs.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 Nov. 12, 2023, 2:59 a.m.