Skip to content

Commit

Permalink
Updates for the fetch and yaml code, and keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGrumm-NOAA committed Jan 4, 2025
1 parent a6dade0 commit a6a84d4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
6 changes: 3 additions & 3 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if [[ "${PDY}${cyc}" -ge "2019092100" && "${PDY}${cyc}" -le "2019110700" ]]; the
fi
export ARCDIR="${NOSCRUB}/archive/${PSLOT}"
export ATARDIR="@ATARDIR@"
export FETCHDIR="@FETCHDIR@" # DG adding 121724
export FETCHDIR="@FETCHDIR@"

# Commonly defined parameters in JJOBS
export envir=${envir:-"prod"}
Expand Down Expand Up @@ -476,8 +476,8 @@ export FHMAX_FITS=132
[[ "${FHMAX_FITS}" -gt "${FHMAX_GFS}" ]] && export FHMAX_FITS=${FHMAX_GFS}

# Fetch options
export DO_FETCH_HPSS="NO" # pull from HPSS
export DO_FETCH_LOCAL="NO" # pull from local
export DO_FETCH_HPSS="NO" # pull from HPSS ## 123124 DG change to YES, or next
export DO_FETCH_LOCAL="YES" # pull from local
if [[ ${DO_FETCH_HPSS} = "YES" ]] && [[ ${DO_FETCH_LOCAL} = "YES" ]]; then
echo "Both HPSS and local fetch selected. Please choose one or the other."
exit 3
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gfs/config.fetch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

echo "BEGIN: config.fetch"

export FETCH_YAML_TMPL="${PARMgfs}/fetch/C48_cold.yaml.j2"
export FETCH_YAML_TMPL="${PARMgfs}/fetch/ATM_cold.yaml.j2"

# Get task specific resources
source "${EXPDIR}/config.resources" fetch
Expand Down
9 changes: 1 addition & 8 deletions scripts/exglobal_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,14 @@ def main():
fetch = Fetch(config)

# Pull out all the configuration keys needed to run the fetch step
keys = ['current_cycle', 'RUN', 'PDY', 'PARMgfs', 'PSLOT', 'ROTDIR', 'fetch_yaml', 'FETCHDIR', 'ntiles', 'DATAROOT']
keys = ['current_cycle', 'RUN', 'PDY', 'PARMgfs', 'PSLOT', 'ROTDIR', 'FETCH_YAML_DICT', 'FETCHDIR', 'ntiles', 'DATAROOT']

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

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

# Determine which archives to retrieve from HPSS
# Read the input YAML file to get the list of tarballs on tape
fetchdir_set = fetch.configure(fetch_dict)
Expand Down
3 changes: 1 addition & 2 deletions ush/python/pygfs/task/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def configure(self, fetch_dict: Dict[str, Any]):
"""
self.hsi = Hsi()

fetch_yaml = fetch_dict.fetch_yaml
fetch_yaml = fetch_dict.FETCH_YAML_TMPL
fetch_parm = os.path.join(fetch_dict.PARMgfs, "fetch")

parsed_fetch = parse_j2yaml(os.path.join(fetch_parm, fetch_yaml),
Expand Down Expand Up @@ -87,7 +87,6 @@ def execute_pull_data(self, fetchdir_set: Dict[str, Any]) -> None:
if on_hpss is True: # htar all files in fnames
htar_obj = Htar.Htar()
htar_obj.xvf(tarball, f_names)

else: # tar all files in fnames
pass # TODO
# with tarfile.open(dest, "w") as tar:
Expand Down
2 changes: 1 addition & 1 deletion workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def stage_ic(self):
if self.options['do_fetch_hpss'] or self.options['do_fetch_local']:
deps = []
dep_dict = {
'type': 'task', 'name': f'fetch',
'type': 'task', 'name': f'{self.run}_fetch',
}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)
Expand Down
2 changes: 1 addition & 1 deletion workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Tasks:
SERVICE_TASKS = ['arch', 'earc', 'stage_ic', 'fetch', 'cleanup']
VALID_TASKS = ['aerosol_init', 'stage_ic',
VALID_TASKS = ['aerosol_init', 'stage_ic', 'fetch',
'prep', 'anal', 'sfcanl', 'analcalc', 'analdiag', 'arch', "cleanup",
'prepatmiodaobs', 'atmanlinit', 'atmanlvar', 'atmanlfv3inc', 'atmanlfinal',
'prepoceanobs',
Expand Down

0 comments on commit a6a84d4

Please sign in to comment.