-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rocoto generation for new stage_ic and add GEFS from WalterKol…
…czynski-NOAA:feature/stage_gefs
- Loading branch information
1 parent
0967029
commit bd148ca
Showing
10 changed files
with
103 additions
and
68 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#! /usr/bin/env bash | ||
|
||
########## config.stage_ic ########## | ||
|
||
echo "BEGIN: config.stage_ic" | ||
|
||
# Get task specific resources | ||
source "${EXPDIR}/config.resources" stage_ic | ||
|
||
case "${CASE}" in | ||
"C48") | ||
export CPL_ATMIC="gefs_test" | ||
export CPL_ICEIC="gefs_test" | ||
export CPL_OCNIC="gefs_test" | ||
export CPL_WAVIC="gefs_test" | ||
;; | ||
*) | ||
echo "FATAL ERROR Unrecognized resolution: ${CASE}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "END: config.stage_ic" |
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 |
---|---|---|
|
@@ -8,10 +8,64 @@ class GEFSTasks(Tasks): | |
def __init__(self, app_config: AppConfig, cdump: str) -> None: | ||
super().__init__(app_config, cdump) | ||
|
||
def stage_ic(self): | ||
|
||
cpl_ic = self._configs['stage_ic'] | ||
|
||
deps = [] | ||
|
||
# Atm ICs | ||
if self.app_config.do_atm: | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ATMIC']}/@Y@m@d@H/mem000/atmos" | ||
for file in ['gfs_ctrl.nc'] + \ | ||
[f'{datatype}_data.tile{tile}.nc' | ||
for datatype in ['gfs', 'sfc'] | ||
for tile in range(1, self.n_tiles + 1)]: | ||
data = f"{prefix}/{file}" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
# Ocean ICs | ||
if self.app_config.do_ocean: | ||
ocn_res = f"{self._base.get('OCNRES', '025'):03d}" | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_OCNIC']}/@Y@m@d@H/mem000/ocean" | ||
data = f"{prefix}/@Y@m@[email protected]" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
if ocn_res in ['025']: | ||
# 0.25 degree ocean model also has these additional restarts | ||
for res in [f'res_{res_index}' for res_index in range(1, 4)]: | ||
data = f"{prefix}/@Y@m@[email protected].{res}.nc" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
# Ice ICs | ||
if self.app_config.do_ice: | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ICEIC']}/@Y@m@d@H/mem000/ice" | ||
data = f"{prefix}/@Y@m@[email protected]_model.res.nc" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
# Wave ICs | ||
if self.app_config.do_wave: | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_WAVIC']}/@Y@m@d@H/mem000/wave" | ||
for wave_grid in self._configs['waveinit']['waveGRD'].split(): | ||
data = f"{prefix}/{wave_grid}/@Y@m@[email protected].{wave_grid}" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) | ||
|
||
resources = self.get_resource('stage_ic') | ||
task = create_wf_task('stage_ic', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies) | ||
|
||
return task | ||
|
||
def fcst(self): | ||
# TODO: Add real dependencies | ||
dependencies = [] | ||
|
||
dep_dict = {'type': 'task', 'name': f'{self.cdump}stage_ic'} | ||
dependencies.append(rocoto.add_dependency(dep_dict)) | ||
resources = self.get_resource('fcst') | ||
task = create_wf_task('fcst', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies) | ||
|
||
|
@@ -20,7 +74,8 @@ def fcst(self): | |
def efcs(self): | ||
# TODO: Add real dependencies | ||
dependencies = [] | ||
|
||
dep_dict = {'type': 'task', 'name': f'{self.cdump}stage_ic'} | ||
dependencies.append(rocoto.add_dependency(dep_dict)) | ||
efcsenvars = self.envars.copy() | ||
efcsenvars.append(rocoto.create_envar(name='ENSGRP', value='#grp#')) | ||
|
||
|
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 |
---|---|---|
|
@@ -23,13 +23,12 @@ def stage_ic(self): | |
|
||
# Atm ICs | ||
if self.app_config.do_atm: | ||
atm_res = self._base.get('CASE', 'C384') | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ATMIC']}/@Y@m@d@H/{self.cdump}" | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ATMIC']}/@Y@m@d@H/atmos" | ||
for file in ['gfs_ctrl.nc'] + \ | ||
[f'{datatype}_data.tile{tile}.nc' | ||
for datatype in ['gfs', 'sfc'] | ||
for tile in range(1, self.n_tiles + 1)]: | ||
data = f"{prefix}/{atm_res}/INPUT/{file}" | ||
data = f"{prefix}/{file}" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
else: # data-atmosphere | ||
|
@@ -42,14 +41,14 @@ def stage_ic(self): | |
# Ocean ICs | ||
if self.app_config.do_ocean: | ||
ocn_res = f"{self._base.get('OCNRES', '025'):03d}" | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_OCNIC']}/@Y@m@d@H/ocn" | ||
data = f"{prefix}/{ocn_res}/MOM.res.nc" | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_OCNIC']}/@Y@m@d@H/ocean" | ||
data = f"{prefix}/@Y@m@d.@H0000.MOM.res.nc" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
if ocn_res in ['025']: | ||
# 0.25 degree ocean model also has these additional restarts | ||
for res in [f'res_{res_index}' for res_index in range(1, 4)]: | ||
data = f"{prefix}/{ocn_res}/MOM.{res}.nc" | ||
data = f"{prefix}/@Y@m@d.@H0000.MOM.{res}.nc" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
|
@@ -58,15 +57,15 @@ def stage_ic(self): | |
ice_res = f"{self._base.get('ICERES', '025'):03d}" | ||
ice_res_dec = f'{float(ice_res) / 100:.2f}' | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ICEIC']}/@Y@m@d@H/ice" | ||
data = f"{prefix}/{ice_res}/cice5_model_{ice_res_dec}.res_@Y@m@d@H.nc" | ||
data = f"{prefix}/@Y@m@d[email protected]_model.res.nc" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
# Wave ICs | ||
if self.app_config.do_wave: | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_WAVIC']}/@Y@m@d@H/wav" | ||
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_WAVIC']}/@Y@m@d@H/wave" | ||
for wave_grid in self._configs['waveinit']['waveGRD'].split(): | ||
data = f"{prefix}/{wave_grid}/@Y@m@[email protected].{wave_grid}" | ||
data = f"{prefix}/@Y@m@[email protected].{wave_grid}" | ||
dep_dict = {'type': 'data', 'data': data} | ||
deps.append(rocoto.add_dependency(dep_dict)) | ||
|
||
|
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