Skip to content

Commit

Permalink
Refine fit2obs job in rocoto mesh (#2047)
Browse files Browse the repository at this point in the history
This PR adjusts the `fit2obs` job in the rocoto mesh to better define when it exists
and how the archive job dependencies accommodate it not being in the first half
cycle.

Changes in PR:

1. Remove the `fit2obs` job from the first half cycle `cycledef`.
2. Adjust the archive job dependencies to now include the `fit2obs` job in the new
logic check added in PR #1983. The `gdasarch` job in the first half cycle will check if
`gdasfit2obs` is complete OR no prior cycle exists. Also cleaned up this new logic
check block some to make it a tad simpler.
3. Also, fix the addition of the `fit2obs` config to the config list in setup scripts. Now
tied to whether `fit2obs` job is on instead of always adding the config to the list.

Resolves #2043
  • Loading branch information
KateFriedman-NOAA committed Nov 14, 2023
1 parent 5730a71 commit 6f16930
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
5 changes: 4 additions & 1 deletion workflow/applications/gfs_cycled.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_app_configs(self):
if self.do_ocean:
configs += ['ocnpost']

configs += ['sfcanl', 'analcalc', 'fcst', 'post', 'vrfy', 'fit2obs', 'arch', 'cleanup']
configs += ['sfcanl', 'analcalc', 'fcst', 'post', 'vrfy', 'arch', 'cleanup']

if self.do_hybvar:
if self.do_jediatmens:
Expand All @@ -56,6 +56,9 @@ def _get_app_configs(self):
configs += ['eobs', 'eomg', 'ediag', 'eupd']
configs += ['ecen', 'esfc', 'efcs', 'echgres', 'epos', 'earc']

if self.do_fit2obs:
configs += ['fit2obs']

if self.do_verfozn:
configs += ['verfozn']

Expand Down
52 changes: 24 additions & 28 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,8 @@ def fit2obs(self):
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

cycledef = 'gdas_half,gdas' if self.cdump in ['gdas'] else self.cdump

resources = self.get_resource('fit2obs')
task = create_wf_task('fit2obs', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies,
cycledef=cycledef)
task = create_wf_task('fit2obs', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)

return task

Expand Down Expand Up @@ -957,33 +954,32 @@ def metp(self):
def arch(self):
deps = []
dependencies = []
if self.app_config.do_verfozn or self.app_config.do_verfrad or self.app_config.do_vminmon:
if self.app_config.mode in ['cycled']:
if self.cdump in ['gfs']:
if self.app_config.do_vminmon:
dep_dict = {'type': 'task', 'name': f'{self.cdump}vminmon'}
deps.append(rocoto.add_dependency(dep_dict))
elif self.cdump in ['gdas']:
deps2 = []
if self.app_config.do_verfozn:
dep_dict = {'type': 'task', 'name': f'{self.cdump}verfozn'}
deps2.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_verfrad:
dep_dict = {'type': 'task', 'name': f'{self.cdump}verfrad'}
deps2.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_vminmon:
dep_dict = {'type': 'task', 'name': f'{self.cdump}vminmon'}
deps2.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps2)
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'}
dependencies.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='or', dep=dependencies)
if self.app_config.mode in ['cycled']:
if self.cdump in ['gfs']:
if self.app_config.do_vminmon:
dep_dict = {'type': 'task', 'name': f'{self.cdump}vminmon'}
deps.append(rocoto.add_dependency(dep_dict))
elif self.cdump in ['gdas']: # Block for handling half cycle dependencies
deps2 = []
if self.app_config.do_fit2obs:
dep_dict = {'type': 'task', 'name': f'{self.cdump}fit2obs'}
deps2.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_verfozn:
dep_dict = {'type': 'task', 'name': f'{self.cdump}verfozn'}
deps2.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_verfrad:
dep_dict = {'type': 'task', 'name': f'{self.cdump}verfrad'}
deps2.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_vminmon:
dep_dict = {'type': 'task', 'name': f'{self.cdump}vminmon'}
deps2.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps2)
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'}
dependencies.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='or', dep=dependencies)
if self.app_config.do_vrfy:
dep_dict = {'type': 'task', 'name': f'{self.cdump}vrfy'}
deps.append(rocoto.add_dependency(dep_dict))
if self.cdump in ['gdas'] and self.app_config.do_fit2obs:
dep_dict = {'type': 'task', 'name': f'{self.cdump}fit2obs'}
deps.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_wave:
dep_dict = {'type': 'task', 'name': f'{self.cdump}wavepostsbs'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down

0 comments on commit 6f16930

Please sign in to comment.