diff --git a/SS_readcontrol_330.tpl b/SS_readcontrol_330.tpl index b91df468..4b09b1a7 100644 --- a/SS_readcontrol_330.tpl +++ b/SS_readcontrol_330.tpl @@ -3721,6 +3721,7 @@ else { N_selparmvec(f) = abs(seltype(f, 4)) + 1; // so reads value for age 0 through this age + if (seltype(f, 1) == 41) N_selparmvec(f) +=2; // for the scaling parameters } if (seltype(f, 1) == 41) @@ -3856,7 +3857,10 @@ } else { - for (j = 1; j <= N_selparmvec(f); j++) + + k = 0; + if (seltype(f, 1) == 41) k = 2; // reduce count for the scaling parameters + for (j = 1; j <= N_selparmvec(f) - k; j++) { ParCount++; ParmLabel += "AgeSel_P" + NumLbl(j) + "_" + fleetname(f1) + "(" + NumLbl(f1) + ")"; @@ -4407,6 +4411,7 @@ echoinput << "create mirror_mask: " << mirror_mask_a(f) << endl; echoinput << "end check on min-max ranges for age selex=11" << endl; } + // seltype 41 check on the min-max age range could go here, rather than in selex calcs parmcount += N_selparmvec(f + Nfleet); } // clang-format off diff --git a/SS_selex.tpl b/SS_selex.tpl index 5a8e1dae..d5269bd9 100644 --- a/SS_selex.tpl +++ b/SS_selex.tpl @@ -1128,7 +1128,6 @@ FUNCTION void get_selectivity() { lastage = abs(seltype(f, 4)); } - for (a = 1; a <= lastage; a++) { // with use of -999, lastsel stays constant until changed, so could create a linear change in ln(selex) @@ -1138,6 +1137,7 @@ FUNCTION void get_selectivity() lastsel = sp(a + 1 + scaling_offset); } tempvec_a(a) = tempvec_a(a - 1) + lastsel; // cumulative log(selex) +// warning << a << "SP: " << sp(a + 1 + scaling_offset) << " cumul: " << tempvec_a(a) << endl; } if (scaling_offset == 0) { @@ -1147,6 +1147,7 @@ FUNCTION void get_selectivity() { int low_bin = int(value(sp(1))); int high_bin = int(value(sp(2))); + // checks and adjustments below should happen in readcontrol if (low_bin < 0) { low_bin = 0; @@ -1166,6 +1167,8 @@ FUNCTION void get_selectivity() sp(1) = low_bin; sp(2) = high_bin; temp = mean(tempvec_a(low_bin, high_bin)); +// warning << tempvec_a(low_bin, high_bin) << endl; +// warning << low_bin << " " << high_bin << " mean " << temp << endl; } sel_a(y, fs, 1) = mfexp(tempvec_a - temp); a = 0;