Skip to content

Commit

Permalink
Fix checking for restart files (NOAA-EMC#1186)
Browse files Browse the repository at this point in the history
Undoes the portion of PR NOAA-EMC#1179 that caused a new bug while attempting to fix NOAA-EMC#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 NOAA-EMC#1140 
Fixes NOAA-EMC#1185
Moots NOAA-EMC#1190
  • Loading branch information
XianwuXue-NOAA committed Dec 18, 2022
1 parent 9be5c41 commit 8581eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ush/forecast_det.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8581eac

Please sign in to comment.