-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use assim_freq to configure "offset" in dependencies (#2039)
Use the assim_freq from config.base to configure "offset" in dependencies instead of hard-coding them. Resolves #2038
- Loading branch information
1 parent
4e3d82b
commit 85f1f51
Showing
7 changed files
with
87 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from applications.applications import AppConfig | ||
from rocoto.tasks import Tasks, create_wf_task | ||
from wxflow import timedelta_to_HMS | ||
import rocoto.rocoto as rocoto | ||
import numpy as np | ||
|
||
|
@@ -86,10 +87,10 @@ def prep(self): | |
gfs_enkf = True if self.app_config.do_hybvar and 'gfs' in self.app_config.eupd_cdumps else False | ||
|
||
deps = [] | ||
dep_dict = {'type': 'metatask', 'name': 'gdaspost', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'metatask', 'name': 'gdaspost', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
data = f'{atm_hist_path}/[email protected]' | ||
dep_dict = {'type': 'data', 'data': data, 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'data', 'data': data, 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
data = f'{dump_path}/{self.cdump}[email protected]_d' | ||
dep_dict = {'type': 'data', 'data': data} | ||
|
@@ -116,7 +117,7 @@ def waveinit(self): | |
dep_dict = {'type': 'task', 'name': f'{self.cdump}prep'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
if self.cdump in ['gdas']: | ||
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) | ||
cycledef = 'gdas_half,gdas' if self.cdump in ['gdas'] else self.cdump | ||
|
@@ -155,7 +156,7 @@ def aerosol_init(self): | |
interval = self._base['INTERVAL_GFS'] | ||
elif self.cdump in ['gdas']: | ||
interval = self._base['INTERVAL'] | ||
offset = f'-{interval}' | ||
offset = f'-{timedelta_to_HMS(interval)}' | ||
|
||
# Files from previous cycle | ||
files = [f'@Y@m@[email protected]_core.res.nc'] + \ | ||
|
@@ -181,7 +182,7 @@ def anal(self): | |
dep_dict = {'type': 'task', 'name': f'{self.cdump}prep'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
if self.app_config.do_hybvar: | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
else: | ||
|
@@ -223,7 +224,7 @@ def analcalc(self): | |
dep_dict = {'type': 'task', 'name': f'{self.cdump}sfcanl'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
if self.app_config.do_hybvar and self.cdump in ['gdas']: | ||
dep_dict = {'type': 'task', 'name': 'enkfgdasechgres', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'task', 'name': 'enkfgdasechgres', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
|
||
|
@@ -262,7 +263,7 @@ def atmanlinit(self): | |
dep_dict = {'type': 'task', 'name': f'{self.cdump}prepatmiodaobs'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
if self.app_config.do_hybvar: | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
else: | ||
|
@@ -369,7 +370,7 @@ def ocnanalprep(self): | |
|
||
deps = [] | ||
data = f'{ocean_hist_path}/[email protected]' | ||
dep_dict = {'type': 'data', 'data': data, 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'data', 'data': data, 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep=deps) | ||
|
||
|
@@ -536,7 +537,7 @@ def _fcst_cycled(self): | |
dependencies = rocoto.create_dependency(dep_condition='and', dep=dependencies) | ||
|
||
if self.cdump in ['gdas']: | ||
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
dependencies.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='or', dep=dependencies) | ||
|
||
|
@@ -1074,7 +1075,7 @@ def eobs(self): | |
deps = [] | ||
dep_dict = {'type': 'task', 'name': f'{self.cdump.replace("enkf","")}prep'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
|
||
|
@@ -1129,7 +1130,7 @@ def atmensanlinit(self): | |
deps = [] | ||
dep_dict = {'type': 'task', 'name': f'{self.cdump.replace("enkf","")}prepatmiodaobs'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
|
||
|
@@ -1145,7 +1146,7 @@ def atmensanlrun(self): | |
deps = [] | ||
dep_dict = {'type': 'task', 'name': f'{self.cdump}atmensanlinit'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'metatask', 'name': 'enkfgdasepmn', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
|
||
|
@@ -1243,7 +1244,7 @@ def efcs(self): | |
dep_dict = {'type': 'task', 'name': f'{self.cdump}esfc'} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'} | ||
dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"} | ||
dependencies.append(rocoto.add_dependency(dep_dict)) | ||
dependencies = rocoto.create_dependency(dep_condition='or', dep=dependencies) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters