calc_biomass_pool: Calculate biomass in t per non-age-structured groups (biomass...

View source: R/calc_biomass_pool.R

calc_biomass_poolR Documentation

Calculate biomass in t per non-age-structured groups (biomass pools) per polygon and time.

Description

Calculate biomass in t per non-age-structured groups (biomass pools) per polygon and time.

Usage

calc_biomass_pool(pooln, vol, area, fgs, biolprm)

Arguments

pooln

A data.frame containing the Nitrogen per functional-group ("species") per timestep, layer and polygon. Ageclass is always = 1. The data.frame has to originate from load_nc using select_variable = "N".

vol

A data.frame containing the volume for each time, polygon, and layer. The data.frame must originate from load_nc_physics using physic_variables = "volume".

area

A data.frame containing the area for each polygon. The data.frame must originate from load_boxarea.

fgs

A data frame created by load_fgs that reads in the csv file containing functional group names, usually "functionalGroups.csv".

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=1, time, polygon and atoutput. Atoutput is the total biomass in t. At this point biomass was aggregated (sum) per layer or area for benthos!

Author(s)

Alexander Keth modified by Sarah Gaichas

See Also

Other calc functions: calc_Z(), calc_age2length(), calc_avgwtstage2age(), calc_biomass_age(), 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 pool values
pooln <- load_nc(dir = d, file_nc = "outputs.nc",
  bps = bps, fgs = fgs, select_groups = fgs[fgs$IsTurnedOn > 0, "Name"],
  select_variable = "N", check_acronyms = TRUE, bboxes = boxes)

biomasspools <- calc_biomass_pool(pooln = pooln, biolprm = biolprm)


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