Conversation
|
I found the same issue when running the standalone aerodyn version compiled in 32bits. This change solved the error. |
andrew-platt
force-pushed
the
InflowWind_Grid3DField
branch
from
September 18, 2026 20:17
e85c18b to
a42c07d
Compare
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.
Feature or improvement description
In
IfW_FlowField.f90, the subroutineGetBoundsTcan throw a fatal error if we are trying to access a time close to 0 but slightly negative due to a floating-point rounding.For example, running an AeroDyn standalone model with 2 wind turbines using OLAF and periodic turbulent wind, I got:
The value that makes the solver crash is very small (-2.62260E-06 s). The flag
IT_LO=0confirms that a point is asking for data beforet = 0. Interestingly, this error only occurs when compiling in single precision (e.g., using GitHub Actions default). When building in double precision, there is no problem.Looking at
GetBoundsT, we can see thatMODULOis applied twice to try to avoid this condition:To confirm this was the actual issue, I added a debug print before the fatal error:
print *, 'DEBUG: Periodic=', G3D%Periodic, ' T_GRID=', T_GRID, ' NSteps=', G3D%NStepswhich returned:
DEBUG: Periodic= T T_GRID= -2.4414062E-04 NSteps= 4000So even with
Periodic = .true.,T_GRIDcould come out negative after bothMODULOcalls when using single precision.Looking at the code,
GetBoundsYandGetBoundsZfollow a similar logic toGetBoundsT. But those subroutines have an additional condition for the lower bound with a grid tolerance (e.g.,IY_LO == 0 .and. DY >= 1.0_ReKi - GridTol). I followed a similar approach forIT_LO == 0, so a point withinGridTol(e.g., 0.001) of t = 0 s at the negative side is clamped onto the first time sample instead of raising a fatal error: