Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the name of the TC tracker filenames in archive.py #3030

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading