-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff6f103
commit ce24266
Showing
3 changed files
with
1,197 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#!/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. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
. $USHdir/source_util_funcs.sh | ||
source_config_for_task "task_run_prepstart" ${GLOBAL_VAR_DEFNS_FP} | ||
. $USHdir/job_preamble.sh "TRUE" | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Save current shell options (in a global array). Then set new options | ||
# for this script/function. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
{ save_shell_opts; . $USHdir/preamble.sh; } > /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} | ||
CYCLE_SUBTYPE=${CYCLE_SUBTYPE:-empty} | ||
|
||
# Use the forecast INPUT directory as working directory | ||
if [ "${RUN_ENVIR}" = "nco" ]; then | ||
DATA=$DATAROOT/${TAG}run_fcst_${CYCLE_TYPE}${dot_ensmem/./_}.${share_pid} | ||
else | ||
DATA=${COMIN}${SLASH_ENSMEM_SUBDIR} | ||
fi | ||
|
||
if [ ${CYCLE_TYPE} == "spinup" ]; then | ||
DATA="${DATA}/fcst_fv3lam_spinup/INPUT" | ||
if [ ${DO_ENSINIT} == "TRUE" ] && [ ${CYCLE_SUBTYPE} == "ensinit" ]; then | ||
DATA="${DATA}/fcst_fv3lam_ensinit/INPUT" | ||
fi | ||
else | ||
DATA="${DATA}/fcst_fv3lam/INPUT" | ||
fi | ||
|
||
mkdir_vrfy -p ${DATA} | ||
cd_vrfy ${DATA} | ||
# | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Call the ex-script for this J-job and pass to it the necessary varia- | ||
# bles. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
$SCRIPTSdir/exregional_run_prepstart.sh || print_err_msg_exit "\ | ||
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed." | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Run job postamble. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
job_postamble | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Restore the shell options saved at the beginning of this script/func- | ||
# tion. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
{ restore_shell_opts; } > /dev/null 2>&1 |
Oops, something went wrong.