Skip to content

Commit

Permalink
Fix the name of the TC tracker filenames in archive.py (#3030)
Browse files Browse the repository at this point in the history
This corrects the names of the product files created by the `tracker`
job when attempting to rename the experiment and push the file to the
`ARCDIR` within the `arch` job.
  • Loading branch information
DavidHuber-NOAA authored Oct 31, 2024
1 parent 1cc4078 commit 5a8a5aa
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ush/python/pygfs/task/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,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 in ["gdas", "gfs"]:

# Copy the cyclone track files and rename the experiments
Archive._rename_cyclone_expt(arch_dict)

# Collect datasets that need to be archived
# Each dataset represents one tarball

Expand Down Expand Up @@ -371,14 +366,14 @@ def _rename_cyclone_expt(arch_dict) -> None:

if run == "gfs":
in_track_file = (track_dir_in + "/avno.t" +
cycle_HH + "z.cycle.trackatcfunix")
cycle_HH + "z.cyclone.trackatcfunix")
in_track_p_file = (track_dir_in + "/avnop.t" +
cycle_HH + "z.cycle.trackatcfunixp")
cycle_HH + "z.cyclone.trackatcfunix")
elif run == "gdas":
in_track_file = (track_dir_in + "/gdas.t" +
cycle_HH + "z.cycle.trackatcfunix")
cycle_HH + "z.cyclone.trackatcfunix")
in_track_p_file = (track_dir_in + "/gdasp.t" +
cycle_HH + "z.cycle.trackatcfunixp")
cycle_HH + "z.cyclone.trackatcfunix")

if not os.path.isfile(in_track_file):
# Do not attempt to archive the outputs
Expand Down Expand Up @@ -416,7 +411,7 @@ def replace_string_from_to_file(filename_in, filename_out, search_str, replace_s
with open("/tmp/track_file", "w") as new_file:
new_file.writelines(out_lines)

shutil.move("tmp/track_file", filename_out)
shutil.move("/tmp/track_file", filename_out)

replace_string_from_to_file(in_track_file, out_track_file, "AVNO", pslot4)
replace_string_from_to_file(in_track_p_file, out_track_p_file, "AVNO", pslot4)
Expand Down

0 comments on commit 5a8a5aa

Please sign in to comment.