From e5414cf8f0490a08055926398b5a8ff46c512f5c Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Wed, 15 Feb 2023 14:37:07 +0000 Subject: [PATCH 01/13] bugfixes for aerosol cycling --- ush/python/pygfs/task/aero_analysis.py | 4 ++-- ush/python/pygfs/task/analysis.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index c658943de5d..f1193b92962 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -85,7 +85,7 @@ def initialize(self: Analysis) -> None: # stage berror files # copy BUMP files, otherwise it will assume ID matrix if self.task_config.get('STATICB_TYPE', 'bump_aero') in ['bump_aero']: - FileHandler(AerosolAnalysis.get_berror_dict(self.task_config)).sync() + FileHandler(self.get_berror_dict(self.task_config)).sync() # stage backgrounds FileHandler(self.get_bkg_dict(AttrDict(self.task_config, **self.task_config))).sync() @@ -254,7 +254,7 @@ def get_berror_dict(self, config: Dict[str, Any]) -> Dict[str, List[str]]: berror_dict: Dict a dictionary containing the list of background error files to copy for FileHandler """ - super.get_berror_dict(config) + super().get_berror_dict(config) # aerosol static-B needs nicas, cor_rh, cor_rv and stddev files. b_dir = config['BERROR_DATA_DIR'] b_datestr = config['BERROR_DATE'] diff --git a/ush/python/pygfs/task/analysis.py b/ush/python/pygfs/task/analysis.py index 10b2a14df59..f83c43fda66 100644 --- a/ush/python/pygfs/task/analysis.py +++ b/ush/python/pygfs/task/analysis.py @@ -22,7 +22,8 @@ class Analysis(Task): """ def __init__(self, config: Dict[str, Any]) -> None: - super().__init__(config, ntiles=6) + super().__init__(config) + self.config.ntiles = 6 def initialize(self) -> None: super().initialize() From 9aaad8d7d70dc5ad18351ee392574cb8a963415e Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Thu, 16 Feb 2023 10:54:08 -0600 Subject: [PATCH 02/13] Intermediate debugging --- ush/python/pygfs/task/aero_analysis.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index f1193b92962..b6f51958ab8 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -84,7 +84,7 @@ def initialize(self: Analysis) -> None: # stage berror files # copy BUMP files, otherwise it will assume ID matrix - if self.task_config.get('STATICB_TYPE', 'bump_aero') in ['bump_aero']: + if self.task_config.get('STATICB_TYPE', 'identity') in ['bump_aero']: FileHandler(self.get_berror_dict(self.task_config)).sync() # stage backgrounds @@ -258,6 +258,8 @@ def get_berror_dict(self, config: Dict[str, Any]) -> Dict[str, List[str]]: # aerosol static-B needs nicas, cor_rh, cor_rv and stddev files. b_dir = config['BERROR_DATA_DIR'] b_datestr = config['BERROR_DATE'] + print(b_datestr) + print(type(b_datestr)) berror_list = [] for ftype in ['cor_rh', 'cor_rv', 'stddev']: From a1276d15d0a55e34ba2e8b51005aef243064bc26 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Thu, 16 Feb 2023 14:04:23 -0600 Subject: [PATCH 03/13] More debugging for bump --- ush/python/pygfs/task/aero_analysis.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index b6f51958ab8..4583a9a9590 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -13,6 +13,7 @@ from pygw.timetools import to_isotime, to_fv3time, to_timedelta from pygw.fsutils import rm_p from pygw.template import Template, TemplateConstants +from pygw.timetools import to_fv3time from pygw.yaml_file import YAMLFile from pygw.logger import logit from pygfs.task.analysis import Analysis @@ -84,7 +85,7 @@ def initialize(self: Analysis) -> None: # stage berror files # copy BUMP files, otherwise it will assume ID matrix - if self.task_config.get('STATICB_TYPE', 'identity') in ['bump_aero']: + if self.task_config.get('STATICB_TYPE', 'identity') in ['bump']: FileHandler(self.get_berror_dict(self.task_config)).sync() # stage backgrounds @@ -257,9 +258,7 @@ def get_berror_dict(self, config: Dict[str, Any]) -> Dict[str, List[str]]: super().get_berror_dict(config) # aerosol static-B needs nicas, cor_rh, cor_rv and stddev files. b_dir = config['BERROR_DATA_DIR'] - b_datestr = config['BERROR_DATE'] - print(b_datestr) - print(type(b_datestr)) + b_datestr = to_fv3time(config['BERROR_DATE']) berror_list = [] for ftype in ['cor_rh', 'cor_rv', 'stddev']: From 931ced798cc68b6f44c6b8c29561db2f4be2a2e7 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Thu, 16 Feb 2023 16:20:59 -0600 Subject: [PATCH 04/13] fix module problem... --- ush/load_ufsda_modules.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ush/load_ufsda_modules.sh b/ush/load_ufsda_modules.sh index d4e525c6133..e3356432d7e 100755 --- a/ush/load_ufsda_modules.sh +++ b/ush/load_ufsda_modules.sh @@ -53,6 +53,14 @@ elif [[ -d /scratch1 ]] ; then module load prod_util elif [[ -d /work ]] ; then # We are on MSU Orion + # prod_util stuff, find a better solution later... + #module use /apps/contrib/NCEP/hpc-stack/libs/hpc-stack/modulefiles/compiler/intel/2022.1.2/ + #module load prod_util + export UTILROOT=/work2/noaa/da/python/opt/intel-2022.1.2/prod_util/1.2.2 + export MDATE=/work2/noaa/da/python/opt/intel-2022.1.2/prod_util/1.2.2/bin/mdate + export NDATE=/work2/noaa/da/python/opt/intel-2022.1.2/prod_util/1.2.2/bin/ndate + export NHOUR=/work2/noaa/da/python/opt/intel-2022.1.2/prod_util/1.2.2/bin/nhour + export FSYNC=/work2/noaa/da/python/opt/intel-2022.1.2/prod_util/1.2.2/bin/fsync_file module load "${MODS}/orion" if [[ "${DEBUG_WORKFLOW:-NO}" == "YES" ]] ; then module list @@ -62,9 +70,6 @@ elif [[ -d /work ]] ; then ncdump=$( which ncdump ) NETCDF=$( echo "${ncdump}" | cut -d " " -f 3 ) export NETCDF - # prod_util stuff, find a better solution later... - module use /apps/contrib/NCEP/hpc-stack/libs/hpc-stack/modulefiles/compiler/intel/2022.1.2/ - module load prod_util elif [[ -d /glade ]] ; then # We are on NCAR Yellowstone echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM From 6e1d5cdf3674717261f06eac8dacaa2094735eae Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Thu, 16 Feb 2023 20:41:19 -0600 Subject: [PATCH 05/13] fix some finalize stuff --- ush/python/pygfs/task/aero_analysis.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 4583a9a9590..5eee8a2842e 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -149,9 +149,10 @@ def finalize(self: Analysis) -> None: src = os.path.join(self.task_config['DATA'], f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.aerovar.yaml") dest = os.path.join(self.task_config['COMOUTaero'], f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.aerovar.yaml") yaml_copy = { - 'mkdir': self.task_config['COMOUTaero'], - 'copy': [src, dest] + 'mkdir': [self.task_config['COMOUTaero']], + 'copy': [[src, dest]] } + print(yaml_copy) FileHandler(yaml_copy).sync() # ---- NOTE below is 'temporary', eventually we will not be using FMS RESTART formatted files From 9684a179c5b1b21f93a9e5a8b4a409b1bc2811fa Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Thu, 16 Feb 2023 20:45:19 -0600 Subject: [PATCH 06/13] Fix increment add for aero --- parm/parm_gdas/aeroanl_inc_vars.yaml | 2 +- ush/python/pygfs/task/aero_analysis.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/parm/parm_gdas/aeroanl_inc_vars.yaml b/parm/parm_gdas/aeroanl_inc_vars.yaml index 795b4cef041..298373d6e28 100644 --- a/parm/parm_gdas/aeroanl_inc_vars.yaml +++ b/parm/parm_gdas/aeroanl_inc_vars.yaml @@ -1 +1 @@ -['dust1', 'dust2', 'dust3', 'dust4', 'dust5', 'seas1', 'seas2', 'seas3', 'seas4', 'so4', 'oc1', 'oc2', 'bc1', 'bc2'] +incvars: ['dust1', 'dust2', 'dust3', 'dust4', 'dust5', 'seas1', 'seas2', 'seas3', 'seas4', 'so4', 'oc1', 'oc2', 'bc1', 'bc2'] diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 5eee8a2842e..bfb10f43af0 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -152,7 +152,6 @@ def finalize(self: Analysis) -> None: 'mkdir': [self.task_config['COMOUTaero']], 'copy': [[src, dest]] } - print(yaml_copy) FileHandler(yaml_copy).sync() # ---- NOTE below is 'temporary', eventually we will not be using FMS RESTART formatted files @@ -194,7 +193,7 @@ def _add_fms_cube_sphere_increments(self: Analysis) -> None: fms_bkg_file_template = os.path.join(self.task_config.comin_ges_atm, 'RESTART', f'{self.task_config.cdate_fv3}.fv_tracer.res.tileX.nc') # get list of increment vars incvars_list_path = os.path.join(self.task_config['HOMEgfs'], 'parm', 'parm_gdas', 'aeroanl_inc_vars.yaml') - incvars = YAMLFile(path=incvars_list_path) + incvars = YAMLFile(path=incvars_list_path)['incvars'] super().add_fv3_increments(fms_inc_file_template, fms_bkg_file_template, incvars) @logit(logger) From dbbb00cd51ca6b2fd84880816d417c56b9f83205 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Tue, 21 Feb 2023 13:12:05 -0600 Subject: [PATCH 07/13] change dependencies for aeroanlinit --- workflow/rocoto/workflow_tasks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/workflow/rocoto/workflow_tasks.py b/workflow/rocoto/workflow_tasks.py index 7232398db14..95618291e6d 100644 --- a/workflow/rocoto/workflow_tasks.py +++ b/workflow/rocoto/workflow_tasks.py @@ -463,8 +463,7 @@ def aeroanlinit(self): data = f'&ROTDIR;/gdas.@Y@m@d/@H/atmos/gdas.t@Hz.atmf009.nc' dep_dict = {'type': 'data', 'data': data, 'offset': '-06:00:00'} deps.append(rocoto.add_dependency(dep_dict)) - data = f'{dmpdir}/{self.cdump}{dump_suffix}.@Y@m@d/@H/atmos/{self.cdump}.t@Hz.updated.status.tm00.bufr_d' - dep_dict = {'type': 'data', 'data': data} + dep_dict = {'type': 'task', 'name': f'{self.cdump}prep'} deps.append(rocoto.add_dependency(dep_dict)) dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) From 50eb5f6c0e590f87d26c7c946b3f7ac681cb0e71 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Tue, 21 Feb 2023 13:14:25 -0600 Subject: [PATCH 08/13] pep8 --- workflow/applications.py | 1 - workflow/rocoto/workflow_tasks.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/workflow/applications.py b/workflow/applications.py index 9c9996b8398..89ac1738033 100644 --- a/workflow/applications.py +++ b/workflow/applications.py @@ -397,7 +397,6 @@ def _get_cycled_task_names(self): gdas_tasks += gdas_gfs_common_tasks_after_fcst - if self.do_wave and 'gdas' in self.wave_cdumps: if self.do_wave_bnd: gdas_tasks += wave_bndpnt_tasks diff --git a/workflow/rocoto/workflow_tasks.py b/workflow/rocoto/workflow_tasks.py index 95618291e6d..99f66b96e7b 100644 --- a/workflow/rocoto/workflow_tasks.py +++ b/workflow/rocoto/workflow_tasks.py @@ -1350,7 +1350,7 @@ def create_wf_task(task_name, resources, 'varval': f'{varval}', 'vardict': vardict} - cycledefstr = cdump.replace('enkf','') if cycledef is None else cycledef + cycledefstr = cdump.replace('enkf', '') if cycledef is None else cycledef task_dict = {'taskname': f'{tasknamestr}', 'cycledef': f'{cycledefstr}', From ec3ea2cfbbe7a154caa05a8bb205273923e9c250 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Tue, 21 Feb 2023 13:15:58 -0600 Subject: [PATCH 09/13] more pep8 --- workflow/applications.py | 1 - 1 file changed, 1 deletion(-) diff --git a/workflow/applications.py b/workflow/applications.py index 89ac1738033..717940a1bda 100644 --- a/workflow/applications.py +++ b/workflow/applications.py @@ -396,7 +396,6 @@ def _get_cycled_task_names(self): gdas_tasks += gdas_gfs_common_tasks_after_fcst - if self.do_wave and 'gdas' in self.wave_cdumps: if self.do_wave_bnd: gdas_tasks += wave_bndpnt_tasks From d4071bf47a45879172304641744dd7819bcf4323 Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Thu, 23 Feb 2023 19:52:49 +0000 Subject: [PATCH 10/13] Fix possible bug with attributes in increment --- ush/python/pygfs/task/analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/python/pygfs/task/analysis.py b/ush/python/pygfs/task/analysis.py index f83c43fda66..357cf0c47e4 100644 --- a/ush/python/pygfs/task/analysis.py +++ b/ush/python/pygfs/task/analysis.py @@ -86,7 +86,7 @@ def add_fv3_increments(self, inc_file_tmpl: str, bkg_file_tmpl: str, incvars: Li rstfile.variables[vname][:] = anl[:] try: rstfile.variables[vname].delncattr('checksum') # remove the checksum so fv3 does not complain - except AttributeError: + except (AttributeError, RuntimeError): pass # checksum is missing, move on @logit(logger) From cd6b813f7ccfc5f84eb57a71642253bc430cb9ca Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Thu, 23 Feb 2023 21:56:33 +0000 Subject: [PATCH 11/13] Use temporary gdasapp hash --- Externals.cfg | 2 +- sorc/checkout.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index ec5b58610a3..1b0de1459dd 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ protocol = git required = False [GDASApp] -hash = f7c23af +hash = fa50c47 local_path = sorc/gdas.cd repo_url = https://github.com/NOAA-EMC/GDASApp.git protocol = git diff --git a/sorc/checkout.sh b/sorc/checkout.sh index 514e772c988..187546071a1 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -165,7 +165,7 @@ if [[ ${checkout_gsi} == "YES" ]]; then fi if [[ ${checkout_gdas} == "YES" ]]; then - checkout "gdas.cd" "https://github.com/NOAA-EMC/GDASApp.git" "f7c23af"; errs=$((errs + $?)) + checkout "gdas.cd" "https://github.com/NOAA-EMC/GDASApp.git" "fa50c47"; errs=$((errs + $?)) fi if [[ ${checkout_gsi} == "YES" || ${checkout_gdas} == "YES" ]]; then From 816240182d27cc9d8d0eed0f2c1e3272a29d5426 Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Fri, 24 Feb 2023 19:47:31 +0000 Subject: [PATCH 12/13] update gdasapp hash --- Externals.cfg | 2 +- sorc/checkout.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 1b0de1459dd..f46f190e263 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ protocol = git required = False [GDASApp] -hash = fa50c47 +hash = ebd3111 local_path = sorc/gdas.cd repo_url = https://github.com/NOAA-EMC/GDASApp.git protocol = git diff --git a/sorc/checkout.sh b/sorc/checkout.sh index 187546071a1..8e1e5c5dc74 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -165,7 +165,7 @@ if [[ ${checkout_gsi} == "YES" ]]; then fi if [[ ${checkout_gdas} == "YES" ]]; then - checkout "gdas.cd" "https://github.com/NOAA-EMC/GDASApp.git" "fa50c47"; errs=$((errs + $?)) + checkout "gdas.cd" "https://github.com/NOAA-EMC/GDASApp.git" "ebd3111"; errs=$((errs + $?)) fi if [[ ${checkout_gsi} == "YES" || ${checkout_gdas} == "YES" ]]; then From df40125832891c853a3026f7785e3482883f5dc5 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Tue, 28 Feb 2023 15:05:05 -0600 Subject: [PATCH 13/13] Update to latest gdasapp --- Externals.cfg | 2 +- sorc/checkout.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index b5917a2b206..9e508b68d23 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ protocol = git required = False [GDASApp] -hash = ebd3111 +hash = a00b5da local_path = sorc/gdas.cd repo_url = https://github.com/NOAA-EMC/GDASApp.git protocol = git diff --git a/sorc/checkout.sh b/sorc/checkout.sh index d583406f0de..64d27c94b56 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -165,7 +165,7 @@ if [[ ${checkout_gsi} == "YES" ]]; then fi if [[ ${checkout_gdas} == "YES" ]]; then - checkout "gdas.cd" "https://github.com/NOAA-EMC/GDASApp.git" "ebd3111"; errs=$((errs + $?)) + checkout "gdas.cd" "https://github.com/NOAA-EMC/GDASApp.git" "a00b5da"; errs=$((errs + $?)) fi if [[ ${checkout_gsi} == "YES" || ${checkout_gdas} == "YES" ]]; then