Skip to content

Commit

Permalink
Update ocean post-processing triggers (NOAA-EMC#2784)
Browse files Browse the repository at this point in the history
This PR:
- replaces `check_netcdf.sh` checker for ocean post-processing with with
ocean output at the next forecast hour or finishing of the forecast job
for ocean prod
- removes no longer needed `ush/check_netcdf.sh`
  • Loading branch information
aerorahul authored Aug 2, 2024
1 parent aa2af1c commit 4987704
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 29 deletions.
15 changes: 0 additions & 15 deletions ush/check_netcdf.sh

This file was deleted.

10 changes: 6 additions & 4 deletions workflow/rocoto/gefs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _atmosoceaniceprod(self, component: str):
'history_file_tmpl': f'{self.run}[email protected]#fhr#'},
'ocean': {'config': 'oceanice_products',
'history_path_tmpl': 'COM_OCEAN_HISTORY_TMPL',
'history_file_tmpl': f'{self.run}.ocean.t@Hz.{fhout_ocn_gfs}hr_avg.f#fhr#.nc'},
'history_file_tmpl': f'{self.run}.ocean.t@Hz.{fhout_ocn_gfs}hr_avg.f#fhr_next#.nc'},
'ice': {'config': 'oceanice_products',
'history_path_tmpl': 'COM_ICE_HISTORY_TMPL',
'history_file_tmpl': f'{self.run}.ice.t@Hz.{fhout_ice_gfs}hr_avg.f#fhr#.nc'}}
Expand All @@ -236,10 +236,9 @@ def _atmosoceaniceprod(self, component: str):
if component in ['ocean']:
dep_dict = {'type': 'data', 'data': data, 'age': 120}
deps.append(rocoto.add_dependency(dep_dict))
command = f"{self.HOMEgfs}/ush/check_netcdf.sh {history_path}/{history_file_tmpl}"
dep_dict = {'type': 'sh', 'command': command}
dep_dict = {'type': 'task', 'name': 'fcst_mem#member#'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps, dep_condition='and')
dependencies = rocoto.create_dependency(dep=deps, dep_condition='or')
elif component in ['ice']:
command = f"{self.HOMEgfs}/ush/check_ice_netcdf.sh @Y @m @d @H #fhr# &ROTDIR; #member# {fhout_ice_gfs}"
dep_dict = {'type': 'sh', 'command': command}
Expand Down Expand Up @@ -281,6 +280,9 @@ def _atmosoceaniceprod(self, component: str):
fhrs.remove(0)

fhr_var_dict = {'fhr': ' '.join([f"{fhr:03d}" for fhr in fhrs])}
if component in ['ocean']:
fhrs_next = fhrs[1:] + [fhrs[-1] + (fhrs[-1] - fhrs[-2])]
fhr_var_dict['fhr_next'] = ' '.join([f"{fhr:03d}" for fhr in fhrs_next])

fhr_metatask_dict = {'task_name': f'{component}_prod_#member#',
'task_dict': task_dict,
Expand Down
18 changes: 8 additions & 10 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ def _atmosoceaniceprod(self, component: str):
'history_file_tmpl': f'{self.run}[email protected]#fhr#'},
'ocean': {'config': 'oceanice_products',
'history_path_tmpl': 'COM_OCEAN_HISTORY_TMPL',
'history_file_tmpl': f'{self.run}[email protected]_avg.f#fhr#.nc'},
'history_file_tmpl': f'{self.run}[email protected]_avg.f#fhr_next#.nc'},
'ice': {'config': 'oceanice_products',
'history_path_tmpl': 'COM_ICE_HISTORY_TMPL',
'history_file_tmpl': f'{self.run}[email protected]_avg.f#fhr#.nc'}}
Expand All @@ -1104,13 +1104,9 @@ def _atmosoceaniceprod(self, component: str):
data = f'{history_path}/{history_file_tmpl}'
dep_dict = {'type': 'data', 'data': data, 'age': 120}
deps.append(rocoto.add_dependency(dep_dict))
if component in ['ocean']:
command = f"{self.HOMEgfs}/ush/check_netcdf.sh {history_path}/{history_file_tmpl}"
dep_dict = {'type': 'sh', 'command': command}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps, dep_condition='and')
else:
dependencies = rocoto.create_dependency(dep=deps)
dep_dict = {'type': 'task', 'name': f'{self.cdump}fcst'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps, dep_condition='or')

cycledef = 'gdas_half,gdas' if self.run in ['gdas'] else self.run
resources = self.get_resource(component_dict['config'])
Expand All @@ -1134,10 +1130,12 @@ def _atmosoceaniceprod(self, component: str):
fhrs.remove(0)

fhr_var_dict = {'fhr': ' '.join([f"{fhr:03d}" for fhr in fhrs])}
if component in ['ocean']:
fhrs_next = fhrs[1:] + [fhrs[-1] + (fhrs[-1] - fhrs[-2])]
fhr_var_dict['fhr_next'] = ' '.join([f"{fhr:03d}" for fhr in fhrs_next])
metatask_dict = {'task_name': f'{self.run}{component}_prod',
'task_dict': task_dict,
'var_dict': fhr_var_dict
}
'var_dict': fhr_var_dict}

task = rocoto.create_task(metatask_dict)

Expand Down

0 comments on commit 4987704

Please sign in to comment.