MAP can't be used when writing checkpoint files#2915
Merged
deslaughter merged 4 commits intoOpenFAST:rc-4.1.2from Jul 9, 2025
Merged
MAP can't be used when writing checkpoint files#2915deslaughter merged 4 commits intoOpenFAST:rc-4.1.2from
deslaughter merged 4 commits intoOpenFAST:rc-4.1.2from
Conversation
Cross merge v4.1.1 release into dev
…when attempting to use MAP and write checkpoint files
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces error guards to prevent unsupported operations when the MAP module is active and standardizes how registry packing failures report fatal errors.
- Disallow writing checkpoint files if MAP is enabled.
- Prevent VTK mode shape visualization under MAP.
- Refactor registry pack routines to assign
ErrStat/ErrMsgfor C object packing failures.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| reg_tests/r-test | Updated subproject commit reference. |
| modules/openfast-registry/src/registry_gen_fortran.cpp | Refactored pack generator to manually set fatal error and message on C object. |
| modules/openfast-library/src/FAST_Subs.f90 | Added fatal errors for VTK mode shapes and checkpoint creation with MAP. |
| modules/map/src/MAP_Types.f90 | Updated all pack routines to set ErrID_Fatal and ErrMsg for C_obj packing. |
| modules/extloads/src/ExtLoadsDX_Types.f90 | Updated pack routines to set ErrID_Fatal and ErrMsg for C_obj packing. |
| modules/externalinflow/src/ExternalInflow_Types.f90 | Updated pack routines to set ErrID_Fatal and ErrMsg for C_obj packing. |
Comments suppressed due to low confidence (4)
modules/openfast-library/src/FAST_Subs.f90:1136
- Add or update regression tests to verify that requesting mode shape visualization with MAP active correctly triggers this fatal error path.
! If mode shape visualization requested when MAP is active, set error and return
modules/openfast-library/src/FAST_Subs.f90:1134
- [nitpick] Consider removing or replacing the developer initials in this comment to improve clarity and adhere to codebase comment conventions.
!bjj: until we modify this, MAP requires HydroDyn to be used. (perhaps we could send air density from AeroDyn or something...)
modules/openfast-registry/src/registry_gen_fortran.cpp:679
- [nitpick] To maintain consistency with existing error handling, consider using the SetErrStat subroutine instead of manually assigning RF%ErrStat and RF%ErrMsg.
w << indent << " RF%ErrStat = ErrID_Fatal";
Collaborator
|
Note: neither |
andrew-platt
approved these changes
Jul 9, 2025
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.
This PR is ready to merge.
Feature or improvement description
This PR adds error checks for when a user requests writing checkpoint files either for restart or mode shape visualization when the MAP module is active. If this should happen, an error message is displayed and OpenFAST will exit.
MAP can't be used with checkpoint files because MAP contains both Fortran and C components and the registry, which does the packing and unpacking of the checkpoint files, can't access some of the C data. Therefore, the checkpoint file can't contain the full state of the program so the restore won't work properly. MAP would likely need to be converted to Fortran to allow writing the checkpoint files.
While debugging this issue, some addition error handling was added to the registry to give better error messages in case a module tries to pack
C_Obj%objectdata; hence the registry changes.Related issue, if one exists
Closes #2887
Impacted areas of the software
registry_gen_fortran.cppMAP_Types.f90ExternalInflow_Types.f90ExtLoadsDX_Types.f90FAST_Subs.f90