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

CMEPS can only run under create_test and NOT create_newcase (cmeps1.0.31) #520

Closed
ekluzek opened this issue Dec 12, 2024 · 2 comments · Fixed by #521
Closed

CMEPS can only run under create_test and NOT create_newcase (cmeps1.0.31) #520

ekluzek opened this issue Dec 12, 2024 · 2 comments · Fixed by #521
Labels
bug Something isn't working

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Dec 12, 2024

A bug in CMEPS 1.0.31 from this commit 630c935 where TESTCASE is queried from the case. Since TESTCASE does NOT exist when create_test is NOT used (so under create_newcase) it aborts with an error something like this at preview_namelist time...

12-12 16:10 CIME.case.preview_namelists INFO     Create namelist for component drv
12-12 16:10 CIME.utils   INFO        Calling /glade/work/erik/ctsm_worktrees/quickfix/components/cmeps/cime_config/buildnml
attribute is NOT in the attributes dictionary:TESTCASE
attributes dictionary:{'cime_model': 'cesm', 'iyear': '2000', 'BGC_MODE': 'none', 'CPL_I2O_PER_CAT': False, 'DRV_THREADING': None, 'CPL_ALBAV': False, 'CPL_EPBAL': 'off', 'FLDS_WISO': False, 'BUDGETS': False, 'MACH': 'derecho', 'MPILIB': 'mpi-serial', 'OS': 'CNL', 'TESTCASE': None, 'glc_nec': 10, 'timer_level': 'pos', 'continue_run': '.false.', 'flux_epbal': 'off', 'mask_grid': 'null', 'hist_option': 'never', 'rest_option': 'ndays', 'stop_option': 'ndays', 'comp_ocn': 'socn', 'atm_grid': 'CLM_USRDAT', 'lnd_grid': 'CLM_USRDAT', 'ice_grid': 'null', 'ocn_grid': 'null', 'samegrid_atm_lnd': 'true', 'samegrid_atm_ocn': 'true', 'samegrid_atm_ice': 'true', 'samegrid_atm_wav': 'true', 'samegrid_lnd_rof': 'true', 'samegrid_wav_ocn': 'true', 'single_column': 'true', 'COMP_ATM': 'datm', 'COMP_ICE': 'sice', 'COMP_GLC': 'sglc', 'COMP_LND': 'clm', 'COMP_OCN': 'socn', 'COMP_ROF': 'srof', 'COMP_WAV': 'swav', 'CAMDEV': 'False', 'ROF_MODE': 'null', 'run_type': 'startup', 'wav_ice_coupling': False}
filename:/glade/work/erik/ctsm_worktrees/quickfix/components/cmeps/cime_config/namelist_definition_drv.xml
groups:{}
Traceback (most recent call last):
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/scripts/test_newcase/./preview_namelists", line 67, in <module>
    _main_func(__doc__)
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/scripts/test_newcase/./preview_namelists", line 63, in _main_func
    case.create_namelists(component=args.component)
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/case/preview_namelists.py", line 90, in create_namelists
    import_and_run_sub_or_cmd(
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/utils.py", line 668, in import_and_run_sub_or_cmd
    raise e1 from None
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/utils.py", line 664, in import_and_run_sub_or_cmd
    run_sub_or_cmd(
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/utils.py", line 709, in run_sub_or_cmd
    getattr(mod, subname)(*subargs)
  File "/glade/work/erik/ctsm_worktrees/quickfix/components/cmeps/cime_config/buildnml", line 693, in buildnml
    _create_drv_namelists(case, infile, confdir, nmlgen, files)
  File "/glade/work/erik/ctsm_worktrees/quickfix/components/cmeps/cime_config/buildnml", line 149, in _create_drv_namelists
    nmlgen.init_defaults(infile, config, skip_default_for_groups=["modelio"])
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/nmlgen.py", line 168, in init_defaults
    self.add_default(self._definition.get(entry, "id"))
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/nmlgen.py", line 706, in add_default
    default = self.get_default(name, allow_none=True)
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/nmlgen.py", line 343, in get_default
    default = self._definition.get_value_match(
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/XML/namelist_definition.py", line 217, in get_value_match
    value = super(NamelistDefinition, self).get_value_match(
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/XML/entry_id.py", line 71, in get_value_match
    value = self._get_value_match(
  File "/glade/work/erik/ctsm_worktrees/quickfix/cime/CIME/XML/entry_id.py", line 143, in _get_value_match
    if not re.search(
  File "/glade/u/apps/derecho/23.09/opt/._view/yazo4iwystz7p2hxu5ukzrw3xa24ksen/lib/python3.10/re.py", line 200, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object

NOTE: I added some extra printing to see what's going on in CIME to find the problem.

But, the lines in question is here in cime_config/namelist_definition_drv.xml

    <values>
       <value>.true.</value>
       <value rest_option='none'>.false.</value>
        <value rest_option='never'>.false.</value>
+     <value TESTCASE='ERC'>.false.</value>
+     <value TESTCASE='ERP'>.false.</value>
+     <value TESTCASE='ERI'>.false.</value>
    </values>
  </entry>
@ekluzek ekluzek added the bug Something isn't working label Dec 12, 2024
@ekluzek
Copy link
Collaborator Author

ekluzek commented Dec 12, 2024

This was found as part of ESCOMP/CTSM#2757

@ekluzek
Copy link
Collaborator Author

ekluzek commented Dec 12, 2024

One fix would be to move TESTCASE in cime from env_test.xml to env_run.xml or env_case.xml so that it could always be queried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant