diff --git a/ush/check_ice_netcdf.sh b/ush/check_ice_netcdf.sh deleted file mode 100755 index 9d2d945a8b..0000000000 --- a/ush/check_ice_netcdf.sh +++ /dev/null @@ -1,43 +0,0 @@ -#! /usr/bin/env bash - -yyyy=${1?} -mm=${2?} -dd=${3?} -cyc=${4?} -fhr=${5?} -ROTDIR=${6?} -member=${7?} -FHOUT_ICE_GFS=${8?} - -fhri=$((10#${fhr})) - -#Will need to consider fhmin in the future to calculate the offset if we are to stick with this approach. -((offset = ( cyc ) % FHOUT_ICE_GFS)) - -if (( offset != 0 )); then - (( fhri = fhri - cyc )) - fhr3=$(printf %03i "${fhri}") - if (( fhri <= FHOUT_ICE_GFS )); then - (( interval = FHOUT_ICE_GFS - cyc )) - ncfile=${ROTDIR}/gefs.${yyyy}${mm}${dd}/${cyc}/mem${member}/model/ice/history/gefs.ice.t${cyc}z.${interval}hr_avg.f${fhr3}.nc - else - ncfile=${ROTDIR}/gefs.${yyyy}${mm}${dd}/${cyc}/mem${member}/model/ice/history/gefs.ice.t${cyc}z.${FHOUT_ICE_GFS}hr_avg.f${fhr3}.nc - fi -else - ncfile=${ROTDIR}/gefs.${yyyy}${mm}${dd}/${cyc}/mem${member}/model/ice/history/gefs.ice.t${cyc}z.${FHOUT_ICE_GFS}hr_avg.f${fhr}.nc -fi - -#Check if netcdf file exists. -if [[ ! -f "${ncfile}" ]];then - rc=1 -else - #Check if netcdf file is older than 2 minutes. - ncage="$(find "${ncfile}" -mmin -2)" - if [[ -n "${ncage}" ]]; then - rc=1 - else - rc=0 - fi -fi - -exit "${rc}" diff --git a/ush/forecast_predet.sh b/ush/forecast_predet.sh index 9e08a12dd8..d7c04ea699 100755 --- a/ush/forecast_predet.sh +++ b/ush/forecast_predet.sh @@ -642,15 +642,8 @@ CICE_predet(){ # CICE does not have a concept of high frequency output like FV3 # Convert output settings into an explicit list for CICE - if (( $(( ( cyc + FHMIN ) % FHOUT_ICE )) == 0 )); then - # shellcheck disable=SC2312 - mapfile -t CICE_OUTPUT_FH < <(seq "${FHMIN}" "${FHOUT_ICE}" "${FHMAX}") || exit 10 - else - CICE_OUTPUT_FH=("${FHMIN}") - # shellcheck disable=SC2312 - mapfile -t -O "${#CICE_OUTPUT_FH[@]}" CICE_OUTPUT_FH < <(seq "$(( FHMIN + $(( ( cyc + FHMIN ) % FHOUT_ICE )) ))" "${FHOUT_ICE}" "${FHMAX}") || exit 10 - CICE_OUTPUT_FH+=("${FHMAX}") - fi + # shellcheck disable=SC2312 + mapfile -t CICE_OUTPUT_FH < <(seq "${FHMIN}" "${FHOUT_ICE}" "${FHMAX}") || exit 10 # Fix files ${NCP} "${FIXgfs}/cice/${ICERES}/${CICE_GRID}" "${DATA}/" diff --git a/ush/python/pygfs/task/oceanice_products.py b/ush/python/pygfs/task/oceanice_products.py index 98b57ae801..39ec53b100 100644 --- a/ush/python/pygfs/task/oceanice_products.py +++ b/ush/python/pygfs/task/oceanice_products.py @@ -58,22 +58,10 @@ def __init__(self, config: Dict[str, Any]) -> None: valid_datetime = add_to_datetime(self.task_config.current_cycle, to_timedelta(f"{self.task_config.FORECAST_HOUR}H")) + forecast_hour = self.task_config.FORECAST_HOUR if self.task_config.COMPONENT == 'ice': - offset = int(self.task_config.current_cycle.strftime("%H")) % self.task_config.FHOUT_ICE_GFS - # For CICE cases where offset is not 0, forecast_hour needs to be adjusted based on the offset. - # TODO: Consider FHMIN when calculating offset. - if offset != 0: - forecast_hour = self.task_config.FORECAST_HOUR - int(self.task_config.current_cycle.strftime("%H")) - # For the first forecast hour, the interval may be different from the intervals of subsequent forecast hours - if forecast_hour <= self.task_config.FHOUT_ICE_GFS: - interval = self.task_config.FHOUT_ICE_GFS - int(self.task_config.current_cycle.strftime("%H")) - else: - interval = self.task_config.FHOUT_ICE_GFS - else: - forecast_hour = self.task_config.FORECAST_HOUR - interval = self.task_config.FHOUT_ICE_GFS + interval = self.task_config.FHOUT_ICE_GFS if self.task_config.COMPONENT == 'ocean': - forecast_hour = self.task_config.FORECAST_HOUR interval = self.task_config.FHOUT_OCN_GFS # TODO: This is a bit of a hack, but it works for now diff --git a/workflow/rocoto/gefs_tasks.py b/workflow/rocoto/gefs_tasks.py index 8a4f148f24..3b72677a58 100644 --- a/workflow/rocoto/gefs_tasks.py +++ b/workflow/rocoto/gefs_tasks.py @@ -213,21 +213,11 @@ def _atmosoceaniceprod(self, component: str): history_path = self._template_to_rocoto_cycstring(self._base[history_path_tmpl], {'MEMDIR': 'mem#member#'}) deps = [] data = f'{history_path}/{history_file_tmpl}' - if component in ['ocean']: - dep_dict = {'type': 'data', 'data': data, 'age': 120} - deps.append(rocoto.add_dependency(dep_dict)) - dep_dict = {'type': 'metatask', 'name': 'fcst_mem#member#'} - deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep=deps, dep_condition='or') - elif component in ['ice']: - command = f"{self.HOMEgfs}/ush/check_ice_netcdf.sh @Y @m @d @H #fhr# &ROTDIR; #member# {fhout_ice_gfs}" - dep_dict = {'type': 'sh', 'command': command} - deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep=deps) - else: - dep_dict = {'type': 'data', 'data': data, 'age': 120} - deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep=deps) + dep_dict = {'type': 'data', 'data': data, 'age': 120} + deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'metatask', 'name': 'fcst_mem#member#'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep=deps, dep_condition='or') postenvars = self.envars.copy() postenvar_dict = {'ENSMEM': '#member#',