From 6f1693081662f241fafc930b1afc88125f7f5aff Mon Sep 17 00:00:00 2001 From: Kate Friedman Date: Tue, 14 Nov 2023 11:15:02 -0500 Subject: [PATCH] Refine fit2obs job in rocoto mesh (#2047) 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 --- workflow/applications/gfs_cycled.py | 5 ++- workflow/rocoto/gfs_tasks.py | 52 +++++++++++++---------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/workflow/applications/gfs_cycled.py b/workflow/applications/gfs_cycled.py index cdb5e18f3e..3b8472d3c8 100644 --- a/workflow/applications/gfs_cycled.py +++ b/workflow/applications/gfs_cycled.py @@ -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: @@ -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'] diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 4843ef68a8..24d31521c2 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -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 @@ -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))