Skip to content

Commit

Permalink
Update ush/python/pygfs/task/aero_prepobs.py
Browse files Browse the repository at this point in the history
Co-authored-by: David Huber <[email protected]>
  • Loading branch information
CoryMartin-NOAA and DavidHuber-NOAA authored Jun 14, 2024
1 parent 75b6d6b commit 5dd514b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ush/python/pygfs/task/aero_prepobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,18 @@ def runConverter(self) -> None:
Run the IODA converter gdas_obsprovider2ioda.x
"""
chdir(self.task_config.DATA)
for prepaero_yaml in self.task_config.prepaero_yaml:
exec_cmd = Executable(self.task_config.APRUN_PREPOBSAERO)
exec_name = os.path.join(self.task_config.DATA, 'gdas_obsprovider2ioda.x')
exec_cmd.add_default_arg(exec_name)
exec_cmd.add_default_arg(prepaero_yaml)
exec_cmd = Executable(self.task_config.APRUN_PREPOBSAERO)
exec_name = os.path.join(self.task_config.DATA, 'gdas_obsprovider2ioda.x')
exec_cmd.add_default_arg(exec_name)

for prepaero_yaml in self.task_config.prepaero_yaml:
try:
logger.debug(f"Executing {exec_cmd}")
exec_cmd()
logger.debug(f"Executing {exec_cmd} on {prepaero_yaml}")
exec_cmd(f"{prepaero_yaml}")
except OSError:
raise OSError(f"Failed to execute {exec_cmd}")
raise OSError(f"Failed to execute {exec_cmd} on {prepaero_yaml}")
except Exception:
raise WorkflowException(f"An error occured during execution of {exec_cmd}")
raise WorkflowException(f"An error occured during execution of {exec_cmd} on {prepaero_yaml}")

pass

Expand Down

0 comments on commit 5dd514b

Please sign in to comment.