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 check for MOM6 parameter filenames defined in input.nml #364

Merged

Conversation

jo-basevi
Copy link
Collaborator

In this branch, I've tagged on some code that runs at the end of Mom6.setup() that checks if files listed in parameter_file of MOM_input_nml and SIS_input_nml namelists in input.nml, are included in mom6's hard coded config_files or optional_config_files.

If the file is not present, I've added a warning, added the file to config_files and then copied the file to the workpath.
Or is just a warning/error printed out during setup sufficient? If not, should the files be treated as config_files or optional_config_files - i.e. raises an exception if file not found or not?

From what I can tell, the only usages of optional_config_files and config_files are:

  • to be added to the runlog manifest (which happens during Experiment.run())
  • config files are copied from the control path to the work path (at Model.setup())

Should close #325

@pep8speaks
Copy link

pep8speaks commented Sep 18, 2023

Hello @jo-basevi! 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! 🍻

Comment last updated at 2023-10-04 01:19:44 UTC

@coveralls
Copy link

coveralls commented Sep 18, 2023

Coverage Status

coverage: 42.772% (+0.7%) from 42.053% when pulling ab80d20 on jo-basevi:325-read-mom6-parameter-filenames into fc83ec9 on payu-org:master.

@jo-basevi jo-basevi force-pushed the 325-read-mom6-parameter-filenames branch from 631a372 to 15046e2 Compare September 18, 2023 23:38
@jo-basevi jo-basevi force-pushed the 325-read-mom6-parameter-filenames branch from 15046e2 to 5afdd8a Compare September 28, 2023 04:47
@jo-basevi jo-basevi marked this pull request as ready for review September 28, 2023 04:49
@jo-basevi jo-basevi force-pushed the 325-read-mom6-parameter-filenames branch from 5afdd8a to 8ace7f6 Compare September 29, 2023 00:10
@aidanheerdegen
Copy link
Collaborator

I would have asked @angus-g for a review, but he wasn't a team member. Have added him, so he should be able to review this.

@aidanheerdegen
Copy link
Collaborator

I've pinged you for a review @angus-g

Copy link
Collaborator

@angus-g angus-g left a comment

Choose a reason for hiding this comment

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

This is a much nicer way of dealing with things! I've left a comment on how to take this a bit further to tidy up the lists of config files.

payu/models/mom6.py Outdated Show resolved Hide resolved
test/models/test_mom6.py Outdated Show resolved Hide resolved
@jo-basevi jo-basevi force-pushed the 325-read-mom6-parameter-filenames branch from a054ebb to b26543e Compare October 3, 2023 23:12
Jo Basevi added 2 commits October 4, 2023 12:10
If parameter file is not in mom6's hardcoded files, it is added to the config file and moved to the work directory
- Add a warning when there's no parameter files for MOM_input_nml or (SIS_input_nml if present)
@jo-basevi jo-basevi force-pushed the 325-read-mom6-parameter-filenames branch from b26543e to ab80d20 Compare October 4, 2023 01:19
@jo-basevi jo-basevi requested a review from angus-g October 4, 2023 21:45
Copy link
Collaborator

@angus-g angus-g left a comment

Choose a reason for hiding this comment

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

Excellent, thanks @jo-basevi, this looks good now!

@jo-basevi jo-basevi merged commit cfd694a into payu-org:master Oct 4, 2023
8 checks passed
@jo-basevi jo-basevi deleted the 325-read-mom6-parameter-filenames branch October 4, 2023 21:56
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.

Read MOM6 parameter filenames from experiment
5 participants