Skip to content

Commit

Permalink
Merge branch 'develop' into feature/cleanup-rundirs
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul authored Jul 29, 2024
2 parents ecb17b7 + 61875f2 commit 075eddf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/exglobal_stage_ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

# Atmosphere Perturbation Files (usually used with replay ICS)
# Extra zero on MEMDIR ensure we have a number even if the string is empty
if (( 0${MEMDIR:3} > 0 )) && [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
if (( $((10#0${MEMDIR:3})) > 0 )) && [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
YMD=${PDY} HH=${cyc} declare_from_tmpl COM_ATMOS_ANALYSIS:COM_ATMOS_ANALYSIS_TMPL
[[ ! -d "${COM_ATMOS_ANALYSIS}" ]] && mkdir -p "${COM_ATMOS_ANALYSIS}"
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${PDY}${cyc}/${MEMDIR}/atmos/${DTG_PREFIX}.fv3_perturbation.nc"
Expand Down Expand Up @@ -130,7 +130,7 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

# Ocean Perturbation Files
# Extra zero on MEMDIR ensure we have a number even if the string is empty
if (( 0${MEMDIR:3} > 0 )) && [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
if (( $((10#0${MEMDIR:3})) > 0 )) && [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
YMD=${PDY} HH=${cyc} declare_from_tmpl COM_OCEAN_ANALYSIS:COM_OCEAN_ANALYSIS_TMPL
[[ ! -d "${COM_OCEAN_ANALYSIS}" ]] && mkdir -p "${COM_OCEAN_ANALYSIS}"
src="${BASE_CPLIC}/${CPL_OCNIC:-}/${PDY}${cyc}/${MEMDIR}/ocean/${DTG_PREFIX}.mom6_perturbation.nc"
Expand Down
16 changes: 16 additions & 0 deletions workflow/rocoto/gefs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ def _atmosoceaniceprod(self, component: str):
'maxtries': '&MAXTRIES;'}

fhrs = self._get_forecast_hours('gefs', self._configs[config], component)

# when replaying, atmos component does not have fhr 0, therefore remove 0 from fhrs
is_replay = self._configs[config]['REPLAY_ICS']
if is_replay and component in ['atmos'] and 0 in fhrs:
fhrs.remove(0)

# ocean/ice components do not have fhr 0 as they are averaged output
if component in ['ocean', 'ice'] and 0 in fhrs:
fhrs.remove(0)

fhr_var_dict = {'fhr': ' '.join([f"{fhr:03d}" for fhr in fhrs])}

fhr_metatask_dict = {'task_name': f'{component}_prod_#member#',
Expand Down Expand Up @@ -314,6 +324,12 @@ def atmos_ensstat(self):
'maxtries': '&MAXTRIES;'}

fhrs = self._get_forecast_hours('gefs', self._configs['atmos_ensstat'])

# when replaying, atmos component does not have fhr 0, therefore remove 0 from fhrs
is_replay = self._configs['atmos_ensstat']['REPLAY_ICS']
if is_replay and 0 in fhrs:
fhrs.remove(0)

fhr_var_dict = {'fhr': ' '.join([f"{fhr:03d}" for fhr in fhrs])}

fhr_metatask_dict = {'task_name': f'atmos_ensstat',
Expand Down
5 changes: 5 additions & 0 deletions workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,11 @@ def _atmosoceaniceprod(self, component: str):
}

fhrs = self._get_forecast_hours(self.cdump, self._configs[config], component)

# ocean/ice components do not have fhr 0 as they are averaged output
if component in ['ocean', 'ice'] and 0 in fhrs:
fhrs.remove(0)

fhr_var_dict = {'fhr': ' '.join([f"{fhr:03d}" for fhr in fhrs])}
metatask_dict = {'task_name': f'{self.cdump}{component}_prod',
'task_dict': task_dict,
Expand Down
4 changes: 0 additions & 4 deletions workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ def _get_forecast_hours(cdump, config, component='atmos') -> List[str]:
fhrs_hf = range(fhmin, fhmax_hf + fhout_hf, fhout_hf)
fhrs = list(fhrs_hf) + list(range(fhrs_hf[-1] + fhout, fhmax + fhout, fhout))

# ocean/ice components do not have fhr 0 as they are averaged output
if component in ['ocean', 'ice'] and 0 in fhrs:
fhrs.remove(0)

return fhrs

def get_resource(self, task_name):
Expand Down

0 comments on commit 075eddf

Please sign in to comment.