Skip to content

Commit

Permalink
minor change and add outdir check
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindougherty-noaa committed Feb 19, 2025
1 parent d8994cd commit e1f04f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/exglobal_analysis_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Create list based on DA components
StatAnl.task_config['STAT_ANALYSES'] = []
if StatAnl.task_config.DO_AERO:
if StatAnl.task_config.DO_AERO_ANL:
StatAnl.task_config['STAT_ANALYSES'].append('aero')
if StatAnl.task_config.DO_JEDISNOWDA:
StatAnl.task_config['STAT_ANALYSES'].append('snow')
Expand Down
7 changes: 6 additions & 1 deletion ush/python/pygfs/task/stat_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ def finalize(self, jedi_dict_key: str) -> None:
for analysis_dict in analysis_config_dict[jedi_dict_key]['ob spaces']:
diagfile = os.path.join(self.task_config.DATA, analysis_dict['output file'])
outdir = self.task_config['COMOUT_' + jedi_dict_key.upper() + '_ANLMON']
# TODO need to create outdir if it does not exist, can do that here or in the j-job

# Check if the directory exists; if not, create it
if not os.path.exists(outdir):
os.makedirs(outdir)
logger.info(f"Created directory: {outdir}")

dest = os.path.join(outdir, f"{analysis_dict['output file']}")
logger.debug(f"copying {diagfile} to {dest}")
diag_copy = {
Expand Down

0 comments on commit e1f04f3

Please sign in to comment.