Runs the core age- and season-structured population dynamics loop for Southern Bluefin Tuna. Starts from initial equilibrium numbers (derived from B0 and h), applies seasonal harvest, natural mortality, spawning, recruitment (Beverton-Holt + log-normal deviates), and computes predicted catches and harvest rates. Handles both standard Baranov harvest (removal_switch_f == 0) and direct age-sliced removals (removal_switch_f == 1).
Usage
do_dynamics(
first_yr,
first_yr_catch,
B0,
R0,
alpha,
beta,
h,
sigma_r = 0.6,
rdev_y,
M_a,
phi_ya,
init_number_a,
removal_switch_f,
catch_obs_ysf,
sel_fya,
weight_fya,
af_sliced_ysfa
)Arguments
- first_yr
Integer first model year (e.g., 1931).
- first_yr_catch
Integer first year with catch data (determines when fishing begins).
- B0
Numeric unfished equilibrium spawning biomass.
- R0
Numeric unfished equilibrium recruitment.
- alpha
Numeric Beverton-Holt stock-recruitment alpha parameter.
- beta
Numeric Beverton-Holt stock-recruitment beta parameter.
- h
Numeric steepness parameter (0.2-1.0) of the Beverton-Holt stock-recruitment relationship.
- sigma_r
Numeric standard deviation of log recruitment deviations (default = 0.6).
- rdev_y
A
vectorof log-scale recruitment deviations of length n_year (one per recruitment year).- M_a
A
vectorof natural mortality rates indexed by age (length n_age).- phi_ya
A
matrixof spawning output (maturity × fecundity × weight) per recruit at age with dimensions (n_year + 1) by n_age (pre-computed viaget_phi).- init_number_a
A
vectorof initial numbers-at-age (length n_age) for year 1, season 1.- removal_switch_f
An integer
vectorof length n_fishery indicating removal type: 0 = standard Baranov harvest rate, 1 = direct removal using sliced age frequencies.- catch_obs_ysf
A 3D
arrayof observed catch weights with dimensions n_catch_years by n_season by n_fishery.- sel_fya
A 3D
arrayof fishery-specific selectivity-at-age with dimensions n_fishery by n_year by n_age (pre-computed viaget_selectivity).- weight_fya
A 3D
arrayof mean weight-at-age with dimensions n_fishery by n_year by n_age.- af_sliced_ysfa
A 4D
arrayof sliced age-frequency numbers with dimensions n_year by n_season by n_fishery by n_age (used only when removal_switch_f == 1).
Value
A list containing:
- number_ysa
3D array of updated numbers-at-age with dimensions (n_year + 1) by n_season by n_age.
- spawning_biomass_y
Vector of spawning biomass by year (length n_year + 1).
- hrate_ysfa
4D array of harvest rates with dimensions (n_year + 1) by n_season by n_fishery by n_age.
- hrate_ysa
3D array of total harvest rates with dimensions (n_year + 1) by n_season by n_age.
- catch_pred_fya
3D array of predicted catch numbers with dimensions n_fishery by (n_year + 1) by n_age.
- catch_pred_ysf
3D array of predicted catch weights with dimensions (n_year + 1) by n_season by n_fishery.
- lp_penalty
Numeric total penalty from
posfun(harvest rate constraints).
