From 7edf65f10c54bd557ed08bceee452b14ef87779d Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 11 Jul 2024 09:26:38 -0500 Subject: [PATCH 1/2] address issues in creating XML for GFS forecast-only with app S2SWA --- workflow/applications/applications.py | 6 ++++++ workflow/applications/gfs_forecast_only.py | 8 +++++--- workflow/rocoto/gfs_tasks.py | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/workflow/applications/applications.py b/workflow/applications/applications.py index 6a4d240fe5..64440830c1 100644 --- a/workflow/applications/applications.py +++ b/workflow/applications/applications.py @@ -79,12 +79,18 @@ def __init__(self, conf: Configuration) -> None: self.wave_cdumps = [wave_cdump] self.aero_anl_cdumps = None + self.aero_fcst_cdumps = None if self.do_aero: aero_anl_cdump = _base.get('AERO_ANL_CDUMP', 'BOTH').lower() if aero_anl_cdump in ['both']: self.aero_anl_cdumps = ['gfs', 'gdas'] elif aero_anl_cdump in ['gfs', 'gdas']: self.aero_anl_cdumps = [aero_anl_cdump] + aero_fcst_cdump = _base.get('AERO_FCST_CDUMP', None).lower() + if aero_fcst_cdump in ['both']: + self.aero_fcst_cdumps = ['gfs', 'gdas'] + elif aero_fcst_cdump in ['gfs', 'gdas']: + self.aero_fcst_cdumps = [aero_fcst_cdump] def _init_finalize(self, conf: Configuration): print("Finalizing initialize") diff --git a/workflow/applications/gfs_forecast_only.py b/workflow/applications/gfs_forecast_only.py index e219032551..1e2d14b948 100644 --- a/workflow/applications/gfs_forecast_only.py +++ b/workflow/applications/gfs_forecast_only.py @@ -25,7 +25,8 @@ def _get_app_configs(self): configs += ['atmos_products'] if self.do_aero: - configs += ['aerosol_init'] + if self._base['EXP_WARM_START'] in ['.false.']: + configs += ['aerosol_init'] if self.do_tracker: configs += ['tracker'] @@ -87,9 +88,10 @@ def get_task_names(self): tasks = ['stage_ic'] if self.do_aero: - aero_fcst_cdump = _base.get('AERO_FCST_CDUMP', 'BOTH').lower() + aero_fcst_cdump = self._base.get('AERO_FCST_CDUMP', 'BOTH').lower() if self._base['CDUMP'] in aero_fcst_cdump or aero_fcst_cdump == "both": - tasks += ['aerosol_init'] + if self._base['EXP_WARM_START'] in ['.false.']: + tasks += ['aerosol_init'] if self.do_wave: tasks += ['waveinit'] diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 530ea465c4..0a8f3c1a13 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -856,7 +856,9 @@ def _fcst_forecast_only(self): dep_dict = {'type': 'task', 'name': f'{self.cdump}{wave_job}'} dependencies.append(rocoto.add_dependency(dep_dict)) - if self.app_config.do_aero and self.cdump in self.app_config.aero_fcst_cdumps: + if self.app_config.do_aero and \ + self.cdump in self.app_config.aero_fcst_cdumps and \ + self._base['EXP_WARM_START'] in ['.false.']: # Calculate offset based on CDUMP = gfs | gdas interval = None if self.cdump in ['gfs']: From 94a74d930d678b52ba6d6fd968da5c84bcc64437 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 11 Jul 2024 11:03:40 -0500 Subject: [PATCH 2/2] fortran bools are translated to python bools --- workflow/applications/gfs_forecast_only.py | 4 ++-- workflow/rocoto/gfs_tasks.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow/applications/gfs_forecast_only.py b/workflow/applications/gfs_forecast_only.py index 1e2d14b948..938a514896 100644 --- a/workflow/applications/gfs_forecast_only.py +++ b/workflow/applications/gfs_forecast_only.py @@ -25,7 +25,7 @@ def _get_app_configs(self): configs += ['atmos_products'] if self.do_aero: - if self._base['EXP_WARM_START'] in ['.false.']: + if not self._base['EXP_WARM_START']: configs += ['aerosol_init'] if self.do_tracker: @@ -90,7 +90,7 @@ def get_task_names(self): if self.do_aero: aero_fcst_cdump = self._base.get('AERO_FCST_CDUMP', 'BOTH').lower() if self._base['CDUMP'] in aero_fcst_cdump or aero_fcst_cdump == "both": - if self._base['EXP_WARM_START'] in ['.false.']: + if not self._base['EXP_WARM_START']: tasks += ['aerosol_init'] if self.do_wave: diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 0a8f3c1a13..c14c3e2898 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -858,7 +858,7 @@ def _fcst_forecast_only(self): if self.app_config.do_aero and \ self.cdump in self.app_config.aero_fcst_cdumps and \ - self._base['EXP_WARM_START'] in ['.false.']: + not self._base['EXP_WARM_START']: # Calculate offset based on CDUMP = gfs | gdas interval = None if self.cdump in ['gfs']: