Skip to content

Commit

Permalink
Sort list of coupler restart files for restart time determination (NO…
Browse files Browse the repository at this point in the history
…AA-EMC#2360)

The loop in the following conditional seems to assume the list is
sorted, so make that explicit in the array construction.
  • Loading branch information
DWesl committed Mar 1, 2024
1 parent 23c2552 commit 91738cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ush/forecast_det.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 91738cb

Please sign in to comment.