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

Sort sets before writing #10

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/ccpp_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ def write_var_set_loop(ofile, varlist_name, var_list, indent,
ofile.write("allocate({}({}))".format(varlist_name, len(var_list)),
indent)
# end if
for ind, var in enumerate(var_list):
for ind, var in enumerate(sorted(var_list)):
if start_var:
ind_str = "{} + {}".format(start_var, ind + start_index)
else:
Expand Down
4 changes: 2 additions & 2 deletions scripts/host_cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def write_host_cap(host_model, api, module_name, output_dir, run_env):
mlen = max([len(x.module) for x in api.suites])
maxmod = max(maxmod, mlen)
maxmod = max(maxmod, len(CONST_DDT_MOD))
for mod in modules:
for mod in sorted(modules):
mspc = (maxmod - len(mod[0]))*' '
cap.write("use {}, {}only: {}".format(mod[0], mspc, mod[1]), 1)
# End for
Expand Down Expand Up @@ -530,7 +530,7 @@ def write_host_cap(host_model, api, module_name, output_dir, run_env):
for suite in api.suites:
mspc = (max_suite_len - len(suite.module))*' '
spart_list = suite_part_list(suite, stage)
for spart in spart_list:
for spart in sorted(spart_list):
stmt = "use {}, {}only: {}"
cap.write(stmt.format(suite.module, mspc, spart.name), 2)
# End for
Expand Down
6 changes: 3 additions & 3 deletions scripts/suite_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ def write(self, outfile, host_arglist, indent, const_mod,
# end if
# Write out the scheme use statements
scheme_use = 'use {},{} only: {}'
for scheme in self._local_schemes:
for scheme in sorted(self._local_schemes):
smod = scheme[0]
sname = scheme[1]
slen = ' '*(modmax - len(smod))
Expand Down Expand Up @@ -1853,7 +1853,7 @@ def write(self, outfile, host_arglist, indent, const_mod,
'funcname' : self.name})
# Allocate local arrays
alloc_stmt = "allocate({}({}))"
for lname in allocatable_var_set:
for lname in sorted(allocatable_var_set):
var = subpart_vars[lname][0]
dims = var.get_dimensions()
alloc_str = self.allocate_dim_str(dims, var.context)
Expand Down Expand Up @@ -1886,7 +1886,7 @@ def write(self, outfile, host_arglist, indent, const_mod,
item.write(outfile, errcode, indent + 1)
# end for
# Deallocate local arrays
for lname in allocatable_var_set:
for lname in sorted(allocatable_var_set):
outfile.write('deallocate({})'.format(lname), indent+1)
# end for
# Deallocate suite vars
Expand Down