Skip to content

Commit

Permalink
Turn gempack special job into a metatask
Browse files Browse the repository at this point in the history
Converts the `gempakpgrb2spec` job into a metatask. To facilitate
this, new variables are created to control the length and cadence
of the GOES output.
  • Loading branch information
WalterKolczynski-NOAA committed Jun 20, 2024
1 parent 662b229 commit 9a5446f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
7 changes: 7 additions & 0 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ if (( FHMAX_HF_GFS < 120 )); then
export ILPOST=${FHOUT_GFS}
fi

# Limit bounds of goes processing
export FHMAX_GOES=180
export FHOUT_GOES=3
if (( FHMAX_GOES > FHMAX_GFS )); then
export FHMAX_GOES=${FHMAX_GFS}
fi

# GFS restart interval in hours
export restart_interval_gfs=12
# NOTE: Do not set this to zero. Instead set it to $FHMAX_GFS
Expand Down
9 changes: 3 additions & 6 deletions scripts/exgfs_atmos_grib2_special_npoess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,9 @@ done
################################################################
# Specify Forecast Hour Range F000 - F180 for GOESSIMPGRB files
################################################################
export SHOUR=0
export FHOUR=180
export FHINC=3
if (( FHOUR > FHMAX_GFS )); then
export FHOUR="${FHMAX_GFS}"
fi
export SHOUR=${FHMIN_GFS}
export FHOUR=${FHMAX_GOES}
export FHINC=${FHOUT_GOES}

#################################
# Process GFS PGRB2_SPECIAL_POST
Expand Down
27 changes: 24 additions & 3 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,8 +1552,13 @@ def gempakpgrb2spec(self):
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

gempak_vars = self.envars.copy()
gempak_dict = {'FHR3': '#fhr#'}
for key, value in gempak_dict.items():
gempak_vars.append(rocoto.create_envar(name=key, value=str(value)))

resources = self.get_resource('gempak')
task_name = f'{self.cdump}gempakgrb2spec'
task_name = f'{self.cdump}gempakgrb2spec_f#fhr#'
task_dict = {'task_name': task_name,
'resources': resources,
'dependency': dependencies,
Expand All @@ -1565,7 +1570,23 @@ def gempakpgrb2spec(self):
'maxtries': '&MAXTRIES;'
}

task = rocoto.create_task(task_dict)
# Override forecast lengths locally to be that of gempak goes job
local_config = self._configs['gempak']
goes_times = {
'FHMAX_HF_GFS': 0,
'FHMAX_GFS': local_config['FHMAX_GOES'],
'FHOUT_GFS': local_config['FHOUT_GOES'],
}
local_config.update(goes_times)

fhrs = self._get_forecast_hours(self.cdump, local_config)
fhr_var_dict = {'fhr': ' '.join([f"{fhr:03d}" for fhr in fhrs])}

fhr_metatask_dict = {'task_name': f'{self.cdump}gempakgrb2spec',
'task_dict': task_dict,
'var_dict': fhr_var_dict}

task = rocoto.create_task(fhr_metatask_dict)

return task

Expand Down Expand Up @@ -2248,7 +2269,7 @@ def cleanup(self):
dep_dict = {'type': 'task', 'name': f'{self.cdump}gempakncdcupapgif'}
deps.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_goes:
dep_dict = {'type': 'task', 'name': f'{self.cdump}gempakgrb2spec'}
dep_dict = {'type': 'metatask', 'name': f'{self.cdump}gempakgrb2spec'}
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{self.cdump}npoess_pgrb2_0p5deg'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down

0 comments on commit 9a5446f

Please sign in to comment.