Skip to content

[Bug]: irregular forecast when using dynamic B0 #791

Closed

Description

@Rick-Methot-NOAA

Describe the bug

A user reported:
unexpected outcome when using the dynamic B0 calculation in the forecast period – the result seems to depend on the input forecast catch.
Some details of the setup:
I’m specifying option 2 for the extra SD reporting and a value of 1 for the Dynamic B0 setting
I am doing a four-year projection with fixed forecast catches for 5 fleets.
When I run with forecast catches set to 1, I get a B0 time-series that looks reasonable for the 4 forecast years.
When I run with positive catches, the B0 estimate declines in the forecast period as if the catches are being removed (the magnitude of decline is larger for larger forecast catches). The time-series is unaffected.
I’m recreating from a .par file so there are no changes in any other model quantity including variances.
Also, when forecast only uses one stage, the behavior of dynamic B0 is as expected.

Files sent to nmfs.stock.synthesis@noaa.gov

To Reproduce

run the files

Expected behavior

dynamic B0 should be calculated only in the first stage of the forecast, then held constant.

Screenshots

No response

Which OS are you seeing the problem on?

No response

Which version of SS3 are you seeing the problem on?

No response

Additional Context

No response

Activity

  1. added this to the 3.30.27 milestone on Nov 9, 2026
  2. Rick-Methot-NOAA commented on Nov 10, 2026

    @Rick-Methot-NOAA
    CollaboratorAuthor
    • The code to get dynamic B0 is fairly simple at

      ss3-source-code/SS_global.tpl

      Lines 1030 to 1031 in 9c77dd2

      if (Do_Dyn_Bzero > 0) // do dynamic Bzero
      {
      It just turns fishery_on_off to 0, runs the time series and forecast, and stores SSB in extra_std. So, my intuition is that the problem is in forecast not responding correctly to the fishery_on_off flag.

    • Here it appears that the code executes with input catch, even if fishery_on_off == 0. This is the suspected source of the problem.

      if (ABC_Loop == 2 && N_Fcast_Input_Catches > 0) // tune to input catch if in ABC_loop 2
      {

    • Also, it appears that dynamic Bzero is being called from procedure and from global. This should be better documented. The first happens early in the post-processing and produces a version that has gradient info and variance and appears in the derived quantities as time series of "Dyn_Bzero_1983". The other appears in the end-of-the-run calculations and produces Dynamic_Bzero report:59 which is after the gradient chain has been broken and it uses a different method to turn off the fisheries.

  3. Rick-Methot-NOAA commented on Nov 16, 2026

    @Rick-Methot-NOAA
    CollaboratorAuthor

    Some extra echoinput statements shows that the code to calc dynBzero in Procedure section only happens when calculating variances, then in happens again in Global and finally with output of age-specific details in Write:
    OK with obj_func 160.228
    Wrote first version of output files (before hessian, benchmark, and forecast)
    do dynBzero in procedure 670908
    Start benchmark and forecast, if requested
    Calculated Fspr 0.0979803 0.43
    Calculated Btgt: 0.124164 0.3
    Calculated Fmsy 0.155174 65642.2
    Finished benchmark, forecast, and sdreporting
    Iterations: 1363
    finished COVAR.SSO
    do dynBzero in global 670908
    Finished forecast
    Writing wtatage.ss_new
    Finished StdDev quantities
    Finished posteriors
    Finished SS_summary.sso
    Finished final writing of report.sso
    Begin writing data_echo.ss_new file
    Write starter.ss_new file
    Write forecast.ss_new file
    Write control.ss_new file
    Begin final output calculations and warnings
    do dynBzero in write 670908 670908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions