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

if the config_machines.xml file cannot be found give a meaningful error #4469

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

jedwards4b
Copy link
Contributor

Gives a meaningful error if config_grids.xml or config_machines.xml cannot be found.

Test suite:scripts_regression_tests.py
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes #4468

User interface changes?:

Update gh-pages html (Y/N)?:

@jedwards4b jedwards4b self-assigned this Aug 1, 2023
Copy link
Contributor

@mnlevy1981 mnlevy1981 left a comment

Choose a reason for hiding this comment

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

For testing, I checked out cesm2_3_beta15 and ran ./manage_externals/checkout_externals cime pop cmeps cdeps ww3; I then tried to run ./create_newcase --compset C --res T62_g17 --case ../../cases/C.test out of cime/scripts.

Out of the box, the error I got matched what is reported in #4468 (I don't think I included the full traceback, but the Schema validity test fails line is what helped us realize we were missing ccs_config):

Compset longname is 2000_DATM%NYF_SLND_DICE%SSMI_POP2_DROF%NYF_SGLC_WW3
Compset specification file is /glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/components/pop//cime_config/config_compsets.xml
Automatically adding SESP to compset
Schema validity test fails for /glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/ccs_config/config_grids_nuopc.xml
Traceback (most recent call last):
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/scripts/./create_newcase", line 18, in <module>
    _main_func()
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/CIME/scripts/create_newcase.py", line 422, in _main_func
    case.create(
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/CIME/case/case.py", line 2419, in create
    self.configure(
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/CIME/case/case.py", line 1289, in configure
    grids = Grids(gridfile, comp_interface=driver)
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/CIME/XML/grids.py", line 34, in __init__
    self._version = self.get_version()
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/CIME/XML/generic_xml.py", line 434, in get_version
    version = self.get(self.root, "version")
  File "/glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/cime/CIME/XML/generic_xml.py", line 200, in get
    return node.xml_element.get(attrib_name, default=default)
AttributeError: 'NoneType' object has no attribute 'xml_element'

With the branch this PR uses, the error is

Compset longname is 2000_DATM%NYF_SLND_DICE%SSMI_POP2_DROF%NYF_SGLC_WW3
Compset specification file is /glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/components/pop//cime_config/config_compsets.xml
Automatically adding SESP to compset
ERROR: ERROR: grid file not found /glade/work/mlevy/codes/CESM/cesm2_3_beta15.test/ccs_config/config_grids_nuopc.xml

which is much better.

@jedwards4b jedwards4b merged commit 4d85958 into ESMCI:master Aug 1, 2023
9 checks passed
@jedwards4b jedwards4b deleted the fix_ccs_missing_error branch August 1, 2023 14:40
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.

Better error message when missing ccs_config?
2 participants