diff --git a/SS_benchfore.tpl b/SS_benchfore.tpl index 0044edd3..45f031c0 100644 --- a/SS_benchfore.tpl +++ b/SS_benchfore.tpl @@ -2836,7 +2836,13 @@ FUNCTION void Get_Forecast() (1.0) * (1.0 - join2); // scale right side break; } - } + } + // protection level; contributed by AEP + if (H4010_prot > 0) + { + join1 = 1.0 / (1. + mfexp(20.0 * (SSB_current - H4010_prot * HCR_anchor))); + ABC_buffer(y) = 0.0001*join1 + (1.0 - 0.0001)*(1.0 - join1)*ABC_buffer(y); + } } // end calc of ABC buffer else { // ABC buffer remains at previously calculated value diff --git a/SS_readdata_330.tpl b/SS_readdata_330.tpl index bb681676..c1ac6fd7 100644 --- a/SS_readdata_330.tpl +++ b/SS_readdata_330.tpl @@ -4029,7 +4029,9 @@ int Rebuild_Yinit; int HarvestPolicy; // 0=none; 1=west coast adjust catch; 2=AK to adjust F number H4010_top_rd; + number H4010_bot_rd; number H4010_bot; + number H4010_prot; number H4010_scale; number H4010_scale_rd; int Do_Impl_Error; @@ -4283,8 +4285,17 @@ echoinput << HarvestPolicy << " # echoed HarvestPolicy " << endl; *(ad_comm::global_datafile) >> H4010_top_rd; // as fraction of HCR_anchor; use -1 as legacy approach to set H4010_top to Bmsy/SSB_unf echoinput << H4010_top_rd << " # echoed control rule inflection" << endl; - *(ad_comm::global_datafile) >> H4010_bot; - echoinput << H4010_bot << " # echoed control rule cutoff " << endl; + *(ad_comm::global_datafile) >> H4010_bot_rd; + echoinput << H4010_bot_rd << " # echoed control rule cutoff " << endl; + H4010_bot = H4010_bot_rd; + H4010_prot = -1000; + if (H4010_bot < 0) + { + H4010_bot *= -1; + echoinput << H4010_bot << " # echoed control rule cutoff " << endl; + *(ad_comm::global_datafile) >> H4010_prot; + echoinput << H4010_prot << " # echoed protection level cutoff " << endl; + } *(ad_comm::global_datafile) >> H4010_scale_rd; H4010_scale = H4010_scale_rd; echoinput << H4010_scale << " # echoed control rule scalar " << endl; diff --git a/SS_write_ssnew.tpl b/SS_write_ssnew.tpl index 07c852a7..5e395867 100644 --- a/SS_write_ssnew.tpl +++ b/SS_write_ssnew.tpl @@ -1645,7 +1645,11 @@ FUNCTION void write_nucontrol() NuFore << HarvestPolicy << " # Control rule method (0: none; 1: ramp does catch=f(SSB), buffer on F; 2: ramp does F=f(SSB), buffer on F; 3: ramp does catch=f(SSB), buffer on catch; 4: ramp does F=f(SSB), buffer on catch) " << endl; NuFore << "# values for top, bottom and buffer required, but not used when Policy=0" << endl; NuFore << H4010_top_rd << " # Control rule inflection for constant F (as frac of HCR_anchor, see below); must be > control rule cutoff" << endl; - NuFore << H4010_bot << " # Control rule cutoff for no F (as frac of HCR_anchor, e.g. 0.10) " << endl; + NuFore << H4010_bot_rd << " # Control rule cutoff for no F (as frac of HCR_anchor, e.g. 0.10); negative value to also invoke read of protection level " << endl; + if (H4010_bot_rd < 0) + { NuFore << H4010_prot << " # AK protection level: control rule level below which F goes to 0.0001" << endl;} + else + { NuFore << " # placeholder for AK protection level: control rule level below which F goes to 0.0001" << endl;} NuFore << H4010_scale_rd << " # Buffer: enter Control rule target as fraction of Flimit (e.g. 0.75), negative value invokes list of [year, scalar]. -year fills from year to YrMax " << endl; NuFore << "# Also see HCR_anchor below to use virgin vs benchmark SSB or Bmsy as basis for inflection and cutoff" << endl; if (H4010_scale_rd < 0)