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

query_config --grids doesn't show new MOM grid unless --comp_interface nuopc is specified #4456

Closed
klindsay28 opened this issue Jul 7, 2023 · 7 comments · Fixed by #4463
Closed

Comments

@klindsay28
Copy link
Collaborator

When I run query_config --grids with cesm2_3_beta15, there is no mention of the recently added MOM grid tx2_3v2.
It shows up if I add the argument --comp_interface nuopc to the command line invocation.
It looks like this is because the default for --comp_interface is mct:

parser.add_argument(
"--comp_interface",
choices=supported_comp_interfaces,
default="mct",
help="Coupler/Driver interface",
)

For CESM, this default differs from the default for --driver in create_newcase,
so CESM users see output from query_config that doesn't match create_newcase (by default).
Would it make sense to make the default for --comp_interface in query_config be get_cime_default_driver(),
as is done in create_newcase?
parser.add_argument(
"--driver",
default=get_cime_default_driver(),
choices=drv_choices,
help=drv_help,
)

(Is there a reason for this option to be named --driver in create_newcase and --comp_interface in query_config? I find it confusing, but perhaps there is a distinction that I'm not aware of.)

@ekluzek
Copy link
Contributor

ekluzek commented Jul 7, 2023

I have the same problem with the mizuRoute grids, that I've been putting up with, but would like the default updated as well. Since, CESM has MCT deprecated, we really should update the default to be NUOPC.

@ekluzek
Copy link
Contributor

ekluzek commented Jul 7, 2023

It looks like one way to have a different default for cesm is to do something like:

comp_interface_default = "mct"
if config.test_mode == "cesm":
   comp_interface_default = "nuopc"

 parser.add_argument( 
     "--comp_interface", 
     choices=supported_comp_interfaces, 
     default=comp_interface_default, 
     help="Coupler/Driver interface", 
 ) 

Although the way outlined above how it's done for create_newcase seems a simpler and better method.

@klindsay28
Copy link
Collaborator Author

Is there a reason to not use the get_cime_default_driver() function from CIME.utils, like is done for create_newcase?
This is what I was getting at in the initial comment.

@ekluzek
Copy link
Contributor

ekluzek commented Jul 7, 2023

Ahhh, I see what you mean. I didn't pick that up on my first read through. I do think that's the way to do it, and it might as well also use drv_choices to list the options the same was as done in create_newcase.

For the purposes of these two scripts, I don't think there is an important distinction between "driver" and "comp_interface". The name of the internal XML variable is "COMP_INTERFACE", so --comp_interface corresponds closer to that. But, you also can't just create a case and change the COMP_INTERFACE variable and get the case to work. It is something that you need to know at the top level to get it to work correctly.

@ekluzek
Copy link
Contributor

ekluzek commented Jul 7, 2023

In looking at the blame and git log for these two scripts, it looks like create_newcase always used driver and query_config always used comp_interface going all the way back. The query_config script does have several internal variables that use comp_interface, so having the command line option be "driver", would be a little strange unless you changed all of that. I also get the impression that the query_config could use the simpler methodology used in create_newcase, but I can't say for sure.

@jasonb5 you did a lot of the work on query_config for this, do you think the distinction for comp_interface in query_config is important? Could it be changed to use "driver" and more similar to the methodology used in create_newcase?

@jasonb5
Copy link
Collaborator

jasonb5 commented Jul 11, 2023

@ekluzek The distinction is not very important. I'd be fine with updating the argument to be driver. @jgfouca Any thoughts on this change?

The model specific driver options and defaults are exposed through the Config class

cime/CIME/config.py

Lines 190 to 197 in 5877fde

self._set_attribute(
"driver_default", "nuopc", desc="Sets the default driver for the model."
)
self._set_attribute(
"driver_choices",
("mct", "nuopc"),
desc="Sets the available driver choices for the model.",
)

If the defaults don't work, you can customize it in your model's cime_config directory, you can reference the E3SM config.

@jgfouca
Copy link
Contributor

jgfouca commented Jul 11, 2023

I'd be fine with changing the arg to driver.

jasonb5 added a commit that referenced this issue Jul 20, 2023
- Adds --driver to query_config
- Deprecates --comp_interface for query_config
- Fixes driver_choices in create_test

Test suite: pytest CIME/tests/test_unit*
Test baseline: n/a
Test namelist changes: n/a
Test status: n/a

Fixes #4456
User interface changes?: N
Update gh-pages html (Y/N)?: N
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 a pull request may close this issue.

4 participants