Trim element symbol in atomic_data abort message - #128
Open
djkees wants to merge 1 commit into
Open
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.
Summary
Fixes a stray space in the "Symbol not found" abort message in
get_atom(source/atomic_data.f90) when the element symbol is a single letter.Changes
symbolis a fixed 2-character field (element_name_len = 2), so for single-letter symbols likeHit's stored as"H "with a trailing space. The abort message embeddedsymboldirectly instead of trimming it, producingSymbol H not found in the element list.(double space) instead ofSymbol H not found in the element list.. Every otherabort()call in the codebase that embeds a variable name trims it first (seemixture.f90,input.f90,equilibrium.f90) — this was the one outlier. Addedtrim()aroundsymbolin the oneabort()call atsource/atomic_data.f90:155.Testing
core-cpreset, GNU/gfortran on Windows): all 14 tests pass.reac name Test Q 1 wt%=100, an unrecognized single-letter element in an exploded formula, forcingmolecular_weight_from_formula->get_atom_weight->get_atom). Confirmed the message changed from a double space to a single space:CRITICAL: Symbol Q not found in the element list.Compatibility / Numerical behavior
This only changes the text of an error message on an abort path; it does not touch any numerical computation.
Drafted with Claude's assistance
source/atomic_data.f90directly (theelement_name_len = 2field and the singleabort()call missingtrim()), and by grepping every otherabort()call site to verify thetrim()pattern is otherwise universal.core-cpreset) and ranctest— all 14 existing tests passed before and after the change.cea.exeinvocation before and after the fix to confirm the message actually changes as described, rather than trusting the diff alone.