Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HydroDyn/SeaState Code Cleanup + Registry updates #2

Merged
merged 40 commits into from
May 19, 2022

Conversation

bjonkman
Copy link

Feature or improvement description

  • Removed unused subroutines, variables, and sections of HydroDyn code that were logically impossible to get to (including a lot of Morison submodule file output options)
  • Made sure the SeaState output files are named consistently (previously some were RootName.SEA.ext and some RootName.SeaSt.ext).
  • Fixed some error handling in HydroDyn and SeaState
  • Updates to VersionInfo (see Updates to VersionInfo module and its dependencies OpenFAST/openfast#1124).
  • Updated FAST Registry to add an optional argument to the destroy routines, telling it to nullify pointers but not deallocate the memory they point to. This allows us to get rid of the nullify() statements strewn throughout the code, which have a tendency to be set incorrectly (or be missed). PLEASE LET ME KNOW IF YOU NOTICE ISSUES WITH THIS PART OF THE CODE.
    • updated Types.f90 files generated by the Registry
  • Updated pointer to r-test with updated input files for HydroDyn. This also involved updating example input files in the docs folder.

Impacted areas of the software
HydroDyn, SeaState, NWTC_Library, VersionInfo, Registry (+ all registry-generated *_Types files)

Test results, if applicable
The r-tests run locally, but--as expected--give different answers from previous versions.

Just as a note, there seem to be some intermittent issues with file I/O in the HydroDyn driver (with gfortran). I think this is similar to the intermittent behavior that the AeroDyn driver also exhibits sometimes. For example, in https://github.com/bjonkman/openfast/actions/runs/2303615322, the HD driver's ITI barge regression case runs to completion in debug mode, but in release mode it fails with this error:

 Error status and messages after execution:
            ErrStat: 4
    ErrMsg returned: SeaSt_Init:SeaStateInput_ProcessInitData:NWaveElev must not be negative.

The echo files for debug/release are the same, showing that NWaveElev is read as 1:

---------------------- OUTPUT --------------------------------------------------
 True            = SeaStSum            
 3               = OutSwtch            
 E15.7e2         = OutFmt              
 A11             = OutSFmt             
 1               = NWaveElev           
0   WaveElevxi     - List of xi-coordinates for points where the incident wave elevations can be output (meters) [NWaveElev points, separated by commas or white space; usused if NWaveElev = 0]
0   WaveElevyi     - List of yi-coordinates for points where the incident wave elevations can be output (meters) [NWaveElev points, separated by commas or white space; usused if NWaveElev = 0]
 0               = NWaveKin            
14.43376,      -18.4752    WaveKinxi - List of xi-coordinates for points where the wave kinematics can be output (meters) [NWaveKin points, separated by commas or white space; usused if NWaveKin = 0]
25,            -6    WaveKinyi - List of yi-coordinates for points where the wave kinematics can be output (meters) [NWaveKin points, separated by commas or white space; usused if NWaveKin = 0]
-14,           -17    WaveKinzi - List of zi-coordinates for points where the wave kinematics can be output (meters) [NWaveKin points, separated by commas or white space; usused if NWaveKin = 0]

bjonkman and others added 30 commits April 20, 2021 22:02
This change removes USE statements for modules that are inherited through modules that are explicitly included in the Registry input files. This should reduce the memory required to build the code in certain instances, but should have no effect on the compiled code.
If the user specifies the array dimensions via {*} instead of {:} a Fortran pointer to an array is generated instead of an allocatable array.  If the -ccode option is used, then {*} results  in the same output as {:} for compatibility with the corresponding C code.  The user can only generate these Fortran pointers in the InitInput, InitOutput and Parameter data structures.  The Registry will exit with an error if the user attempts to generate Fortran pointers in the other Framework data structures.
- updated error handling in HD driver input file
- made paths listed in HD driver relative to input file location
…dule

moved all code that was in NWTC_IO that called the version info module into the version info module. This allows us to rebuild the version info stuff without having to rebuild the NWTC library.

Also moved some of the more generic GetVersion functions from FAST and SeaState into the version info module so we won't have to duplicate code with every driver that wants to use it.
change strings passed as `CHARACTER(1024)` to `CHARACTER(*)` to avoid potential issues of calling the routines with different size variables
Previously, SeaState used `.SeaSt.sum`, `.SEA.out` , and `.SEA.ech`
check: does choosing to only output to combined (driver) file suppress output in HD driver?
Before this change, if output channel names weren't in a quoted string, they could not contain comments after the channel name.
The size of p%WAMIT differs based on the NBodyMod parameter, so make the loop limits more generic.
NWTC Library no longer depends on VersionInfo (to aid in changing version + without rebuilding all of openFAST)
it is now in module VersionInfo instead of NWTC_IO. I don't feel like renaming and moving the file to the new module.
need to move this to the VersionInfo test directory
- Removed unused variables flagged by compiler
- replaced string `'SeaSt_CalcOutput'` with `RoutineName` parameter so that searches for that routine don't result in 100s of matches (including in Morison.f90).
- remove unused variables identified by compiler
I had a hard time remembering if the new test directory was the `test` or `tests` one, so I renamed `test` to `Old_test` to help me remember.
plus fix r-test input files for AD regression tets
Also call `Morison_CopyMOutput` routine to copy data types containing allocatable arrays to avoid memory issues with some compilers.
bjonkman added 10 commits May 4, 2022 12:08
- fix error handling
- allow optional argument to prevent deallocating memory from pointers (allows pointers to get set to NULL while maintaining data for other modules that may point to same data). NOTE: this continues to place a burden on developers to make sure that memory is getting handled properly.
- removed unused framework-related subroutines
- removed unused code to create module-level output files (related to `OutSwtch` variable)
- removed unused code to output all Morison outputs (related to `NumOutAll` and `OutAll` variables) 
- initialized AllOuts to 0
Use `DEALLOCATEpointers` argument on call to destroy, instead of manually nullifying the pointers first.
Also added `PointsToSeaState` variable to help with deallocation on restart. This should avoid issues with memory leaks and/or deallocation errors.
- update some error handling
- replace nullify() statements in driver with DEALLOCATEpointers argument to destroy routine
- replace character string with parameter
- r-test input files updated
- fixed comments regarding valid AMMod entries
@luwang00 luwang00 merged commit 4d7f0ed into luwang00:dev May 19, 2022
luwang00 pushed a commit that referenced this pull request May 3, 2023
AD buoyancy: minor modification of SolveOption1 algorithm
luwang00 pushed a commit that referenced this pull request May 3, 2023
Lidar for IfW updates/modifications
luwang00 pushed a commit that referenced this pull request Aug 7, 2023
luwang00 pushed a commit that referenced this pull request Oct 25, 2023
Update the regression tests.
luwang00 pushed a commit that referenced this pull request Dec 19, 2023
Update to dev branch, and include regression test updates
luwang00 pushed a commit that referenced this pull request Apr 3, 2024
ADI_C: minor name changes, a couple of notes for future
luwang00 pushed a commit that referenced this pull request Jul 29, 2024
MD: remove extra internal read for linear damping on rods
andrew-platt added a commit that referenced this pull request Aug 26, 2024
Forgot to remove an override of the position for the Nacelle mesh in PR OpenFAST#982.
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.

3 participants