Skip to content
Closed
2 changes: 2 additions & 0 deletions jobs/JREGIONAL_RUN_FCST
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ the specified cycle.
CYCLE_TYPE=${CYCLE_TYPE:-prod}
if [ ${CYCLE_TYPE} == "spinup" ]; then
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_spinup"
elif [ ${CYCLE_TYPE} == "ensinit" ]; then
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_ensinit"
else
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam"
fi
Expand Down
9 changes: 9 additions & 0 deletions jobs/JREGIONAL_RUN_PREPSTART
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ if [ ${CYCLE_TYPE} == "spinup" ]; then
else
modelinputdir=${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam/INPUT
fi

if [ ${DO_ENSINIT} == "TRUE" ]; then
for cyc_start in "${CYCL_HRS_ENSINIT[@]}"; do
if [ ${HH} -eq ${cyc_start} ]; then
modelinputdir=${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_ensinit/INPUT
fi
done
fi

rm -fr ${modelinputdir}
mkdir_vrfy -p ${modelinputdir}
#
Expand Down
119 changes: 119 additions & 0 deletions jobs/JREGIONAL_RUN_PREPSTART_ENSINIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#!/bin/bash

#
#-----------------------------------------------------------------------
#
# This J-JOB script stages initial and boundary conditions for
# the analysis and model of the cycle it is running. The initial
# could come from external model or previous cycles forecast.
# The boundary could come from previous many cycles.
#
#-----------------------------------------------------------------------

#
#-----------------------------------------------------------------------
#
# Source the variable definitions file and the bash utility functions.
#
#-----------------------------------------------------------------------
#
. ${GLOBAL_VAR_DEFNS_FP}
. $USHDIR/source_util_funcs.sh
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array). Then set new options
# for this script/function.
#
#-----------------------------------------------------------------------
#
{ save_shell_opts; set -u +x; } > /dev/null 2>&1
#
#-----------------------------------------------------------------------
#
# Get the full path to the file in which this script/function is located
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in
# which the file is located (scrfunc_dir).
#
#-----------------------------------------------------------------------
#
scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" )
scrfunc_fn=$( basename "${scrfunc_fp}" )
scrfunc_dir=$( dirname "${scrfunc_fp}" )
#
#-----------------------------------------------------------------------
#
# Print message indicating entry into script.
#
#-----------------------------------------------------------------------
#
print_info_msg "
========================================================================
Entering script: \"${scrfunc_fn}\"
In directory: \"${scrfunc_dir}\"

This is the J-job script for the task that runs a analysis with FV3 for
the specified cycle.
========================================================================"
#
#-----------------------------------------------------------------------
#
# Create the working directory under the cycle directory.
#
#-----------------------------------------------------------------------
#
# CYCLE_TYPE is to indicate which type of cycle this job for:
# spinup: this job is for spin-up cycles
# others(prod): this job is for product cycle
#
CYCLE_TYPE=${CYCLE_TYPE:-prod}
if [ ${CYCLE_TYPE} == "spinup" ]; then
modelinputdir=${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_spinup/INPUT
else
modelinputdir=${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam/INPUT
fi
rm -fr ${modelinputdir}
mkdir_vrfy -p ${modelinputdir}
#
#
#
gridspec_dir=${NWGES_BASEDIR}/grid_spec
#
#-----------------------------------------------------------------------
#
# Call the ex-script for this J-job and pass to it the necessary varia-
# bles.
#
#-----------------------------------------------------------------------
#
$SCRIPTSDIR/exregional_run_prepstart_ensinit.sh \
cycle_dir="${CYCLE_DIR}" \
cycle_type="${CYCLE_TYPE}" \
gridspec_dir="${gridspec_dir}" \
modelinputdir="${modelinputdir}" \
lbcs_root="${LBCS_ROOT}" \
fg_root="${FG_ROOT}" || \
print_err_msg_exit "\
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
# Print exit message.
#
#-----------------------------------------------------------------------
#
print_info_msg "
========================================================================
Exiting script: \"${scrfunc_fn}\"
In directory: \"${scrfunc_dir}\"
========================================================================"
#
#-----------------------------------------------------------------------
#
# Restore the shell options saved at the beginning of this script/func-
# tion.
#
#-----------------------------------------------------------------------
#
{ restore_shell_opts; } > /dev/null 2>&1

3 changes: 3 additions & 0 deletions jobs/JREGIONAL_SAVE_RESTART
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ CYCLE_TYPE=${CYCLE_TYPE:-prod}
if [ ${CYCLE_TYPE} == "spinup" ]; then
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_spinup"
nwges_dir="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_spinup"
elif [ ${CYCLE_TYPE} == "ensinit" ]; then
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_ensinit"
nwges_dir="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_ensinit"
else
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam"
nwges_dir="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam"
Expand Down
Loading