-
Notifications
You must be signed in to change notification settings - Fork 236
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
Abort if registering a restart too late in init()? #1214
Comments
Hi Michael, I discussed with others here and we agree that there should in principle be no reason to call Having said that, there are two minor and one major issue with doing this right now. The first minor issue is that we do actually call The second minor issue is that I don't think either of these instances would be difficult to resolve. But there is a larger issue, namely that we are preparing for a major overhaul of the FMS I/O, which includes a new handling of restart files (#1165). Any work that we here would likely cause a conflict with this PR. One of the sections heavily impacted by this PR is the initial state output. There is also the possibility that this ought to be handled at the FMS level, which we can also look into. Due to the ongoing FMS update, I'm going to recommend that we hold off on this and leave this issue open until the FMS PR has been merged. Does that work for you? |
That sounds reasonable to me -- I don't think this is an urgent issue, but did want to open a ticket in case others run into similar problems with restart files seemingly not being read. |
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.
I'm working on the MARBL driver based off of the NCAR fork, and I ran into something unexpected with
register_restart_field()
. Basically, we use an iterative solver to compute PH, with an initial guess of PH from the previous time step - to ensure bit-for-bit comparisons when restarting, we need these initial guesses in the restart file. I naively calledregister_restart_field()
from a subroutine called bytracer_flow_control_init()
and the fields were dutifully being written to the restart file but not being read in upon restarting. I moved the calls to a subroutine called fromcall_tracer_register()
and everything worked as expected.So it appears to me that the restart file is read in somewhere between the call to
call_tracer_register()
and the call totracer_flow_control_init()
-- if that's the case, it would be really nice to get an explicit error message when trying to register a new restart field after the restarts have already been processed. I didn't see anything in the log files to indicate I had done anything wrong, so it was dumb luck that I stumbled on the solution on my own.The text was updated successfully, but these errors were encountered: