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

Add an archive task to GEFS system to archive files locally #2816

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
9306bb5
remove error message from archive.py
AntonMFernando-NOAA Aug 12, 2024
6e28237
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 12, 2024
c1d46bf
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 13, 2024
9e43bda
test1
AntonMFernando-NOAA Aug 13, 2024
710c387
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 13, 2024
2f6b9e1
updated gefes_tasks.py
AntonMFernando-NOAA Aug 14, 2024
ec5eeed
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 14, 2024
f94fc05
update gefs_arcdir.yaml.j2
AntonMFernando-NOAA Aug 16, 2024
ef4d37c
updated config.arch
AntonMFernando-NOAA Aug 16, 2024
1471b19
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 20, 2024
84ffee5
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 21, 2024
dda46b7
update archive.py
AntonMFernando-NOAA Aug 21, 2024
ba92907
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 21, 2024
58fdd37
updated JGLOBAL_ARCHIVE and gefs_arch.yaml.j2
AntonMFernando-NOAA Aug 22, 2024
c50cf8b
updated config.com
AntonMFernando-NOAA Aug 22, 2024
652e779
updated JGLOBAL_ARCHIVE
AntonMFernando-NOAA Aug 22, 2024
99df46e
updated gefs_arcdir.yaml.j2
AntonMFernando-NOAA Aug 22, 2024
f4bbcea
updated gefs_arch.yaml.j2
AntonMFernando-NOAA Aug 22, 2024
13c4e56
modified: parm/archive/gefs_arcdir.yaml.j2
AntonMFernando-NOAA Aug 22, 2024
7746024
updated gefs_Arcdir.yaml.j2
AntonMFernando-NOAA Aug 22, 2024
fdd4937
updated gefs_Arch.yaml.j2
AntonMFernando-NOAA Aug 22, 2024
484cfb5
updated gefs_arc.yamlj2
AntonMFernando-NOAA Aug 23, 2024
522c78a
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 23, 2024
f4617e2
Merge branch 'develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 23, 2024
4940b05
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 27, 2024
bb0cc1d
modified archive.py
AntonMFernando-NOAA Aug 27, 2024
40a2f55
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 27, 2024
bdc5851
modify exglobal_archive.py
AntonMFernando-NOAA Aug 27, 2024
5906112
modified exglobal_archive.py
AntonMFernando-NOAA Aug 27, 2024
2dbcc80
Remove config.arch
AntonMFernando-NOAA Aug 27, 2024
4bfcd62
updated archive.py
AntonMFernando-NOAA Aug 27, 2024
deb38d2
modified JGLOBAL_ARCHIVE
AntonMFernando-NOAA Aug 27, 2024
68d8452
modified gefs_arcdir.yaml.j2
AntonMFernando-NOAA Aug 27, 2024
a293160
modified JGLOBAL_ARCHIVE
AntonMFernando-NOAA Aug 27, 2024
773d4ba
modified config.com parm/gfs
AntonMFernando-NOAA Aug 27, 2024
7d68226
renamed archdir.yaml.j2
AntonMFernando-NOAA Aug 27, 2024
0144216
modified exglobal_archive.py
AntonMFernando-NOAA Aug 27, 2024
d7f89ca
updated gefs_archdir.yaml.j2
AntonMFernando-NOAA Aug 28, 2024
c117574
updated gefs_archdir.yaml.j2
AntonMFernando-NOAA Aug 28, 2024
b5607e1
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 28, 2024
ed1913e
modified gefs_arcdir.yaml.j2
AntonMFernando-NOAA Aug 29, 2024
b2db1cf
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 29, 2024
36ca810
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 29, 2024
39b56f5
modified JGLOBAL_ARCHIVE
AntonMFernando-NOAA Aug 29, 2024
3b2b6c7
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 29, 2024
49f39a2
updated exglobal_archive.py
AntonMFernando-NOAA Aug 29, 2024
4cfdaeb
modified exglobal_Archive.py
AntonMFernando-NOAA Aug 29, 2024
608ebd7
updated archive.py
AntonMFernando-NOAA Aug 29, 2024
c8fd8d2
modified exglobal_archive.py
AntonMFernando-NOAA Aug 29, 2024
e324bb5
modified exglobal_archive.py
AntonMFernando-NOAA Aug 29, 2024
dac46dd
modified exglobal_archive.py
AntonMFernando-NOAA Aug 29, 2024
3d7e366
modified exglobal_archive.py
AntonMFernando-NOAA Aug 29, 2024
fb0a7f5
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 29, 2024
37baf68
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 30, 2024
a3d0fe9
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 30, 2024
7cf40fa
modified exglobal_archive.py
AntonMFernando-NOAA Aug 30, 2024
508f60f
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 30, 2024
e938b58
modified exglobal_archive.py
AntonMFernando-NOAA Aug 30, 2024
1bb9f13
modified exglobal_archive.py
AntonMFernando-NOAA Aug 30, 2024
28f4737
modified exglobal_archive.py
AntonMFernando-NOAA Aug 30, 2024
42d8d04
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Aug 30, 2024
e2f2c54
modified exglobal_Archive.py
AntonMFernando-NOAA Aug 30, 2024
559bf88
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Aug 30, 2024
2be37d9
modified exglobal_archive.py
AntonMFernando-NOAA Aug 30, 2024
033721e
modified exglobal_archive.py
AntonMFernando-NOAA Aug 30, 2024
29a2423
modified exglobal_archive.py
AntonMFernando-NOAA Sep 4, 2024
161db4f
modify JGLOBAL_ARCHIVE
AntonMFernando-NOAA Sep 4, 2024
ea2166f
modify gefs_arcdir.yaml.j2
AntonMFernando-NOAA Sep 4, 2024
f075b01
updated exglobal_archive.py
AntonMFernando-NOAA Sep 4, 2024
c360e7c
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Sep 4, 2024
1538f94
modified exglobal_archive.py
AntonMFernando-NOAA Sep 4, 2024
6c44a8f
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Sep 4, 2024
196cd1b
modify gefs_arcdir.yaml.j2
AntonMFernando-NOAA Sep 4, 2024
b40fdab
modifed JGLOBAL_ARCHIVE
AntonMFernando-NOAA Sep 4, 2024
9119a3c
modified JGLOBAL_ARCHIVE
AntonMFernando-NOAA Sep 4, 2024
a71fcbb
removed arch_test.sh
AntonMFernando-NOAA Sep 4, 2024
55db0a2
modified exgdas_enkf_earc.py
AntonMFernando-NOAA Sep 5, 2024
283e57f
modified exdas_enkf_earc.py
AntonMFernando-NOAA Sep 5, 2024
c3704a5
modified config.base
AntonMFernando-NOAA Sep 6, 2024
a4550a6
modified config.base
AntonMFernando-NOAA Sep 6, 2024
8f26607
modified config.base
AntonMFernando-NOAA Sep 6, 2024
72ae42c
modified config.base and parm/config/gefs/yaml/defaults.yaml
AntonMFernando-NOAA Sep 6, 2024
5b971b8
modified config.base
AntonMFernando-NOAA Sep 6, 2024
6a00c5d
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Sep 6, 2024
7fad1f1
deleted gefs.yaml
AntonMFernando-NOAA Sep 6, 2024
48b1eae
modified parm/config/gefs/yaml/defaults.yaml
AntonMFernando-NOAA Sep 6, 2024
1680191
modifed parm/config/gefs/yaml/defaults.yaml
AntonMFernando-NOAA Sep 6, 2024
08e276a
Merge branch 'NOAA-EMC:develop' into feature/gefs-arch
AntonMFernando-NOAA Sep 6, 2024
abee604
added a test to archive.py
AntonMFernando-NOAA Sep 6, 2024
a1a9bb1
Merge branch 'feature/gefs-arch' of https://github.com/AntonMFernando…
AntonMFernando-NOAA Sep 6, 2024
b82e1d5
modified exglobal_Archive.py
AntonMFernando-NOAA Sep 6, 2024
692de26
modified the warning message exgdas_enkf_earc.py
AntonMFernando-NOAA Sep 6, 2024
18bc470
modified gefs_arcdir.yaml.j2
AntonMFernando-NOAA Sep 6, 2024
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
3 changes: 0 additions & 3 deletions jobs/rocoto/arch_test.sh

This file was deleted.

38 changes: 38 additions & 0 deletions parm/archive/gefs_arcdir.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% 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 ~ "/gefsarch" %}

{% set file_set = [] %}

{% set tmpl_dict = ({ '${ROTDIR}':ROTDIR,
'${RUN}':RUN,
'${YMD}':cycle_YMD,
'${HH}':cycle_HH,
'${GRID}': '1p00',
'${MEMDIR}': 'ensstat' }) %}

{% set COMIN_ATMOS_ENSSTAT_1p00 = COM_ATMOS_GRIB_GRID_TMPL | replace_tmpl(tmpl_dict) %}

# Select ensstat files to copy to the arcdir
{% if RUN == "gefs" %}
{% set ensstat_files = [] %}
{% if path_exists(COMIN_ATMOS_ENSSTAT_1p00) %}
{% for fhr in range(FHMIN_GFS, FHMAX_GFS + FHOUT_GFS, FHOUT_GFS) %}
{% do ensstat_files.append([COMIN_ATMOS_ENSSTAT_1p00 ~ "/" ~ head ~ "mean.pres_." ~
"1p00" ~ ".f" ~ '%03d'|format(fhr) ~ ".grib2",
GEFS_ARCH]) %}
{% endfor %}
{% endif %}
{% endif %}
{% set file_set = ensstat_files %}
# Actually write the yaml
mkdir:
- "{{ GEFS_ARCH }}"
copy:
{% for source_dest_pair in file_set %}
- {{ source_dest_pair }}
{% endfor %}
File renamed without changes.
2 changes: 2 additions & 0 deletions parm/config/gefs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ base:
FCST_BREAKPOINTS: "48"
REPLAY_ICS: "NO"
USE_OCN_PERTURB_FILES: "false"
HPSSARCH: "NO"
LOCALARCH: "NO"
6 changes: 4 additions & 2 deletions scripts/exgdas_enkf_earc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ def main():
'DOHYBVAR', 'DOIAU_ENKF', 'IAU_OFFSET', 'DOIAU',
'DO_CALC_INCREMENT', 'assim_freq', 'ARCH_CYC',
'ARCH_WARMICFREQ', 'ARCH_FCSTICFREQ',
'IAUFHRS_ENKF']
'IAUFHRS_ENKF', 'NET']

archive_dict = AttrDict()
for key in keys:
archive_dict[key] = archive.task_config[key]
archive_dict[key] = archive.task_config.get(key)
if archive_dict[key] is None:
print(f"Warning: key ({key}) not found in task_config!")

# Also import all COMIN* directory and template variables
for key in archive.task_config.keys():
Expand Down
12 changes: 8 additions & 4 deletions scripts/exglobal_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@ def main():
'restart_interval_gdas', 'restart_interval_gfs',
'AERO_ANL_RUN', 'AERO_FCST_RUN', 'DOIBP_WAV', 'DO_JEDIOCNVAR',
'NMEM_ENS', 'DO_JEDIATMVAR', 'DO_VRFY_OCEANDA', 'FHMAX_FITS',
'IAUFHRS', 'DO_FIT2OBS']
'IAUFHRS', 'DO_FIT2OBS', 'NET']
AntonMFernando-NOAA marked this conversation as resolved.
Show resolved Hide resolved

archive_dict = AttrDict()
for key in keys:
archive_dict[key] = archive.task_config[key]
archive_dict[key] = archive.task_config.get(key)
if archive_dict[key] is None:
print(f"Warning: key ({key}) not found in task_config!")

# Also import all COMIN* and COMOUT* directory and template variables
for key in archive.task_config.keys():
if key.startswith("COMIN_") or key.startswith("COMOUT_"):
archive_dict[key] = archive.task_config[key]
if key.startswith("COM_") or key.startswith("COMIN_") or key.startswith("COMOUT_"):
archive_dict[key] = archive.task_config.get(key)
if archive_dict[key] is None:
print(f"Warning: key ({key}) not found in task_config!")

cwd = os.getcwd()

Expand Down
8 changes: 4 additions & 4 deletions ush/python/pygfs/task/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, f"{arch_dict.NET}_arcdir.yaml.j2")

# Add the glob.glob function for capturing log filenames
# TODO remove this kludge once log filenames are explicit
Expand Down Expand Up @@ -117,6 +114,9 @@ def configure(self, arch_dict: Dict[str, Any]) -> (Dict[str, Any], List[Dict[str
self.tar_cmd = ""
return arcdir_set, []

if arch_dict.NET == "gefs":
raise NotImplementedError("GEFS archiving is not yet implemented!")

master_yaml = "master_" + arch_dict.RUN + ".yaml.j2"

parsed_sets = parse_j2yaml(os.path.join(archive_parm, master_yaml),
Expand Down
2 changes: 1 addition & 1 deletion workflow/rocoto/gefs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def arch(self):
'envars': self.envars,
'cycledef': 'gefs',
'dependency': dependencies,
'command': f'{self.HOMEgfs}/jobs/rocoto/arch_test.sh',
'command': f'{self.HOMEgfs}/jobs/rocoto/arch.sh',
'job_name': f'{self.pslot}_{task_name}_@H',
'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',
'maxtries': '&MAXTRIES;'
Expand Down
Loading