Skip to content

fix(outputs): write every channel value with a three-digit exponent - #53

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
fix/output-exponent
Oct 26, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
fix/output-exponent

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Problem

OpenFAST's native <root>.CD.out writes channel values as ES15.6E2. When a value needs a
three-digit exponent (below 1e-99, or 1e100 and above), Fortran fills the whole field with asterisks.

The round-off noise of a component that is truly zero reaches that range. Typical cases are the y
position (L<L>N<J>py) and the tangent azimuth (L<L>N<J>Azi) of a line in the x–z plane.

  • Field report: a coupled campaign with the 0.3.0 release counted 28,818 such fields in 31 runs.
    Every reader failed on them or misread them.
  • Reproduction: the IEA-15 mixed deck prints 30 such fields in 10 s, e.g. 2.9e-113 and 2.9e-104.

Change

  • .CD.out: channel values get a three-digit exponent at the same width, ES15.6E3; the field
    is at most 14 characters. The format is shared through two public constants in
    CableDyn_Conventions:
    • CD_NATIVE_CHANNEL_FMT, for .CD.out and the OpenFAST module driver;
    • CD_CHANNEL_FMT (ES15.7E3, as every other standalone writer), for the mixed EI = 0 +
      finite-EI .out.
  • Writers with no exponent width: the mixed-route .out, the module driver, the modal results
    and the static driver's mesh file stated none. A three-digit exponent there drops its letter
    (1.0000000-120), which Python's float() rejects. They all get E3.
  • Docs: outputs.rst and the OpenFAST tutorial sample show the format.

Evidence

  • New test_output_formats: writes zero, 1e-120, −3e150, the 1e±100 edges, a subnormal,
    HUGE and ordinary values through both formats. Each field must be:

    • TAB plus a fixed width, with no asterisks;
    • a mantissa, E, a sign and three digits;
    • read back to its printed precision, zero exactly.

    Against the old formats the test fails on exactly the reported fields: asterisks for .CD.out,
    a missing E for the mixed .out.

  • End to end: an OpenFAST build (gfortran) on the IEA-15 mixed deck, with the cable's py and
    Azi channels added, writes no asterisk field, and numpy.loadtxt reads the whole file.

  • Full suite: ctest 302/302, pytest 2069 passed.

OpenFAST's native <root>.CD.out wrote channel values as ES15.6E2. A
value that needs a three-digit exponent, below 1e-99 or from 1e100 on,
then fills the field with asterisks, and the round-off noise of a zero
component reaches that range: on the IEA-15 mixed deck the y position
and tangent azimuth channels of the finite-EI cable, which lies in the
x-z plane, printed 30 such fields in 10 s (e.g. 2.9e-113, 2.9e-104),
and a coupled campaign with the 0.3.0 release counted 28,818 in 31 runs.
Every reader of the file failed or misread it.

Channel values are now written with a three-digit exponent at the same
field width, ES15.6E3, through two shared formats in
CableDyn_Conventions: CD_NATIVE_CHANNEL_FMT for .CD.out and the OpenFAST
module driver, CD_CHANNEL_FMT (ES15.7E3, as every other standalone
writer) for the mixed EI = 0 + finite-EI .out. That writer, the module
driver, the modal results and the static driver's mesh file stated no
exponent width, so a three-digit exponent dropped its letter
(1.0000000-120), which Python's float() rejects; they get E3 too.

test_output_formats writes zero, 1e-120, -3e150, the 1e+-100 edges, a
subnormal, HUGE and ordinary values through both formats: each field is
TAB plus a fixed width with no asterisks, a mantissa, E, a sign and
three digits, and reads back to its printed precision (zero exactly).
With the old formats it fails on exactly the reported fields. On the
mixed deck the .CD.out now has no asterisk field and numpy reads it
whole. The outputs reference and the OpenFAST tutorial show the format.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T12:38:33.330927Z 3b056c1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35412657 | 📁 Comparing 3b056c1 against latest (fd1936d)

  🔍 Preview build  

14 files changed · ± 14 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 3b056c1f4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 8abfec7 into dev Oct 26, 2026
21 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/output-exponent branch October 26, 2026 14:02
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