Rceattle C++ template
The CEATTLE likelihood: src/TMB/ceattle.cpp and its headers
Loading...
Searching...
No Matches
bioenergetics.hpp File Reference

Go to the source code of this file.

Functions

template<class Type>
void calculate_temperature_function (matrix< Type > &fT, int nspp, int nyrs, const vector< int > &Ceq, const vector< int > &Cindex, const vector< Type > &Qc, const vector< Type > &Tcm, const vector< Type > &Tco, const vector< Type > &Tcl, const vector< Type > &CK1, const vector< Type > &CK4, const matrix< Type > &env_index)
 Temperature-dependent function of consumption (fT) for bioenergetics.
template<class Type>
void calculate_ration (array< Type > &consumption_at_age, int nspp, int nyrs, int nyrs_hind, const vector< int > &nsex, const vector< int > &nages, const vector< int > &Ceq, const vector< Type > &CA, const vector< Type > &CB, const vector< Type > &fday, const vector< Type > &Pvalue, matrix< Type > &fT, array< Type > &ration_data, array< Type > &weight_hat)
 Annual ration of a predator at age, in kg per predator per year.

Function Documentation

◆ calculate_ration()

template<class Type>
void calculate_ration ( array< Type > & consumption_at_age,
int nspp,
int nyrs,
int nyrs_hind,
const vector< int > & nsex,
const vector< int > & nages,
const vector< int > & Ceq,
const vector< Type > & CA,
const vector< Type > & CB,
const vector< Type > & fday,
const vector< Type > & Pvalue,
matrix< Type > & fT,
array< Type > & ration_data,
array< Type > & weight_hat )

Annual ration of a predator at age, in kg per predator per year.

Updates consumption_at_age in place, from the bioenergetics equations (Ceq 1-3) or from input consumption (Ceq 4).

Parameters
consumption_at_ageIndividual consumption, kg/yr [nspp, max_sex, max_age, nyrs].
nsppNumber of species.
nyrsYears, hindcast plus projection.
nyrs_hindYears in the hindcast.
nsexSexes modelled per species: 1 = combined, 2 = both.
nagesAge bins per species.
CeqConsumption equation per species.
CAAllometric mass function intercept (Cmax = CA * W^(1+CB)).
CBAllometric mass function slope.
fdayForaging days per year, per species.
PvalueProportion of maximum consumption (scales Cmax).
fTTemperature-dependence function [nspp, nyrs].
ration_dataRelative foraging rates (Ceq 1-3), input consumption (Ceq 4).
weight_hatWeight-at-age [n_wt_indices, max_sex, max_age, nyrs].

Definition at line 125 of file bioenergetics.hpp.

◆ calculate_temperature_function()

template<class Type>
void calculate_temperature_function ( matrix< Type > & fT,
int nspp,
int nyrs,
const vector< int > & Ceq,
const vector< int > & Cindex,
const vector< Type > & Qc,
const vector< Type > & Tcm,
const vector< Type > & Tco,
const vector< Type > & Tcl,
const vector< Type > & CK1,
const vector< Type > & CK4,
const matrix< Type > & env_index )

Temperature-dependent function of consumption (fT) for bioenergetics.

Updates the fT matrix in place. Supports multiple bioenergetics models: 1 = Exponential function (Stewart et al. 1983) 2 = Warm-water species temperature dependence (Kitchell et al. 1977) 3 = Cool/cold-water species temperature dependence (Thornton and Lessem 1979) 4 = Constant (fT = 1.0)

Parameters
fTTemperature functions [nspp, nyrs], updated.
nsppNumber of species.
nyrsYears, hindcast plus projection.
CeqConsumption equation per species.
CindexEnvironmental index driving each species.
QcQ coefficient in equations 1-2, a temperature in equation 3.
TcmThermal max.
TcoThermal optimum.
TclThermal limit for Thornton/Lessem.
CK1Ascending limit for Thornton/Lessem.
CK4Descending limit for Thornton/Lessem.
env_indexEnvironmental predictors, e.g. bottom temperature [nyrs, n_indices].

Definition at line 27 of file bioenergetics.hpp.