Skip to content

Commit 95a4d9c

Browse files
Abstract common j-job tasks
Takes all of the tasks that are common to all j-jobs and abstracts them out into a shared script that is sourced by each job: - Set and create $DATA - Call setpy and set $cycle - Set pid, pgmout, and pgmerr - Source config files - Source machine environment file The common j-job header script is called by passing a list of config files to source: ``` ${HOMEgfs}/ush/jjob_header.sh [config1 [config2 [...]]] ``` Some pre j-job rocoto entry scripts (`jobs/rocoto/*`) are currently doing much more than they should be. These sometimes required extra finagling, usually pre-calling the jjob header in the rocoto script before it does something.
1 parent cf1b328 commit 95a4d9c

File tree

67 files changed

+221
-2318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+221
-2318
lines changed

jobs/JGDAS_ATMOS_ANALYSIS_DIAG

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,7 @@
11
#! /usr/bin/env bash
22

33
source "${HOMEgfs}/ush/preamble.sh"
4-
5-
##############################################
6-
# make temp directory
7-
##############################################
8-
export DATA=${DATA:-${DATAROOT}/${jobid}}
9-
mkdir -p ${DATA}
10-
cd ${DATA}
11-
12-
13-
##############################################
14-
# Run setpdy and initialize PDY variables
15-
##############################################
16-
export cycle="t${cyc}z"
17-
setpdy.sh
18-
. ./PDY
19-
20-
21-
##############################################
22-
# Determine Job Output Name on System
23-
##############################################
24-
export pid=${pid:-$$}
25-
export pgmout="OUTPUT.${pid}"
26-
export pgmerr=errfile
27-
28-
29-
#############################
30-
# Source relevant config files
31-
#############################
32-
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
33-
configs="base anal analdiag"
34-
for config in ${configs}; do
35-
. ${EXPDIR}/config.${config}
36-
status=$?
37-
[[ ${status} -ne 0 ]] && exit ${status}
38-
done
39-
40-
41-
##########################################
42-
# Source machine runtime environment
43-
##########################################
44-
. ${HOMEgfs}/env/${machine}.env anal
45-
status=$?
46-
[[ ${status} -ne 0 ]] && exit ${status}
4+
source "${HOMEgfs}/ush/jjob_header.sh" base anal analdiag
475

486

497
##############################################

jobs/JGDAS_ATMOS_CHGRES_FORENKF

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,7 @@
11
#! /usr/bin/env bash
22

33
source "${HOMEgfs}/ush/preamble.sh"
4-
5-
##############################################
6-
# make temp directory
7-
##############################################
8-
export DATA=${DATA:-${DATAROOT}/${jobid}}
9-
mkdir -p ${DATA}
10-
cd ${DATA}
11-
12-
13-
##############################################
14-
# Run setpdy and initialize PDY variables
15-
##############################################
16-
export cycle="t${cyc}z"
17-
setpdy.sh
18-
. ./PDY
19-
20-
21-
##############################################
22-
# Determine Job Output Name on System
23-
##############################################
24-
export pid=${pid:-$$}
25-
export pgmout="OUTPUT.${pid}"
26-
export pgmerr=errfile
27-
28-
29-
#############################
30-
# Source relevant config files
31-
#############################
32-
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
33-
configs="base anal echgres"
34-
for config in ${configs}; do
35-
. ${EXPDIR}/config.${config}
36-
status=$?
37-
[[ ${status} -ne 0 ]] && exit ${status}
38-
done
39-
40-
41-
##########################################
42-
# Source machine runtime environment
43-
##########################################
44-
. ${HOMEgfs}/env/${machine}.env anal
45-
status=$?
46-
[[ ${status} -ne 0 ]] && exit ${status}
4+
source "${HOMEgfs}/ush/jjob_header.sh" base anal echgres
475

486

497
##############################################

jobs/JGDAS_ATMOS_GEMPAK

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,12 @@
11
#! /usr/bin/env bash
22

33
source "${HOMEgfs}/ush/preamble.sh"
4+
source "${HOMEgfs}/ush/jjob_header.sh" base gempak
45

5-
##########################################################
6-
# make temp directory
7-
##########################################################
8-
export DATA=${DATA:-${DATAROOT}/${jobid}}
9-
mkdir -p ${DATA}
10-
cd ${DATA}
11-
12-
###########################################
13-
# Run setpdy and initialize PDY variables
14-
###########################################
15-
export cycle="t${cyc}z"
16-
setpdy.sh
17-
. ./PDY
18-
19-
export pid=${pid:-$$}
20-
export pgmout="OUTPUT.${pid}"
21-
export pgmerr=errfile
22-
23-
#############################
24-
# Source relevant config files
25-
#############################
26-
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
27-
configs="base gempak"
28-
for config in ${configs}; do
29-
. ${EXPDIR}/config.${config}
30-
status=$?
31-
[[ ${status} -ne 0 ]] && exit ${status}
32-
done
33-
34-
###############################################################
35-
. ${BASE_ENV}/${machine}.env gempak
36-
status=$?
37-
[[ ${status} -ne 0 ]] && exit ${status}
6+
# TODO (#1219) This j-job is not part of the rocoto suite
387

398
################################
409
# Set up the HOME directory
41-
################################
42-
export HOMEgfs=${HOMEgfs:-${PACKAGEROOT}/gfs.${gfs_ver}} # TODO: remove these as they are already defined in config.base
4310
export EXECgfs=${EXECgfs:-${HOMEgfs}/exec}
4411
export PARMgfs=${PARMgfs:-${HOMEgfs}/parm}
4512
export PARMwmo=${PARMwmo:-${HOMEgfs}/parm/wmo}
@@ -67,8 +34,6 @@ export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn}
6734
###################################
6835
# Specify NET and RUN Name and model
6936
####################################
70-
export NET=${NET:-gfs}
71-
export RUN=${RUN:-gdas}
7237
export model=${model:-gdas}
7338
export COMPONENT="atmos"
7439

@@ -83,7 +48,7 @@ if [ ${SENDCOM} = YES ] ; then
8348
fi
8449

8550

86-
# TODO: These actions belong in an ex-script not a j-job
51+
# TODO: These actions belong in an ex-script not a j-job (#1219)
8752
if [ -f ${DATA}/poescript ]; then
8853
rm ${DATA}/poescript
8954
fi

jobs/JGDAS_ATMOS_GEMPAK_META_NCDC

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
#! /usr/bin/env bash
22

3-
source "${HOMEgfs}/ush/preamble.sh"
4-
53
############################################
64
# GDAS GEMPAK META NCDC PRODUCT GENERATION
75
############################################
86

9-
##########################################################
10-
# make temp directory
11-
##########################################################
12-
export DATA=${DATA:-${DATAROOT}/${jobid}}
13-
mkdir -p ${DATA}
14-
cd ${DATA}
7+
# TODO (#1222) This j-job is not part of the rocoto
158

16-
###########################################
17-
# Run setpdy and initialize PDY variables
18-
###########################################
19-
export cycle="t${cyc}z"
20-
setpdy.sh
21-
. ./PDY
22-
23-
export pid=${pid:-$$}
24-
export pgmout="OUTPUT.${pid}"
25-
export pgmerr=errfile
9+
source "${HOMEgfs}/ush/preamble.sh"
10+
source "${HOMEgfs}/ush/jjob_header.sh" base gempak
2611

2712
################################
2813
# Set up the HOME directory
@@ -46,8 +31,6 @@ cp ${FIXgempak}/datatype.tbl datatype.tbl
4631
###################################
4732
# Specify NET and RUN Name and model
4833
####################################
49-
export NET=${NET:-gfs}
50-
export RUN=${RUN:-gdas}
5134
export COMPONENT="atmos"
5235
export MODEL=GDAS
5336
export GRID_NAME=gdas

jobs/JGDAS_ATMOS_GLDAS

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,7 @@
11
#! /usr/bin/env bash
22

33
source "${HOMEgfs:?}/ush/preamble.sh"
4-
5-
##############################################
6-
# Obtain unique process id (pid) and make temp directory
7-
##############################################
8-
export DATA=${DATA:-${DATAROOT}/${jobid}}
9-
mkdir -p "${DATA}"
10-
cd "${DATA}" || exit 1
11-
12-
13-
##############################################
14-
# Run setpdy and initialize PDY variables
15-
##############################################
16-
export cycle="t${cyc}z"
17-
setpdy.sh
18-
. ./PDY
19-
20-
21-
##############################################
22-
# Determine Job Output Name on System
23-
##############################################
24-
export pid=${pid:-$$}
25-
export pgmout="OUTPUT.${pid}"
26-
export pgmerr=errfile
27-
28-
29-
#############################
30-
# Source relevant config files
31-
#############################
32-
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
33-
configs="base gldas"
34-
for config in ${configs}; do
35-
. ${EXPDIR}/config.${config}
36-
status=$?
37-
[[ ${status} -ne 0 ]] && exit "${status}"
38-
done
39-
4+
source "${HOMEgfs}/ush/jjob_header.sh" base gldas
405

416
if [[ "${cyc:?}" -ne "${gldas_cyc:?}" ]]; then
427
echo "GLDAS only runs for ${gldas_cyc} cycle; Skip GLDAS step for cycle ${cyc}"
@@ -51,15 +16,6 @@ if [[ "${CDATE}" -le "$(${NDATE:?} +"${xtime}" "${SDATE:?}")" ]]; then
5116
exit 0
5217
fi
5318

54-
##########################################
55-
# Source machine runtime environment
56-
##########################################
57-
# shellcheck disable=SC1090-SC1091
58-
. "${HOMEgfs}/env/${machine:?}.env" gldas
59-
# shellcheck disable=
60-
status=$?
61-
[[ ${status} -ne 0 ]] && exit "${status}"
62-
6319

6420
##############################################
6521
# Set variables used in the exglobal script

jobs/JGDAS_ATMOS_VERFOZN

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,12 @@
44
# Set up environment for GDAS Ozone Monitor job
55
#############################################################
66
source "${HOMEgfs}/ush/preamble.sh"
7-
8-
###########################################################
9-
# make temp directories
10-
###########################################################
11-
export DATA=${DATA:-${DATAROOT}/${jobid}}
12-
mkdir -p ${DATA}
13-
cd ${DATA}
14-
15-
16-
##############################################
17-
# Run setpdy and initialize PDY variables
18-
##############################################
19-
export cycle="t${cyc}z"
20-
setpdy.sh
21-
. ./PDY
22-
23-
24-
####################################
25-
# Determine Job Output Name on System
26-
####################################
27-
export pid=$$
28-
export pgmout="OUTPUT.${pid}"
29-
export pgmerr=errfile
7+
source "${HOMEgfs}/ush/jjob_header.sh" base vrfy
308

319

3210
###############################
3311
# Specify NET, RUN, and COMPONENT name
3412
##############################
35-
export NET=${NET:-gfs}
36-
export RUN=${RUN:-gdas}
3713
export COMPONENT="atmos"
3814

3915
export OZNMON_SUFFIX=${OZNMON_SUFFIX:-${NET}}

jobs/JGDAS_ATMOS_VERFRAD

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,8 @@
44
# Set up environment for GDAS Radiance Monitor job
55
#############################################################
66
source "${HOMEgfs}/ush/preamble.sh"
7+
source "${HOMEgfs}/ush/jjob_header.sh" base vrfy
78

8-
###########################################################
9-
# make temp directories
10-
###########################################################
11-
export DATA=${DATA:-${DATAROOT}/${jobid}}
12-
mkdir -p ${DATA}
13-
cd ${DATA}
14-
15-
16-
##############################################
17-
# Run setpdy and initialize PDY variables
18-
##############################################
19-
export cycle="t${cyc}z"
20-
setpdy.sh
21-
. ./PDY
22-
23-
24-
####################################
25-
# Determine Job Output Name on System
26-
####################################
27-
export pid=$$
28-
export pgmout="OUTPUT.${pid}"
29-
export pgmerr=errfile
30-
31-
32-
###############################
33-
# Specify NET, RUN, and COMPONENT name
34-
##############################
35-
export NET=${NET:-gfs}
36-
export RUN=${RUN:-gdas}
379
export COMPONENT="atmos"
3810

3911
export RAD_DATA_IN=${DATA}

jobs/JGDAS_ATMOS_VMINMON

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,8 @@
44
# GDAS Minimization Monitor (MinMon) job
55
###########################################################
66
source "${HOMEgfs}/ush/preamble.sh"
7+
source "${HOMEgfs}/ush/jjob_header.sh" base vrfy
78

8-
###########################################################
9-
# make temp directories
10-
###########################################################
11-
export DATA=${DATA:-${DATAROOT}/${jobid}}
12-
mkdir -p ${DATA}
13-
cd ${DATA}
14-
15-
16-
##############################################
17-
# Run setpdy and initialize PDY variables
18-
##############################################
19-
export cycle="t${cyc}z"
20-
setpdy.sh
21-
. ./PDY
22-
23-
24-
####################################
25-
# Determine Job Output Name on System
26-
####################################
27-
export pid=$$
28-
export pgmout="OUTPUT.${pid}"
29-
export pgmerr=errfile
30-
31-
32-
###############################
33-
# Specify NET, RUN, and COMPONENT name
34-
##############################
35-
export NET=${NET:-gfs}
36-
export RUN=${RUN:-gdas}
379
export COMPONENT="atmos"
3810

3911
###########################################################

0 commit comments

Comments
 (0)