diff --git a/src/common/cp_array_utils.fypp b/src/common/cp_array_utils.fypp index 07cc2dab0c..5f18f43aa7 100644 --- a/src/common/cp_array_utils.fypp +++ b/src/common/cp_array_utils.fypp @@ -31,7 +31,7 @@ REAL(${el1}$) < REAL(${el2}$) .OR. (ABS(REAL(${el1}$)-REAL(${el2}$)) < epsilon(M #:def uselist(list_in) #! comma-separated list of unique entries of list_in - $: ", ".join(list(set([_ for _ in list_in if _]))) + $: ", ".join(sorted(set(x for x in list_in if x))) #:enddef #:endmute diff --git a/src/common/list.fypp b/src/common/list.fypp index 87274435bc..7f9c2695ed 100644 --- a/src/common/list.fypp +++ b/src/common/list.fypp @@ -16,7 +16,7 @@ #:def uselist(list_in) #! comma-separated list of unique entries of list_in - $: ", ".join(list(set(list_in))) + $: ", ".join(sorted(set(list_in))) #:enddef #:def uselist_listmethods(t)