Skip to content

Commit

Permalink
minimal intervention to create a data-atmosphere xml
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul committed Jul 28, 2022
1 parent 1ed89c7 commit 113085c
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 26 deletions.
7 changes: 6 additions & 1 deletion parm/config/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn}
export APP=@APP@

# Defaults:
export DO_ATM="YES"
export DO_COUPLED="NO"
export DO_WAVE="NO"
export DO_OCN="NO"
Expand All @@ -164,7 +165,6 @@ export cplwav2atm=".false."

case "${APP}" in
ATM)
echo "APP=ATM; will use defaults"
export confignamevarfornems="atm"
;;
ATMA)
Expand All @@ -177,6 +177,11 @@ case "${APP}" in
export WAVE_CDUMP="both"
export confignamevarfornems="leapfrog_atm_wav"
;;
NG-GODAS)
export DO_ATM="NO"
export DO_OCN="YES"
export DO_ICE="YES"
;;
S2S*)
export DO_COUPLED="YES"
export DO_OCN="YES"
Expand Down
1 change: 1 addition & 0 deletions parm/config/config.coupled_ic
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export CPL_ATMIC=GEFS-NoahMP-aerosols-p8c
export CPL_ICEIC=CPC
export CPL_OCNIC=CPC3Dvar
export CPL_WAVIC=GEFSwave20210528v2
export CPL_DATM=CDEPS_DATM

echo "END: config.coupled_ic"
30 changes: 20 additions & 10 deletions workflow/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def __init__(self, configuration: Configuration) -> None:

self.model_app = _base.get('APP', 'ATM')
self.do_hybvar = _base.get('DOHYBVAR', False)
self.do_atm = _base.get('DO_ATM', True)
self.do_wave = _base.get('DO_WAVE', False)
self.do_wave_bnd = _base.get('DOBNDPNT_WAVE', False)
self.do_ocean = _base.get('DO_OCN', False)
Expand Down Expand Up @@ -181,12 +182,12 @@ def _cycled_configs(self):

configs += ['sfcanl', 'analcalc', 'fcst', 'post', 'vrfy', 'arch']


if self.do_gldas:
configs += ['gldas']

if self.do_hybvar:
if self.do_jediens:
if self.do_jediens:
configs += ['atmensanalprep', 'atmensanalrun', 'atmensanalpost']
else:
configs += ['eobs', 'eomg', 'ediag', 'eupd']
Expand Down Expand Up @@ -224,9 +225,14 @@ def _forecast_only_configs(self):
Returns the config_files that are involved in the forecast-only app
"""

configs = ['fcst', 'post', 'vrfy', 'arch']
configs = ['fcst']

if self.do_atm:
configs += ['post', 'vrfy']

configs += ['arch']

if self.model_app in ['S2S', 'S2SW', 'S2SWA']:
if self.model_app in ['S2S', 'S2SW', 'S2SWA', 'NG-GODAS']:
configs += ['coupled_ic']
else:
configs += ['init']
Expand All @@ -239,7 +245,7 @@ def _forecast_only_configs(self):
if self.do_ocean or self.do_ice:
configs += ['ocnpost']

if self.do_metp:
if self.do_atm and self.do_metp:
configs += ['metp']

if self.do_gempak:
Expand Down Expand Up @@ -436,7 +442,7 @@ def _get_forecast_only_task_names(self):

tasks = []

if 'S2S' in self.model_app:
if self.model_app in ['S2S', 'S2SW', 'S2SWA', 'NG-GODAS']:
tasks += ['coupled_ic']
else:
if self.do_hpssarch:
Expand All @@ -452,12 +458,16 @@ def _get_forecast_only_task_names(self):

tasks += ['fcst']

tasks += ['post']
if 'S2S' in self.model_app:
if self.do_atm:
tasks += ['post']

if self.model_app in ['S2S', 'S2SW', 'S2SWA', 'NG-GODAS']:
tasks += ['ocnpost']

tasks += ['vrfy']
if self.do_metp:
if self.do_atm:
tasks += ['vrfy']

if self.do_atm and self.do_metp:
tasks += ['metp']

if self.do_wave:
Expand Down
49 changes: 35 additions & 14 deletions workflow/rocoto/workflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,20 @@ def coupled_ic(self):
deps = []

# Atm ICs
atm_res = self._base.get('CASE', 'C384')
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ATMIC']}/@Y@m@d@H/{self.cdump}"
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}"
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}"
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}"
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
else: # data-atmosphere
# TODO - need more information about how these forcings are stored
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_DATM']}/@Y@m@d@H"
data = f"{prefix}/gefs.@Y@m.nc"
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))

Expand Down Expand Up @@ -474,14 +481,28 @@ def fcst(self):
@property
def _fcst_forecast_only(self):
dependencies = []

deps = []
data = f'&ROTDIR;/{self.cdump}.@Y@m@d/@H/atmos/INPUT/sfc_data.tile6.nc'
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
data = f'&ROTDIR;/{self.cdump}.@Y@m@d/@H/atmos/RESTART/@Y@m@d.@H0000.sfcanl_data.tile6.nc'
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
dependencies.append(rocoto.create_dependency(dep_condition='or', dep=deps))
if self.app_config.do_atm:
data = f'&ROTDIR;/{self.cdump}.@Y@m@d/@H/atmos/INPUT/sfc_data.tile6.nc'
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
data = f'&ROTDIR;/{self.cdump}.@Y@m@d/@H/atmos/RESTART/@Y@m@d.@H0000.sfcanl_data.tile6.nc'
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
dependencies.append(rocoto.create_dependency(dep_condition='or', dep=deps))

else: # data-atmosphere
data = f'&ICSDIR;/@Y@m@d@H/datm/gefs.@Y@m.nc' # GEFS forcing
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
data = '&ICSDIR;/@Y@m@d@H/ocn/MOM.res.nc' # TODO - replace with actual ocean IC
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
data = '&ICSDIR;/@Y@m@d@H/ice/cice5_model.res.nc' # TODO - replace with actual ice IC
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
dependencies.append(rocoto.create_dependency(dep_condition='and', dep=deps))

if self.app_config.do_wave and self.cdump in self.app_config.wave_cdumps:
wave_job = 'waveprep' if self.app_config.model_app in ['ATMW'] else 'waveinit'
Expand Down
2 changes: 1 addition & 1 deletion workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def input_args():

# forecast only mode additional arguments
forecasts.add_argument('--app', help='UFS application', type=str, choices=[
'ATM', 'ATMA', 'ATMW', 'S2S', 'S2SW', 'S2SWA'], required=False, default='ATM')
'ATM', 'ATMA', 'ATMW', 'S2S', 'S2SW', 'S2SWA', 'NG-GODAS'], required=False, default='ATM')

args = parser.parse_args()

Expand Down

0 comments on commit 113085c

Please sign in to comment.