Skip to content

Commit

Permalink
Merge pull request #210 from nmfs-stock-synthesis/fix_warn
Browse files Browse the repository at this point in the history
Fix: increment warning where forgotten
  • Loading branch information
Rick-Methot-NOAA authored Sep 17, 2021
2 parents 9746cbf + b2a8bae commit cfbe093
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 17 deletions.
6 changes: 2 additions & 4 deletions SS_benchfore.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ FUNCTION void setup_Benchmark()
for (s=1;s<=nseas;s++)
{
if(Fcast_RelF_Use(s,f)==0. && bycatch_setup(f,3)>0)
{Fcast_RelF_Use(s,f)=1.0e-6; warning<<N_warn<<" setting positive forecast relF for bycatch fleet: "<<f<<endl;}
{Fcast_RelF_Use(s,f)=1.0e-6; N_warn++; warning<<N_warn<<" setting positive forecast relF for bycatch fleet: "<<f<<endl;}
}
}
if(N_Fcast_Input_Catches>0)
Expand All @@ -137,7 +137,7 @@ FUNCTION void setup_Benchmark()
for (s=1;s<=nseas;s++)
{
if(Fcast_RelF_special(s,f)==1 && Fcast_RelF_Use(s,f)==0.0)
{Fcast_RelF_Use(s,f)=1.0e-6; warning<<N_warn<<" setting positive forecast relF for forecast only fleet: "<<f<<endl;}
{Fcast_RelF_Use(s,f)=1.0e-6; N_warn++; warning<<N_warn<<" setting positive forecast relF for forecast only fleet: "<<f<<endl;}
}
}
} // end getting quantities for forecasts
Expand Down Expand Up @@ -2087,7 +2087,6 @@ FUNCTION void Get_Forecast()
}
join1=1./(1.+mfexp(30.*(temp-0.95*max_harvest_rate)));
Hrate(f,t)=join1*temp + (1.-join1)*max_harvest_rate; // new F value for this fleet, constrained by max_harvest_rate
// if(f==1) warning<<N_warn<<" "<<y<<" "<<Tune_F<<" stored old F "<<H_temp(f)<<" catch "<<C_temp(f)<<" tempF "<<temp<<" join "<<join1<<" new F "<<Hrate(f,t)<<endl;
C_old(f)=C_temp(f);
H_old(f)=H_temp(f);
}
Expand Down Expand Up @@ -2377,7 +2376,6 @@ FUNCTION void Get_Forecast()
countN += 1; // increment count of values included in average
annual_F(y,2) += log(tempM)-log(tempZ); // F=Z-M
annual_F(y,3) += log(tempbase)-log(tempM); // M
// if(save_for_report==1) warning<<N_warn<<" "<<y<<" age: "<<a<<" count: "<<countN<<" Z: "<<log(tempbase)-log(tempZ)<<" M: "<<log(tempbase)-log(tempM)<<" F: "<<log(tempM)-log(tempZ)<<" "<<annual_F(y)(2,3)<<endl;
}
annual_F(y,3) /= countN; // M
annual_F(y,2) /= countN; // F
Expand Down
7 changes: 5 additions & 2 deletions SS_expval.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,11 @@ FUNCTION void Get_expected_values(const int y,const int t);
exp_disc(f,j)=catch_fleet(t,f,4)-catch_fleet(t,f,6); // discard in numbers
if(disc_units(f)==2) exp_disc(f,j) /= (catch_fleet(t,f,4) + 0.0000001);
}
if(exp_disc(f,j)<0.0) warning<<N_warn<<" "<<f<<" "<<j<<" "<<exp_disc(f,j)<<" catches "<<catch_fleet(t,f)<<endl;
}
if(exp_disc(f,j)<0.0) {
N_warn++;
warning<<N_warn<<" "<<f<<" "<<j<<" "<<exp_disc(f,j)<<" catches "<<catch_fleet(t,f)<<endl;
}
}
else
{
exp_disc(f,j)=-1.;
Expand Down
2 changes: 0 additions & 2 deletions SS_global.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ GLOBALS_SECTION
if (z>0) // blocks with z as the block pattern
{
Nblocks=0.5*(block_design_pass.size());
// if(z>N_Block_Designs) {N_warn++; warning<<N_warn<<" "<<"parm: "<<j<<" ERROR, Block > N Blocks "<<z<<" "<<N_Block_Designs<<endl; exit(1);}
k=int(baseparm_list(14)); // block method
echoinput<<"block pattern: "<<z<<" method "<<k<<" Nblocks: "<<Nblocks<<endl;

Expand Down Expand Up @@ -595,7 +594,6 @@ GLOBALS_SECTION
}
// timevary_setup(12)=-5; // set reasonable phase for devs;
// baseparm_list(12)=-5;
// N_warn++; warning<<N_warn<<" "<<"A parameter dev vector has been created with phase set to negative. Edit phase as needed "<<endl;
}
timevary_parm_rd.push_back (dvector(tempvec(1,7)));

Expand Down
2 changes: 1 addition & 1 deletion SS_objfunc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ FUNCTION dvariable Get_Prior(const int T, const double& Pmin, const double& Pmax
mu=(Pr-Pmin) / (Pmax-Pmin); // CASAL's v
tau=(Pr-Pmin)*(Pmax-Pr)/square(Psd)-1.0;
Bprior=tau*mu; Aprior=tau*(1.0-mu); // CASAL's m and n
if(Bprior<=1.0 || Aprior <=1.0) { warning<<N_warn<<" "<<" bad Beta prior "<<Pval<<" "<<Pr<<endl;N_warn++;}
if(Bprior<=1.0 || Aprior <=1.0) { N_warn++; warning<<N_warn<<" "<<" bad Beta prior "<<Pval<<" "<<Pr<<endl;}
Prior_Like = (1.0-Bprior)*log(Pconst+Pval-Pmin) + (1.0-Aprior)*log(Pconst+Pmax-Pval)
-(1.0-Bprior)*log(Pconst+Pr-Pmin) - (1.0-Aprior)*log(Pconst+Pmax-Pr);
break;
Expand Down
5 changes: 0 additions & 5 deletions SS_popdyn.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ FUNCTION void setup_recdevs()
else if(do_recdev>=2)
{recdev(recdev_start,recdev_end)=recdev2(recdev_start,recdev_end);}
if(Do_Forecast>0 && do_recdev>0) recdev(recdev_end+1,YrMax)=Fcast_recruitments(recdev_end+1,YrMax); // only needed here for reporting
// if(mcmc_counter>0) warning<<N_warn<<" "<<mcmc_counter<<" MGparm "<<MGparm<<" SRparm "<<SR_parm<<" recdev "<<recdev2<<" fore_rec "<<Fcast_recruitments<<" selparm "<<selparm<<" q: "<<Q_parm<<endl;
} // end setup for recdevs

FUNCTION void get_initial_conditions()
Expand Down Expand Up @@ -486,8 +485,6 @@ FUNCTION void get_initial_conditions()
Save_PopAge(t+s,p+pop,g)=elem_prod(natage(t+s,p,g),mfexp(-Z_rate(t+s,p,g)*0.5*seasdur(s)));
Save_PopBio(t+s,p,g)=elem_prod(natage(t+s,p,g),Wt_Age_beg(s,g));
Save_PopBio(t+s,p+pop,g)=elem_prod(Save_PopAge(t+s,p+pop,g),Wt_Age_mid(s,g));

// warning<<N_warn<<" "<<s<<" init "<<t+Settle_seas_offset(settle_g(g))<<endl;
Recr(p,t+1+Settle_seas_offset(settle_g(g)))+=equ_Recr*recr_dist(y,GP(g),settle_g(g),p)*platoon_distr(GP2(g));
}
}
Expand Down Expand Up @@ -574,7 +571,6 @@ FUNCTION void get_time_series()
else
{ // should be 0.0
}
// warning<<N_warn<<" "<<y<<" "<<SSB_current<<" "<<SSB_yr(styr-1)<<" "<<recdev(y)<<" env: "<<env_data(y)<<endl;
t=t_base+1; // first season
s=1;
if(WTage_rd>0)
Expand Down Expand Up @@ -1403,7 +1399,6 @@ FUNCTION void get_time_series()
countN += 1; // increment count of values included in average
annual_F(y,2) += log(tempM)-log(tempZ); // F=Z-M
annual_F(y,3) += log(tempbase)-log(tempM); // M
// if(save_for_report==1) warning<<N_warn<<" "<<y<<" age: "<<a<<" count: "<<countN<<" Z: "<<log(tempbase)-log(tempZ)<<" M: "<<log(tempbase)-log(tempM)<<" F: "<<log(tempM)-log(tempZ)<<" "<<annual_F(y)(2,3)<<endl;
}
annual_F(y,3) /= countN; // M
annual_F(y,2) /= countN; // F
Expand Down
1 change: 0 additions & 1 deletion SS_readcontrol_330.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3359,7 +3359,6 @@
selparm_1(k,2)=new_upper_bound;

warning<<N_warn<<" "<<"new min, max, init, prior: "<<selparm_1(k)(1,4)<<endl;
// if (selparm_1(k,8) !=0 || selparm_1(k,9)!=0 || selparm_1(k,13)!=0) warning<<N_warn<<" "<<"Timevarying, so you must do timevary parm conversion manually"<<endl;
}
}
parmcount+=N_selparmvec(f);
Expand Down
1 change: 0 additions & 1 deletion SS_readdata_330.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,6 @@
obs_a_all(1,f,a)+=obs_a(f,j,n_abins+a); // males
}
}
// warning<<N_warn<<" "<<obs_a(f,j)(1,6)<<endl;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion SS_selex.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,6 @@ FUNCTION void get_selectivity()
{tempvec_a(a)=sp(j-seltype(f,4));} // use female parameter for males
else // so value is -999 so set to next younger age
{tempvec_a(a) = tempvec_a(a-1);}
// warning<<N_warn<<" "<<" sex "<<gg<<" a "<<a<<" j "<<j<<" sp "<<sp(j)<<" use "<<tempvec_a(a)<<endl;
}
int low_bin = int(value(sp(2)));
int high_bin = int(value(sp(3)));
Expand Down

0 comments on commit cfbe093

Please sign in to comment.