Skip to content
Merged
Changes from 3 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
19 changes: 13 additions & 6 deletions scripts/exglobal_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ def main():
# Instantiate the Archive object
archive = Archive(config)

# update these keys to be 3 digits if they are part of archive.task_config.keys
if {'OCNRES', 'ICERES'} <= archive.task_config.keys():
Comment thread
aerorahul marked this conversation as resolved.
Outdated
for key in ['OCNRES', 'ICERES']:
try:
archive.task_config[key] = f"{archive.task_config[key]:03d}"
except KeyError as ee:
logger.info(f"key ({key}) not found in archive.task_config!")
Comment thread
aerorahul marked this conversation as resolved.
Outdated

# Pull out all the configuration keys needed to run the rest of archive steps
keys = ['ATARDIR', 'current_cycle', 'FHMIN', 'FHMAX', 'FHOUT', 'RUN', 'PDY',
'DO_VERFRAD', 'DO_VMINMON', 'DO_VERFOZN', 'DO_ICE', 'DO_PREP_OBS_AERO',
Expand All @@ -37,16 +45,15 @@ def main():

archive_dict = AttrDict()
for key in keys:
archive_dict[key] = archive.task_config.get(key)
if archive_dict[key] is None:
print(f"Warning: key ({key}) not found in task_config!")
try:
archive_dict[key] = archive.task_config[key]
except KeyError as ee:
logger.warning(f"WARNING: key ({key}) not found in archive.task_config!")

# Also import all COMIN* and COMOUT* directory and template variables
for key in archive.task_config.keys():
if key.startswith("COM_") or key.startswith("COMIN_") or key.startswith("COMOUT_"):
if key.startswith(("COM_", "COMIN_", "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!")

with chdir(config.ROTDIR):

Expand Down