Skip to content

Commit

Permalink
Convert archive jobs to proper j-jobs (#1115)
Browse files Browse the repository at this point in the history
Updates the archive jobs to the standard j-job/exscript format.

Fixes: #1051
Refs: #720
  • Loading branch information
lgannoaa authored Nov 22, 2022
1 parent 3a9c27a commit 5df144d
Show file tree
Hide file tree
Showing 6 changed files with 750 additions and 618 deletions.
73 changes: 73 additions & 0 deletions jobs/JENKFGDAS_ARCHIVE
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
75 changes: 75 additions & 0 deletions jobs/JGLOBAL_ARCHIVE
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
Loading

0 comments on commit 5df144d

Please sign in to comment.