From 91738cbf871d8cdce46912e2c11e304d567a2aae Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:46:42 -0500 Subject: [PATCH] Sort list of coupler restart files for restart time determination (#2360) The loop in the following conditional seems to assume the list is sorted, so make that explicit in the array construction. --- ush/forecast_det.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ush/forecast_det.sh b/ush/forecast_det.sh index 198df6505f..a1c153776b 100755 --- a/ush/forecast_det.sh +++ b/ush/forecast_det.sh @@ -45,7 +45,8 @@ FV3_det(){ RERUN=${RERUN:-"NO"} # Get a list of all YYYYMMDD.HH0000.coupler.res files from the atmos restart directory - mapfile -t file_array < <(find "${COM_ATMOS_RESTART:-/dev/null}" -name "????????.??0000.coupler.res") + # shellcheck disable=SC2312 + mapfile -t file_array < <(find "${COM_ATMOS_RESTART:-/dev/null}" -name "????????.??0000.coupler.res" | sort) if [[ ( "${RUN}" = "gfs" || "${RUN}" = "gefs" ) \ && "${#file_array[@]}" -gt 0 ]]; then