Skip to content

Commit

Permalink
Merge branch 'develop' into bug/NCO-COM
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonMFernando-NOAA authored Feb 14, 2025
2 parents 2b73e50 + 0da3832 commit eb3f5f1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion parm/archive/gdas.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions parm/archive/gfs_arcdir.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion parm/archive/gfsa.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions ush/python/pygfs/task/aero_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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))
Expand Down
5 changes: 5 additions & 0 deletions ush/python/pygfs/task/snow_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def prepare_IMS(self) -> None:
prep_ims_config = parse_j2yaml(self.task_config.IMS_OBS_LIST, localconf)
logger.debug(f"{self.task_config.IMS_OBS_LIST}:\n{pformat(prep_ims_config)}")

asc_file = os.path.join(localconf.COMIN_OBS, f"{localconf.OPREFIX}imssnow96.asc")
if not os.path.isfile(asc_file):
logger.warning(f"WARNING: Obs files are missing. Will not execute CALCFIMSEXE")
return

# copy the IMS obs files from COMIN_OBS to DATA/obs
logger.info("Copying IMS obs for CALCFIMSEXE")
FileHandler(prep_ims_config.calcfims).sync()
Expand Down
5 changes: 5 additions & 0 deletions ush/python/pygfs/task/snowens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ def prepare_IMS(self) -> None:
prep_ims_config = parse_j2yaml(self.task_config.IMS_OBS_LIST, localconf)
logger.debug(f"{self.task_config.IMS_OBS_LIST}:\n{pformat(prep_ims_config)}")

asc_file = os.path.join(localconf.COMIN_OBS, f"{localconf.OPREFIX}imssnow96.asc")
if not os.path.isfile(asc_file):
logger.warning(f"WARNING: Obs files are missing. Will not execute CALCFIMSEXE")
return

# copy the IMS obs files from COMIN_OBS to DATA/obs
logger.info("Copying IMS obs for CALCFIMSEXE")
FileHandler(prep_ims_config.calcfims).sync()
Expand Down

0 comments on commit eb3f5f1

Please sign in to comment.