calc_Z | R Documentation |
Calculate total mortality for all age-structured groups
in an Atlantis model. The mortality values are then used in other
functions to translate stages to ages: calc_stage2age
.
calc_Z(yoy, nums, fgs, biolprm, toutinc)
yoy |
Output from |
nums |
Object containing the number at stage. |
fgs |
A data frame created by |
biolprm |
A list of biological parameters available from the
|
toutinc |
output time increment from run.prm file |
Steps included when translating from stages (i.e., multiple age classes in a single group) to individual age classes are:
obtain numbers at age from each time-step
obtain numbers of recruits for each time-step, where the
information provided in the [...]YOY.txt
or yoy
object is provided in biomass and must be converted to numbers.
calculate total mortality for each time step, where
survival_{t} = (\sum(nastage_{t}) - recruits_{t}) / \sum{nastage_{t-1}}
Z_{t} = -1 * ln(survival_{t})
This function uses the YOY.txt and Nums to calculate Z.
A data.frame
of time-varying Z values.
Sean Lucey
Other calc functions:
calc_age2length()
,
calc_avgwtstage2age()
,
calc_biomass_age()
,
calc_biomass_pool()
,
calc_pred_cons()
,
calc_pred_diet()
,
calc_stage2age()
,
calc_timestep2time()
## Not run:
dir <- system.file("extdata", "SETAS_Example", package = "atlantisom")
file_nc <- "outputs.nc"
fgs <- load_fgs(dir = dir, "Functional_groups.csv")
file_init <- "Initial_condition.nc"
bps <- load_bps(dir = dir, "Functional_groups.csv", file_init = "Initial_condition.nc")
select_groups <- fgs$Name[fgs$IsTurnedOn > 0]
select_variable <- "Nums"
box.info <- load_box(dir = dir, file_bgm="Geography.bgm")
bboxes <- get_boundary(box.info)
#when calc_stage2age is run in the run_truth, it will need to have the nums
#data frame and the bioprm already read in:
nums_data <- load_nc(dir = dir,
file_nc="outputs.nc",
bps=bps, fgs=fgs, select_groups=select_groups,
select_variable = "Nums",
check_acronyms = TRUE, bboxes = bboxes)
biolprm <- load_biolprm(dir, file_biolprm="Biology.prm")
run <- load_runprm(dir, "Run_settings.xml")
yoy <- load_yoy(dir = dir, file_yoy = "outputsYOY.txt")
calc_Z(yoy = yoy, nums = nums_data, fgs = fgs, biolprm = biolprm,
toutinc = run$toutinc)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.