Repository navigation
fix(outputs): write every channel value with a three-digit exponent - #53
Merged
Merged
Conversation
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>
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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.
Problem
OpenFAST's native
<root>.CD.outwrites channel values asES15.6E2. When a value needs athree-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.Every reader failed on them or misread them.
Change
.CD.out: channel values get a three-digit exponent at the same width,ES15.6E3; the fieldis at most 14 characters. The format is shared through two public constants in
CableDyn_Conventions:CD_NATIVE_CHANNEL_FMT, for.CD.outand the OpenFAST module driver;CD_CHANNEL_FMT(ES15.7E3, as every other standalone writer), for the mixedEI = 0+finite-EI
.out..out, the module driver, the modal resultsand the static driver's mesh file stated none. A three-digit exponent there drops its letter
(
1.0000000-120), which Python'sfloat()rejects. They all getE3.outputs.rstand the OpenFAST tutorial sample show the format.Evidence
New
test_output_formats: writes zero, 1e-120, −3e150, the 1e±100 edges, a subnormal,HUGEand ordinary values through both formats. Each field must be:E, a sign and three digits;Against the old formats the test fails on exactly the reported fields: asterisks for
.CD.out,a missing
Efor 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.loadtxtreads the whole file.Full suite: ctest 302/302, pytest 2069 passed.