Skip to content

Commit

Permalink
Compress first[last]_mem logic and remove unused variable
Browse files Browse the repository at this point in the history
Refs #2475
  • Loading branch information
KateFriedman-NOAA committed Aug 13, 2024
1 parent 6659e72 commit c6bb969
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
19 changes: 8 additions & 11 deletions ush/python/pygfs/task/stage_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,16 @@ def configure(self, stage_dict: Dict[str, Any]) -> (Dict[str, Any]):
stage_dict['rRUN'] = rRUN

# Determine ensemble member settings
MEM_START = -1 # Deterministic default, no members
if self.task_config.NMEM_ENS > 0:
if self.task_config.NMEM_ENS > 0: # Ensemble RUN
if self.task_config.RUN == "gefs":
MEM_START = 0
stage_dict['first_mem'] = 0
stage_dict['last_mem'] = self.task_config.NMEM_ENS
elif self.task_config.RUN == "enkfgdas":
MEM_START = 1

if MEM_START >= 0: # Ensemble RUN
stage_dict['first_mem'] = MEM_START
stage_dict['last_mem'] = self.task_config.NMEM_ENS
else: # Deteministic RUN
stage_dict['first_mem'] = MEM_START
stage_dict['last_mem'] = MEM_START
stage_dict['first_mem'] = 1
stage_dict['last_mem'] = self.task_config.NMEM_ENS
else: # Deterministic RUN
stage_dict['first_mem'] = -1
stage_dict['last_mem'] = -1

return stage_dict

Expand Down
1 change: 0 additions & 1 deletion workflow/rocoto/gefs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def __init__(self, app_config: AppConfig, run: str) -> None:
super().__init__(app_config, run)

def stage_ic(self):
cpl_ic = self._configs['stage_ic']

resources = self.get_resource('stage_ic')
task_name = f'stage_ic'
Expand Down
2 changes: 0 additions & 2 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def stage_ic(self):

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

cpl_ic = self._configs['stage_ic']

resources = self.get_resource('stage_ic')
task_name = f'{self.run}stage_ic'
task_dict = {'task_name': task_name,
Expand Down

0 comments on commit c6bb969

Please sign in to comment.