-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert archive jobs to proper j-jobs (#1115)
- Loading branch information
Showing
6 changed files
with
750 additions
and
618 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,73 @@ | ||
#! /usr/bin/env bash | ||
|
||
source "${HOMEgfs}/ush/preamble.sh" | ||
|
||
############################# | ||
# Source relevant config files | ||
############################# | ||
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config} | ||
configs="base earc" | ||
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config} | ||
for config in ${configs}; do | ||
. "${config_path}"/config."${config}" | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
done | ||
|
||
########################################## | ||
# Source machine runtime environment | ||
########################################## | ||
. "${HOMEgfs}"/env/"${machine}".env earc | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
|
||
############################################## | ||
# Obtain unique process id (pid) and make temp directory | ||
############################################## | ||
export pid=${pid:-$$} | ||
export DATA=${DATA:-${DATAROOT}/${jobid:?}} | ||
mkdir -p "${DATA}" | ||
cd "${DATA}" | ||
|
||
|
||
############################################## | ||
# Run setpdy and initialize PDY variables | ||
############################################## | ||
export cycle="t${cyc}z" | ||
setpdy.sh | ||
. ./PDY | ||
|
||
|
||
############################################## | ||
# Determine Job Output Name on System | ||
############################################## | ||
export pgmout="OUTPUT.${pid}" | ||
export pgmerr=errfile | ||
|
||
|
||
############################################## | ||
# Set variables used in the script | ||
############################################## | ||
export CDATE=${CDATE:-${PDY}${cyc}} | ||
export CDUMP=${CDUMP:-${RUN:-"gdas"}} | ||
export COMPONENT=${COMPONENT:-atmos} | ||
|
||
############################################################### | ||
# Run archive script | ||
############################################################### | ||
|
||
"${SCRgfs}"/exgdas_enkf_earc.sh | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
|
||
############################################################### | ||
|
||
echo "ENDED NORMALLY." | ||
|
||
########################################## | ||
# Remove the Temporary working directory | ||
########################################## | ||
cd "${DATAROOT}" | ||
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" | ||
|
||
exit 0 |
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,75 @@ | ||
#! /usr/bin/env bash | ||
|
||
source "${HOMEgfs}/ush/preamble.sh" | ||
|
||
export RUN_ENVIR=${RUN_ENVIR:-"nco"} | ||
|
||
############################################# | ||
# Source relevant config files | ||
############################################# | ||
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config} | ||
configs="base arch" | ||
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config} | ||
for config in ${configs}; do | ||
. "${config_path}"/config."${config}" | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
done | ||
|
||
########################################## | ||
# Source machine runtime environment | ||
########################################## | ||
. "${HOMEgfs}"/env/"${machine}".env arch | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
|
||
############################################## | ||
# Obtain unique process id (pid) and make temp directory | ||
############################################## | ||
export pid=${pid:-$$} | ||
export DATA=${DATA:-${DATAROOT}/${jobid:?}} | ||
mkdir -p "${DATA}" | ||
cd "${DATA}" | ||
|
||
|
||
############################################## | ||
# Run setpdy and initialize PDY variables | ||
############################################## | ||
export cycle="t${cyc}z" | ||
setpdy.sh | ||
. ./PDY | ||
|
||
|
||
############################################## | ||
# Determine Job Output Name on System | ||
############################################## | ||
export pgmout="OUTPUT.${pid}" | ||
export pgmerr=errfile | ||
|
||
|
||
############################################## | ||
# Set variables used in the script | ||
############################################## | ||
export CDATE=${CDATE:-${PDY}${cyc}} | ||
export CDUMP=${CDUMP:-${RUN:-"gfs"}} | ||
export COMPONENT=${COMPONENT:-atmos} | ||
|
||
############################################################### | ||
# Run archive script | ||
############################################################### | ||
|
||
${GLOBALARCHIVESH:-${SCRgfs}/exglobal_archive.sh} | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
|
||
############################################################### | ||
|
||
echo "ENDED NORMALLY." | ||
|
||
########################################## | ||
# Remove the Temporary working directory | ||
########################################## | ||
cd "${DATAROOT}" | ||
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" | ||
|
||
exit 0 |
Oops, something went wrong.