Runs the core age- and season-structured population dynamics loop for southern bluefin tuna. The loop applies catch-conditioned removals, natural mortality, spawning, and Beverton-Holt recruitment with lognormal deviations. Standard fisheries use selectivity-based catch conditioning; optional direct-removal fisheries use sliced age frequencies.
Usage
do_dynamics(
first_yr,
first_yr_catch,
B0 = 6400000,
R0,
alpha,
beta,
h = 0.7,
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,
harvest_wall = NULL,
report = FALSE
)Arguments
- first_yr
Integer first model year (e.g., 1931).
- first_yr_catch
Integer first year with catch data, which 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 retained for interface compatibility. The supplied
alphaandbetaalready encode steepness, so this argument is not read by the dynamics loop.- sigma_r
Numeric standard deviation of log recruitment deviations.
- rdev_y
Vector of log recruitment deviations, one per modeled recruitment year.
- M_a
Vector of natural mortality rates indexed by age.
- phi_ya
Matrix of spawning output per fish at age, with dimensions
(n_year + 1)byn_age, created byget_phi().- init_number_a
Vector of initial numbers-at-age for year 1, season 1.
- removal_switch_f
Integer vector of length
n_fishery: 0 uses catch-conditioned selectivity and 1 uses direct sliced age frequencies.- catch_obs_ysf
A 3D array of observed catch weights with dimensions catch year by season by fishery.
- sel_fya
A 3D array of fishery selectivity-at-age with dimensions fishery by year by age, created by
get_selectivity().- weight_fya
A 3D array of mean weight-at-age in tonnes per fish, with dimensions n_fishery by n_year by n_age.
- af_sliced_ysfa
A 4D array of sliced age-frequency numbers with dimensions year by season by fishery by age. It is used only for fisheries whose removal switch is 1.
- harvest_wall
Optional named list with
strength,onset,ceiling, andscale. These values are passed toharvest_wall_contract()inside the dynamics.NULLuses the disabled contract and is intended for direct diagnostic or projection calls;sbt_model()always supplies the explicit settings prepared byget_data().- report
Logical. If
TRUE, register dynamics and penalty outputs withRTMB::REPORT(). The assessment objective sets this to true; direct calls default to no reporting side effects.
Value
A list containing:
- number_ysa
Updated numbers-at-age by year, season, and age.
- spawning_biomass_y
Spawning biomass by year.
- recruitment_y
Recruitment by year.
- hrate_ysfa
Raw fishery-specific harvest rates.
- hrate_raw_ysa,hrate_ysa
Raw total and positive-continuation harvest rates used by the dynamics.
- survival_raw_ysa,survival_used_ysa
Raw and continued survival after fishing.
- harvest_penalty_ysa,harvest_penalty_ys
Age-specific and aggregated feasibility penalties.
- catch_pred_fya
Predicted catch numbers by fishery, year, and age.
- catch_pred_ysf
Predicted catch weights by year, season, and fishery.
- harvest_wall_penalty_ysa
Preventive-wall contribution by cell.
- lp_feasibility
Total positive-survival continuation penalty.
- lp_harvest_wall
Total preventive harvest-wall penalty.
- lp_penalty
Sum of
lp_feasibilityandlp_harvest_wall.
Details
The implementation is specialized to the assessment's two seasons and six fisheries. It preserves each observed total catch exactly when constructing removals. The smooth positive continuation is an objective feasibility device and does not replace the separate biological-state acceptance checks.
