Skip to content

Fix CLI output formatting regressions in main.f90 (dynamic species formats, legacy-aligned headers, and ratio reporting)#45

Merged
markleader merged 2 commits intonasa:mainfrom
markleader:bug/main-output
Feb 25, 2026
Merged

Conversation

@markleader
Copy link
Copy Markdown
Contributor

Summary

Fixes output-formatting issues in the main interface, including Issue #35 (format buffer overflow crash), and improves legacy compatibility of generated .out files by aligning section ordering/headers and table column layout.

Changes

  • Fixed species-format overflow crash by replacing fixed-length format strings with deferred-length formats in:
    • thermo_output
    • rocket_output
    • shock_output
    • deton_output
  • Updated species format builders to construct format strings dynamically:
    • get_eq_species_format
    • get_rocket_species_format
    • get_shock_species_format
    • get_deton_species_format
  • Updated thermo output to begin each block with legacy-style major headers and CASE = ... line before data tables.
  • Replaced hard-coded reactant placeholders (-1) with computed/parsed values in thermo and rocket reactant tables.
  • Added/cleaned rocket pre-table metadata output (e.g., pi/p, subar, supar).
  • Aligned rocket station headers and value columns, including:
    • aligned PERFORMANCE PARAMETERS rows with the station column grid
    • corrected species-row label offset/alignment
  • Improved fuel-ratio reporting logic in compute_fuel_ratios:
    • supports %fuel and %f
    • computes O/F/% Fuel from reactant amounts when no of_schedule is present
    • avoids placeholder overflow (********) in % Fuel formatting
    • handles non-fuel/oxidant (na) cases safely

Testing

  • Reproduced Issue [bug] Format issues cause crash for larger problem sizes on legacy interface #35 input (7-temperature TP case) and verified no format crash.
  • Ran representative interface cases and verified output structure/columns:
    • example1 (thermo)
    • example6 (detonation)
    • example7 (shock)
    • example8, example9 (rocket IAC/FAC)
    • example11, example13, example14 (fuel-ratio edge cases)
  • Ran test_main.py with expected outputs.

Compatibility / Numerical behavior

  • No expected changes to numerical results
  • Expected changes (explain and provide validation)

@markleader markleader requested review from Copilot and removed request for Copilot February 25, 2026 19:09
@markleader markleader merged commit 03c4f97 into nasa:main Feb 25, 2026
27 checks passed
@markleader markleader deleted the bug/main-output branch February 25, 2026 21:52
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.

[bug] Format issues cause crash for larger problem sizes on legacy interface

1 participant