Skip to content

Commit

Permalink
revert changes to extend stage_ic to gdas for cycled parallels (NOAA-…
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTreadon-NOAA committed Feb 14, 2024
1 parent 62afe41 commit ea200a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 87 deletions.
9 changes: 0 additions & 9 deletions parm/config/gfs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ echo "BEGIN: config.stage_ic"
# Get task specific resources
source "${EXPDIR}/config.resources" stage_ic

# Stage ICs for coupled system
if [[ "${DO_COUPLED}" = "YES" ]]; then
case "${CASE}" in
"C48" | "C96")
export CPL_ATMIC="workflow_${CASE}_refactored"
Expand Down Expand Up @@ -39,12 +37,5 @@ case "${CASE}" in
exit 1
;;
esac
fi # End block for coupled ICs

# Stage ICs for cycled runs
if [[ "${MODE}" == "cycled" ]]; then
export CPL_ATMIC="C48C48"
export CPL_ATMDAIC="C48C48"
fi

echo "END: config.stage_ic"
55 changes: 0 additions & 55 deletions scripts/exglobal_stage_ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ error_message() {
echo "FATAL ERROR: Unable to copy ${1} to ${2} (Error code ${3})"
}

if [[ "${MODE}" == "forecast-only" ]]; then

###############################################################
for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

Expand Down Expand Up @@ -154,59 +152,6 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

done # for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

# Stage files for MODE="cycled"
else
# Stage deterministic ICs from previous cycle
RUN=${rCDUMP} YMD=${gPDY} HH=${gcyc} generate_com COM_TOP:COM_TOP_TMPL
COM_TOP_BASE=$(dirname "${COM_TOP}")
[[ ! -d "${COM_TOP_BASE}" ]] && mkdir -p "${COM_TOP_BASE}"
[[ -d "${COM_TOP_BASE}/${gcyc}" ]] && rm -f "${COM_TOP_BASE:-}/${gcyc:-}"
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${RUN}.${gPDY}/${gcyc}"
tgt="${COM_TOP_BASE}/"
${NLN} "${src}" "${tgt}"
rc=$?
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}"
err=$((err + rc))

# Stage ensemble ICs from previous cycle
if [[ "${DOHYBVAR}" == "YES" ]]; then
RUN=enkf${rCDUMP} YMD=${gPDY} HH=${gcyc} generate_com COM_TOP:COM_TOP_TMPL
COM_TOP_BASE=$(dirname "${COM_TOP}")
[[ ! -d "${COM_TOP_BASE}" ]] && mkdir -p "${COM_TOP_BASE}"
[[ -d "${COM_TOP_BASE}/${gcyc}" ]] && rm -rf "${COM_TOP_BASE:-}/${gcyc:-}"
src="${BASE_CPLIC}/${CPL_ATMIC:-}/enkf${RUN}.${gPDY}/${gcyc}"
tgt="${COM_TOP_BASE}/"
${NLN} "${src}" "${tgt}"
rc=$?
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}"
err=$((err + rc))
fi

# Stage bias correction files
RUN=${rCDUMP} YMD=${PDY} HH=${cyc} generate_com COM_ATMOS_ANALYSIS:COM_ATMOS_ANALYSIS_TMPL
[[ ! -d "${COM_ATMOS_ANALYSIS}" ]] && mkdir -p "${COM_ATMOS_ANALYSIS}"
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${RUN}.${PDY}/${cyc}/analysis/atmos"
tgt="${COM_ATMOS_ANALYSIS}/"
if [[ "${DO_JEDIATMVAR}" == "YES" || "${DO_JEDIATMENS}" == "YES" ]]; then
flist="radbcor"
else
flist="abias abias_air abias_pc radstat"
fi
for ftype in ${flist}; do
file=${rCDUMP}.t${cyc}z.${ftype}
${NCP} "${src}"/"${file}" "${tgt}"
rc=$?
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}"
err=$((err + rc))
done
if [[ "${DO_JEDIATMVAR}" == "YES" || "${DO_JEDIATMENS}" == "YES" ]]; then
cd "${tgt}" || exit
tar -xvf "${rCDUMP}".t"${cyc}"z.radbcor
cd "${DATA}" || exit
fi

fi

###############################################################
# Check for errors and exit if any of the above failed
if [[ "${err}" -ne 0 ]]; then
Expand Down
5 changes: 2 additions & 3 deletions workflow/applications/gfs_cycled.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _get_app_configs(self):
Returns the config_files that are involved in the cycled app
"""

configs = ['stage_ic', 'prep']
configs = ['prep']

if self.do_jediatmvar:
configs += ['prepatmiodaobs', 'atmanlinit', 'atmanlrun', 'atmanlfinal']
Expand Down Expand Up @@ -166,8 +166,7 @@ def get_task_names(self):
hybrid_after_eupd_tasks += ['ecen', 'esfc', 'efcs', 'epos', 'earc', 'cleanup']

# Collect all "gdas" cycle tasks
gdas_tasks = ['stage_ic']
gdas_tasks += gdas_gfs_common_tasks_before_fcst.copy()
gdas_tasks = gdas_gfs_common_tasks_before_fcst.copy()

if not self.do_jediatmvar:
gdas_tasks += ['analdiag']
Expand Down
29 changes: 10 additions & 19 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ def stage_ic(self):

# Atm ICs
if self.app_config.do_atm:
if self.cdump in 'gdas':
prefix = f"{cpl_ic['BASE_CPLIC']}/{cpl_ic['CPL_ATMIC']}/gdas.@Y@m@d/@H/model_data/atmos/restart"
PDY = self._base.get('SDATE').strftime("%Y%m%d%H")[0:8]
cyc = self._base.get('SDATE').strftime("%Y%m%d%H")[8:10]
file = PDY + '.' + cyc + '0000.fv_core.res.nc'
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}/{file}"
dep_dict = {'type': 'data', 'data': data, 'offset': f"-{timedelta_to_HMS(self._base['cycle_interval'])}"}
else:
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}/{file}"
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
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"
Expand Down Expand Up @@ -78,14 +70,13 @@ def stage_ic(self):

dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)

cycledef = 'gdas_half' if self.cdump in ['gdas'] else self.cdump
resources = self.get_resource('stage_ic')
task_name = f'{self.cdump}stage_ic'
task_dict = {'task_name': task_name,
'resources': resources,
'dependency': dependencies,
'envars': self.envars,
'cycledef': cycledef,
'cycledef': self.cdump,
'command': f'{self.HOMEgfs}/jobs/rocoto/stage_ic.sh',
'job_name': f'{self.pslot}_{task_name}_@H',
'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',
Expand Down Expand Up @@ -842,7 +833,7 @@ def _fcst_cycled(self):
dependencies = rocoto.create_dependency(dep_condition='and', dep=dependencies)

if self.cdump in ['gdas']:
dep_dict = {'type': 'task', 'name': f'{self.cdump}stage_ic'}
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)

Expand Down Expand Up @@ -2540,7 +2531,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': 'task', 'name': f'gdasstage_ic'}
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)

Expand Down
2 changes: 1 addition & 1 deletion workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def link_files_from_src_to_dst(src_dir, dst_dir):
src_dir = os.path.join(inputs.icsdir, current_cycle_dir, src_atm_anl_dir)
dst_dir = os.path.join(rotdir, current_cycle_dir, dst_atm_anl_dir)
makedirs_if_missing(dst_dir)
for ftype in ['abias', 'abias_pc', 'abias_air', 'radstat', 'atms_n20.satbias.nc4', 'atms_n20.satbias_cov.nc4', 'atms_n20.tlapse.txt']:
for ftype in ['abias', 'abias_pc', 'abias_air', 'radstat']:
fname = f'{inputs.cdump}.t{idatestr[8:]}z.{ftype}'
src_file = os.path.join(src_dir, fname)
if os.path.exists(src_file):
Expand Down

0 comments on commit ea200a4

Please sign in to comment.