@bthe mentioned that a model without age optimises significantly faster. In general removing the age loops when not required is hard, but there's a bunch of housekeeping in predation that could do stock_ssinv(stock__predby_predstock, 'area') instead of stock_ss(stock__predby_predstock), and remove the need for looping over each age this way.
However, TMB say no:-
Error in convert_subset(tail(in_call, -2)) :
Missing values must be at start of subset, can't restructure array: fish__predby_comm[, fish__area_idx, ]
Calls: g3_to_tmb ... cpp_code -> paste0 -> cpp_code -> paste0 -> convert_subset
Age being on the end means that bumping everything up one is a much easier operation, but maybe it's a poor choice in retrospect? There's always going to be more age dimensions than area.
@bthe mentioned that a model without age optimises significantly faster. In general removing the age loops when not required is hard, but there's a bunch of housekeeping in predation that could do
stock_ssinv(stock__predby_predstock, 'area')
instead ofstock_ss(stock__predby_predstock)
, and remove the need for looping over each age this way.However, TMB say no:-
Age being on the end means that bumping everything up one is a much easier operation, but maybe it's a poor choice in retrospect? There's always going to be more age dimensions than area.