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 fetch job and update stage_ic to work with fetched ICs #3141

Open
wants to merge 45 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fdb996d
Stage_ic updates: GH2988
DavidGrumm-NOAA Nov 27, 2024
a1f03ec
Removed white space
DavidGrumm-NOAA Dec 10, 2024
17f7e6c
remove more whitespace
DavidGrumm-NOAA Dec 10, 2024
a9bd3e2
Incorporate fetch into GW
DavidGrumm-NOAA Dec 12, 2024
ba1a017
Merge branch 'develop' into stage_ic_2988
DavidGrumm-NOAA Dec 13, 2024
e624872
Fix whitespace
DavidGrumm-NOAA Dec 13, 2024
fa35c61
Reconcile divergent branches. Merge branch 'stage_ic_2988' of github.…
DavidGrumm-NOAA Dec 13, 2024
f21f96b
Move the fetch options to the run_options dict
DavidGrumm-NOAA Dec 16, 2024
20f2862
Additonal code to incorporate fetch, including modifying some of the …
DavidGrumm-NOAA Dec 18, 2024
5ca1531
Updated fetch code to use fetch directory FETCHDIR instead of ATARDIR…
DavidGrumm-NOAA Dec 18, 2024
09ce49c
Deleted ci/cases/pr/ATM_cold.yaml
DavidGrumm-NOAA Dec 19, 2024
c71b340
modifying stage_ic and fetch code to ensure that both function compat…
DavidGrumm-NOAA Dec 20, 2024
a6dade0
Moved setting of cycle_YMDH
DavidGrumm-NOAA Dec 23, 2024
a6a84d4
Updates for the fetch and yaml code, and keys.
DavidGrumm-NOAA Jan 4, 2025
8aead59
Corrected typo
DavidGrumm-NOAA Jan 7, 2025
ecc1b48
Add specification of fetch directory, corrrected name of yaml file.
DavidGrumm-NOAA Jan 10, 2025
dd645eb
Add DO_FETCH_HPSS setting to all non-hera files in workflow/hosts
DavidGrumm-NOAA Jan 10, 2025
4ca9d49
Change pass to raise an error
DavidGrumm-NOAA Jan 10, 2025
df88c29
whitespace repair
DavidGrumm-NOAA Jan 10, 2025
dd2b726
Merge branch 'develop' into stage_ic_2988
DavidGrumm-NOAA Jan 10, 2025
89c42ef
Add S2SW_cold fetch template
DavidHuber-NOAA Jan 13, 2025
d0e6f9b
Update ATM_cold.yaml.j2
DavidHuber-NOAA Jan 13, 2025
701093c
Add YMDH to fetch_yamls
DavidHuber-NOAA Jan 13, 2025
9433473
Add previous_cycle to fetch dict
DavidHuber-NOAA Jan 13, 2025
04f8da9
Check for missing files after untarring, add logging
DavidHuber-NOAA Jan 13, 2025
d1f2a00
Renamed fetch configs
DavidHuber-NOAA Jan 13, 2025
34ae4a8
Replace gefs config.fetch with link to gfs
DavidHuber-NOAA Jan 13, 2025
5c25f26
Update fetch directory
DavidHuber-NOAA Jan 13, 2025
35f2454
Restrict fetch cases to C48_S2SW and C48_ATM
DavidHuber-NOAA Jan 13, 2025
57d01ea
Merge pull request #1 from DavidHuber-NOAA/new_fetch_yaml
DavidGrumm-NOAA Jan 13, 2025
b929200
Cleanup of env files
DavidGrumm-NOAA Jan 17, 2025
8e3be40
Merge branch 'develop' into stage_ic_2988
DavidGrumm-NOAA Jan 17, 2025
23b2057
Renamed variable, removed unused code
DavidGrumm-NOAA Jan 17, 2025
bab00e5
need to pull changes from remote. Merge branch 'stage_ic_2988' of git…
DavidGrumm-NOAA Jan 21, 2025
ac86509
Merged in develop
DavidGrumm-NOAA Jan 23, 2025
60241bd
Merged in develop
DavidGrumm-NOAA Jan 23, 2025
00e3d62
Undo merge mangling
DavidGrumm-NOAA Jan 23, 2025
e7396bc
Adding higher resolutions back
DavidGrumm-NOAA Jan 23, 2025
eba7841
Removing higher resolutions (they will be added in a different PR)
DavidGrumm-NOAA Jan 23, 2025
8644449
Address additional reviewer comments
DavidGrumm-NOAA Jan 23, 2025
b7c919e
Remove some fetch options for now
DavidGrumm-NOAA Jan 23, 2025
aae3e6e
Address reviewer comments(.venv) [David.Grumm@hfe10 G_WF_2988]$ git a…
DavidGrumm-NOAA Jan 24, 2025
2eec8da
Remove extraneous new lines
DavidGrumm-NOAA Jan 24, 2025
939ce24
Merge branch 'develop' into stage_ic_2988
DavidHuber-NOAA Jan 24, 2025
7afe68c
Delete updated submodules to placate git pull. Merge branch 'stage_ic…
DavidGrumm-NOAA Jan 24, 2025
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
2 changes: 1 addition & 1 deletion ci/cases/yamls/gfs_defaults_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ base:
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
DO_TEST_MODE: "NO"
FETCHDIR: "/NCEPDEV/emc-global/1year/David.Grumm/test_data"
DO_FETCH_HPSS: "YES"
DO_FETCH_HPSS: "NO"
DavidHuber-NOAA marked this conversation as resolved.
Show resolved Hide resolved
DO_METP: "NO"

DavidHuber-NOAA marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 0 additions & 8 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,6 @@ export DO_VRFY_OCEANDA="@DO_VRFY_OCEANDA@" # Run SOCA Ocean and Seaice DA verif
export FHMAX_FITS=132
[[ "${FHMAX_FITS}" -gt "${FHMAX_GFS}" ]] && export FHMAX_FITS=${FHMAX_GFS}

# Fetch options
# TODO once tarballs are available for CI at other resolutions/start types, etc, remove this if block
if [[ "${APP}" == "ATM" || "${APP}" == "S2SW" ]] && \
[[ "${EXP_WARM_START}" == ".false." && "${CASE}" == "C48" ]]; then
export DO_FETCH_HPSS="@DO_FETCH_HPSS@" # pull from HPSS ## 123124 DG change to YES, or next
export DO_FETCH_LOCAL="NO" # pull from local
fi

DavidHuber-NOAA marked this conversation as resolved.
Show resolved Hide resolved
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
6 changes: 3 additions & 3 deletions parm/config/gfs/config.fetch
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

echo "BEGIN: config.fetch"

# Get task specific resources
source "${EXPDIR}/config.resources" fetch

# Determine start type
if [[ "${EXP_WARM_START}" == ".false." ]]; then
ic_type="cold"
Expand All @@ -13,7 +16,4 @@ fi

export FETCH_YAML_TMPL="${PARMgfs}/fetch/${NET}_${APP}_${ic_type}_${MODE}.yaml.j2"

# Get task specific resources
source "${EXPDIR}/config.resources" fetch

echo "END: config.fetch"
18 changes: 9 additions & 9 deletions parm/fetch/gfs_S2SW_cold_forecast-only.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{% set cycle_YMDH = current_cycle | to_YMDH %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set p_cycle_YMD = previous_cycle | to_YMD %}
{% set p_cycle_HH = previous_cycle | strftime("%H") %}
{% set prev_cycle_YMD = previous_cycle | to_YMD %}
{% set prev_cycle_HH = previous_cycle | strftime("%H") %}
# For cold starts, the ATM component is in the current cycle RUN.YYYYMMDD/HH
# For ocean/ice, some files are in the current cyle, some in the previous
# For waves, all files are in the previous cycle
# Previous cycles are always gdas (gdas.YYYYMMDD/HH)
{% set atm_dir = RUN + "." ~ cycle_YMD ~ "/" ~ cycle_HH ~ "/model/atmos/input" %}
{% set ocean_dir = RUN + "." ~ cycle_YMD ~ "/" ~ cycle_HH ~ "/model/ocean/restart" %}
{% set ice_dir = RUN + "." ~ cycle_YMD ~ "/" ~ cycle_HH ~ "/model/ice/restart" %}
{% set p_ocean_dir = "gdas." ~ p_cycle_YMD ~ "/" ~ p_cycle_HH ~ "/model/ocean/restart" %}
{% set p_ice_dir = "gdas." ~ p_cycle_YMD ~ "/" ~ p_cycle_HH ~ "/model/ice/restart" %}
{% set p_wave_dir = "gdas." ~ p_cycle_YMD ~ "/" ~ p_cycle_HH ~ "/model/wave/restart" %}
{% set prev_ocean_dir = "gdas." ~ prev_cycle_YMD ~ "/" ~ prev_cycle_HH ~ "/model/ocean/restart" %}
{% set prev_ice_dir = "gdas." ~ prev_cycle_YMD ~ "/" ~ prev_cycle_HH ~ "/model/ice/restart" %}
{% set prev_wave_dir = "gdas." ~ prev_cycle_YMD ~ "/" ~ prev_cycle_HH ~ "/model/wave/restart" %}
{% set restart_prefix = cycle_YMD ~ "." ~ cycle_HH ~ "0000" %}
untar:
tarball : "{{ FETCHDIR }}/{{ cycle_YMDH }}/s2sw_cold.tar"
Expand All @@ -27,11 +27,11 @@ untar:
{% endfor %} # ftype
# Ocean
- {{ocean_dir}}/{{restart_prefix}}.MOM.res.nc
- {{p_ocean_dir}}/{{restart_prefix}}.MOM.res.nc
- {{prev_ocean_dir}}/{{restart_prefix}}.MOM.res.nc
# Ice
- {{ice_dir}}/{{restart_prefix}}.cice_model.res.nc
- {{p_ice_dir}}/{{restart_prefix}}.cice_model.res.nc
- {{prev_ice_dir}}/{{restart_prefix}}.cice_model.res.nc
# Wave
- {{p_wave_dir}}/{{restart_prefix}}.restart.ww3
- {{p_wave_dir}}/{{restart_prefix}}.restart.{{waveGRD}}
- {{prev_wave_dir}}/{{restart_prefix}}.restart.ww3
- {{prev_wave_dir}}/{{restart_prefix}}.restart.{{waveGRD}}
destination: "{{ DATAROOT }}"
40 changes: 20 additions & 20 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,50 @@ def _is_this_a_gdas_task(run, task_name):
raise TypeError(f'{task_name} must be part of the "enkfgdas" cycle and not {run}')

# Specific Tasks begin here
def stage_ic(self):

dependencies = None
if self.options['do_fetch_hpss'] or self.options['do_fetch_local']:
deps = []
dep_dict = {
'type': 'task', 'name': f'{self.run}_fetch',
}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)
def fetch(self):

cycledef = 'gdas_half' if self.run in ['gdas', 'enkfgdas'] else self.run

resources = self.get_resource('stage_ic')
task_name = f'{self.run}_stage_ic'
resources = self.get_resource('fetch')
task_name = f'{self.run}_fetch'
task_dict = {'task_name': task_name,
'resources': resources,
'envars': self.envars,
'cycledef': cycledef,
'command': f'{self.HOMEgfs}/jobs/rocoto/stage_ic.sh',
'command': f'{self.HOMEgfs}/jobs/rocoto/fetch.sh',
'job_name': f'{self.pslot}_{task_name}_@H',
'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',
'maxtries': '&MAXTRIES;',
'dependency': dependencies
'maxtries': '&MAXTRIES;'
}

task = rocoto.create_task(task_dict)

return task

def fetch(self):
def stage_ic(self):

dependencies = None
if self.options['do_fetch_hpss'] or self.options['do_fetch_local']:
deps = []
dep_dict = {
'type': 'task', 'name': f'{self.run}_fetch',
}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

cycledef = 'gdas_half' if self.run in ['gdas', 'enkfgdas'] else self.run

resources = self.get_resource('fetch')
task_name = f'{self.run}_fetch'
resources = self.get_resource('stage_ic')
task_name = f'{self.run}_stage_ic'
task_dict = {'task_name': task_name,
'resources': resources,
'envars': self.envars,
'cycledef': cycledef,
'command': f'{self.HOMEgfs}/jobs/rocoto/fetch.sh',
'command': f'{self.HOMEgfs}/jobs/rocoto/stage_ic.sh',
'job_name': f'{self.pslot}_{task_name}_@H',
'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',
'maxtries': '&MAXTRIES;'
'maxtries': '&MAXTRIES;',
'dependency': dependencies
}

task = rocoto.create_task(task_dict)
Expand Down