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

Enable seperate ice_history.nml & cice_in.nml settings #483

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

anton-seaice
Copy link
Collaborator

To enable simpler changes to the icefields namelist in cice, this change adds support for an ice_history.nml file which is spliced into the normal cice runtime settings (cice_in.nml) by payu before the model is run.

This follow the discussion in https://forum.access-hive.org.au/t/access-esm1-5-release-work-plan/1721/24

The contents of ice_history.nml can be anything which also would fit in cice_in.nml , but the intention is to move &icefields_nml to the ice_history file

Do we need to update docs ? Or tests ? There doesn't appear to be any of either at this point

@pep8speaks
Copy link

pep8speaks commented Aug 13, 2024

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

Line 56:8: E114 indentation is not a multiple of four (comment)

Line 92:28: E201 whitespace after '{'
Line 92:41: E202 whitespace before '}'

Comment last updated at 2024-08-15 04:15:42 UTC

@anton-seaice
Copy link
Collaborator Author

@aidanheerdegen @blimlim - This is ready for review.

To test, make a ice/ice_history.nml file and put some valid namelist values in it (move something from ice/cice_in.nml) and the payu run.

@coveralls
Copy link

coveralls commented Aug 13, 2024

Coverage Status

coverage: 54.145% (+1.9%) from 52.281%
when pulling 64e356c on ACCESS-NRI:esm1.5-patch-cice-history-nml
into 83001a2 on payu-org:master.

@aidanheerdegen
Copy link
Collaborator

Do we need to update docs ? Or tests ? There doesn't appear to be any of either at this point

That would be great.

We have an issue about the lack of driver docs

#470

And there isn't an example to leverage off at this point I'm afraid.

But just adding some tests for this functionality in a driver test suite would be fantastic. There are some examples you could base that on here

https://github.com/payu-org/payu/blob/master/test/models/

@anton-seaice
Copy link
Collaborator Author

The expected behaviour for this change is :

  • ice_history.nml overrides and adds to any values also in cice_in.nml
  • there is no change if ice_history.nml doesn't exist
  • ice_history.nml is not moved to output* folders, as its content is in cice_in.nml

@anton-seaice
Copy link
Collaborator Author

But just adding some tests for this functionality in a driver test suite would be fantastic. There are some examples you could base that on here

I think that would require splitting the new lines in a function ? e.g. patch_nml(self)

It feels a bit like overkill but maybe its sensible ?

blimlim
blimlim previously approved these changes Aug 14, 2024
Copy link
Collaborator

@blimlim blimlim left a comment

Choose a reason for hiding this comment

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

Awesome, really glad that this is working!

Changes look good to me. I've just added a comment for an optional change, but am not sure that it's necessarily better.

Running on gadi with the history parameters separated into a separate namelist worked for me.

payu/models/cice.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

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

I have an opinion or two ...

payu/models/cice.py Show resolved Hide resolved
payu/models/cice.py Outdated Show resolved Hide resolved
@anton-seaice
Copy link
Collaborator Author

I added a test, and moved the 'dump_last' to the cice5 driver. I didn't add ice_history.nml to optional_config_files because I think its potentially confusing (cice_in.nml is the source of truth).

Copy link
Collaborator

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

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

LGTM

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.

5 participants