Skip to content

Add RANLUX to NWTC Library / HydroDyn#508

Merged
rafmudaf merged 9 commits intoOpenFAST:devfrom
rafmudaf:feature/ranlux
Aug 3, 2020
Merged

Add RANLUX to NWTC Library / HydroDyn#508
rafmudaf merged 9 commits intoOpenFAST:devfrom
rafmudaf:feature/ranlux

Conversation

@rafmudaf
Copy link
Collaborator

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 Waves module. 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_NUMBER subroutine, 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:
compiler_diff

Using RANLUX, the both align
compiler_same

@rafmudaf rafmudaf requested a review from andrew-platt July 21, 2020 18:24
@rafmudaf rafmudaf self-assigned this Jul 21, 2020
@rafmudaf rafmudaf marked this pull request as draft July 23, 2020 17:15
@rafmudaf rafmudaf marked this pull request as ready for review July 29, 2020 02:42
@rafmudaf
Copy link
Collaborator Author

@andrew-platt could you please review this when you have a chance?

@andrew-platt
Copy link
Collaborator

Did any of the visual studio projects get updated?

@rafmudaf
Copy link
Collaborator Author

Negative, good catch.

@rafmudaf rafmudaf changed the title RANLUX in NWTC Library / HydroDyn Add RANLUX to NWTC Library / HydroDyn Aug 3, 2020
@rafmudaf rafmudaf merged commit 1cde44a into OpenFAST:dev Aug 3, 2020
@rafmudaf rafmudaf deleted the feature/ranlux branch August 3, 2020 18:30
@rafmudaf rafmudaf mentioned this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants