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 in stubs for aerosol DA tasks + bugfix for setup_expt where cycled and ATMA are used #990

Merged
merged 17 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 14 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
10 changes: 10 additions & 0 deletions jobs/rocoto/aeroanlfinal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
status=$?
[[ $status -ne 0 ]] && exit $status

###############################################################
echo "Do nothing for now"
10 changes: 10 additions & 0 deletions jobs/rocoto/aeroanlinit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
status=$?
[[ $status -ne 0 ]] && exit $status

###############################################################
echo "Do nothing for now"
10 changes: 10 additions & 0 deletions jobs/rocoto/aeroanlrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
status=$?
[[ $status -ne 0 ]] && exit $status

###############################################################
echo "Do nothing for now"
6 changes: 6 additions & 0 deletions workflow/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ def _cycled_configs(self):
if self.do_wafs:
configs += ['wafs', 'wafsgrib2', 'wafsblending', 'wafsgcip', 'wafsgrib20p25', 'wafsblending0p25']

if self.do_aero:
configs += ['aeroanlinit', 'aeroanlrun', 'aeroanlfinal']

return configs

@property
Expand Down Expand Up @@ -348,6 +351,9 @@ def _get_cycled_task_names(self):

gdas_gfs_common_tasks_before_fcst += ['sfcanl', 'analcalc']

if self.do_aero:
gdas_gfs_common_tasks_before_fcst += ['aeroanlinit', 'aeroanlrun', 'aeroanlfinal']

gldas_tasks = ['gldas']
wave_prep_tasks = ['waveinit', 'waveprep']
wave_bndpnt_tasks = ['wavepostbndpnt', 'wavepostbndpntbll']
Expand Down
56 changes: 53 additions & 3 deletions workflow/rocoto/workflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Tasks:
'earc', 'ecen', 'echgres', 'ediag', 'efcs',
'eobs', 'eomg', 'epos', 'esfc', 'eupd',
'atmensanalprep', 'atmensanalrun', 'atmensanalpost',
'aeroanlinit', 'aeroanlrun', 'aeroanlfinal',
'fcst', 'post', 'ocnpost', 'vrfy', 'metp',
'postsnd', 'awips', 'gempak',
'wafs', 'wafsblending', 'wafsblending0p25',
Expand Down Expand Up @@ -450,6 +451,57 @@ def atmanalpost(self):

return task

def aeroanlinit(self):

suffix = self._base["SUFFIX"]
dump_suffix = self._base["DUMP_SUFFIX"]
gfs_cyc = self._base["gfs_cyc"]
dmpdir = self._base["DMPDIR"]

deps = []
dep_dict = {'type': 'metatask', 'name': 'gdaspost', 'offset': '-06:00:00'}
deps.append(rocoto.add_dependency(dep_dict))
data = f'&ROTDIR;/gdas.@Y@m@d/@H/atmos/gdas.t@Hz.atmf009{suffix}'
dep_dict = {'type': 'data', 'data': data, 'offset': '-06:00:00'}
deps.append(rocoto.add_dependency(dep_dict))
data = f'{dmpdir}/{self.cdump}{dump_suffix}.@Y@m@d/@H/{self.cdump}.t@Hz.updated.status.tm00.bufr_d'
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)

cycledef = self.cdump
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved

aerorahul marked this conversation as resolved.
Show resolved Hide resolved
resources = self.get_resource('aeroanlinit')
task = create_wf_task('aeroanlinit', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies,
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
cycledef=cycledef)
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
return task

def aeroanlrun(self):

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}aeroanlinit'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

resources = self.get_resource('aeroanlrun')
task = create_wf_task('aeroanlrun', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)

return task

def aeroanlfinal(self):

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}aeroanlrun'}
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'cycleexist', 'offset': '-06:00:00'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)

resources = self.get_resource('aeroanlfinal')
task = create_wf_task('aeroanlfinal', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)

return task

def gldas(self):

deps = []
Expand All @@ -470,15 +522,14 @@ def fcst(self):
'cycled': self._fcst_cycled}

try:
task = fcst_map[self.app_config.mode]
task = fcst_map[self.app_config.mode]()
except KeyError:
raise NotImplementedError(f'{self.app_config.mode} is not a valid type.\n' +
'Currently supported forecast types are:\n' +
f'{" | ".join(fcst_map.keys())}')

return task

@property
def _fcst_forecast_only(self):
dependencies = []

Expand Down Expand Up @@ -531,7 +582,6 @@ def _fcst_forecast_only(self):

return task

@property
def _fcst_cycled(self):

dep_dict = {'type': 'task', 'name': f'{self.cdump}sfcanl'}
Expand Down
2 changes: 1 addition & 1 deletion workflow/rocoto/workflow_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _get_cycledefs_cycled(self):
sdate = self._base['SDATE'].strftime('%Y%m%d%H%M')
edate = self._base['EDATE'].strftime('%Y%m%d%H%M')
interval = self._base.get('INTERVAL', '06:00:00')
strings = [f'\t<cycledef group="gdas" >{sdate} {edate} {interval}</cycledef>']
strings = [f'\t<cycledef group="gdas" >{sdate} {edate} {interval}</cycledef>\n']

if self._app_config.gfs_cyc != 0:
sdate_gfs = self._base['SDATE_GFS'].strftime('%Y%m%d%H%M')
Expand Down
2 changes: 1 addition & 1 deletion workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def input_args():
cycled.add_argument('--nens', help='number of ensemble members',
type=int, required=False, default=20)
cycled.add_argument('--app', help='UFS application', type=str,
choices=['ATM', 'ATMW'], required=False, default='ATM')
choices=['ATM', 'ATMW', 'ATMA'], required=False, default='ATM')
aerorahul marked this conversation as resolved.
Show resolved Hide resolved

# forecast only mode additional arguments
forecasts.add_argument('--app', help='UFS application', type=str, choices=[
Expand Down