Skip to content

Commit

Permalink
Fix some rocoto dependencies (#2074)
Browse files Browse the repository at this point in the history
A few small errors/cleanup in the dependencies, mostly in fcst:

A few small errors/cleanup have crept into the dependencies with recent changes,
mostly in fcst:

- Fixed the offset, as it would yield a string rocoto doesn't recognize when the
interval was 24+ hrs
- Removed the duplicate wave dependency. When `waveprep` is included, it
depends on `waveinit` so there is no need to add a `waveinit` dependency.
- Converted an interval in the archive job that was missed in #2039

Resolves #2075
  • Loading branch information
WalterKolczynski-NOAA authored Nov 16, 2023
1 parent d4c7508 commit 635c471
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def aerosol_init(self):
interval = self._base['INTERVAL_GFS']
elif self.cdump in ['gdas']:
interval = self._base['INTERVAL']
offset = f'-{timedelta_to_HMS(interval)}'
offset = timedelta_to_HMS(-interval)

# Files from previous cycle
files = [f'@Y@m@[email protected]_core.res.nc'] + \
Expand Down Expand Up @@ -491,8 +491,6 @@ 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 All @@ -501,7 +499,7 @@ def _fcst_forecast_only(self):
interval = self._base['INTERVAL_GFS']
elif self.cdump in ['gdas']:
interval = self._base['INTERVAL']
offset = f'-{interval}'
offset = timedelta_to_HMS(-interval)
deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}aerosol_init'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down Expand Up @@ -1012,7 +1010,7 @@ def arch(self):
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'}
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"}
dependencies.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='or', dep=dependencies)
if self.cdump in ['gfs'] and self.app_config.do_tracker:
Expand Down

0 comments on commit 635c471

Please sign in to comment.