From f69e6e5db1b6ec15d72d10f9d426afaa7ef98a77 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Mon, 16 Oct 2023 00:36:59 -0500 Subject: [PATCH] Add enkf back into cleanup The streamlining of the cleanup script resulted in enkf not being cleaned up. Script not runs for `$RUN` and `enkf${RUN}`. Since the existence of the directory is checked before trying to clean up, it doesn't matter if `enkf${RUN}` is not a valid `$RUN` for the experiment. Refs #583 --- scripts/exglobal_cleanup.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/exglobal_cleanup.sh b/scripts/exglobal_cleanup.sh index 718135568a3..30658c89051 100755 --- a/scripts/exglobal_cleanup.sh +++ b/scripts/exglobal_cleanup.sh @@ -59,14 +59,16 @@ for (( current_date=first_date; current_date <= last_date; \ # TODO: This needs to be revamped to not look at the rocoto log. # shellcheck disable=SC2312 if [[ $(tail -n 1 "${rocotolog}") =~ "This cycle is complete: Success" ]]; then - YMD="${current_PDY}" HH="${current_cyc}" generate_com COM_TOP + runs_to_clean=("${RUN}" "enkf${RUN}") + for run in "${runs_to_clean[@]}"; do + RUN=${run} YMD="${current_PDY}" HH="${current_cyc}" generate_com COM_TOP + if [[ -d "${COM_TOP}" ]]; then + exclude_list=("prepbufr" "cnvstat" "atmanl.nc") + remove_files "${COM_TOP}" "${exclude_list[@]:-}" - if [[ -d "${COM_TOP}" ]]; then - exclude_list=("prepbufr" "cnvstat" "atmanl.nc") - remove_files "${COM_TOP}" "${exclude_list[@]:-}" - - if [[ -d "${rtofs_dir}" ]] && (( current_date < last_rtofs )); then rm -rf "${rtofs_dir}" ; fi - fi + if [[ -d "${rtofs_dir}" ]] && (( current_date < last_rtofs )); then rm -rf "${rtofs_dir}" ; fi + fi + done fi fi