From 8581eacf1a26efba614a1c04715fbc24cb7ae858 Mon Sep 17 00:00:00 2001 From: Xianwu Xue - NOAA <48287866+XianwuXue-NOAA@users.noreply.github.com> Date: Sun, 18 Dec 2022 00:01:48 -0500 Subject: [PATCH] Fix checking for restart files (#1186) Undoes the portion of PR #1179 that caused a new bug while attempting to fix #1140, without removing the linter fixes. Instead `/dev/null` is 'searched' if `${RSTDIR_ATM}` is not defined. That situation will always result in zero files found, ensuring a rerun is not triggered. Fixes #1140 Fixes #1185 Moots #1190 --- ush/forecast_det.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/forecast_det.sh b/ush/forecast_det.sh index 0518f97913..f27bb3c260 100755 --- a/ush/forecast_det.sh +++ b/ush/forecast_det.sh @@ -40,7 +40,7 @@ FV3_GFS_det(){ #------------------------------------------------------- # determine if restart IC exists to continue from a previous forecast RERUN="NO" - [[ ${CDUMP} = "gfs" ]] && filecount=$(find "${RSTDIR_ATM}" -type f | wc -l) + filecount=$(find "${RSTDIR_ATM:-/dev/null}" -type f | wc -l) if [ ${CDUMP} = "gfs" -a ${rst_invt1} -gt 0 -a ${FHMAX} -gt ${rst_invt1} -a ${filecount} -gt 10 ]; then reverse=$(echo "${restart_interval[@]} " | tac -s ' ') for xfh in ${reverse} ; do