Skip to content

Commit e09a648

Browse files
authored
Merge branch 'bartgol/eamxx/namelist-change' (PR #7577)
Allows users to change the list of processes in the "overall eamxx atm process group". [BFB]
2 parents 063b02e + 516225c commit e09a648

File tree

55 files changed

+79
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+79
-74
lines changed

components/eamxx/cime_config/eamxx_buildnml.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,16 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
577577
... <selectors/>
578578
... <generated_files/>
579579
... <atmosphere_processes_defaults>
580-
... <atm_procs_list type="array(string)">P1,P2</atm_procs_list>
581580
... <atm_proc_base>
582581
... <prop1>zero</prop1>
583582
... </atm_proc_base>
584583
... <atm_proc_group inherit="atm_proc_base">
585584
... <atm_procs_list>NONE</atm_procs_list>
586585
... <prop2>one</prop2>
587586
... </atm_proc_group>
587+
... <eamxx inherit="atm_proc_group">
588+
... <atm_procs_list>P1,P2</atm_procs_list>
589+
... </eamxx>
588590
... <P1 inherit="atm_proc_base">
589591
... <prop1>two</prop1>
590592
... </P1>
@@ -596,7 +598,7 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
596598
>>> import xml.etree.ElementTree as ET
597599
>>> defaults = ET.fromstring(xml)
598600
>>> generated = _create_raw_xml_file_impl(case,defaults)
599-
>>> d = convert_to_dict(get_child(generated,'atmosphere_processes'))
601+
>>> d = convert_to_dict(get_child(generated,'eamxx'))
600602
>>> import pprint
601603
>>> pp = pprint.PrettyPrinter(indent=4)
602604
>>> pp.pprint(d)
@@ -610,18 +612,20 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
610612
>>> xml = '''
611613
... <namelist_defaults>
612614
... <selectors>
613-
... <selector name="grid" case_env="ATM_GRID"/>
615+
... <selector name="grid" case_env="ATM_GRID"/>
614616
... </selectors>
615617
... <generated_files/>
616618
... <atmosphere_processes_defaults>
617-
... <atm_procs_list type="array(string)">P1,P2</atm_procs_list>
618619
... <atm_proc_base>
619620
... <prop1>zero</prop1>
620621
... </atm_proc_base>
621622
... <atm_proc_group inherit="atm_proc_base">
622623
... <atm_procs_list>NONE</atm_procs_list>
623624
... <prop2>one</prop2>
624625
... </atm_proc_group>
626+
... <eamxx inherit="atm_proc_group">
627+
... <atm_procs_list>P1,P2</atm_procs_list>
628+
... </eamxx>
625629
... <P1 inherit="atm_proc_base">
626630
... <prop1>two</prop1>
627631
... <prop1 grid='ne4ne4'>two_selected</prop1>
@@ -634,7 +638,7 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
634638
>>> import xml.etree.ElementTree as ET
635639
>>> defaults = ET.fromstring(xml)
636640
>>> generated = _create_raw_xml_file_impl(case,defaults)
637-
>>> d = convert_to_dict(get_child(generated,'atmosphere_processes'))
641+
>>> d = convert_to_dict(get_child(generated,'eamxx'))
638642
>>> import pprint
639643
>>> pp = pprint.PrettyPrinter(indent=4)
640644
>>> pp.pprint(d)
@@ -652,12 +656,14 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
652656
... </selectors>
653657
... <generated_files/>
654658
... <atmosphere_processes_defaults>
655-
... <atm_procs_list type="array(string)">P1,P2</atm_procs_list>
656659
... <atm_proc_base>
657660
... <number_of_subcycles constraints='gt 0'>1</number_of_subcycles>
658661
... <enable_precondition_checks type='logical'>true</enable_precondition_checks>
659662
... <enable_postcondition_checks type='logical'>true</enable_postcondition_checks>
660663
... </atm_proc_base>
664+
... <eamxx inherit="atm_proc_group">
665+
... <atm_procs_list>P1,P2</atm_procs_list>
666+
... </eamxx>
661667
... <physics_proc_base inherit='atm_proc_base'>
662668
... <Grid>physics_gll</Grid>
663669
... <Grid grid='ne4ne4'>physics_pg2</Grid>
@@ -678,7 +684,7 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
678684
>>> import xml.etree.ElementTree as ET
679685
>>> defaults = ET.fromstring(xml)
680686
>>> generated = _create_raw_xml_file_impl(case,defaults)
681-
>>> d = convert_to_dict(get_child(generated,'atmosphere_processes'))
687+
>>> d = convert_to_dict(get_child(generated,'eamxx'))
682688
>>> import pprint
683689
>>> pp = pprint.PrettyPrinter(indent=4)
684690
>>> pp.pprint(d)
@@ -721,15 +727,16 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
721727
# 4. Expand any CIME var that appears inside XML nodes text
722728
expand_cime_vars(xml,case)
723729

724-
# 5. Grab the atmosphere_processes macro list, with all the defaults
730+
# 5. Grab the atmosphere_processes_defaults node, with all the procs defaults
725731
atm_procs_defaults = get_child(xml,"atmosphere_processes_defaults",remove=True)
726732

727-
# 6. Get atm procs list
728-
atm_procs_list = get_child(atm_procs_defaults,"atm_procs_list",remove=True)
733+
# 6. Get eamxx atm procs list
734+
eamxx_group = get_child(atm_procs_defaults,"eamxx",remove=True)
735+
atm_procs_list = get_child(eamxx_group,"atm_procs_list",remove=True)
729736

730737
# 7. Form the nested list of atm procs needed, append to atmosphere_driver section
731738
atm_procs = gen_atm_proc_group(atm_procs_list.text, atm_procs_defaults)
732-
atm_procs.tag = "atmosphere_processes"
739+
atm_procs.tag = "eamxx"
733740
xml.append(atm_procs)
734741

735742
# 8. Apply all changes in the SCREAM_ATMCHANGE_BUFFER that do not alter

components/eamxx/cime_config/eamxx_buildnml_impl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,9 @@ def resolve_inheritance(root, elem):
502502
for child in elem:
503503
if child.tag==entry.tag:
504504
expect (att not in child.attrib.keys(),
505-
f"Do not set '{att}' attribute when parent node already specifies it.")
505+
f"Do not set '{att}' attribute when parent node already specifies it."
506+
f" parent node: {parent.tag}\n"
507+
f" child node : {entry.tag}")
506508
child.attrib[att] = parent_type
507509

508510
for child in elem:

components/eamxx/cime_config/namelist_defaults_eamxx.xml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ be lost if SCREAM_HACK_XML is not enabled.
5050
<sections>ctl_nl</sections>
5151
</file>
5252
<file name="data/scream_input.yaml" format="yaml">
53-
<sections>driver_debug_options,driver_options,iop_options,atmosphere_processes,grids_manager,initial_conditions,scorpio,e3sm_parameters</sections>
53+
<sections>driver_debug_options,driver_options,iop_options,eamxx,grids_manager,initial_conditions,scorpio,e3sm_parameters</sections>
5454
</file>
5555
</generated_files>
5656

@@ -138,15 +138,6 @@ be lost if SCREAM_HACK_XML is not enabled.
138138

139139
<atmosphere_processes_defaults>
140140

141-
<!--
142-
List of atm procs. You can form processes groups by using parentheses,
143-
or by giving the group a name, and adding a subsection that inherit
144-
from atm_proc_group. atm_procs_list itself *must* represent a group,
145-
so it must be of the form (a,b,...).
146-
NOTE: *CANNOT* be changed.
147-
-->
148-
<atm_procs_list type="array(string)">sc_import,homme,physics,sc_export</atm_procs_list>
149-
150141
<!-- Basic options for each atm process -->
151142
<atm_proc_base>
152143
<number_of_subcycles constraints="gt 0" doc="how many times to subcycle this atm process">1</number_of_subcycles>
@@ -173,6 +164,11 @@ be lost if SCREAM_HACK_XML is not enabled.
173164
<schedule_type valid_values="sequential">sequential</schedule_type>
174165
</atm_proc_group>
175166

167+
<!-- The list of atm processes for the atm as a whole -->
168+
<eamxx inherit="atm_proc_group">
169+
<atm_procs_list>sc_import,homme,physics,sc_export</atm_procs_list>
170+
</eamxx>
171+
176172
<!-- Surface coupling (import and export) -->
177173
<sc_import inherit="atm_proc_base"/>
178174
<sc_export inherit="atm_proc_base">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
1+
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 eamxx::internal_diagnostics_level=0 -b
22
./xmlchange POSTRUN_SCRIPT="$CIMEROOT/../components/eamxx/scripts/check-hashes-ers"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_SMALL_KERNELS On'
2-
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
2+
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 eamxx::internal_diagnostics_level=0 -b
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_P3_SMALL_KERNELS On'
2-
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
2+
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 eamxx::internal_diagnostics_level=0 -b
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_SHOC_SMALL_KERNELS On'
2-
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
2+
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 eamxx::internal_diagnostics_level=0 -b

components/eamxx/src/control/atmosphere_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void AtmosphereDriver::create_atm_processes()
235235
// Create the group of processes. This will recursively create the processes
236236
// tree, storing also the information regarding parallel execution (if needed).
237237
// See AtmosphereProcessGroup class documentation for more details.
238-
auto& atm_proc_params = m_atm_params.sublist("atmosphere_processes");
238+
auto& atm_proc_params = m_atm_params.sublist("eamxx");
239239
atm_proc_params.rename("EAMxx");
240240
atm_proc_params.set("logger",m_atm_logger);
241241
m_atm_process_group = std::make_shared<AtmosphereProcessGroup>(m_atm_comm,atm_proc_params);

components/eamxx/src/control/tests/ad_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ initial_conditions:
99
V: [2.0, 3.0]
1010
Z: "A"
1111

12-
atmosphere_processes:
12+
eamxx:
1313
atm_procs_list: [dummy1, dummy2, dummy3]
1414
schedule_type: sequential
1515

components/eamxx/tests/multi-process/dynamics_physics/homme_shoc_cld_p3_rrtmgp/input.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ initial_conditions:
2323
hetfrz_contact_nucleation_tend: 0.1
2424
hetfrz_deposition_nucleation_tend: 0.1
2525

26-
atmosphere_processes:
26+
eamxx:
2727
atm_procs_list: [homme,physics]
2828
schedule_type: sequential
2929
homme:

0 commit comments

Comments
 (0)