-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow APP to differ between RUNs #2943
base: develop
Are you sure you want to change the base?
Allow APP to differ between RUNs #2943
Conversation
This is going to require some more leg work as some APP-specific flags are currently read in without specifying a global-workflow/workflow/applications/applications.py Lines 34 to 50 in c6e3262
This will require reworking the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WalterKolczynski-NOAA I have made some significant changes to the Application
classes to allow the APP
to vary by RUN
. Next, I will need to update the Rocoto
class to work with this modified class. Before I start that, could you take a look at these and see if you're OK with what I have done. Happy to meet to go over details if needed.
217ec77
to
8275caf
Compare
This PR now correctly generates identical CI XMLs as compared to develop (with the exception of the Marking ready for review. |
if run_options[run]['do_aero']: | ||
aero_anl_run = run_base.get('AERO_ANL_RUN', 'BOTH').lower() | ||
if aero_anl_run in ['both']: | ||
aero_anl_runs = ['gfs', 'gdas'] | ||
elif aero_anl_run in ['gfs', 'gdas']: | ||
aero_anl_runs = [aero_anl_run] | ||
|
||
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']: | ||
aero_fcst_runs = [aero_fcst_run] | ||
|
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic can be redesigned in config.base so that, e.g. do_aero_anl
would be set based on RUN
, making the Python logic simpler and making it easier for developers to modify. There are some other places I will tag that should be moveable as well. Should this be done as part of this PR or could it wait for a future issue?
if run == 'gdas': | ||
if not options['do_jediatmvar']: | ||
task_names[run] += ['analdiag'] | ||
|
||
if options['do_wave'] and run in self.wave_runs: | ||
task_names[run] += wave_prep_tasks | ||
|
||
if options['do_aero'] and run in options['aero_anl_runs']: | ||
task_names[run] += ['aeroanlgenb'] | ||
|
||
else: | ||
if options['do_wave'] and run in self.wave_runs: | ||
task_names[run] += wave_prep_tasks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could be made into RUN-specific options in config.base.
wave_runs = [] | ||
if run_options[run]['do_wave']: | ||
wave_run = run_base.get('WAVE_RUN', 'BOTH').lower() | ||
if wave_run in ['both']: | ||
wave_runs = ['gfs', 'gdas'] | ||
elif wave_run in ['gfs', 'gdas']: | ||
wave_runs = [wave_run] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be handled in config.base so do_wave
is set based on RUN
.
if options['do_wave'] and run in self.wave_runs: | ||
task_names[run] += wave_prep_tasks | ||
|
||
if options['do_aero'] and run in options['aero_anl_runs']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do_aero
could be set in config.base based on RUN
.
if options['do_metp']: | ||
task_names[run] += ['metp'] | ||
|
||
if options['do_wave'] and run in options['wave_runs']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do_wave
could be set in config.base based on RUN
.
if options['do_aero']: | ||
aero_fcst_run = options['aero_fcst_run'] | ||
if self.run in aero_fcst_run or aero_fcst_run == "both": | ||
if not self.exp_warm_start: | ||
if not options['exp_warm_start']: | ||
tasks += ['aerosol_init'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do_aero_fcst
could be set in config.base based on RUN
.
if self.app_config.do_aero and \ | ||
self.run in self.app_config.aero_fcst_runs and \ | ||
if self.options['do_aero'] and \ | ||
self.run in self.options['aero_fcst_runs'] and \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do_aero_fcst
could be set in config.base based on RUN
.
dep_dict = {'type': 'task', 'name': f'{self.run}marineanlfinal'} | ||
dependencies.append(rocoto.add_dependency(dep_dict)) | ||
|
||
if self.app_config.do_aero and self.run in self.app_config.aero_anl_runs: | ||
if self.options['do_aero'] and self.run in self.options['aero_anl_runs']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do_aero_anl
could be set in config.base based on RUN
.
Description
This enables APP to be specified for each RUN. This also removes the need for a
_no_run
configuration dictionary and somewhat simplifies the_init_finalize
method.Resolves #2908
Type of change
Change characteristics
How has this been tested?
{"gdas": "S2S", "gfs": "ATM"}
)Checklist