Repository navigation
Brunt_N2 could report invalid or old values from set_no_mix - #1116
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a small bug in
set_no_mixingthat affectsdo_brunt_N2.MESA computes the Brunt–Väisälä frequency squared at face
kasHowever, if sticky gradr or phase seperation or any other routine calls
set_no_mixing, it will sets% gradT(k)to the radiative gradient but forgets to sets% gradT_sub_grada(k). This means Brunt_N2 can use whatever is left sitting in thes% gradT_sub_gradaarray, or if nonfinite this number will be it would be zeroed out indo_brunt_N2.In the specific scenario in which a nonfinite value is returned to
do_brunt_N2,brunt_B,brunt_N2, andbrunt_N2_composition_termall get set to zero at that face. I don't know if or when this happens in practice out side of when one directly setsfill_arrays_with_NaNs = .true., but it's still a bit concerning, sincebrunt_Bis used by mlt/tdc.Either way, this mistake will affect pulsation outputs and should be corrected. This pr fixes this issue by ensuring
set_no_mixingupdatess% gradT_sub_grada.see
do_brunt_N2instar/private/brunt.f90:169and
set_no_mixinginstar/private/turb_info.f90:310