diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST index 6b64e5ab8a..00526d45e7 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST @@ -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 @@ -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 diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP index 9ba0a96ae5..3c036674fa 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP @@ -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) @@ -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"} diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN index 374d889ee6..25941d1784 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN @@ -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) @@ -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 @@ -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