From 5730a71fa5d311e49d9bb11528b500f27f33d69d Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:13:11 -0700 Subject: [PATCH] Add `waveinit` and `waveprep` to half-cycle. (#2037) This PR addresses issue #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 #1444 --- workflow/rocoto/gfs_tasks.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 5e2ed8cd03..4843ef68a8 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -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 @@ -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 @@ -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 @@ -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)) @@ -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')