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

XML fields that are disconnected to nuopc.runconfig and hence don't function #362

Closed
ekluzek opened this issue Apr 12, 2023 · 5 comments · Fixed by NorESMhub/CMEPS#3
Closed
Labels
bug Something isn't working

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Apr 12, 2023

This is related to #346.

There's a list of XML variables that can be set, but don't actually do anything (changing them doesn't change the value in nuopc.runconfig). As such they should be removed from the XML. You could still set them if needed in the user_nl_cpl file.

Here's the list:

ATM2WAV_SMAPNAME
LND2ATM_SMAPNAME
ATM2LND_FMAPNAME
ATM2WAV_SMAPNAME
OCN2ATM_FMAPNAME
OCN2ATM_SMAPNAME
ATM2OCN_FMAPNAME
ATM2OCN_SMAPNAME
ATM2OCN_VMAPNAME
ATM2LND_FMAPNAME
ATM2LND_SMAPNAME
LND2ATM_FMAPNAME
LND2ATM_SMAPNAME

@ekluzek ekluzek added the bug Something isn't working label Apr 12, 2023
@ekluzek
Copy link
Collaborator Author

ekluzek commented Apr 12, 2023

Like #345 this came in with the commit b4a1983

@ekluzek
Copy link
Collaborator Author

ekluzek commented Apr 12, 2023

I think the right solution is to just remove all of the above XML variables. But, I need a CMEPS developer to make that call. I could add that change to #361 if that's approved as well.

@ekluzek ekluzek changed the title XML fields that are disconnected to anything XML fields that are disconnected to namelist and hence don't function Apr 12, 2023
@mvertens
Copy link
Collaborator

@ekluzek - I think your assumption that these xml fields are not used is incorrect. They provide the flexibility for the user to specify a mapping file rather than use the online regridding. Its an optional use that can be extremely helpful in debugging.
These are all queried in esmFldsExchange_cesm_mod.F90. Here is an example.

     ! mapping to lnd
      call NUOPC_CompAttributeGet(gcomp, name='atm2lnd_map', value=atm2lnd_map,  rc=rc)
      if (chkerr(rc,__LINE__,u_FILE_u)) return
      if (mastertask) write(logunit, '(a)') trim(subname)//'atm2lnd_map = '// trim(atm2lnd_map)

I recommend closing this Issue.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Apr 17, 2023

You misunderstand. I do see the utility of setting atm2lnd_map in the code. The issue is that the user can change the XML fields and atm2lnd_map will NOT be changed, because the XML field is NOT connected to the config variable that's read in the code. For the XML field to be used, it would have to be read in the buildnml and change the setting of atm2lnd_map. However, when I grep through the code, the only instance of the XML field ATM2LND_FMAPNAME is in the config_component.xml file. It's not read in by the buildnml. For it to change the nuopc.runconfig value I would expect it to be in either namelist_definition_or buildnml (or both). But, it's on in the config XML file as you see here:

This is for cmeps0.14.17

git grep ATM2LND_FMAPNAME | head
cime_config/config_component.xml:  <entry id="ATM2LND_FMAPNAME">

But, for a practical example to show how this works. Let me show an example for an actual case. I created a test SMS_D_Ld1.nldas2_rnldas2_mnldas2.I2000Clm50Sp.cheyenne_intel.clm-default. And I query ATM2LND_FMAPNAME in the XML and also in the nuopc.runconfig file. I then change the XML field and show that the field in nuopc.runconfig does NOT change.

1015 12:14 ./xmlquery ATM2LND_FMAPNAME
1016 12:14 grep atm2lnd_map CaseDocs/nuopc.runconfig
atm2lnd_map = idmap
1017 12:14 ./xmlchange ATM2LND_FMAPNAME="zztop"
1018 12:14 ./preview_namelists
1019 12:15 grep atm2lnd_map CaseDocs/nuopc.runconfig
atm2lnd_map = idmap

However, I CAN change the value if I add it into the user_nl_cpl file. So we should either remove the XML field since it doesn't function -- OR reconnect it so that it changes the value of atm2lnd_map in the nuopc.runconfig file. Personally I think the former makes the most sense, since it's easier to do (and the user can currently change the value if desired in the user_nl_cpl). But, if it's desired to get the XML working that's fine too.

@ekluzek ekluzek changed the title XML fields that are disconnected to namelist and hence don't function XML fields that are disconnected to nuopc.runconfig and hence don't function Apr 17, 2023
@mvertens
Copy link
Collaborator

@ekluzek - thanks for clarifying. I think you are totally right. Sorry for not seeing that.

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.

2 participants