Skip to content

Commit

Permalink
Update marine DA j-jobs to new format (#1149)
Browse files Browse the repository at this point in the history
The new marine DA jobs were added (PR #1134) roughly concurrently with the refactoring
of the j-job scripts (PR #1120), and thus didn't pick up the changes there. These new jobs
are now updated.
  • Loading branch information
aerorahul committed Dec 12, 2022
1 parent 287f52c commit f19d795
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 60 deletions.
29 changes: 26 additions & 3 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,37 @@
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"

##############################################
# make temp directory
##############################################
export DATA=${DATA:-${DATAROOT}/ocnanal_${cyc}}
mkdir -p "${DATA}"
cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1)


##############################################
# Run setpdy and initialize PDY variables
##############################################
export cycle="t${cyc}z"
setpdy.sh
. ./PDY


##############################################
# Determine Job Output Name on System
##############################################
export pid=${pid:-$$}
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanalpost"
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
. "${config_path}"/config."${config}"
. "${EXPDIR}/config.${config}"
status=$?
[[ "${status}" -ne 0 ]] && exit "${status}"
done
Expand All @@ -18,6 +41,6 @@ done
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || exit 1
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"
[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}"

exit 0
56 changes: 27 additions & 29 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,11 @@
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"

#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanal ocnanalprep"
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 ocnanalprep
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Obtain unique process id (pid) and make temp directory
# make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL${job}"}

export DATA=${DATA:-${DATAROOT}/ocnanal_${CDATE}}
export DATA=${DATA:-${DATAROOT}/ocnanal_${cyc}}
rm -rf "${DATA}" # Ensure starting with a clean DATA
mkdir -p "${DATA}"
cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1)

Expand All @@ -45,24 +22,45 @@ setpdy.sh
##############################################
# Determine Job Output Name on System
##############################################
export pid=${pid:-$$}
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanal ocnanalprep"
for config in ${configs}; do
. "${EXPDIR}/config.${config}"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
done


##########################################
# Source machine runtime environment
##########################################
. "${HOMEgfs}/env/${machine}.env ocnanalprep"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Set variables used in the script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export COMPONENT=${COMPONENT:-ocean}
export COMPONENT="ocean"

##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
GDATE=$(date +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

Expand Down
53 changes: 25 additions & 28 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,11 @@
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"

#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanal ocnanalrun"
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 ocnanalrun
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Obtain unique process id (pid) and make temp directory
# make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL${job}"}

export DATA=${DATA:-${DATAROOT}/ocnanal_${CDATE}}
export DATA=${DATA:-${DATAROOT}/ocnanal_${cyc}}
mkdir -p "${DATA}"
cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1)

Expand All @@ -45,16 +22,37 @@ setpdy.sh
##############################################
# Determine Job Output Name on System
##############################################
export pid=${pid:-$$}
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanal ocnanalrun"
for config in ${configs}; do
. "${EXPDIR}/config.${config}"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
done


##########################################
# Source machine runtime environment
##########################################
. "${HOMEgfs}/env/${machine}.env ocnanalrun"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Set variables used in the script
##############################################

export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export COMPONENT=${COMPONENT:-ocean}
export COMPONENT="ocean"

##############################################
# Begin JOB SPECIFIC work
Expand Down Expand Up @@ -82,9 +80,8 @@ if [[ -e "${pgmout}" ]] ; then
fi

##########################################
# Remove the Temporary working directory
# Do not remove the Temporary working directory (do this in POST)
##########################################
cd "${DATAROOT}" || exit 1
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"

exit 0

0 comments on commit f19d795

Please sign in to comment.