ESCOMP / POP2-CESM

Parallel Ocean Program (POP2) in CESM
http://www.cesm.ucar.edu/models/cesm2/ocean/
4 stars 24 forks source link

Bad XML entry in config_components.xml #15

Open mnlevy1981 opened 4 years ago

mnlevy1981 commented 4 years ago

Description of the issue:

The following block of code in cime_config/config_components.xml doesn't behave as expected:

  <entry id="OCN_COUPLING">
    <type>char</type>
    <valid_values>full,partial</valid_values>
    <default_value>full</default_value>
    <values>
      <value compset="_DATM%CPLHIST.*_POP2">full</value>
      <value compset="_DATM.*_POP2">partial</value>
    </values>
    <group>build_pop</group>
    <file>env_build.xml</file>
    <desc>Determine surface freshwater and heat forcing settings.
      The full option yields settings that are appropriate for coupling to an
      active atmospheric model (e.g., a B-type compset). The partial option yields
      settings that are appropriate for coupling to a data atmospheric model
      (e.g., a C or G-type compset). The create_newcase command selects the
      appropriate setting for this variable based on the specified compset.
      Users should NOT EDIT this setting.</desc>
</entry>

The default behavior of CIME is to take the last value option that matches the maximum number of attributes, so a compset with DATM%CPLHIST.*_POP2 in the long name will end up using OCN_COUPLING=partial rather than full. To fix this, either start the values block with <values match="first"> OR swap the order of the <value> items (doing both will continue to provide the wrong value for CPLHIST compsets!). I think swapping the <value> items is the better solution as we don't use the match attribute anywhere else in cime_config/.

Version:

Machine/Environment Description:

Discovered on cheyenne during a code review with @klindsay28 but problem should be evident on any machine

Any xml/namelist changes or SourceMods:

No