Skip to content

Fixed some output requests, better data types#269

Merged
Bruno02468 merged 2 commits into
MystranSolver:devfrom
Bruno02468:better_output_requests
Jun 28, 2026
Merged

Fixed some output requests, better data types#269
Bruno02468 merged 2 commits into
MystranSolver:devfrom
Bruno02468:better_output_requests

Conversation

@Bruno02468

@Bruno02468 Bruno02468 commented Jun 28, 2026

Copy link
Copy Markdown
Member

This PR is all about the "specifiers" in Case Control output requests, such as PRINT, PLOT, and PUNCH. You can put them in parens in output requests to direct them to the F06, OP2 and PCH files respectively.

However, the way it was done before was bad for four reasons:

  1. No-specifier requests (e.g. DISPLACEMENT = ALL) would never produce OP2 output (issue: DISP=ALL doesn't write to OP2 with PARAM,POST,-1 #177)
  2. There was no way to omit something from the F06.
  3. It was all done using Y/N strings and magic indices all over the place.
  4. Lots of repeated code in some L1A-CC subroutines.

So here's what I did:

  1. I created a new data type, OUTPUT_TARGETS, in the DERIVED_DATA_TYPES module. It holds three booleans, they indicate whether to write that result to F06, OP2, and PCH respectively. This supersedes the strings and magic indices, fixing issue 3.
  2. I centralised the specifiers -> output targets logic into a new subroutine, COMPUTE_OUTPUT_TARGETS, so no more code repetition (hence the negative line delta), fixing issue 4.
  3. In that subroutine, I made it so no-specifier requests default to F06 and OP2, fixing issue 1.
  4. Finally, I made it so all of those booleans start as false, so, for example, you can omit something from the F06 by using PLOT alone -- as one does in commercial solvers like MSC -- and fixed issue 2.

Here are the caveats:

  1. MYSTRAN still doesn't care one bit about PARAM,POST. We need to address that. One of the proposals being floated is to have a non-negative PARAM,POST completely disable OP2 writing.
  2. MYSTRAN might produce more OP2 output in total than commercial solvers. That might be related to ignoring PARAM,POST and warrants further investigation and discussion.

Oh, and three bonus changes:

  1. Eliminated a code path that could result in an OP2 file being created without a header!
  2. Disabled MYSTRAN-specific params PRTOP2 and PRTF06. All they did was override the strings to be all-Y. This is in line with our current efforts to make MYSTRAN more compatible with other solvers.
  3. The new subroutine has no _Interface or _USE_IFs files. It exists in a module and is imported from there. This is a sign of things to come. ;)

I'd like to thank everybody who participated on the discussions in the Discord server. This is a product of everone's input.

@Bruno02468 Bruno02468 linked an issue Jun 28, 2026 that may be closed by this pull request
@Bruno02468 Bruno02468 merged commit 2b5efc2 into MystranSolver:dev Jun 28, 2026
1 check passed
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.

DISP=ALL doesn't write to OP2 with PARAM,POST,-1

1 participant