Skip to content

Conversation

@xevra
Copy link
Contributor

@xevra xevra commented May 20, 2025

The goal of this pull request is to update the behavior of COSMIC so that the supernova entry in the BPP (evol_type 15 or 16) reflects the state of the star prior to assign_remnant.

The current behavior is:
mass0 is not updated during the evol_type == 15 / 16 table entry.
menv is not updated during the evol_type == 15/ 16 table entry.
massc is updated sometimes, but does not reflect the core mass of the star immediately prior to supernovae.

The desired behavior is:
mass0 is updated to contain the preSN total mass of the star in all subsequent bpp entries, including the evol_type == 15 / 16 entry.
massc is updated to contain the core mass of the star prior to supernova in the evol_type == 15 / 16 bpp entry.
menv is updated to contain the quantity mcbagb - mc from assign remnant during a Supernova explosion

Katie and I looked a hrdiag.f and determined that a Supernova of this kind can only occur when massc reflects a metallic core (not a Helium core). This enables us to print the metallic core mass of a star prior to Supernova, which is useful for updating supernova models, and comparing with other popsynth codes (specifically StarTrack).

The meaning of mcbagb is less clear, but can be interpreted as the Helium envelope, where the Hydrogen envelope can then be determined by calculating mt - mc - mcbagb. This is usually, but not always, close to zero.

We accomplish these objectives by introducing common block variables in evolv2.f, assign_remnant.f, and comenv.f, avoiding passing additional values to hrdiag.f, in order to avoid overhead in hrdiag.f which is called many times.

@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

❌ Patch coverage is 82.45614% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.46%. Comparing base (8772c07) to head (65921ae).
⚠️ Report is 115 commits behind head on develop.

Files with missing lines Patch % Lines
src/cosmic/src/hrdiag.f 72.41% 8 Missing ⚠️
src/cosmic/src/comenv.f 12.50% 7 Missing ⚠️
src/cosmic/src/evolv2.f 87.50% 5 Missing ⚠️

❌ Your patch status has failed because the patch coverage (82.46%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #703      +/-   ##
===========================================
- Coverage    86.91%   78.46%   -8.45%     
===========================================
  Files           40       49       +9     
  Lines        25542    27179    +1637     
  Branches         0      848     +848     
===========================================
- Hits         22198    21325     -873     
- Misses        3344     5582    +2238     
- Partials         0      272     +272     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@katiebreivik
Copy link
Collaborator

Will need to add in docs for the new columns but will merge this for now to clear the backlog!

Copy link
Collaborator

@katiebreivik katiebreivik left a comment

Choose a reason for hiding this comment

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

👍 !!

@katiebreivik katiebreivik merged commit 9041544 into COSMIC-PopSynth:develop Jan 6, 2026
2 of 4 checks passed
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.

2 participants