payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

Flag a MOM6 run as a restart if using prior restart path #324

Closed angus-g closed 2 years ago

angus-g commented 2 years ago

Using the mechanism to point to an external restart directory:

restart: /path/to/restart

doesn't modify the experiment counter, because as far as payu is concerned, this is the first run. This breaks the logic the MOM6 module was using to determine whether to flag a run as a restart or not. In the case that the prior restart path has been set, we want to explicitly perform a restart run.

Thanks to @julia-neme for (unfortunately) finding this!

pep8speaks commented 2 years ago

Hello @angus-g! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-03-29 00:07:26 UTC
coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 42.245% when pulling b39ff26bf0a750fa8318529b447e75234283760a on angus-g:mom6-prior-restart into 3f00d4b72390053ab9182e340c582fbd0a67683f on payu-org:master.

aidanheerdegen commented 2 years ago

Seems a straightforward change.

Just to be explicit, would this have let to different behaviour if input_type is set incorrectly?

angus-g commented 2 years ago

That's right, input_type = 'r' will try to start the run from the restart files, and input_type = 'n' will ignore any restart files and start a fresh run.

aidanheerdegen commented 2 years ago

Huh, interesting. Not the same behaviour as MOM5 and other FMS models I guess. I'll merge.

angus-g commented 2 years ago

What do the other models do with that parameter?

aidanheerdegen commented 2 years ago

MOM5 at least didn't use it. Just reads in restart files that are either initial conditions or restarts from a previous run. In some cases if the restarts don't exist then it initialises to an "ideal state".

Many (most?) models seem to have flags which indicate an initial or continuing run (UM, CICE come to mind), but I've always found it to be a pain, just another state flag to set, when it should be possible for the model to intuit state as MOM5 does.

marshallward commented 2 years ago

I believe MOM6 (or is it FMS) supports the a argument, which does some sort of autodetection. Not sure on the exact rules though.