Skip to content

Commit 019d056

Browse files
committed
Merge branch 'jgfouca/eamxx_consistent_names' into master (PR #7197)
First round of name convention enforcing in namelist_defaults_eamxx.xml and YAML files. Related to #7179 Avoid arbitrary capitalization of param names, use only when it really makes sense (like T for temperature). Full list of XML renames: * Scorpio -> scorpio * Type -> type * Averaging Type -> averaging_type * Group -> group * Sequential -> sequential * Moisture -> moisture * BfbHash -> bfb_hash * cldFraction -> cld_fraction * Filename -> filename * MPI Ranks in Filename -> mpi_ranks_in_filename * ML* -> ml_* * testOnly -> test_only * Frequency -> frequency * Ckh -> coeff_kh * Ckm -> coeff_km * srf_emis_specifier_for_DMS -> srf_emis_specifier_for_dms * srf_emis_specifier_for_SO2 -> srf_emis_specifier_for_so2 YAML renames: * Remove mpi_ranks_in_filename * column_conservation_checks_fail_handling_type Warning/Fatal -> warning/fatal * disable_diagnostics and theta_hydrostatic_mode, False->false * GLL -> gll * PG2 -> pg2 * None -> none (physics_grid_rebalance) * Homme -> homme * All average_type values should be lowercase * Max Snapshots Per File -> max_snapshots_per_file * Fields -> fields * Physics -> physics * Field Names -> field_names * Mesh Free -> mesh_free * Restart -> restart. Restart Run -> restart_run * Point Grid -> point_grid * Checkpoint Control -> checkpoint_control * Sub Name -> sub_name * Grid Name -> grid_name. IO Grid Name -> io_grid_name * SurfaceCouplingImporter -> surface_coupling_importer * Dynamics -> dynamics * physics gll -> physics_gll. physics pg2 -> physics_pg2 [BFB]
2 parents 2463549 + 038bdfe commit 019d056

File tree

233 files changed

+1526
-1548
lines changed

Some content is hidden

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

233 files changed

+1526
-1548
lines changed

components/eamxx/cime_config/eamxx_buildnml.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
587587
... <enable_postcondition_checks type='logical'>true</enable_postcondition_checks>
588588
... </atm_proc_base>
589589
... <physics_proc_base inherit='atm_proc_base'>
590-
... <Grid>Physics GLL</Grid>
591-
... <Grid grid='ne4ne4'>Physics PG2</Grid>
590+
... <Grid>physics_gll</Grid>
591+
... <Grid grid='ne4ne4'>physics_pg2</Grid>
592592
... </physics_proc_base>
593593
... <atm_proc_group inherit="atm_proc_base">
594594
... <atm_procs_list>NONE</atm_procs_list>
@@ -617,7 +617,7 @@ def _create_raw_xml_file_impl(case, xml, filepath=None):
617617
('enable_postcondition_checks', True),
618618
( 'P1',
619619
OrderedDict([ ('prop1', 'hi'),
620-
('Grid', 'Physics PG2'),
620+
('Grid', 'physics_pg2'),
621621
('number_of_subcycles', 1),
622622
('enable_precondition_checks', True),
623623
('enable_postcondition_checks', True)])),
@@ -940,7 +940,7 @@ def create_input_data_list_file(case,caseroot):
940940
with open(eamxx_xml_file, "r") as fd:
941941
eamxx_xml = ET.parse(fd).getroot()
942942

943-
scorpio = get_child(eamxx_xml,'Scorpio')
943+
scorpio = get_child(eamxx_xml,'scorpio')
944944
out_files_xml = get_child(scorpio,"output_yaml_files",must_exist=False)
945945
# out_files = out_files_xml.text.split(",") if (out_files_xml is not None and out_files_xml.text is not None) else []
946946
# for fn in out_files:
@@ -1009,7 +1009,7 @@ def do_cime_vars_on_yaml_output_files(case, caseroot):
10091009
with open(eamxx_xml_file, "r") as fd:
10101010
eamxx_xml = ET.parse(fd).getroot()
10111011

1012-
scorpio = get_child(eamxx_xml,'Scorpio')
1012+
scorpio = get_child(eamxx_xml,'scorpio')
10131013
out_files_xml = get_child(scorpio,"output_yaml_files",must_exist=False)
10141014
out_files = out_files_xml.text.split(",") if (out_files_xml is not None and out_files_xml.text is not None) else []
10151015

@@ -1027,10 +1027,10 @@ def do_cime_vars_on_yaml_output_files(case, caseroot):
10271027
scream_input = yaml.load(open(scream_input_file,"r"),Loader=loader)
10281028

10291029
# Determine the physics grid type for use in CIME-var substitution.
1030-
pgt = 'GLL'
1030+
pgt = 'gll'
10311031
atm_grid = case.get_value('ATM_GRID')
10321032
if '.pg' in atm_grid:
1033-
pgt = 'PG' + atm_grid[-1]
1033+
pgt = 'pg' + atm_grid[-1]
10341034

10351035
for fn in out_files:
10361036
# Get full name
@@ -1052,10 +1052,10 @@ def do_cime_vars_on_yaml_output_files(case, caseroot):
10521052
# produces an output at t=0, which is not present in the restarted run, and
10531053
# which also causes different timestamp in the file name.
10541054
# Hence, change default output settings to perform a single AVERAGE step at the end of the run
1055-
if case.get_value("TESTCASE") in ["ERP", "ERS"] and content['Averaging Type'].upper()=="INSTANT":
1055+
if case.get_value("TESTCASE") in ["ERP", "ERS"] and content['averaging_type'].upper()=="INSTANT":
10561056
hist_n = int(case.get_value("HIST_N",resolved=True))
10571057
hist_opt = case.get_value("HIST_OPTION",resolved=True)
1058-
content['output_control']['Frequency'] = hist_n
1058+
content['output_control']['frequency'] = hist_n
10591059
content['output_control']['frequency_units'] = hist_opt
10601060
content['output_control']['skip_t0_output'] = True
10611061
print ("ERS/ERP test with INSTANT output detected. Adjusting output control specs:\n")
@@ -1065,7 +1065,7 @@ def do_cime_vars_on_yaml_output_files(case, caseroot):
10651065
# If frequency_units is not nsteps, verify that we don't request
10661066
# a frequency faster than the model timestep
10671067
if content['output_control']['frequency_units'] in ['nsecs','nmins','nhours']:
1068-
freq = content['output_control']['Frequency']
1068+
freq = content['output_control']['frequency']
10691069
units = content['output_control']['frequency_units']
10701070
dt_out = 1 if units=="nsecs" else 60 if units=="nmins" else 3600
10711071
dt_out = dt_out*int(freq)
@@ -1074,18 +1074,18 @@ def do_cime_vars_on_yaml_output_files(case, caseroot):
10741074
expect (dt_atm<=dt_out,
10751075
"Cannot have output frequency faster than atm timestep.\n"
10761076
f" yaml file: {fn.strip()}\n"
1077-
f" Frequency: {freq}\n"
1077+
f" frequency: {freq}\n"
10781078
f" frequency_units: {units}\n"
10791079
f" ATM_NCPL: {case.get_value('ATM_NCPL')}\n"
1080-
f" This yields dt_atm={dt_atm} > dt_output={dt_out}. Please, adjust 'Frequency' and/or 'frequency_units'\n")
1080+
f" This yields dt_atm={dt_atm} > dt_output={dt_out}. Please, adjust 'frequency' and/or 'frequency_units'\n")
10811081

10821082
ordered_dump(content, open(dst_yaml, "w"))
10831083

10841084
output_yaml_files.append(dst_yaml)
10851085

10861086
# Now update the output yaml files entry, and dump the new content
10871087
# of the scream input to YAML file
1088-
scream_input["Scorpio"]["output_yaml_files"] = refine_type(",".join(output_yaml_files),"array(string)")
1088+
scream_input["scorpio"]["output_yaml_files"] = refine_type(",".join(output_yaml_files),"array(string)")
10891089
with open(scream_input_file, "w") as fd:
10901090
fd.write(
10911091
"""################################################################

components/eamxx/cime_config/eamxx_buildnml_impl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ def gen_group_processes(ap_names_str, atm_procs_defaults):
590590

591591
# Check if this pre-defined proc is itself a group, and, if so,
592592
# build all its sub-processes
593-
ptype = get_child(proc, "Type", must_exist=False)
594-
if ptype is not None and ptype.text=="Group":
593+
ptype = get_child(proc, "type", must_exist=False)
594+
if ptype is not None and ptype.text=="group":
595595
# This entry of the group is itself a group, with pre-defined
596596
# defaults. Let's add its entries to it
597597
sub_group_procs = get_child(proc, "atm_procs_list").text

0 commit comments

Comments
 (0)