Skip to content

Commit

Permalink
Application bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuber-NOAA committed Sep 24, 2024
1 parent 4374bad commit e6b1920
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
7 changes: 6 additions & 1 deletion workflow/applications/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def _get_run_options(self, conf: Configuration) -> Dict[str, Any]:
elif wave_run in ['gfs', 'gdas']:
wave_runs = [wave_run]

run_options[run]['wave_runs'] = wave_runs

aero_anl_runs = []
aero_fcst_runs = []
if run_options[run]['do_aero']:
Expand All @@ -122,7 +124,7 @@ def _get_run_options(self, conf: Configuration) -> Dict[str, Any]:
elif aero_anl_run in ['gfs', 'gdas']:
aero_anl_runs = [aero_anl_run]

aero_fcst_run = base.get('AERO_FCST_RUN', None).lower()
aero_fcst_run = run_base.get('AERO_FCST_RUN', None).lower()
if aero_fcst_run in ['both']:
aero_fcst_runs = ['gfs', 'gdas']
elif aero_fcst_run in ['gfs', 'gdas']:
Expand All @@ -131,6 +133,9 @@ def _get_run_options(self, conf: Configuration) -> Dict[str, Any]:
run_options[run]['do_aero_anl'] = True if run in aero_anl_runs else False
run_options[run]['do_aero_fcst'] = True if run in aero_fcst_runs else False

run_options[run]['aero_anl_runs'] = aero_anl_runs
run_options[run]['aero_fcst_runs'] = aero_fcst_runs

# Append any MODE-specific options
run_options = self._netmode_run_options(run_base, run_options)

Expand Down
3 changes: 2 additions & 1 deletion workflow/applications/gefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def __init__(self, conf: Configuration):

def _netmode_run_options(self, base: Dict[str, Any], run_options: Dict[str, Any]) -> Dict[str, Any]:

# Nothing specific to do for gefs (yet).
run_options[self.run]['nens'] = base.get('NMEM_ENS', 0)
print(run_options[self.run]['nens'])
return run_options

def _get_app_configs(self, run):
Expand Down
39 changes: 20 additions & 19 deletions workflow/applications/gfs_cycled.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def __init__(self, conf: Configuration):
# cycled cases to be able to determine valid runs
base = conf.parse_config('config.base')
self.runs = ["gdas"]
self.runs.append("gfs") if gfs_cyc > 0 else 0
self.runs.append("gfs") if base['gfs_cyc'] > 0 else 0

self.ens_runs = None

if self.do_hybvar:
if base.get('DOHYBVAR', False):
ens_run = base.get('EUPD_CYC', 'gdas').lower()
if ens_run in ['both']:
self.ens_runs = ['gfs', 'gdas']
Expand All @@ -31,18 +31,19 @@ def __init__(self, conf: Configuration):

def _netmode_run_options(self, base: Dict[str, Any], run_options: Dict[str, Any]) -> Dict[str, Any]:

run_options[run]['do_hybvar'] = base.get('DOHYBVAR', False)
run_options[run]['nens'] = base.get('NMEM_ENS', 0)
if run_options[run]['do_hybvar']:
run_options[run]['lobsdiag_forenkf'] = base.get('lobsdiag_forenkf', False)

run_options[run]['do_fit2obs'] = base.get('DO_FIT2OBS', True)
run_options[run]['do_jediatmvar'] = base.get('DO_JEDIATMVAR', False)
run_options[run]['do_jediatmens'] = base.get('DO_JEDIATMENS', False)
run_options[run]['do_jediocnvar'] = base.get('DO_JEDIOCNVAR', False)
run_options[run]['do_jedisnowda'] = base.get('DO_JEDISNOWDA', False)
run_options[run]['do_mergensst'] = base.get('DO_MERGENSST', False)
run_options[run]['do_vrfy_oceanda'] = base.get('DO_VRFY_OCEANDA', False)
for run in self.runs:
run_options[run]['do_hybvar'] = base.get('DOHYBVAR', False)
run_options[run]['nens'] = base.get('NMEM_ENS', 0)
if run_options[run]['do_hybvar']:
run_options[run]['lobsdiag_forenkf'] = base.get('lobsdiag_forenkf', False)

run_options[run]['do_fit2obs'] = base.get('DO_FIT2OBS', True)
run_options[run]['do_jediatmvar'] = base.get('DO_JEDIATMVAR', False)
run_options[run]['do_jediatmens'] = base.get('DO_JEDIATMENS', False)
run_options[run]['do_jediocnvar'] = base.get('DO_JEDIOCNVAR', False)
run_options[run]['do_jedisnowda'] = base.get('DO_JEDISNOWDA', False)
run_options[run]['do_mergensst'] = base.get('DO_MERGENSST', False)
run_options[run]['do_vrfy_oceanda'] = base.get('DO_VRFY_OCEANDA', False)

return run_options

Expand Down Expand Up @@ -158,7 +159,7 @@ def get_task_names(self):
task_names = {run: [] for run in self.runs}

for run in self.runs:
options = self.run_options(run)
options = self.run_options[run]

# Common gdas and gfs tasks before fcst
if run in ['gdas', 'gfs']:
Expand All @@ -180,7 +181,7 @@ def get_task_names(self):
if options['do_jedisnowda']:
task_names[run] += ['prepsnowobs', 'snowanl']

if options['do_wave'] and run in options['wave_runs']:
if options['do_wave'] and run in self.wave_runs:
task_names[run] += ['waveinit', 'waveprep']

# gdas-specific analysis tasks
Expand All @@ -191,7 +192,7 @@ def get_task_names(self):
if options['do_aero'] and run in options['aero_anl_runs']:
task_names[run] += ['aeroanlgenb']

if options['do_aero'] and run in options[aero_anl_runs]:
if options['do_aero'] and run in options['aero_anl_runs']:
task_names[run] = ['aeroanlinit', 'aeroanlvar', 'aeroanlfinal']

if options['do_aero'] and run in options['aero_anl_runs']:
Expand All @@ -203,7 +204,7 @@ def get_task_names(self):
if run == 'gdas':
task_names[run] += ['stage_ic']

task_name[run] += ['atmanlupp', 'atmanlprod', 'fcst']
task_names[run] += ['atmanlupp', 'atmanlprod', 'fcst']

# gfs-specific products
if run == 'gfs':
Expand Down Expand Up @@ -308,7 +309,7 @@ def get_task_names(self):

task_names[run] += ['stage_ic', 'ecen', 'esfc', 'efcs', 'epos', 'earc', 'cleanup']

return tasks
return task_names

@staticmethod
def get_gfs_cyc_dates(base: Dict[str, Any]) -> Dict[str, Any]:
Expand Down

0 comments on commit e6b1920

Please sign in to comment.