@@ -13,53 +13,52 @@ INITIALIZATION_SECTION
13
13
PARAMETER_SECTION
14
14
// {
15
15
// SS_Label_Info_5.0.1 #Setup convergence critera and max func evaluations
16
- LOCAL_CALCS
17
- // clang-format on
18
- // set the filename to all ADMB output files to " base_modelname.[ext]"
19
- // where base_modelname can be read from command line with command modelname followed by text
20
- // e.g. ss3_win.exe -nohess -stopph 3 modelname ss4you
21
- // if requested modelname.par is not found, then will attempt to read from ss3.par then ss.par
22
- // whatever name is read, the write will be to modelname.par. Which has default of ss3.par
23
- ad_comm::adprogram_name = base_modelname;
24
- echoinput << " Begin setting up parameters" << endl;
25
- cout << " Begin setting up parameters ... " ;
26
- if (readparfile >= 1)
27
- {
28
- anystring = base_modelname + " .par" ;
29
- cout << " read parm file: " << anystring << endl;
30
-
16
+ LOCAL_CALCS
17
+ // clang-format on
18
+ // set the filename to all ADMB output files to " base_modelname.[ext]"
19
+ // where base_modelname can be read from command line with command modelname followed by text
20
+ // e.g. ss3_win.exe -nohess -stopph 3 modelname ss4you
21
+ // if requested modelname.par is not found, then will attempt to read from ss3.par then ss.par
22
+ // whatever name is read, the write will be to modelname.par. Which has default of ss3.par
23
+ ad_comm::adprogram_name = base_modelname;
24
+ echoinput << " Begin setting up parameters" << endl;
25
+ cout << " Begin setting up parameters ... " ;
26
+ if (readparfile >= 1) {
27
+ anystring = base_modelname + " .par" ;
28
+ cout << " read parm file: " << anystring << endl;
29
+
30
+ ifstream fin(anystring);
31
+ if (fin.fail()) {
32
+ cout << " no find, try ss3.par" << endl;
33
+ anystring = " ss3.par" ;
31
34
ifstream fin(anystring);
32
- if (fin.fail() ) {
33
- cout << " no find, try ss3.par" << endl;
34
- anystring = " ss3.par" ;
35
- ifstream fin(anystring);
36
- if (fin.fail() ) {
35
+ if (fin.fail()) {
37
36
cout << " no find, try ss.par" << endl;
38
37
anystring = " ss.par" ;
39
38
ifstream fin(anystring);
40
- if (fin.fail() ) {
41
- warnstream << " could not find ss3.par, ss.par, or requested parfile " << base_modelname << " .par" ;
42
- write_message(FATAL, 0);
39
+ if (fin.fail()) {
40
+ warnstream << " could not find ss3.par, ss.par, or requested parfile " << base_modelname << " .par" ;
41
+ write_message(FATAL, 0);
43
42
}
44
- }}
45
- cout << " found "<<anystring <<endl;
46
-
47
- ad_comm::change_pinfile_name(anystring);
43
+ }
48
44
}
49
-
50
- maximum_function_evaluations.allocate(func_eval.indexmin(), func_eval.indexmax());
51
- maximum_function_evaluations = func_eval;
52
- convergence_criteria.allocate(func_conv.indexmin(), func_conv.indexmax());
53
- convergence_criteria = func_conv;
54
- if (do_ageK == 1) // need for age-specific K
55
- {
56
- k = nages;
57
- } // use for dimension of VBK()
58
- else
59
- {
60
- k = 0;
61
- }
62
- // clang-format off
45
+ cout << " found " << anystring << endl;
46
+
47
+ ad_comm::change_pinfile_name(anystring);
48
+ }
49
+
50
+ maximum_function_evaluations.allocate(func_eval.indexmin(), func_eval.indexmax());
51
+ maximum_function_evaluations = func_eval;
52
+ convergence_criteria.allocate(func_conv.indexmin(), func_conv.indexmax());
53
+ convergence_criteria = func_conv;
54
+ if (do_ageK == 1) // need for age-specific K
55
+ {
56
+ k = nages;
57
+ } // use for dimension of VBK()
58
+ else {
59
+ k = 0;
60
+ }
61
+ // clang-format off
63
62
END_CALCS
64
63
65
64
!! // SS_Label_Info_5.0.2 #Create dummy_parm that will be estimated even if turn_off_phase is set to 0
@@ -112,23 +111,25 @@ PARAMETER_SECTION
112
111
4darray Save_PopBio(styr-3*nseas,TimeMax_Fcast_std+nseas,1,2*pop,1,gmorph,0,nages)
113
112
114
113
LOCAL_CALCS
115
- // clang-format on
116
- // If empirical wt-at-age is used, maturity and fecundity vectors are set to a distinctive value of 0.5
117
- // If parameters are used, then the calcs could be age-based or length-based or both, so start with default value of 1.0
118
- // These calculations happen in function get_mat_fec() in file SS_biofxn.tpl
119
- if (WTage_rd == 1 || Maturity_Option == 4 || Maturity_Option == 5 ) {
120
- mat_len = 0.5;
121
- mat_age = 0.5;
122
- mat_fec_len = 0.5;
123
- fec_len = 0.5;
124
- }
125
- else {
126
- mat_len = 1.0;
127
- mat_age = 1.0;
128
- mat_fec_len = 1.0;
129
- fec_len = 1.0;
130
- }
131
- // clang-format off
114
+ // clang-format on
115
+ // If empirical wt-at-age is used, maturity and fecundity vectors are set to a distinctive value of 0.5
116
+ // If parameters are used, then the calcs could be age-based or length-based or both, so start with default value of 1.0
117
+ // These calculations happen in function get_mat_fec() in file SS_biofxn.tpl
118
+ if (WTage_rd == 1 || Maturity_Option == 4 || Maturity_Option == 5)
119
+ {
120
+ mat_len = 0.5;
121
+ mat_age = 0.5;
122
+ mat_fec_len = 0.5;
123
+ fec_len = 0.5;
124
+ }
125
+ else
126
+ {
127
+ mat_len = 1.0;
128
+ mat_age = 1.0;
129
+ mat_fec_len = 1.0;
130
+ fec_len = 1.0;
131
+ }
132
+ // clang-format off
132
133
END_CALCS
133
134
134
135
3darray age_age(0,N_ageerr+store_agekey_add,1,n_abins2,0,gender*nages+gender-1)
@@ -159,42 +160,40 @@ PARAMETER_SECTION
159
160
3darray recr_dist_endyr(1,N_GP*gender,1,N_settle_timings,1,pop);
160
161
!!// SS_Label_Info_5.1.2 #Create SR_parm vector, recruitment vectors
161
162
init_bounded_number_vector SR_parm(1,N_SRparm3,SR_parm_LO,SR_parm_HI,SR_parm_PH)
162
- matrix SR_parm_byyr(styr-3,YrMax,1,N_SRparm2+1) // R0, steepness, parm3, sigmar, rec_dev_offset, R1, rho, SPB Time_vary implementation of spawner-recruitment
163
+ matrix SR_parm_byyr(styr-3,YrMax,1,N_SRparm2+1) // R0, steepness, parm3, sigmar, rec_dev_offset, R1, rho, SSB Time_vary implementation of spawner-recruitment
163
164
vector SR_parm_virg(1,N_SRparm2+1)
164
165
vector SR_parm_work(1,N_SRparm2+1)
165
166
number two_sigmaRsq;
166
167
number half_sigmaRsq;
167
168
number sigmaR;
168
- number SPR_virgin;
169
+ number SSBpR_virgin;
170
+ number SSBpR_virgin_adj;
169
171
number regime_change;
170
172
number rho;
171
173
number dirichlet_Parm;
172
174
LOCAL_CALCS
173
- // clang-format on
174
- Ave_Size.initialize();
175
- // if(SR_parm(N_SRparm2)!=0.0 || SR_parm_PH(N_SRparm2)>0) { SR_autocorr=1;} else { SR_autocorr=0;} // flag for recruitment autocorrelation
176
- if (do_recdev == 1)
177
- {
178
- k = recdev_start;
179
- j = recdev_end;
180
- s = 1;
181
- p = -1;
182
- }
183
- else if (do_recdev >= 2)
184
- {
185
- s = recdev_start;
186
- p = recdev_end;
187
- k = 1;
188
- j = -1;
189
- }
190
- else
191
- {
192
- s = 1;
193
- p = -1;
194
- k = 1;
195
- j = -1;
196
- }
197
- // clang-format off
175
+ // clang-format on
176
+ Ave_Size.initialize();
177
+ // if(SR_parm(N_SRparm2)!=0.0 || SR_parm_PH(N_SRparm2)>0) { SR_autocorr=1;} else { SR_autocorr=0;} // flag for recruitment autocorrelation
178
+ if (do_recdev == 1) {
179
+ k = recdev_start;
180
+ j = recdev_end;
181
+ s = 1;
182
+ p = -1;
183
+ }
184
+ else if (do_recdev >= 2) {
185
+ s = recdev_start;
186
+ p = recdev_end;
187
+ k = 1;
188
+ j = -1;
189
+ }
190
+ else {
191
+ s = 1;
192
+ p = -1;
193
+ k = 1;
194
+ j = -1;
195
+ }
196
+ // clang-format off
198
197
END_CALCS
199
198
200
199
// vector biasadj(styr-nages,YrMax) // biasadj as used; depends on whether a recdev is estimated or not
@@ -210,45 +209,45 @@ PARAMETER_SECTION
210
209
vector recdev(recdev_first,YrMax);
211
210
212
211
LOCAL_CALCS
213
- // clang-format on
214
- if (do_recdev == 0)
215
- {
216
- s = -1;
217
- }
218
- else
219
- {
220
- s = YrMax;
221
- }
222
- if (Do_Impl_Error > 0)
223
- {
224
- k = Fcast_recr_PH2;
225
- j = YrMax;
226
- }
227
- else
228
- {
229
- k = -1;
230
- j = -1;
231
- }
232
- // clang-format off
212
+ // clang-format on
213
+ if (do_recdev == 0) {
214
+ s = -1;
215
+ }
216
+ else {
217
+ s = YrMax;
218
+ }
219
+ if (Do_Impl_Error > 0) {
220
+ k = Fcast_recr_PH2;
221
+ j = YrMax;
222
+ }
223
+ else {
224
+ k = -1;
225
+ j = -1;
226
+ }
227
+ // clang-format off
233
228
END_CALCS
234
229
init_bounded_vector Fcast_recruitments(recdev_end+1,s,recdev_LO,recdev_HI,Fcast_recr_PH2)
235
230
init_bounded_vector Fcast_impl_error(endyr+1,j,-1,1,k)
236
231
vector ABC_buffer(endyr+1,YrMax);
232
+ number HCR_anchor // basis (denominator) for inflection in control rule. Select virgin SSB or benchmark SSB
237
233
238
234
// SPAWN-RECR: define some spawning biomass and recruitment entities
239
235
number SSB_virgin
240
236
number Recr_virgin
241
237
number SSB_vir_LH
242
238
243
- number SSB_unf
239
+ number SSB_unf // SSB unfished, based on benchmark biology
244
240
number Recr_unf
241
+ number SSB_use
242
+ number R0_use; // annually updated value if SR_update_SSBpR0_timeseries == 1
245
243
244
+ number SSB_deplete // SSB that will be used as denominator for depletion calculations and as basis for control rule inflection
246
245
number SSB_current; // Spawning biomass
247
246
number SSB_equil;
248
247
249
248
number SPR_trial
250
249
number SPR_actual;
251
- number SPR_temp ; // used to pass quantity into Equil_SpawnRecr
250
+ number SSBpR_temp ; // SSB per Recruit; used to pass quantity into Equil_SpawnRecr
252
251
number Recruits; // Age0 Recruits
253
252
number equ_mat_bio
254
253
number equ_mat_num
@@ -321,7 +320,7 @@ PARAMETER_SECTION
321
320
!!k=0;
322
321
!!if(Hermaphro_Option!=0) k=1;
323
322
324
- 3darray MaleSPB (styr-3,YrMax*k,1,pop,1,N_GP) //Male Spawning biomass
323
+ 3darray MaleSSB (styr-3,YrMax*k,1,pop,1,N_GP) //Male Spawning biomass
325
324
326
325
matrix SSB_equil_pop_gp(1,pop,1,N_GP);
327
326
matrix MaleSSB_equil_pop_gp(1,pop,1,N_GP);
@@ -387,16 +386,15 @@ PARAMETER_SECTION
387
386
388
387
389
388
LOCAL_CALCS
390
- // clang-format on
391
- if (N_Fparm > 0) // continuous F
392
- {
393
- k = N_Fparm;
394
- }
395
- else
396
- {
397
- k = -1;
398
- }
399
- // clang-format off
389
+ // clang-format on
390
+ if (N_Fparm > 0) // continuous F
391
+ {
392
+ k = N_Fparm;
393
+ }
394
+ else {
395
+ k = -1;
396
+ }
397
+ // clang-format off
400
398
END_CALCS
401
399
// defining F_rate as number_vector allows for Fparm_PH to be element specific
402
400
init_bounded_number_vector F_rate(1,k,0.,max_harvest_rate,Fparm_PH_dim)
@@ -416,6 +414,7 @@ PARAMETER_SECTION
416
414
// note that bycatch_F(1,Nfleet,1,nseas) has similar role
417
415
number alpha;
418
416
number beta;
417
+ number steepness;
419
418
number GenTime;
420
419
number Yield;
421
420
number Adj4010;
@@ -491,9 +490,9 @@ PARAMETER_SECTION
491
490
number overdisp // overdispersion
492
491
493
492
LOCAL_CALCS
494
- // clang-format on
495
- k = Do_TG * (3 * N_TG + 2 * Nfleet1);
496
- // clang-format off
493
+ // clang-format on
494
+ k = Do_TG * (3 * N_TG + 2 * Nfleet1);
495
+ // clang-format off
497
496
END_CALCS
498
497
499
498
init_bounded_number_vector TG_parm(1,k,TG_parm_LO,TG_parm_HI,TG_parm_PH);
@@ -506,12 +505,12 @@ PARAMETER_SECTION
506
505
matrix parm_timevary(1,timevary_cnt,styr-1,YrMax); // time series of adjusted parm values for block and trend
507
506
508
507
LOCAL_CALCS
509
- // clang-format on
510
- if (Do_Forecast > 0)
511
- k = TimeMax_Fcast_std + nseas;
512
- else
513
- k = TimeMax + nseas;
514
- // clang-format off
508
+ // clang-format on
509
+ if (Do_Forecast > 0)
510
+ k = TimeMax_Fcast_std + nseas;
511
+ else
512
+ k = TimeMax + nseas;
513
+ // clang-format off
515
514
END_CALCS
516
515
517
516
!!// SS_Label_Info_5.1.7 #Create arrays for storing derived selectivity quantities for use in mortality calculations
0 commit comments