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

Cleanup HydroDyn and SeaState code #1864

Merged

Conversation

bjonkman
Copy link
Contributor

@bjonkman bjonkman commented Nov 9, 2023

Feature or improvement description
This PR removes duplicate copies of data and pointers of many variables shared between SeaState and HydroDyn. These shared data are now stored in the WaveField data type (stored as a SeaState parameter).

It also removes duplicated error checks, outdated code (including outdated driver codes for some HydroDyn submodules), and outdated comments. Hopefully these changes will make it easier to read the code, though more updates could be done.

Some particular changes to note:

  • Parameter WtrDpth has been replaced with EffWtrDpth in places where it had added MSL2SWL to the variable. WtrDpth is now ALWAYS the value from the input file. This should help remove confusion about whether that variable is being used before or after adding MSL2SWL.
  • Several subroutines were modified so that SeaSt_Interp doesn't give the same warning about clamped boundaries hundreds of times when that error condition occurs.

Impacted areas of the software
HydroDyn and SeaState; glue codes that connect the two modules are also modified.

Test results, if applicable
Regression test results have not changed.

Someone should add a test where MSL2SWL is non-zero, though. We should also add tests for the new features that have been added recently.

- removed PointsToSeaState (still need to fix some more pointers, though)
- removed InitInp PtfmLocationX and Y from HD since it's used in SeaState
- cleaned up some VS projects related to SeaSt/HD
This is already stored in the WaveField type, so doesn't need extra copies.
also added subroutines to add 1st and 2nd order arrays without copying all the error checks
These are now stored in WaveField data since the modules that need them already access the rest of the WaveField data.
Also, all of the SeaSt InitOut data that are sent to HD Init are now done in one place instead of two (originally there was some issue with pointers in the SeaSt InitOut type, but that is not a concern any more).
- also removed extra pointer for WaveTime in SS Excitation module
- cleaned up some text handling in SS Excitation (some incorrect routine names in error message and a lot of extra repeated string manipulation)
- Do we have a test for SS-Excitation?
@andrew-platt andrew-platt self-assigned this Nov 9, 2023
@andrew-platt andrew-platt added Module: HydroDyn Module: SeaState SeaState module for wave data generation labels Nov 9, 2023
@andrew-platt andrew-platt added this to the v4.0.0 milestone Nov 9, 2023
@andrew-platt
Copy link
Collaborator

@luwang00, can you also review?

@bjonkman
Copy link
Contributor Author

bjonkman commented Nov 9, 2023

As I was updating some of these variables, I question whether some of the tests involving WaveMod are complete (especially regarding the WaveMod 6 and 7 options), or whether some of these tests even need to be checking WaveMod.

Also, I think someone should double check where MSL2SWL is used in HydroDyn... Some of the checks didn't seem to make sense to me after I replaced the variable name with EffWtrDpth, but I could be wrong.

See comments with bjj in the code for the places I had questions.

modules/hydrodyn/src/HydroDyn_Output.f90 Show resolved Hide resolved
modules/hydrodyn/src/WAMIT.f90 Outdated Show resolved Hide resolved
- removed a bunch of `bjj` comments in the code
- simplified some of the checks based on WaveMod (made them easier to read by specifying exactly which models the checks apply to)
- updated default z depth using entered water depth instead of the default water depth
- removed override of `Hs` when it's not used
- override WvHiCOff and WvLowCOff in the cases where they are not supposed to be used; the code DOES actually use them, so they need to be set to allow all frequencies in the cases where they are not supposed to be used.
- put check on valid values of WaveStMod from HydroDyn into SeaState (and removed the conflicting SeaState check)
@andrew-platt andrew-platt merged commit 897d6ee into OpenFAST:dev-unstable-pointers Nov 17, 2023
21 checks passed
@bjonkman bjonkman deleted the f/WaveField_cleanup branch November 18, 2023 00:23
@andrew-platt andrew-platt mentioned this pull request Dec 24, 2024
38 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: HydroDyn Module: SeaState SeaState module for wave data generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants