Skip to content

Commit

Permalink
EAMxx: use special selector for cime scripts test
Browse files Browse the repository at this point in the history
  • Loading branch information
bartgol committed Jun 17, 2024
1 parent 770c7d2 commit fa70323
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions components/eamxx/cime_config/namelist_defaults_scream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ be lost if SCREAM_HACK_XML is not enabled.
<selector name="hgrid" case_env="ATM_GRID"/>
<selector name="dyn" case_env="CAM_TARGET"/>
<selector name="nlev" case_env="SCREAM_CMAKE_OPTIONS" regex=".*SCREAM_NUM_VERTICAL_LEV ([0-9]+).*"/>
<!-- For intenal testing only -->
<selector name="test_sel" case_env="SCREAM_CMAKE_OPTIONS" regex=".*SCREAM_NNUM_TRACERS ([0-9]+).*"/>
</selectors>

<!-- List of scream grids for a given compset. I/O can only happen on these grids -->
Expand Down Expand Up @@ -301,10 +303,10 @@ be lost if SCREAM_HACK_XML is not enabled.
<!-- For internal testing only -->
<testOnly inherit="atm_proc_base">
<my_param type="array(integer)">1,2</my_param>
<my_param nlev="1" append="base">3,4</my_param>
<my_param nlev="1" append="last">5,6</my_param>
<my_param nlev="2" append="last">3,4</my_param>
<my_param nlev="2" append="base">5,6</my_param>
<my_param test_sel="1" append="base">3,4</my_param>
<my_param test_sel="1" append="last">5,6</my_param>
<my_param test_sel="2" append="last">3,4</my_param>
<my_param test_sel="2" append="base">5,6</my_param>
</testOnly>

<!-- Simple Prescribed Aerosols (SPA) -->
Expand Down
4 changes: 2 additions & 2 deletions components/eamxx/scripts/cime-nml-tests
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ class TestBuildnml(unittest.TestCase):
self._chg_atmconfig([("mac_aero_mic::atm_procs_list", "shoc,cldFraction,spa,p3,testOnly")], case)

# Test case 1: append to base, then to last. Should give all 3 entries stacked
run_cmd_no_fail(f"./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_NUM_VERTICAL_LEV 1'", from_dir=case)
run_cmd_no_fail(f"./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_NUM_TRACERS 1'", from_dir=case)
run_cmd_no_fail("./case.setup", from_dir=case)
self._get_values(case,"my_param","1,2,3,4,5,6")

# Test case 2: append to last, then to base. Should give 1st and 3rd entry
run_cmd_no_fail(f"./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_NUM_VERTICAL_LEV 2'", from_dir=case)
run_cmd_no_fail(f"./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_NUM_TRACERS 2'", from_dir=case)
run_cmd_no_fail("./case.setup", from_dir=case)
self._get_values(case,"my_param","1,2,5,6")

Expand Down

0 comments on commit fa70323

Please sign in to comment.