Add RANLUX to NWTC Library / HydroDyn#508
Merged
rafmudaf merged 9 commits intoOpenFAST:devfrom Aug 3, 2020
Merged
Conversation
Collaborator
Author
|
@andrew-platt could you please review this when you have a chance? |
This test case has inconsistent results due to the different pRNG used between compilers. It passes with gfortran but fails with ifort.
Now it is consistent between gfortran and ifort compilers.
Collaborator
|
Did any of the visual studio projects get updated? |
Collaborator
Author
|
Negative, good catch. |
andrew-platt
approved these changes
Aug 3, 2020
Merged
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
It has been observed that HydroDyn wave kinematics are subject to influence from the compiler and operating system. This is due to the use of an intrinsic pRNG in the
Wavesmodule. This pull request introduced a module providing random number generation subroutines to the NWTC Library. This was taken from a similar TurbSim module that includes various methods for pRNG generation. Here, I've only included RANLUX, but the module is flexible and can be extended to use other methods.Also included is a HydroDyn module-level regression test. Initially, the test uses the Fortran intrinsic
RANDOM_NUMBERsubroutine, and the results are inconsistent between Intel and GNU compilers. After adding RANLUX, the test case passes for both compilers.The TurbSim module and its random number routines have not been modified.
Related issue, if one exists
#89
Impacted areas of the software
NWTC Library and HydroDyn
Additional supporting information
The HydroDyn input file now supports choosing the RANLUX pRNG, but fully supports using the Fortran intrinsic subroutine. If the user provides a second seed, the Fortran intrinsic is used. If "RANLUX" is provided instead, that pRNG is used.
This should remove some of the variations we have seen in compiler/machine sensitivities in the OpenFAST regression tests. Once this is accepted, I'll update the appropriate regression tests to use this method in another pull request.
Test results, if applicable

Using
RANDOM_NUMBER, this is the wave elevation calculation from GNU and Intel compilers:Using RANLUX, the both align
