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

+Add a restart registry lock & fix OBC call order #1441

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

Hallberg-NOAA
Copy link
Collaborator

Added code to lock the restart registry once all registration should have
occurred or if the restart has been read, along with a new public interface,
restart_registry_lock, to allow this lock to be set or unset. All calls to
register restart fields now check the state of this lock and issue a fatal error
if the registry is locked. This PR addresses MOM6 issue #1214.

In the process of adding this restart lock, the new error messages revealed
that some of the restart registration calls related to some types of open
boundary conditions were not happening early enough. To avoid this, a new
interface, register_DOME_OBC, was added to the DOME_initialization module and is
being called from call_OBC_register, and a number of the OBC-related calls
during the initialization were collected in the same (appropriate) place. Some
OBC error messages were also corrected. All answers are bitwise identical, but
there are two new public interfaces and the order of some OBC-related entries in
the MOM_parameter_doc calls changed.

  Added code to lock the restart registry once all registration should have
occurred or if the restart has been read, along with a new public interface,
restart_registry_lock, to allow this lock to be set or unset.  All calls to
register restart fields now check the state of this lock and issue a fatal error
if the registry is locked.  This PR addresses MOM6 issue mom-ocean#1214.

  In the process of adding this restart lock, the new error messages revealed
that some of the restart registration calls related to some types of open
boundary conditions were not happening early enough.  To avoid this, a new
interface, register_DOME_OBC, was added to the DOME_initialization module and is
being called from call_OBC_register, and a number of the OBC-related calls
during the initialization were collected in the same (appropriate) place.  Some
OBC error messages were also corrected.  All answers are bitwise identical, but
there are two new public interfaces and the order of some OBC-related entries in
the MOM_parameter_doc calls changed.
@Hallberg-NOAA Hallberg-NOAA linked an issue Jul 9, 2021 that may be closed by this pull request
Copy link
Collaborator

@adcroft adcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adcroft adcroft self-assigned this Jul 30, 2021
@adcroft adcroft merged commit 0abf9c2 into mom-ocean:dev/gfdl Jul 30, 2021
@Hallberg-NOAA Hallberg-NOAA deleted the restart_lock branch July 30, 2021 15:56
@andrew-c-ross
Copy link
Contributor

andrew-c-ross commented Aug 4, 2021

+1 @nikizadehgfdl

@Hallberg-NOAA this PR also appears to have introduced a second bug when running with both OBCs and generic tracers/COBALT (which, admittedly, we haven't sent a PR for yet). Moving call_OBC_register to after tracer_registry_init results in the generic tracers being registered before temperature and salinity on the boundary, meaning T and S become tracers 34-35 (after 33 COBALT tracers) and everything expecting them to be 1-2 breaks.

I have a tentative fix and can open an issue after some more work to confirm the bug is resolved and that it doesn't adversely affect the DOME case.

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.

Abort if registering a restart too late in init()?
4 participants