Skip to content

Commit d3a0504

Browse files
Adding empty GEFS Awips Job to Global Workflow (#3790)
- Add an empty awips job to the GEFS system in global workflow - GEFS awips will depend on atmos_ensstat job - Contents of the job will be added in a different PR Ref #3468
1 parent 3981e40 commit d3a0504

File tree

8 files changed

+105
-2
lines changed

8 files changed

+105
-2
lines changed

dev/ci/cases/yamls/gefs_defaults_ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ base:
77
USE_ATM_ENS_PERTURB_FILES: "NO"
88
DO_BUFRSND: "NO"
99
DO_GEMPAK: "NO"
10+
DO_AWIPS: "NO"
1011
ocn:
1112
MOM6_INTERP_ICS: "NO"

dev/jobs/awips.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /usr/bin/env bash
2+
3+
set -x
4+
source "${HOMEgfs}/ush/load_fv3gfs_modules.sh"
5+
status=$?
6+
if [[ ${status} -ne 0 ]]; then
7+
exit "${status}"
8+
fi
9+
10+
export job="awips"
11+
12+
# shellcheck disable=SC2153
13+
IFS=', ' read -r -a fhr_list <<< "${FHR_LIST}"
14+
15+
export FHR3 jobid
16+
for fhr in "${fhr_list[@]}"; do
17+
FHR3=$(printf '%03d' "${fhr}")
18+
jobid="${job}_f${FHR3}.$$"
19+
###############################################################
20+
# Execute the JJOB # TODO
21+
###############################################################
22+
# "${HOMEgfs}/jobs/J${RUN^^}_ATMOS_AWIPS"
23+
err=$?
24+
if [[ ${err} -ne 0 ]]; then
25+
exit "${err}"
26+
fi
27+
done
28+
29+
exit 0

dev/parm/config/gefs/config.awips

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#! /usr/bin/env bash
2+
3+
########## config.awips ##########
4+
# GFS awips step specific
5+
6+
echo "BEGIN: config.awips"
7+
8+
# Get task specific resources
9+
. "${EXPDIR}/config.resources" awips
10+
11+
# No. of concurrent awips jobs
12+
export MAX_TASKS=42
13+
14+
echo "END: config.awips"

dev/parm/config/gefs/config.resources

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ case ${step} in
262262
export memory="96GB"
263263
;;
264264

265+
"awips")
266+
export walltime="03:30:00"
267+
export ntasks=1
268+
export tasks_per_node=1
269+
export threads_per_task=1
270+
export memory="3GB"
271+
;;
272+
265273
"wavepostsbs")
266274
# Walltime is per forecast hour; will be multipled by group size
267275
export walltime="00:15:00"

dev/parm/config/gfs/config.awips

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ echo "BEGIN: config.awips"
99
. "${EXPDIR}/config.resources" awips
1010

1111
# No. of concurrent awips jobs
12-
export NAWIPSGRP=42
12+
export MAX_TASKS=42
1313

1414
echo "END: config.awips"

dev/workflow/applications/gefs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def _get_app_configs(self, run):
8585

8686
if options['nens'] > 0:
8787
configs += ['efcs', 'atmos_ensstat']
88+
if options['do_awips']:
89+
configs += ['awips']
8890

8991
if options['do_wave']:
9092
configs += ['waveinit', 'wavepostsbs', 'wavepostpnt']
@@ -168,6 +170,8 @@ def get_task_names(self):
168170

169171
if options['nens'] > 0:
170172
tasks += ['atmos_ensstat']
173+
if options['do_awips']:
174+
tasks += ['awips']
171175

172176
if options['do_ocean']:
173177
tasks += ['ocean_prod']

dev/workflow/rocoto/gefs_tasks.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,53 @@ def atmos_ensstat(self):
485485

486486
return task
487487

488+
def awips(self):
489+
490+
resources = self.get_resource('awips')
491+
492+
deps = []
493+
dep_dict = {'type': 'task', 'name': f'{self.run}_atmos_ensstat_#fhr_label#'}
494+
deps.append(rocoto.add_dependency(dep_dict))
495+
dependencies = rocoto.create_dependency(dep=deps)
496+
497+
fhrs = self._get_forecast_hours(self.run, self._configs['awips'])
498+
499+
# when replaying, atmos component does not have fhr 0, therefore remove 0 from fhrs
500+
is_replay = self._configs['awips']['REPLAY_ICS']
501+
if is_replay and 0 in fhrs:
502+
fhrs.remove(0)
503+
504+
max_tasks = self._configs['awips']['MAX_TASKS']
505+
fhr_var_dict = self.get_grouped_fhr_dict(fhrs=fhrs, ngroups=max_tasks)
506+
507+
# Adjust walltime based on the largest group
508+
largest_group = max([len(grp.split(',')) for grp in fhr_var_dict['fhr_list'].split(' ')])
509+
resources['walltime'] = Tasks.multiply_HMS(resources['walltime'], largest_group)
510+
511+
postenvars = self.envars.copy()
512+
postenvar_dict = {'FHR_LIST': '#fhr_list#'}
513+
for key, value in postenvar_dict.items():
514+
postenvars.append(rocoto.create_envar(name=key, value=str(value)))
515+
516+
task_name = f'{self.run}_awips_#fhr_label#'
517+
task_dict = {'task_name': task_name,
518+
'resources': resources,
519+
'dependency': dependencies,
520+
'envars': postenvars,
521+
'cycledef': self.run,
522+
'command': f'{self.HOMEgfs}/dev/jobs/awips.sh',
523+
'job_name': f'{self.pslot}_{task_name}_@H',
524+
'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',
525+
'maxtries': '&MAXTRIES;'}
526+
527+
fhr_metatask_dict = {'task_name': f'{self.run}_awips',
528+
'task_dict': task_dict,
529+
'var_dict': fhr_var_dict}
530+
531+
task = rocoto.create_task(fhr_metatask_dict)
532+
533+
return task
534+
488535
def wavepostsbs(self):
489536

490537
wave_grid = self._configs['base']['waveGRD']

dev/workflow/rocoto/gfs_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ def _get_awipsgroups(run, config):
15231523
fhrs_hf = list(range(fhmin, fhmax_hf + fhout_hf, fhout_hf))
15241524
fhrs = fhrs_hf + list(range(fhrs_hf[-1] + fhout, fhmax + fhout, fhout))
15251525

1526-
nawipsgrp = config['NAWIPSGRP']
1526+
nawipsgrp = config['MAX_TASKS']
15271527
ngrps = nawipsgrp if len(fhrs) > nawipsgrp else len(fhrs)
15281528

15291529
fhrs = [f'f{fhr:03d}' for fhr in fhrs]

0 commit comments

Comments
 (0)