Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ body:
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
placeholder: I expected...
placeholder: I expected ...
validations:
required: true
- type: textarea
Expand Down
14 changes: 9 additions & 5 deletions SS_benchfore.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,9 @@ FUNCTION void Get_Benchmarks(const int show_MSY)
YPR_spr_profit = YPR_spr_revenue - Cost;
SPR_Fmult = Fmult;
if (rundetail > 0 && mceval_counter == 0 && show_MSY == 1)
cout << " got Fspr " << SPR_Fmult << " " << SPR_actual / 100. << endl;
{
echoinput << "Calculated Fspr " << SPR_Fmult << " " << SPR_actual / 100. << endl;
}
Vbio_spr = totbio;
Vbio1_spr = smrybio;
Mgmt_quant(10) = equ_F_std;
Expand Down Expand Up @@ -896,7 +898,7 @@ FUNCTION void Get_Benchmarks(const int show_MSY)

Btgt_Fmult = F1(1);
if (rundetail > 0 && mceval_counter == 0 && show_MSY == 1)
cout << " got_F0.1: " << Btgt_Fmult << endl;
echoinput << "Calculated F0.1: " << Btgt_Fmult << endl;
Comment thread
Rick-Methot-NOAA marked this conversation as resolved.
SPR_temp = SSB_equil;
Equ_SpawnRecr_Result = Equil_Spawn_Recr_Fxn(SR_parm_work(2), SR_parm_work(3), SSB_unf, Recr_unf, SPR_temp); // returns 2 element vector containing equilibrium biomass and recruitment at this SPR
Btgt = Equ_SpawnRecr_Result(1);
Expand Down Expand Up @@ -1060,7 +1062,9 @@ FUNCTION void Get_Benchmarks(const int show_MSY)

Btgt_Fmult = Fmult;
if (rundetail > 0 && mceval_counter == 0 && show_MSY == 1)
cout << " got_Btgt " << Btgt_Fmult << " " << Btgt / SSB_unf << endl;
{
echoinput << "Calculated Btgt: " << Btgt_Fmult << " " << Btgt / SSB_unf << endl;
}
YPR_Btgt_enc = YPR_enc; // total encountered yield per recruit
YPR_Btgt_dead = YPR_dead; // total dead yield per recruit
YPR_Btgt_N_dead = YPR_N_dead; // total dead yield per recruit
Expand Down Expand Up @@ -1664,14 +1668,14 @@ FUNCTION void Get_Benchmarks(const int show_MSY)

Btgt_Fmult2 = Fmult;
if (rundetail > 0 && mceval_counter == 0 && show_MSY == 1)
cout << " got_F_Blimit " << Btgt_Fmult2 << " " << Btgt2 / Blim_report << endl;
echoinput << "Calculated F_Blimit " << Btgt_Fmult2 << " " << Btgt2 / Blim_report << endl;
Comment thread
Rick-Methot-NOAA marked this conversation as resolved.
Mgmt_quant(18) = Btgt2;
Mgmt_quant(19) = equ_F_std;
Mgmt_quant(20) = sum(equ_catch_fleet(2)) * Equ_SpawnRecr_Result(2);
} // end finding F for Blimit

if (rundetail > 0 && mceval_counter == 0 && show_MSY == 1)
cout << " got Fmsy " << MSY_Fmult << " " << MSY << endl;
echoinput << "Calculated Fmsy " << MSY_Fmult << " " << MSY << endl;
Comment thread
Rick-Methot-NOAA marked this conversation as resolved.

// ***************** show management report SS_Label_740
if (show_MSY == 1)
Expand Down
61 changes: 27 additions & 34 deletions SS_global.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,6 @@ GLOBALS_SECTION
BETWEEN_PHASES_SECTION
{
int j_phase = current_phase(); // this is the phase to come
cout << current_phase() - 1 << " " << niter << " -log(L): " << obj_fun << " between " << endl;

// SS_Label_Info_11.1 #Save last value of objective function
if (j_phase > 1)
Expand Down Expand Up @@ -922,16 +921,6 @@ BETWEEN_PHASES_SECTION
FINAL_SECTION
{
// SS_Label_Info_12.1 #Get run ending time
time(&finish);
elapsed_time = difftime(finish, start);
hour = long(elapsed_time) / 3600;
minute = long(elapsed_time) % 3600 / 60;
second = (long(elapsed_time) % 3600) % 60;
cout << endl
<< "In final section " << endl;
cout << "Finish time: " << ctime(&finish);
cout << "Elapsed time: ";
cout << hour << " hours, " << minute << " minutes, " << second << " seconds." << endl;

if (No_Report == 1)
{
Expand All @@ -940,9 +929,8 @@ FINAL_SECTION

else
{
cout << " Iterations: " << niter << " -log(L): " << obj_fun << endl;
cout << "Final gradient: " << objective_function_value::pobjfun->gmax << endl
<< endl;
cout << "Iterations: " << niter << endl;
Comment thread
kellijohnson-NOAA marked this conversation as resolved.
echoinput << "Iterations: " << niter << endl;
if (objective_function_value::pobjfun->gmax > final_conv)
{
warnstream << "Final gradient: " << objective_function_value::pobjfun->gmax << " is larger than final_conv: " << final_conv;
Expand Down Expand Up @@ -997,7 +985,7 @@ FINAL_SECTION
}
}
if (mceval_phase() == 0)
cout << " finished COVAR.SSO" << endl;
echoinput << " finished COVAR.SSO" << endl;
}

// SS_Label_Info_12.3 #Go thru time series calculations again to get extra output quantities
Expand All @@ -1013,7 +1001,7 @@ FINAL_SECTION
if (Do_Forecast > 0)
{
show_MSY = 0;
Get_Forecast();
Get_Forecast(); // First call to forecast
}
k = Do_Dyn_Bzero;
for (j = styr - 2; j <= YrMax; j++)
Expand Down Expand Up @@ -1062,21 +1050,28 @@ FINAL_SECTION
{
Get_Benchmarks(show_MSY);
if (mceval_phase() == 0)
cout << " finished benchmark" << endl;
{
cout << "Finished calculating benchmarks" << endl;
echoinput << "Finished calculating benchmarks" << endl;
}
}
}
if (Do_Forecast >= 0)
{
report5 << "THIS FORECAST FOR PURPOSES OF GETTING DISPLAY QUANTITIES" << endl;
report5 << "THIS FORECAST IS FOR PURPOSES OF GETTING DISPLAY QUANTITIES" << endl;
if (did_MSY > 0)
show_MSY = 0; // so to not repeat forecast_report.sso
Get_Forecast();
if (mceval_phase() == 0)
cout << " finished forecast" << endl;
if (mceval_phase() == 0) {
cout << "Finished forecast" << endl;
echoinput << "Finished forecast" << endl;
}
}

if (write_bodywt > 0)
{
cout << "Writing wtatage.ss_new" << endl;
echoinput << "Writing wtatage.ss_new" << endl;
bodywtout << -9999 << " " << 1 << " " << 1 << " " << 1 << " " << 1 << " " << 0 << " " << Wt_Age_mid(1, 1) << " #terminator " << endl;
bodywtout.close();
}
Expand All @@ -1085,10 +1080,13 @@ FINAL_SECTION
// SS_Label_Info_12.3.4 #call fxn STDquant()
Process_STDquant();
if (mceval_phase() == 0)
cout << " finished StdDev quantities" << endl;
echoinput << "Finished StdDev quantities" << endl;
get_posteriors();
if (mceval_phase() == 0)
cout << " finished posteriors" << endl;
{
cout << "Finished posteriors" << endl;
echoinput << "Finished posteriors" << endl;
}

// SS_Label_Info_12.4.2 #Call fxn write_summaryoutput()
if (Do_CumReport > 0)
Expand All @@ -1114,17 +1112,17 @@ FINAL_SECTION
// SS_Label_Info_12.4 #Do Outputs
// SS_Label_Info_12.4.1 #Call fxn write_bigoutput()
write_bigoutput();
cout << " finished report.sso" << endl;
cout << "Finished final writing of report.sso" << endl;
echoinput << "Finished final writing of report.sso" << endl;
}
// SS_Label_Info_12.4.4 #Call fxn write_nudata() to create bootstrap data
if (N_nudata > 0)
{
cout << "Creating bootstrap files: " << N_nudata << " files";
cout << "Begin writing *.ss_new output files ... ";
write_nudata();
cout << " finished" << endl;

// SS_Label_Info_12.4.5 #Call fxn write_nucontrol() to produce control.ss_new
write_nucontrol();
cout << "Finished writing *.ss_new output files" << endl;
}
else
{
Expand All @@ -1134,28 +1132,22 @@ FINAL_SECTION
}
}

echoinput << "Begin final output calculations and warnings" << endl;
// SS_Label_Info_12.4.6 #Call fxn write_Bzero_output() appended to report.sso
if (pick_report_use(59) == "Y")
{
cout << "dynamic Bzero in FINAL_SECTION: ";
write_Bzero_output();
cout << " finished " << endl;
}

if (pick_report_use(54) == "Y" && Do_Benchmark > 0)
{
cout << "setup_benchmark: " << endl;
setup_Benchmark();
cout << "SPR_profile: ";
SPR_profile();
cout << " finished " << endl;
}

if (pick_report_use(55) == "Y" && Do_Benchmark > 0)
{
cout << "Global_MSY: ";
Global_MSY();
cout << " finished " << endl;
}

if (parm_adjust_method == 3)
Expand Down Expand Up @@ -1344,7 +1336,8 @@ REPORT_SECTION
get_time_series(); // in ADMB's report_section
evaluate_the_objective_function();
write_bigoutput();
cout << "Wrote bigoutput and bodywt for last_phase in REPORT_SECTION and before hessian, no benchmark or forecast " << endl;
echoinput << "Wrote first version of output files (before hessian, benchmark, and forecast)" << endl;
cout << "Wrote first version of output files (before hessian, benchmark, and forecast)" << endl;
save_for_report = 0;
write_bodywt = 0;
// SS2out.close();
Expand Down
35 changes: 20 additions & 15 deletions SS_objfunc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ FUNCTION void evaluate_the_objective_function()
} // end having obs for this survey
}
if (do_once == 1)
cout << " did survey obj_fun " << surv_like << endl;
echoinput << "Finished survey obj_fun " << surv_like << endl;
}

// SS_Label_Info_25.2 #Fit to discard
Expand Down Expand Up @@ -234,7 +234,9 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " did discard obj_fun " << disc_like << endl;
{
echoinput << "Finished discard obj_fun " << disc_like << endl;
}
}

// SS_Label_Info_25.3 #Fit to mean body wt
Expand All @@ -246,7 +248,7 @@ FUNCTION void evaluate_the_objective_function()
mnwt_like(mnwtdata(3, i)) += 0.5 * (DF_bodywt + 1.) * log(1. + square(mnwtdata(6, i) - exp_mnwt(i)) / mnwtdata(9, i)) + mnwtdata(10, i);
}
if (do_once == 1)
cout << " did meanwt obj_fun " << mnwt_like << endl;
echoinput << " Finished meanwt obj_fun " << mnwt_like << endl;
}

// SS_Label_Info_25.4 #Fit to length comp
Expand Down Expand Up @@ -404,7 +406,7 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " did lencomp obj_fun " << length_like_tot << endl;
echoinput << "Finished lencomp obj_fun " << length_like_tot << endl;
}

// SS_Label_Info_25.5 #Fit to age composition
Expand Down Expand Up @@ -540,7 +542,7 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " did agecomp obj_fun " << age_like_tot << endl;
echoinput << "Finished agecomp obj_fun " << age_like_tot << endl;
}

// SS_Label_Info_25.6 #Fit to mean size@age
Expand Down Expand Up @@ -574,7 +576,7 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " did meanlength obj_fun " << sizeage_like << endl;
echoinput << "Finished meanlength obj_fun " << sizeage_like << endl;
}

// SS_Label_Info_25.7 #Fit to generalized Size composition
Expand Down Expand Up @@ -653,7 +655,7 @@ FUNCTION void evaluate_the_objective_function()
Morphcomp_like -= Morphcomp_obs(iobs, 5) * Morphcomp_obs(iobs)(6, k) * log(elem_div(Morphcomp_exp(iobs)(6, k), Morphcomp_obs(iobs)(6, k)));
}
if (do_once == 1)
cout << " did morphcomp obj_fun " << Morphcomp_like << endl;
cout << "Finished morphcomp obj_fun " << Morphcomp_like << endl;
}

// SS_Label_Info_25.9 #Fit to tag-recapture
Expand Down Expand Up @@ -692,7 +694,7 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " did tag obj_fun " << TG_like1 << endl
cout << "Finished tag obj_fun " << TG_like1 << endl
<< TG_like2 << endl;
}

Expand All @@ -706,7 +708,7 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " initequ_catch -log(L) " << equ_catch_like << endl;
echoinput << " initequ_catch -log(L) " << equ_catch_like << endl;

// SS_Label_Info_25.11 #Fit to catch by fleet/season
if (F_Method > 1)
Expand Down Expand Up @@ -736,7 +738,7 @@ FUNCTION void evaluate_the_objective_function()
}
}
if (do_once == 1)
cout << " catch -log(L) " << catch_like << endl;
echoinput << " catch -log(L) " << catch_like << endl;
}

// SS_Label_Info_25.12 #Likelihood for the recruitment deviations
Expand Down Expand Up @@ -809,7 +811,7 @@ FUNCTION void evaluate_the_objective_function()
if (do_recdev == 4)
regime_like += square(sum_recdev);
if (do_once == 1)
cout << " did recruitdev obj_fun " << recr_like << " " << sd_offset_rec << " " << two_sigmaRsq << endl;
echoinput << "Finished recruitdev obj_fun " << recr_like << " " << sd_offset_rec << " " << two_sigmaRsq << endl;
}
if (Do_Forecast > 0 && do_recdev > 0)
{
Expand Down Expand Up @@ -1106,7 +1108,7 @@ FUNCTION void evaluate_the_objective_function()

if (do_once == 1)
{
cout << " OK with obj_func " << obj_fun << endl;
echoinput << " OK with obj_func " << obj_fun << endl;
if (SSB_yr(endyr) < 0.01 * SSB_yr(styr))
{
warnstream << "1st iteration warning: ssb(endyr)/ssb(styr)= " << SSB_yr(endyr) / SSB_yr(styr) << "; suggest start with larger R0 to get near 0.4; or use depletion fleet option";
Expand Down Expand Up @@ -1612,10 +1614,13 @@ FUNCTION void get_posteriors()
//********************************************************************
/* SS_Label_FUNCTION 33 get_posteriors (MCMC eval) */
if (rundetail > 1)
cout << " mceval counter: " << mceval_counter << endl;
{
cout << "mceval counter: " << mceval_counter << endl;
}
if (rundetail == 0 && double(mceval_counter) / 200. == double(mceval_counter / 200.))
cout << " mceval counter: " << mceval_counter << endl;

{
cout << "mceval counter: " << mceval_counter << endl;
}
if (mceval_header == 0 && mceval_phase()) // first pass through the mceval phase
{
// delete any old mcmc output files
Expand Down
3 changes: 2 additions & 1 deletion SS_param.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ PARAMETER_SECTION
// clang-format on
// set the filename to all ADMB output files to "ss.[ext]"
ad_comm::adprogram_name = "ss";
echoinput << "now in PARAMETER_SECTION " << endl;
echoinput << "Begin setting up parameters" << endl;
cout << "Begin setting up parameters ... ";
if (readparfile >= 1)
{
cout << " read parm file" << endl;
Expand Down
Loading