From dda46b78f53119b72c202e51496546114d4e5a7a Mon Sep 17 00:00:00 2001 From: AntonMFernando Date: Wed, 21 Aug 2024 14:41:36 -0400 Subject: [PATCH] update archive.py --- parm/archive/gefs_arcdir.yaml.j2 | 13 +++++++------ ush/python/pygfs/task/archive.py | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/parm/archive/gefs_arcdir.yaml.j2 b/parm/archive/gefs_arcdir.yaml.j2 index 454cc67ea4..f6800f1def 100644 --- a/parm/archive/gefs_arcdir.yaml.j2 +++ b/parm/archive/gefs_arcdir.yaml.j2 @@ -6,16 +6,17 @@ # Declare the GEFS_ARCH where atmos data will be sent {% set GEFS_ARCH = ROTDIR ~"/gefsarch" %} +{% set file_set = [] %} + # test files {% if RUN == "gefs" %} - {% set det_files = [] %} - {% if path_exists(ROTDIR ~ "/gefs.20210323/" ~ "12" - ~ "/ensstat/products/atmos/grib2/0p50") %} - {% do det_files.append([ROTDIR ~ "/gefs.20210323/" ~ "12" - ~ "/ensstat/products/atmos/grib2/0p50/gefs.t12z.mean.pres_.0p50.f000.grib2.idx", GEFS_ARCH]) %} + {% set atmos_files = [] %} + {% if path_exists(ROTDIR ~ "/gefs." ~ cycle_YMD ~ "12/ensstat/products/atmos/grib2/1p00") %} + {% do atmos_files.append([ROTDIR ~ "/gefs." ~ cycle_YMD ~ + ~ "12/ensstat/products/atmos/grib2/1p00/gefs.t12z.mean.pres_.0p50.f000.grib2.idx", GEFS_ARCH]) %} {% endif %} {% endif %} -{% set file_set = det_files %} +{% set file_set = atmos_files %} # Actually write the yaml mkdir: - "{{ GEFS_ARCH }}" diff --git a/ush/python/pygfs/task/archive.py b/ush/python/pygfs/task/archive.py index 25651ba778..55801c8208 100644 --- a/ush/python/pygfs/task/archive.py +++ b/ush/python/pygfs/task/archive.py @@ -71,8 +71,9 @@ def configure(self, arch_dict: Dict[str, Any]) -> (Dict[str, Any], List[Dict[str archive_parm = os.path.join(arch_dict.PARMgfs, "archive") - # Collect the dataset to archive locally - arcdir_j2yaml = os.path.join(archive_parm, "gefs_arcdir.yaml.j2") + if arch_dict.RUN == "gefs": + # Collect the dataset to archive locally + arcdir_j2yaml = os.path.join(archive_parm, "gefs_arcdir.yaml.j2") # Add the glob.glob function for capturing log filenames # TODO remove this kludge once log filenames are explicit