Skip to content

Commit

Permalink
Add waveinit and waveprep to half-cycle. (NOAA-EMC#2037)
Browse files Browse the repository at this point in the history
This PR addresses issue NOAA-EMC#1444. The `waveinit` and `waveprep` tasks have been added to
the GDAS have cycle. The downstream dependencies for the respective GFS and GDAS
forecast tasks have been removed.

Resolves NOAA-EMC#1444
  • Loading branch information
HenryRWinterbottom authored Nov 14, 2023
1 parent 28d2e93 commit 5730a71
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ def waveinit(self):

resources = self.get_resource('waveinit')
dependencies = None
cycledef = None
if self.app_config.mode in ['cycled']:
deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}prep'}
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'}
deps.append(rocoto.add_dependency(dep_dict))
if self.cdump in ['gdas']:
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='or', dep=deps)

task = create_wf_task('waveinit', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)
cycledef = 'gdas_half,gdas' if self.cdump in ['gdas'] else self.cdump
task = create_wf_task('waveinit', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies, cycledef=cycledef)

return task

Expand All @@ -128,9 +130,9 @@ def waveprep(self):
dep_dict = {'type': 'task', 'name': f'{self.cdump}waveinit'}
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('waveprep')
task = create_wf_task('waveprep', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)
task = create_wf_task('waveprep', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies, cycledef=cycledef)

return task

Expand Down Expand Up @@ -488,6 +490,8 @@ def _fcst_forecast_only(self):
wave_job = 'waveprep' if self.app_config.model_app in ['ATMW'] else 'waveinit'
dep_dict = {'type': 'task', 'name': f'{self.cdump}{wave_job}'}
dependencies.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{self.cdump}waveinit'}
dependencies.append(rocoto.add_dependency(dep_dict))

if self.app_config.do_aero:
# Calculate offset based on CDUMP = gfs | gdas
Expand Down Expand Up @@ -521,10 +525,6 @@ def _fcst_cycled(self):
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalpost'}
dependencies.append(rocoto.add_dependency(dep_dict))

if self.app_config.do_wave and self.cdump in self.app_config.wave_cdumps:
dep_dict = {'type': 'task', 'name': f'{self.cdump}waveprep'}
dependencies.append(rocoto.add_dependency(dep_dict))

if self.app_config.do_aero:
dep_dict = {'type': 'task', 'name': f'{self.cdump}aeroanlfinal'}
dependencies.append(rocoto.add_dependency(dep_dict))
Expand All @@ -540,6 +540,11 @@ def _fcst_cycled(self):
dependencies.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='or', dep=dependencies)

if self.app_config.do_wave and self.cdump in self.app_config.wave_cdumps:
dep_dict = {'type': 'task', 'name': f'{self.cdump}waveprep'}
dependencies.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=dependencies)

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

resources = self.get_resource('fcst')
Expand Down

0 comments on commit 5730a71

Please sign in to comment.