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

Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME in cmeps1.0.19 and following for F compsets if you update cmeps after case created #508

Open
ekluzek opened this issue Oct 1, 2024 · 12 comments
Labels
bug Something isn't working CESM only

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Oct 1, 2024

I found this in a CAM checkout of cam6_4_032 with CMEPS updated to cmeps1.0.20 which is what's being used in cesm3_0_alpha03d. I updated the other submodules to the cesm3_0_alpha03d submodules so everything should be consistent.

The test SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 fails at preview_namelist time in the namelist build of the cmeps namelist as follows, because it's expecting that OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME will be an XML variable in the case -- and it's not provided for a compset with SWAV.

So I'd expect this to fail with any compset with SWAV. Since, we aren't seeing this problem in cesm3_0_alpha03d testing -- I'm not sure why this shows up here.

  Calling /glade/derecho/scratch/erik/cam6_4_032/cime/CIME/non_py/src/components/stub_comps_nuopc/sesp/cime_config/buildnml
  2024-10-01 15:25:39 cpl 
Create namelist for component drv
   Calling /glade/derecho/scratch/erik/cam6_4_032/components/cmeps/cime_config/buildnml
Namelist default for variable ocn2wav_smapname refers to unknown XML variable OCN2WAV_SMAPNAME.
Traceback (most recent call last):
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/scripts/SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4.20241001_150352_n6ytq4/./preview_namelists", line 67, in <module>
    _main_func(__doc__)
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/scripts/SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4.20241001_150352_n6ytq4/./preview_namelists", line 63, in _main_func
    case.create_namelists(component=args.component)
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/case/preview_namelists.py", line 90, in create_namelists
    import_and_run_sub_or_cmd(
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/utils.py", line 671, in import_and_run_sub_or_cmd
    raise e1 from None
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/utils.py", line 667, in import_and_run_sub_or_cmd
    run_sub_or_cmd(
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/utils.py", line 712, in run_sub_or_cmd
    getattr(mod, subname)(*subargs)
  File "/glade/derecho/scratch/erik/cam6_4_032/components/cmeps/cime_config/buildnml", line 694, in buildnml
    _create_drv_namelists(case, infile, confdir, nmlgen, files)
  File "/glade/derecho/scratch/erik/cam6_4_032/components/cmeps/cime_config/buildnml", line 148, in _create_drv_namelists
    nmlgen.init_defaults(infile, config, skip_default_for_groups=["modelio"])
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/nmlgen.py", line 168, in init_defaults
    self.add_default(self._definition.get(entry, "id"))
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/nmlgen.py", line 706, in add_default
    default = self.get_default(name, allow_none=True)
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/nmlgen.py", line 383, in get_default
    default[i] = self.quote_string(scalar)
  File "/glade/derecho/scratch/erik/cam6_4_032/cime/CIME/nmlgen.py", line 217, in quote_string
    if string == "" or (string[0] not in ('"', "'") or string[0] != string[-1]):
TypeError: 'NoneType' object is not subscriptable
@ekluzek ekluzek added bug Something isn't working CESM only labels Oct 1, 2024
@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 1, 2024

@billsacks @jedwards4b @fischer-ncar the following change I've tried gets preview_namelists to run. Does this look like the correct change to bring in?

diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml
index 80a59931..35822544 100644
--- a/cime_config/namelist_definition_drv.xml
+++ b/cime_config/namelist_definition_drv.xml
@@ -2308,8 +2308,9 @@
       ocn to wav state mapping file for states
     </desc>
     <values>
+      <value>unset</value>
       <value samegrid_ocn_wav="true">idmap</value>
-      <value>$OCN2WAV_SMAPNAME</value>
+      <value samegrid_ocn_wav="false">$OCN2WAV_SMAPNAME</value>
     </values>
   </entry>
 
@@ -2322,8 +2323,9 @@
       wav to ocn state mapping file for states
     </desc>
     <values>
+      <value>unset</value>
       <value samegrid_ocn_wav="true">idmap</value>
-      <value>$WAV2OCN_SMAPNAME</value>
+      <value samegrid_ocn_wav="false">$WAV2OCN_SMAPNAME</value>
     </values>

@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 1, 2024

I just verified that this does NOT occur in cesm3_0_alpha03d. So must be a problem just in a CAM checkout? @cacraigucar

@ekluzek ekluzek changed the title Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME a FWma2000climo compset (maybe all compsets with SWAV?) Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME in CAM checkout for a FWma2000climo compset (maybe all compsets with SWAV?) Oct 1, 2024
@billsacks
Copy link
Member

Is it possible that this is related to #498, which came in with cmeps1.0.19?

@jedwards4b
Copy link
Collaborator

Yes I believe that the cam cmeps tag needs to be updated to the latest cmeps. (currently cmeps1.0.20)

@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 1, 2024

@jedwards4b no @billsacks is right, in the cam checkout it fails as above using both cmeps1.0.20 and cmeps1.0.19 -- but works using cmeps1.0.18.

I still don't know why it works in cesm3_0_alpha03d though and fails in the cam checkout.

Thoughts on the proposed fix above?

@billsacks
Copy link
Member

@ekluzek can you clarify: when you say it works in alpha03d, do you mean out-of-the-box alpha03d or alpha03d with cmeps updated? It looks like alpha03d uses cmeps1.0.16.

@ekluzek ekluzek changed the title Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME in CAM checkout for a FWma2000climo compset (maybe all compsets with SWAV?) Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME in cmeps1.0.19 and following for a FWma2000climo compset (maybe all compsets with SWAV?) Oct 2, 2024
@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 2, 2024

@billsacks oh you are right. I thought I saw that alpha03d was using cmeps1.0.20, but you are right it's using cmeps1.0.16. And when I update it to cmeps1.0.19 -- it starts failing again as above. So yes this is a problem with the last two cmeps tags.

@cacraigucar
Copy link
Contributor

@brian-eaton is updating our externals to match alpha03d, so we'll probably sidestep the problem for now (unless folks suggest he update to cmeps1.0.20.

@cacraigucar
Copy link
Contributor

Actually, on a closer reading, I don't think CAM wants to update to cmeps1.0.20, until this problem is fixed. I would suggest that @brian-eaton update to the CMEPS used in alpha03d (cmeps1.0.16) until this problem is solved.

@jedwards4b
Copy link
Collaborator

I found the problem and will correct in the next cmeps tag.

@jedwards4b
Copy link
Collaborator

@ekluzek I don't see how you could have produced this error unless you created the case first then updated cmeps before running case.build - is this what happened? If not can you provide instructions to reproduce this issue?

@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 2, 2024

@jedwards4b yep -- you are right. I created the case to work on one problem and then wanted to check it in the latest cmeps and this came up. I didn't hardly realize that is what I had done.

But, I just verified that if I create the case with the updated cmeps in place -- I don't run into this. So thanks for pointing that out.

@ekluzek ekluzek changed the title Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME in cmeps1.0.19 and following for a FWma2000climo compset (maybe all compsets with SWAV?) Problem with OCN2WAV_SMAPNAME and WAV2OCN_SMAPNAME in cmeps1.0.19 and following for F compsets if you update cmeps after case created Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CESM only
Projects
None yet
Development

No branches or pull requests

4 participants