diff --git a/parm/config/gefs/config.base b/parm/config/gefs/config.base index 16e0fefaba..9808b96579 100644 --- a/parm/config/gefs/config.base +++ b/parm/config/gefs/config.base @@ -99,7 +99,6 @@ export EXPDIR="@EXPDIR@/${PSLOT}" export ROTDIR="@COMROOT@/${PSLOT}" export DATAROOT="${STMP}/RUNDIRS/${PSLOT}" # TODO: set via prod_envir in Ops -export RUNDIR="${DATAROOT}" # TODO: Should be removed; use DATAROOT instead export ARCDIR="${NOSCRUB}/archive/${PSLOT}" export ATARDIR="@ATARDIR@" diff --git a/parm/config/gfs/config.base b/parm/config/gfs/config.base index f893eaaf4e..9fd494a9eb 100644 --- a/parm/config/gfs/config.base +++ b/parm/config/gfs/config.base @@ -128,7 +128,6 @@ if [[ "${PDY}${cyc}" -ge "2019092100" && "${PDY}${cyc}" -le "2019110700" ]]; the export DUMP_SUFFIX="p" # Use dumps from NCO GFS v15.3 parallel fi export DATAROOT="${STMP}/RUNDIRS/${PSLOT}" # TODO: set via prod_envir in Ops -export RUNDIR="${DATAROOT}" # TODO: Should be removed; use DATAROOT instead export ARCDIR="${NOSCRUB}/archive/${PSLOT}" export ATARDIR="@ATARDIR@" @@ -295,7 +294,7 @@ export FHOUT_GFS=3 # 3 for ops export FHMAX_HF_GFS=@FHMAX_HF_GFS@ export FHOUT_HF_GFS=1 export FHOUT_OCN_GFS=6 -export FHOUT_ICE_GFS=6 +export FHOUT_ICE_GFS=6 export FHMIN_WAV=0 export FHOUT_WAV=3 export FHMAX_HF_WAV=120 diff --git a/scripts/exglobal_cleanup.sh b/scripts/exglobal_cleanup.sh index 7c3dfafbad..1150ca6d1d 100755 --- a/scripts/exglobal_cleanup.sh +++ b/scripts/exglobal_cleanup.sh @@ -2,6 +2,9 @@ source "${USHgfs}/preamble.sh" +############################################################### +echo "Begin Cleanup ${DATAROOT}!" + # Remove DATAoutput from the forecast model run # TODO: Handle this better DATAfcst="${DATAROOT}/${RUN}fcst.${PDY:-}${cyc}" @@ -9,6 +12,19 @@ if [[ -d "${DATAfcst}" ]]; then rm -rf "${DATAfcst}"; fi #DATAefcs="${DATAROOT}/${RUN}efcs???${PDY:-}${cyc}" rm -rf "${DATAROOT}/${RUN}efcs"*"${PDY:-}${cyc}" +# Search and delete files/directories from DATAROOT/ older than ${purge_every_days} days +# purge_every_days should be a positive integer +purge_every_days=3 + +# Find and delete files older than ${purge_every_days} days +find "${DATAROOT}/"* -type f -mtime "+${purge_every_days}" -exec rm -f {} \; + +# Find and delete directories older than ${purge_every_days} days +find "${DATAROOT}/"* -type d -mtime "+${purge_every_days}" -exec rm -rf {} \; + +echo "Cleanup ${DATAROOT} completed!" +############################################################### + ############################################################### # Clean up previous cycles; various depths # PRIOR CYCLE: Leave the prior cycle alone @@ -67,7 +83,7 @@ for (( current_date=first_date; current_date <= last_date; \ # shellcheck disable=SC2312 if [[ $(tail -n 1 "${rocotolog}") =~ "This cycle is complete: Success" ]]; then YMD="${current_PDY}" HH="${current_cyc}" declare_from_tmpl \ - COMOUT_TOP:COM_TOP_TMPL + COMOUT_TOP:COM_TOP_TMPL if [[ -d "${COMOUT_TOP}" ]]; then IFS=", " read -r -a exclude_list <<< "${exclude_string:-}" remove_files "${COMOUT_TOP}" "${exclude_list[@]:-}"