Skip to content

Commit

Permalink
Replace ARCH_LIST with DATA in earc script
Browse files Browse the repository at this point in the history
Fixes bug with ENKF archive jobs

Refs NOAA-EMC#2064
  • Loading branch information
KateFriedman-NOAA committed Nov 15, 2023
1 parent 42d7f2f commit 14f4623
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions scripts/exgdas_enkf_earc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ source "${HOMEgfs}/ush/preamble.sh"
export n=$((10#${ENSGRP}))
export CDUMP_ENKF="${EUPD_CYC:-"gdas"}"

export ARCH_LIST="${COM_TOP}/earc${ENSGRP}"

# ICS are restarts and always lag INC by $assim_freq hours.
EARCINC_CYC=${ARCH_CYC}
EARCICS_CYC=$((ARCH_CYC-assim_freq))
if [ "${EARCICS_CYC}" -lt 0 ]; then
EARCICS_CYC=$((EARCICS_CYC+24))
fi

[[ -d ${ARCH_LIST} ]] && rm -rf "${ARCH_LIST}"
mkdir -p "${ARCH_LIST}"
cd "${ARCH_LIST}" || exit 2

"${HOMEgfs}/ush/hpssarch_gen.sh" "${RUN}"
status=$?
if [ "${status}" -ne 0 ]; then
Expand Down Expand Up @@ -66,15 +60,15 @@ if (( 10#${ENSGRP} > 0 )) && [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]];

if [ "${PDY}${cyc}" -gt "${SDATE}" ]; then # Don't run for first half cycle

${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${RUN}_grp${ENSGRP}.tar" $(cat "${ARCH_LIST}/${RUN}_grp${n}.txt")
${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${RUN}_grp${ENSGRP}.tar" $(cat "${DATA}/${RUN}_grp${n}.txt")
status=$?
if [ "${status}" -ne 0 ] && [ "${PDY}${cyc}" -ge "${firstday}" ]; then
echo "FATAL ERROR: ${TARCMD} ${PDY}${cyc} ${RUN}_grp${ENSGRP}.tar failed"
exit "${status}"
fi

if [ "${SAVEWARMICA}" = "YES" ] && [ "${cyc}" -eq "${EARCINC_CYC}" ]; then
${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${RUN}_restarta_grp${ENSGRP}.tar" $(cat "${ARCH_LIST}/${RUN}_restarta_grp${n}.txt")
${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${RUN}_restarta_grp${ENSGRP}.tar" $(cat "${DATA}/${RUN}_restarta_grp${n}.txt")
status=$?
if [ "${status}" -ne 0 ]; then
echo "FATAL ERROR: ${TARCMD} ${PDY}${cyc} ${RUN}_restarta_grp${ENSGRP}.tar failed"
Expand All @@ -83,7 +77,7 @@ if (( 10#${ENSGRP} > 0 )) && [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]];
fi

if [ "${SAVEWARMICB}" = "YES" ] && [ "${cyc}" -eq "${EARCICS_CYC}" ]; then
${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${RUN}_restartb_grp${ENSGRP}.tar" $(cat "${ARCH_LIST}/${RUN}_restartb_grp${n}.txt")
${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${RUN}_restartb_grp${ENSGRP}.tar" $(cat "${DATA}/${RUN}_restartb_grp${n}.txt")
status=$?
if [ "${status}" -ne 0 ]; then
echo "FATAL ERROR: ${TARCMD} ${PDY}${cyc} ${RUN}_restartb_grp${ENSGRP}.tar failed"
Expand Down Expand Up @@ -122,11 +116,11 @@ if [ "${ENSGRP}" -eq 0 ]; then
break
fi
fi
done < "${ARCH_LIST}/${RUN}.txt"
done < "${DATA}/${RUN}.txt"

# Create the tarball
tar_fl=${ATARDIR}/${PDY}${cyc}/${RUN}.tar
${TARCMD} -P -cvf "${tar_fl}" $(cat "${ARCH_LIST}/${RUN}.txt")
${TARCMD} -P -cvf "${tar_fl}" $(cat "${DATA}/${RUN}.txt")
status=$?

# If rstprod was found, change the group of the tarball
Expand Down

0 comments on commit 14f4623

Please sign in to comment.