Skip to content

Trim species_names in equilibrium.f90 messages - #140

Open
djkees wants to merge 1 commit into
nasa:mainfrom
djkees:up/equilibrium-species-names-trim
Open

Trim species_names in equilibrium.f90 messages#140
djkees wants to merge 1 commit into
nasa:mainfrom
djkees:up/equilibrium-species-names-trim

Conversation

@djkees

@djkees djkees commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

species_names is character(snl) with snl = species_name_len = 15, so concatenating it directly into a message pads short species names out to the full 15-character width with trailing spaces. This wraps every remaining untrimmed use of species_names in equilibrium.f90 in trim(...), matching the pattern already used correctly elsewhere in the same file.

djkees#9

Changes

Wrapped species_names in trim(...) at 13 sites in source/equilibrium.f90:

  • log_info: lines 1720, 1798, 1894, 1943, 2022, 2049, 4200, 5331
  • log_debug: line 1773
  • abort() message: line 1947
  • write(*,*) verbose finite-difference derivative debug dump: lines 3937, 3941, 3946

No solver logic, convergence criteria, or numerical output changed — purely string formatting in diagnostic/logging/error messages.

Testing

  • Built Fortran+C core (GNU/gfortran, Ninja) and ran all 14 test/main_interface/example*.inp cases plus samples/rp1311_examples.inp through cea.exe -d (debug logging). Confirmed clean (no trailing padding) output at 9 of the 13 fixed sites, including short single/two-character species names (e.g. Inserting BeO(L), Adding AL2O3(L), Phase change: replace BeO(L) with BeO(b), Species F not found in transport database).
  • The write(*,*) finite-difference debug dump (lines 3937/3941/3946) isn't reachable from the CLI — only the C/Python compute_fd(verbose=true) API exposes it, and no existing sample/test calls it with verbose=true. Wrote a small standalone C program against the built cea_bindc library to call it directly; confirmed clean output for single-character species names (e.g. dnj/dstate1 (H): abs=..., no padding).
  • The remaining 4 sites (lines 1798, 1894, 2022, 2049, 1773, 1947 — EqSolver_correct_singular/test_condensed's error-recovery paths) require the solver to hit an actual ill-conditioned Jacobian mid-iteration; none of the 15 standard example problems came close (no log_warning about singular matrices appeared in any run), and I didn't attempt to force these deliberately since it would mean constructing an adversarial degenerate mixture with no guarantee of success. These sites use the identical trim(...) wrap already verified correct at the other 9.

Compatibility / Numerical behavior

  • No expected changes to numerical results

Drafted with Claude's assistance

  • All 13 untrimmed sites (and the 2 already-correct pre-existing sites at lines 1735/1737) were confirmed by direct read of equilibrium.f90.
  • The build was run and its raw output reviewed directly (not just summarized) to confirm the padding fix, as described in the Testing section above.

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.

1 participant