From 4cc38e845a7dedae914e8de570033837f4c0d714 Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Fri, 14 Feb 2025 16:30:58 +0000 Subject: [PATCH 1/2] fix aerostat --- parm/archive/gdas.yaml.j2 | 2 +- parm/archive/gfs_arcdir.yaml.j2 | 4 ++-- parm/archive/gfsa.yaml.j2 | 2 +- ush/python/pygfs/task/aero_analysis.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/parm/archive/gdas.yaml.j2 b/parm/archive/gdas.yaml.j2 index f3db8b98f1a..1a0e9725f06 100644 --- a/parm/archive/gdas.yaml.j2 +++ b/parm/archive/gdas.yaml.j2 @@ -65,7 +65,7 @@ gdas: - "{{ COMIN_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ head }}radstat" {% endif %} {% if DO_AERO_ANL %} - - "{{ COMIN_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat" + - "{{ COMIN_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat.tgz" {% endif %} {% if DO_PREP_OBS_AERO %} - "{{ COMIN_OBS | relpath(ROTDIR) }}/{{ head }}aeroobs" diff --git a/parm/archive/gfs_arcdir.yaml.j2 b/parm/archive/gfs_arcdir.yaml.j2 index 98803b473c0..a4e99c9d0a0 100644 --- a/parm/archive/gfs_arcdir.yaml.j2 +++ b/parm/archive/gfs_arcdir.yaml.j2 @@ -51,8 +51,8 @@ {% endif %} {% if DO_AERO_ANL %} - {% do det_anl_files.append([COMIN_CHEM_ANALYSIS ~ "/" ~ head ~ "aerostat", - ARCDIR ~ "/aerostat." ~ RUN ~ "." ~ cycle_YMDH ]) %} + {% do det_anl_files.append([COMIN_CHEM_ANALYSIS ~ "/" ~ head ~ "aerostat.tgz", + ARCDIR ~ "/aerostat." ~ RUN ~ "." ~ cycle_YMDH ~ ".tgz"]) %} {% endif %} {% if DO_PREP_OBS_AERO == True %} diff --git a/parm/archive/gfsa.yaml.j2 b/parm/archive/gfsa.yaml.j2 index a7cfaafcd58..db03d642c0a 100644 --- a/parm/archive/gfsa.yaml.j2 +++ b/parm/archive/gfsa.yaml.j2 @@ -39,7 +39,7 @@ gfsa: - "{{ COMIN_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ head }}gsistat" {% endif %} {% if DO_AERO_ANL %} - - "{{ COMIN_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat" + - "{{ COMIN_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat.tgz" {% endif %} {% if DO_PREP_OBS_AERO %} - "{{ COMIN_OBS | relpath(ROTDIR) }}/{{ head }}aeroobs" diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index de9360a9acc..b0d6bafec54 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -167,10 +167,10 @@ def finalize(self) -> None: # ---- tar up diags # path of output tar statfile logger.info('Preparing observation space diagnostics for archiving') - aerostat = os.path.join(self.task_config.COMOUT_CHEM_ANALYSIS, f"{self.task_config['APREFIX']}aerostat") + aerostat = os.path.join(self.task_config.COMOUT_CHEM_ANALYSIS, f"{self.task_config['APREFIX']}aerostat.tgz") # get list of diag files to put in tarball - diags = glob.glob(os.path.join(self.task_config['DATA'], 'diags', 'diag*nc4')) + diags = glob.glob(os.path.join(self.task_config['DATA'], 'diags', 'diag*nc')) # gzip the files first for diagfile in diags: From 17acd40e42551f249955f30106bb88a81cf4a8be Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Fri, 14 Feb 2025 19:30:47 +0000 Subject: [PATCH 2/2] gzip --- ush/python/pygfs/task/aero_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index b0d6bafec54..b88ee6e4802 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -191,7 +191,7 @@ def finalize(self) -> None: FileHandler(aero_var_final_list).sync() # open tar file for writing - with tarfile.open(aerostat, "w") as archive: + with tarfile.open(aerostat, "w|gz") as archive: for diagfile in diags: diaggzip = f"{diagfile}.gz" archive.add(diaggzip, arcname=os.path.basename(diaggzip))