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

Consistent formatting of MOM_input, matching MOM_parameter_doc.short #200

Open
aekiss opened this issue Aug 7, 2024 · 8 comments
Open

Comments

@aekiss
Copy link
Contributor

aekiss commented Aug 7, 2024

We need a consistent MOM_input format so we can easily compare across branches using git diff and also avoid merge conflicts when cherry-picking across branches.

I propose we use an order and format that matches MOM_parameter_doc.short so it will also be easy to see whether anything in MOM_input is redundant (e.g. a default value) by comparing MOM_input to MOM_parameter_doc.short. Note that this differs from the previous layout we inherited from CESM - e.g. see here. I've already done this for MOM6-CICE6/1deg_jra55do_ryf and propose doing this for our other branches.

Also note that there will need to be some hand-additions of the parameters not included in MOM_parameter_doc.short - see #121

Any objections?

@dougiesquire
Copy link
Collaborator

Sounds good to me

@aekiss
Copy link
Contributor Author

aekiss commented Aug 8, 2024

@minghangli-uni will this be an annoying disruption to your parameter-tuning workflow? It could make for messy merges of parameter changes.

@minghangli-uni
Copy link
Contributor

Hi @aekiss , my understanding is that the proposed consistent formatting is only applied once for each repo. Following tests will then use this established format, is that correct?

The current technique for tuning parameters is through MOM_override, hence it is not necessarily to modify MOM_input, unless we want to merge the override parameters into MOM_input. But it is still good to have an ordered MOM_input file. I believe this script COSIMA/om3-utils#17 can do the match properly.

One issue might exist if we add a new parameter, such as THERMO_SPANS_COUPLING, to MOM_input, which wasn’t there before, it could change the order of existing parameters and the new parameter does not link with a comment.

@minghangli-uni
Copy link
Contributor

One issue might exist if we add a new parameter, such as THERMO_SPANS_COUPLING, to MOM_input, which wasn’t there before, it could change the order of existing parameters and the new parameter does not link with a comment.

The position of the 'new' parameter and its associated comment can be fixed by aligning MOM_input with MOM_parameter_doc.all, ensuring that they are properly positioned.

@aekiss
Copy link
Contributor Author

aekiss commented Aug 8, 2024

my understanding is that the proposed consistent formatting is only applied once for each repo. Following tests will then use this established format, is that correct?

Yep, the idea is to establish a new standard way of arranging these files.

The content would simply be copied from MOM_parameter_doc.short plus a couple of things from MOM_parameter_doc.debugging.
If new parameters are added, their format and location should match the new MOM_parameter_doc.short that MOM would output with the new parameters.

MOM_parameter_doc.all would not be used.

@anton-seaice
Copy link
Contributor

We should be able to enforce this through a "QA" check in the repro CI, I think

@aekiss
Copy link
Contributor Author

aekiss commented Aug 8, 2024

After MOM_parameter_doc.* are automatically re-generated, CI could detect whether a parameter default has changed when we upgrade MOM6, by seeing if MOM_parameter_doc.short differs from MOM_input (aside from the extra bits from MOM_parameter_doc.debugging).

@minghangli-uni
Copy link
Contributor

Looks good to me. Thanks both!

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

No branches or pull requests

4 participants