From 9e43bda87062cc4e83081a06ea4af32c6a8588be Mon Sep 17 00:00:00 2001 From: AntonMFernando Date: Tue, 13 Aug 2024 16:33:22 -0400 Subject: [PATCH] test1 --- parm/archive/gefs_arcdir.yaml.j2 | 22 ++++++++++++++++++++++ ush/python/pygfs/task/archive.py | 5 +---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 parm/archive/gefs_arcdir.yaml.j2 diff --git a/parm/archive/gefs_arcdir.yaml.j2 b/parm/archive/gefs_arcdir.yaml.j2 new file mode 100644 index 0000000000..e2f4dcebb8 --- /dev/null +++ b/parm/archive/gefs_arcdir.yaml.j2 @@ -0,0 +1,22 @@ +{% set cycle_HH = current_cycle | strftime("%H") %} +{% set cycle_YMDH = current_cycle | to_YMDH %} +{% set cycle_YMD = current_cycle | to_YMD %} +{% set head = RUN + ".t" + cycle_HH + "z." %} + +# Declare the GEFS_ARCH where atmos data will be sent +{% set GEFS_ARCH = ROTDIR ~ RUN ~"/arch" %} + +# test files +{% if RUN == "gefs" %} + {% set det_files = [] %} + {% if path_exists(ROTDIR ~ RUN ~ "." ~ cycle_YMD ~ cycle_HH + ~ "/ensstat/products/atmos/grib2/0p50") %} + {% do det_files.append([ROTDIR ~ RUN ~ "." ~ cycle_YMD ~ cycle_HH + ~ "/ensstat/products/atmos/grib2/0p50/gefs.t12z.mean.pres_.0p50.f006.grib2"]) %} + {% endif %} + +# Actually write the yaml +mkdir: + - "{{ GEFS_ARCH }}" +copy: + - {{ det_files }} diff --git a/ush/python/pygfs/task/archive.py b/ush/python/pygfs/task/archive.py index 953a856192..25651ba778 100644 --- a/ush/python/pygfs/task/archive.py +++ b/ush/python/pygfs/task/archive.py @@ -63,9 +63,6 @@ def configure(self, arch_dict: Dict[str, Any]) -> (Dict[str, Any], List[Dict[str if not os.path.isdir(arch_dict.ROTDIR): raise FileNotFoundError(f"FATAL ERROR: The ROTDIR ({arch_dict.ROTDIR}) does not exist!") - if arch_dict.RUN == "gefs": - raise NotImplementedError("FATAL ERROR: Archiving is not yet set up for GEFS runs") - if arch_dict.RUN in ["gdas", "gfs"]: # Copy the cyclone track files and rename the experiments @@ -75,7 +72,7 @@ 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, "arcdir.yaml.j2") + 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