diff --git a/jobs/JENKFGDAS_ARCHIVE b/jobs/JGDAS_ENKF_ARCHIVE similarity index 74% rename from jobs/JENKFGDAS_ARCHIVE rename to jobs/JGDAS_ENKF_ARCHIVE index 305dbe005b..1988bd76b6 100755 --- a/jobs/JENKFGDAS_ARCHIVE +++ b/jobs/JGDAS_ENKF_ARCHIVE @@ -2,31 +2,12 @@ source "${HOMEgfs}/ush/preamble.sh" -############################# -# Source relevant config files -############################# -export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config} -configs="base earc" -for config in ${configs}; do - . "${EXPDIR}"/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:?}} +export DATA=${DATA:-${DATAROOT}/${jobid}} mkdir -p "${DATA}" -cd "${DATA}" +cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1) ############################################## @@ -40,33 +21,63 @@ 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 earc" +for config in ${configs}; do + . "${EXPDIR}/config.${config}" + status=$? + [[ ${status} -ne 0 ]] && exit "${status}" +done + + +########################################## +# Source machine runtime environment +########################################## +. "${HOMEgfs}/env/${machine}.env" earc +status=$? +[[ ${status} -ne 0 ]] && exit "${status}" + + ############################################## # Set variables used in the script ############################################## export CDATE=${CDATE:-${PDY}${cyc}} export CDUMP=${CDUMP:-${RUN:-"gdas"}} -export COMPONENT="atmos" ############################################################### # Run archive script ############################################################### -${SCRgfs}/exgdas_enkf_earc.sh +"${SCRgfs}/exgdas_enkf_earc.sh" status=$? [[ ${status} -ne 0 ]] && exit "${status}" ############################################################### -echo "ENDED NORMALLY." +############################################## +# End JOB SPECIFIC work +############################################## + +############################################## +# Final processing +############################################## +if [[ -e "${pgmout}" ]] ; then + cat "${pgmout}" +fi + ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" +cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) [[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" exit 0 diff --git a/jobs/JGLOBAL_ARCHIVE b/jobs/JGLOBAL_ARCHIVE index 97d8e4be35..21b20e1273 100755 --- a/jobs/JGLOBAL_ARCHIVE +++ b/jobs/JGLOBAL_ARCHIVE @@ -2,33 +2,12 @@ source "${HOMEgfs}/ush/preamble.sh" -export RUN_ENVIR=${RUN_ENVIR:-"nco"} - -############################################# -# Source relevant config files -############################################# -export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config} -configs="base arch" -for config in ${configs}; do - . ${EXPDIR}/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:?}} +export DATA=${DATA:-${DATAROOT}/${jobid}} mkdir -p "${DATA}" -cd "${DATA}" +cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1) ############################################## @@ -42,16 +21,36 @@ 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 arch" +for config in ${configs}; do + . ${EXPDIR}/config.${config} + status=$? + [[ ${status} -ne 0 ]] && exit "${status}" +done + + +########################################## +# Source machine runtime environment +########################################## +. "${HOMEgfs}/env/${machine}.env" arch +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:-atmos} + ############################################################### # Run archive script @@ -61,14 +60,22 @@ ${GLOBALARCHIVESH:-${SCRgfs}/exglobal_archive.sh} status=$? [[ ${status} -ne 0 ]] && exit "${status}" -############################################################### +############################################## +# End JOB SPECIFIC work +############################################## + +############################################## +# Final processing +############################################## +if [[ -e "${pgmout}" ]] ; then + cat "${pgmout}" +fi -echo "ENDED NORMALLY." ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" +cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) [[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" exit 0 diff --git a/jobs/rocoto/aeroanlfinal.sh b/jobs/rocoto/aeroanlfinal.sh index 1906cc1e7f..3056959ac8 100755 --- a/jobs/rocoto/aeroanlfinal.sh +++ b/jobs/rocoto/aeroanlfinal.sh @@ -8,5 +8,8 @@ source "$HOMEgfs/ush/preamble.sh" status=$? [[ $status -ne 0 ]] && exit $status +export job="aeroanlfinal" +export jobid="${job}.$$" + ############################################################### echo "Do nothing for now" diff --git a/jobs/rocoto/aeroanlinit.sh b/jobs/rocoto/aeroanlinit.sh index 1906cc1e7f..a3d0238369 100755 --- a/jobs/rocoto/aeroanlinit.sh +++ b/jobs/rocoto/aeroanlinit.sh @@ -8,5 +8,8 @@ source "$HOMEgfs/ush/preamble.sh" status=$? [[ $status -ne 0 ]] && exit $status +export job="aeroanlinit" +export jobid="${job}.$$" + ############################################################### echo "Do nothing for now" diff --git a/jobs/rocoto/aeroanlrun.sh b/jobs/rocoto/aeroanlrun.sh index 1906cc1e7f..5dc731a94c 100755 --- a/jobs/rocoto/aeroanlrun.sh +++ b/jobs/rocoto/aeroanlrun.sh @@ -8,5 +8,8 @@ source "$HOMEgfs/ush/preamble.sh" status=$? [[ $status -ne 0 ]] && exit $status +export job="aeroanlrun" +export jobid="${job}.$$" + ############################################################### echo "Do nothing for now" diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index 378b900b19..2f62d8b354 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -8,6 +8,9 @@ source "${HOMEgfs}/ush/preamble.sh" status=$? [[ ${status} -ne 0 ]] && exit "${status}" +export job="arch" +export jobid="${job}.$$" + ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGLOBAL_ARCHIVE diff --git a/jobs/rocoto/earc.sh b/jobs/rocoto/earc.sh index 9e3614377d..c4c7341698 100755 --- a/jobs/rocoto/earc.sh +++ b/jobs/rocoto/earc.sh @@ -4,13 +4,16 @@ source "${HOMEgfs}/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules -. "${HOMEgfs}"/ush/load_fv3gfs_modules.sh +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? [[ ${status} -ne 0 ]] && exit "${status}" +export job="earc" +export jobid="${job}.$$" + ############################################################### # Execute the JJOB -"${HOMEgfs}"/jobs/JENKFGDAS_ARCHIVE +"${HOMEgfs}/jobs/JGDAS_ENKF_ARCHIVE" status=$? diff --git a/jobs/rocoto/gldas.sh b/jobs/rocoto/gldas.sh index db16dd883f..8d8bb903bb 100755 --- a/jobs/rocoto/gldas.sh +++ b/jobs/rocoto/gldas.sh @@ -8,6 +8,9 @@ source "$HOMEgfs/ush/preamble.sh" status=$? [[ $status -ne 0 ]] && exit $status +export job="gldas" +export jobid="${job}.$$" + ############################################################### # Execute the JJOB. GLDAS only runs once per day. diff --git a/jobs/rocoto/ocnanalpost.sh b/jobs/rocoto/ocnanalpost.sh index bad01c93f2..5dead927bd 100755 --- a/jobs/rocoto/ocnanalpost.sh +++ b/jobs/rocoto/ocnanalpost.sh @@ -8,6 +8,9 @@ module purge module use "${HOMEgfs}/sorc/gdas.cd/modulefiles" module load GDAS/"${machine,,}" +export job="ocnanalpost" +export jobid="${job}.$$" + ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST diff --git a/jobs/rocoto/ocnanalprep.sh b/jobs/rocoto/ocnanalprep.sh index 7cf14a66ce..0771872629 100755 --- a/jobs/rocoto/ocnanalprep.sh +++ b/jobs/rocoto/ocnanalprep.sh @@ -8,6 +8,9 @@ module purge module use "${HOMEgfs}/sorc/gdas.cd/modulefiles" module load "GDAS/${machine,,}" +export job="ocnanalprep" +export jobid="${job}.$$" + ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP diff --git a/jobs/rocoto/ocnanalrun.sh b/jobs/rocoto/ocnanalrun.sh index 460169a55f..cd57d13c44 100755 --- a/jobs/rocoto/ocnanalrun.sh +++ b/jobs/rocoto/ocnanalrun.sh @@ -8,6 +8,9 @@ module purge module use "${HOMEgfs}/sorc/gdas.cd/modulefiles" module load GDAS/"${machine,,}" +export job="ocnanalrun" +export jobid="${job}.$$" + ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN diff --git a/scripts/exgdas_enkf_earc.sh b/scripts/exgdas_enkf_earc.sh index ce0d416663..7962946034 100755 --- a/scripts/exgdas_enkf_earc.sh +++ b/scripts/exgdas_enkf_earc.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" ############################################## export n=$((10#${ENSGRP})) export CDUMP_ENKF=$(echo "${EUPD_CYC:-"gdas"}" | tr a-z A-Z) -export ARCH_LIST="${ROTDIR}/enkf${CDUMP}.${PDY}/${cyc}/${COMPONENT}/earc${ENSGRP}" +export ARCH_LIST="${ROTDIR}/enkf${CDUMP}.${PDY}/${cyc}/atmos/earc${ENSGRP}" # ICS are restarts and always lag INC by $assim_freq hours. EARCINC_CYC=${ARCH_CYC} @@ -122,13 +122,13 @@ if [ "${ENSGRP}" -eq 0 ]; then [[ ! -d ${ARCDIR} ]] && mkdir -p "${ARCDIR}" cd "${ARCDIR}" - nb_copy "${ROTDIR}"/enkf"${CDUMP}"."${PDY}"/"${cyc}"/"${COMPONENT}"/"${CDUMP}".t"${cyc}"z.enkfstat enkfstat."${CDUMP}"."${CDATE}" - nb_copy "${ROTDIR}"/enkf"${CDUMP}"."${PDY}"/"${cyc}"/"${COMPONENT}"/"${CDUMP}".t"${cyc}"z.gsistat.ensmean gsistat."${CDUMP}"."${CDATE}".ensmean + nb_copy "${ROTDIR}/enkf${CDUMP}.${PDY}/${cyc}/atmos/${CDUMP}.t${cyc}z.enkfstat" "enkfstat.${CDUMP}.${CDATE}" + nb_copy "${ROTDIR}/enkf${CDUMP}.${PDY}/${cyc}/atmos/${CDUMP}.t${cyc}z.gsistat.ensmean" "gsistat.${CDUMP}.${CDATE}.ensmean" if [ "${CDUMP_ENKF}" != "GDAS" ]; then - nb_copy "${ROTDIR}"/enkfgfs."${PDY}"/"${cyc}"/"${COMPONENT}"/"${CDUMP}".t"${cyc}"z.enkfstat enkfstat.gfs."${CDATE}" - nb_copy "${ROTDIR}"/enkfgfs."${PDY}"/"${cyc}"/"${COMPONENT}"/"${CDUMP}".t"${cyc}"z.gsistat.ensmean gsistat.gfs."${CDATE}".ensmean - fi + nb_copy "${ROTDIR}/enkfgfs.${PDY}/${cyc}/atmos/${CDUMP}.t${cyc}z.enkfstat" "enkfstat.gfs.${CDATE}" + nb_copy "${ROTDIR}/enkfgfs.${PDY}/${cyc}/atmos/${CDUMP}.t${cyc}z.gsistat.ensmean" "gsistat.gfs.${CDATE}.ensmean" + fi fi @@ -152,7 +152,7 @@ if [ "${ENSGRP}" -eq 0 ]; then # Loop over GDAS and GFS EnKF directories separately. clist="gdas gfs" for ctype in ${clist}; do - COMIN_ENS="${ROTDIR}/enkf${ctype}.${gPDY}/${gcyc}/${COMPONENT}" + COMIN_ENS="${ROTDIR}/enkf${ctype}.${gPDY}/${gcyc}/atmos" if [ -d "${COMIN_ENS}" ]; then rocotolog="${EXPDIR}/logs/${GDATE}.log" if [ -f "${rocotolog}" ]; then