Skip to content

Commit

Permalink
MEMDIR updates in JGLOBAL_STAGE_IC
Browse files Browse the repository at this point in the history
- Remove MEMDIR export
- Add MEMDIR input for all declare commands that may need it;
if not gefs or enkfgdas then MEMDIR will be empty and COM won't include
- Remove incorrect comment about locally scoped variables

Refs #2475
  • Loading branch information
KateFriedman-NOAA committed Aug 6, 2024
1 parent 13934d8 commit 55e47c6
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions jobs/JGLOBAL_STAGE_IC
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rRUN=${RUN}
[[ ${RUN} == "gfs" ]] && rRUN="gdas"

# Define significant cycles
# Locally scoped variables and functions
# shellcheck disable=SC2153
half_window=$(( assim_freq / 2 ))
current_cycle="${PDY}${cyc}"
Expand Down Expand Up @@ -53,31 +52,28 @@ err=0
###############################################################
for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

# Export MEMDIR; need even if empty
export MEMDIR

# Declare COMs
if [[ "${MODE}" = "cycled" && "${RUN}" = "gdas" ]]; then
YMD=${current_cycle:0:8} HH=${current_cycle:8:2} declare_from_tmpl -x COMOUT_ATMOS_ANALYSIS:COM_ATMOS_ANALYSIS_TMPL
fi

if [[ ${EXP_WARM_START:-".false."} = ".true." ]]; then
RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL
RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_MED_RESTART_PREV:COM_MED_RESTART_TMPL
MEMDIR=${MEMDIR} RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL
MEMDIR=${MEMDIR} RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_MED_RESTART_PREV:COM_MED_RESTART_TMPL
else
YMD=${current_cycle:0:8} HH=${current_cycle:8:2} declare_from_tmpl -x COMOUT_ATMOS_INPUT:COM_ATMOS_INPUT_TMPL
MEMDIR=${MEMDIR} YMD=${current_cycle:0:8} HH=${current_cycle:8:2} declare_from_tmpl -x COMOUT_ATMOS_INPUT:COM_ATMOS_INPUT_TMPL
fi
if [[ "${DO_OCN:-}" = "YES" ]]; then
RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_OCEAN_RESTART_PREV:COM_OCEAN_RESTART_TMPL
MEMDIR=${MEMDIR} RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_OCEAN_RESTART_PREV:COM_OCEAN_RESTART_TMPL
if [[ "${REPLAY_ICS:-NO}" = "YES" ]]; then
YMD=${current_cycle:0:8} HH=${current_cycle:8:2} declare_from_tmpl -x COMOUT_OCEAN_ANALYSIS:COM_OCEAN_ANALYSIS_TMPL
MEMDIR=${MEMDIR} YMD=${current_cycle:0:8} HH=${current_cycle:8:2} declare_from_tmpl -x COMOUT_OCEAN_ANALYSIS:COM_OCEAN_ANALYSIS_TMPL
fi
fi
if [[ "${DO_ICE:-}" = "YES" ]]; then
RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_ICE_RESTART_PREV:COM_ICE_RESTART_TMPL
MEMDIR=${MEMDIR} RUN=${rRUN} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_ICE_RESTART_PREV:COM_ICE_RESTART_TMPL
fi
if [[ "${DO_WAVE:-}" = "YES" ]]; then
YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_WAVE_RESTART_PREV:COM_WAVE_RESTART_TMPL
MEMDIR=${MEMDIR} YMD=${previous_cycle:0:8} HH=${previous_cycle:8:2} declare_from_tmpl -x COMOUT_WAVE_RESTART_PREV:COM_WAVE_RESTART_TMPL
fi

# Execute staging
Expand Down

0 comments on commit 55e47c6

Please sign in to comment.