Skip to content

Skye: remove unnecessary duplicate computation of xnefer - #1122

Merged
VincentVanlaer merged 7 commits into
mainfrom
MZ/skye_opts
Nov 19, 2026
Merged

VincentVanlaer merged 7 commits into
mainfrom
MZ/skye_opts

Conversation

@zingale

@zingale zingale commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

The computation in compute_ideal_ele is immediately overwritten by

xnefer = compute_xne(den, ytot1, zbar)

in the caller. This means that 10 interpolations (calls to h3) are unnecessary.

This change in the way this is computed was done in f5a6efe

This also removes some dead code that did an incorrect normalization on mass fractions.

This change should be bitwise identical.

@zingale
zingale requested a review from fxt44 as a code owner November 17, 2026 16:05
@zingale

zingale commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

I am not sure what the MESA preference is on disabling code -- a lot was already commented out, so I did the same. I would just as well delete it (it is in git after all).

the mass fractions were being normalized by the number fraction
normalization, but this array was never accessed again, so no
harm was being done.
@Debraheem Debraheem added the eos Equation of state module label Nov 17, 2026
@Debraheem

Copy link
Copy Markdown
Member

if the code had no purpose, it's fine to delete.

@VincentVanlaer

Copy link
Copy Markdown
Member

Feel free to remove the other commented code as well :)

@zingale

zingale commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

can I also go after all the unused variable warnings ? (in a separate PR)

@Debraheem

Copy link
Copy Markdown
Member

can I also go after all the unused variable warnings ? (in a separate PR)

yes! just keep in mind some things were intentionally left there for future analytic composition partials, which I'm using here https://github.com/MESAHub/mesa/tree/EbF/eos_partials.

@zingale

zingale commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

ierr is also set as intent(out), but never filled. Is there a future use case for it? I can either set it to 0 or just remove it.

@VincentVanlaer

Copy link
Copy Markdown
Member

If there is no way the function can fail, I don't think it makes sense to keep ierr

@zingale

zingale commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

It looks like tests pass. I am going to fix the uninitialized ierr and do one last push

@VincentVanlaer
VincentVanlaer merged commit 483ee0a into main Nov 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eos Equation of state module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants