Skip to content

revise code and change VBK_seas usage#747

Open
Rick-Methot-NOAA wants to merge 11 commits intomainfrom
#735-fix-gompertz-growth
Open

revise code and change VBK_seas usage#747
Rick-Methot-NOAA wants to merge 11 commits intomainfrom
#735-fix-gompertz-growth

Conversation

@Rick-Methot-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA Rick-Methot-NOAA commented Dec 22, 2025

Concisely describe what has been changed/addressed in the pull request.

What tests have been done?

Where are the relevant files?

<-- - [x] Test files are in the issue. --> See repo with growth test files (https://github.com/e-perl-NOAA/growth-test-models)

What tests/review still need to be done?

Is there an input change for users to Stock Synthesis?

<-- - [x] No, there was no input change. -->

Additional information (optional).

@Rick-Methot-NOAA
Copy link
Collaborator Author

I will test with big skate locally to diagnose the run failure

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the growth calculation code in Stock Synthesis, focusing on improving variable naming clarity and revising how seasonal growth adjustments (VBK_seas) are applied. The changes address issues #735 and #156.

Key changes:

  • Renamed growth-related variables for clarity (VBK_temp → VBK_work, VBK_temp2 → VBK_by_seas)
  • Restructured growth type handling with improved switch statement organization
  • Modified VBK_seas usage by removing seasdur(s) multipliers in growth calculations
  • Added documentation comments explaining VBK variable purposes
  • Removed preprocessor conditionals (#ifdef DO_ONCE) in favor of runtime checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@e-perl-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA I had copilot review the PR in case there was anything that it might be able to easily identify anything the that might cause the big skate model to fail. There were some suggestions it gave which didn't matter and I closed those but it might be worth looking at some of the other suggestions it made. If they are wrong or you don't agree, feel free to just click the "Resolve conversation" button and they will go away.

Rick-Methot-NOAA and others added 2 commits December 29, 2025 11:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Rick-Methot-NOAA
Copy link
Collaborator Author

now investigating the failure with growth time-vary

Copy link
Collaborator

@e-perl-NOAA e-perl-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me in that the tests are now passing. Copilot seems to think that the logic of everything is more consistent than it was.

@Rick-Methot-NOAA
Copy link
Collaborator Author

@e-perl-NOAA The Richards and age-specific null values are each 1.0, per the manual.

Cessation model (8) is giving unexpected results that need separate attention. Let's leave it out of the current test.

@e-perl-NOAA
Copy link
Collaborator

e-perl-NOAA commented Jan 7, 2026

@Rick-Methot-NOAA I have all the run models with growth plots in each of the respective folders (aside from cessation) in this repository. The only thing that I don't have is any sort of table. The values used to make the growth plots are Age_Beg and Len_Beg. I can grab these for males and females or just one sex, etc. or any other values you would like. I just don't know what values and what sort of structure of table would be most useful for you.

@Rick-Methot-NOAA
Copy link
Collaborator Author

I think we need in one text file the following lines from each report.sso file. So all the results that we need will be in one file. I added a line to be the identifier for each run.

Growth-1-annual
MEAN_SIZE_TIMESERIES report:49
Morph Yr Seas SubSeas 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
1 1971 1 1 20 20.5 21 21.5 22 22.5 23 23.5 24 24.5 25 25.5 26 26.5 27 27.5 28 28.5 29 29.5 30 30.5 31 31.5 32 32.5 33 33.5 34 34.5 35 35.5 36 36.5 37 37.5 38 38.5 39 39.5 43.379
1 1971 1 2 20.25 20.75 21.25 21.75 22.25 22.75 23.25 23.75 24.25 24.75 25.25 25.75 26.25 26.75 27.25 27.75 28.25 28.75 29.25 29.75 30.25 30.75 31.25 31.75 32.25 32.75 33.25 33.75 34.25 34.75 35.25 35.75 36.25 36.75 37.25 37.75 38.25 38.75 39.25 39.75 43.629
1 2011 1 1 20 20.5 21 21.5 22 22.5 23 23.5 24 24.5 25 25.5 26 26.5 27 27.5 28 28.5 29 29.5 30 30.5 31 31.5 32 32.5 33 33.5 34 34.5 35 35.5 36 36.5 37 37.5 38 38.5 39 39.5 43.379
1 2011 1 2 20.25 20.75 21.25 21.75 22.25 22.75 23.25 23.75 24.25 24.75 25.25 25.75 26.25 26.75 27.25 27.75 28.25 28.75 29.25 29.75 30.25 30.75 31.25 31.75 32.25 32.75 33.25 33.75 34.25 34.75 35.25 35.75 36.25 36.75 37.25 37.75 38.25 38.75 39.25 39.75 43.629

@e-perl-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA And you want this in a text file, not a csv for excel sheet?

@Rick-Methot-NOAA
Copy link
Collaborator Author

space delimited text is read by excel just as easily as csv.

@e-perl-NOAA
Copy link
Collaborator

Okay, that output from the report file (as r4ss grabs it) is now in this text file for all of the models.

@Rick-Methot-NOAA
Copy link
Collaborator Author

Growth test models and commentary found in this repo: https://github.com/e-perl-NOAA/growth-test-models

@Rick-Methot-NOAA
Copy link
Collaborator Author

commit ab2ae43
adds output table mean_size by cohort and demonstrates match of midseason in one season model to the beginning of season 2 in a two season model
image

@Rick-Methot-NOAA
Copy link
Collaborator Author

Rick-Methot-NOAA commented Mar 3, 2026

run failure probably due to the new table, which is in same section as the current table MEAN_SIZE_TIMESERIES report:49.
The new table starts with:
#_Mean_size_by_cohort
Morph YearClass Seas SubSeas 0 1 2

New table is omitted if growth is not time-varying

Let me know what changes would ease reading by r4ss. @iantaylor-NOAA

@iantaylor-NOAA
Copy link
Contributor

I'll take a look at adding the new table to the r4ss parsing. I'm guessing it will be fine as you've created it.

@iantaylor-NOAA
Copy link
Contributor

I made a minor change in 3557ff7 to the format of the new table header to match the format of the following tables that start "mean_size_Jan_1_for_sex...". This allowed a more trivial change to the r4ss code which I pushed right away. The r4ss function doesn't yet read the new table but the ss3 test should now play through without crashing. I can then add the read of the new table next.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: growth discrepancy when season duration is < 1.0 (months < 12) and growth type is Gompertz-Richards

4 participants