diff --git a/scripts/ccpp_suite.py b/scripts/ccpp_suite.py index 130a828c..ade2c234 100644 --- a/scripts/ccpp_suite.py +++ b/scripts/ccpp_suite.py @@ -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: diff --git a/scripts/host_cap.py b/scripts/host_cap.py index d2b3066f..4809b158 100644 --- a/scripts/host_cap.py +++ b/scripts/host_cap.py @@ -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 @@ -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 diff --git a/scripts/suite_objects.py b/scripts/suite_objects.py index 5a710548..f6ced28a 100644 --- a/scripts/suite_objects.py +++ b/scripts/suite_objects.py @@ -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)) @@ -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) @@ -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