-
Notifications
You must be signed in to change notification settings - Fork 28
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
Don't require cice_in.nml
namelist in CICE5 restarts
#507
Conversation
Thanks for putting in these changes!
I think cloning wouldn't be necessary in these tests, as when a restart is added through cloning, payu just sets the restart: <fullpath/to/restart> This can be replicated in tests by configuring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep reviewing tomorrow :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to set-up the cice5 tests to import more code from test_cice.py
instead of copying it ? There may be enough differences its not worth doing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation of the code was easy to follow, so great for me who does not have much knowledge of these model drivers. I only have some fairly minor comments so far to add to this review
Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com>
Hello @blimlim! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-09-17 05:32:14 UTC |
Awesome thank you! I've removed the cloning steps from the tests, so that they now just test setting up the cice models with and without restart paths specified in the
Good question, I think the tests are very similar between the two cice versions. Now that the tests have been updated, I'll test this out in a separate branch to see how sharing tests between the two might look. |
Ok hmm I'm finding it a bit challenging to share the test code between the cice 4 and 5 tests. I've temporarily uploaded a (not quite working) attempt here: 377cd5f My idea was to build a base test class, which separate Let me know if you think the (attempted) changes do look any cleaner though, and if it might be worth trying to get them working. |
Happy to take your advice on whether moving to more generalised tests add benefit or confusion :) |
I found it a bit difficult (and in the end wasn't successful) in getting the imported tests to use the correct versions of constants and fixtures, and so I'm thinking for the moment it might be easiest to keep the tests separate. I've just added a couple of small fixes: Re-adding in the |
Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pip installed this branch. Then I cloned ACCESS-OM2
payu clone -b om2_1deg_ryf -B release-1deg_jra55_ryf https://github.com/ACCESS-NRI/access-om2-configs om2
and changed the run length to one month. And did a payu run. - Success
Then I did payu sweep && run again
I also did payu clone again
payu clone om2 om2-clone-n
payu sweep && run. - Success (This started again from 1900-01-01 - I assume that is correct.)
I also did a restart clone
payu clone -r om2/archive/restart000 om2 om2-clone-r
Which didn't work with a warning due to the relative path
payu clone -r /g/data/tm70/as2285/payu/om2/archive/restart000 om2 om2-clone-r
worked and did payu run - Success (run started from 1900-Feb-01)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @blimlim - this looks good.
Confirm with @aidanheerdegen before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for all the work implementing and testing @blimlim, and reviewing @anton-seaice and @jo-basevi.
Thanks for the reviews and help everyone! |
Attempts to close #499
This pull request modifies the
cice.py
driver, by pulling the timing calculations out fromsetup()
into a separatecalc_runtime()
method. This method is then overridden in thecice5.py
driver, allowing thecice_in.nml
namelist file to be absent from the restart directory, since OM2 does not use the information from these calculations. This in turn will allow OM2 to be run after usingpayu clone -r
with a specified OM2 restart directory.Most of the code changes are in the tests, which require a bit of intricate set up. Given that we're skipping
payu setup
and directly runningmodel.setup()
(in order to avoid more complicated pre-test setup), it's difficult to know how well we've matched the conditions for setting up a real experiment. E.g. When setting up the tests, inadvertent changes to the directories that existed at the start of the test led to payu using different work restart directories during different parts of the setup, and different restart files were moved to different places in a way that was tricky to understand. And so while the tests are working, they do feel a bit precarious. If you have any suggestions that would be very welcome!The main relevabt tests are the
test_restart_clone
tests for both CICE 4 and CICE 5. These do the following:The CICE 5 version of
test_restart_clone
passes with the new cice driver changes, and would have failed previously.One thing I'm unsure about: Do you think it's necessary to include the cloning steps in the tests. I think the main issue was payu requiring restart files that cice5 didn't use. This came up when trying to clone, but I don't think the issue came from the cloning step itself. Perhaps it's still useful to be testing the whole clone/setup process though.
Any feedback/suggestions would be very welcome! I'd be keen to get some other ideas before trying to finalise this, and so have marked this PR as a draft.