Do not guard calls mesa_error() with report_ierr #732
Merged
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.
The user flag
report_ierr = .true.
is used as a debugging tool to report diagnostics on internal errors in Mesa but not stop the code. Flipping the switch to true should not change the outcome of the simulation. Therefore, we should not callmesa_error()
insideif(report_ierr == .true.)
if statements. Either always just halt the code, or use guards likeif(stop_for_bad_nums == .true.)
.There are just a handful of cases in the code where this pattern was not followed. This is dangerous because it can cause non-reproducible results when someone is trying to debug their run switches
report_ierr = .true.
on. Particularly in simulations that chain more than one inlist. For example, running./run_all
for the20M_pre_ms_to_core_collapse
test problem withreport_ierr = .true.
was yielding a different result than switching diagnostics off because one of the inlists in the middle of the chain was ending prematurely and the next inlist restarted the simulation from the last photo written.TL;DR: fix so that switching on diagnostics reporting does not change outcome of the simulation