Skip to content

Add configurable ENS_BEC_LOOK_BACK_HRS #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ush/find_ensembles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ if [[ "${HYB_WGT_ENS}" != "0" ]] && [[ "${HYB_WGT_ENS}" != "0.0" ]]; then # usin
if [[ "${HYB_ENS_TYPE}" == "1" ]]; then # rrfsens
echo "use rrfs ensembles"
mpasout_file=mpasout.${timestr}.nc
for (( ii=0; ii<4; ii=ii+1 )); do
enshrs=$(( ENS_BEC_LOOK_BACK_HRS + 1 ))
for (( ii=0; ii<enshrs; ii=ii+1 )); do
CDATEp=$(${NDATE} "-${ii}" "${CDATE}" )
if [[ "${HYB_ENS_PATH}" == "" ]]; then
ensdir=${COMINrrfs}/rrfs.${CDATEp:0:8}/${CDATEp:8:2}
Expand Down
1 change: 1 addition & 0 deletions workflow/exp/exp.conus12km
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export HYB_ENS_PATH="" # if empty, the workflow will try to find ensembles a
export DO_ENVAR_RADAR_REF=false
export RADARREFL_TIMELEVEL="00" # 00 15 30 45 min
export ENS_SIZE=30
export ENS_BEC_LOOK_BACK_HRS=1 # define the hours going back for ensemble forecast files for the ensemble BEC

export DO_CYC=true
export CYC_INTERVAL=1
Expand Down
1 change: 1 addition & 0 deletions workflow/exp/exp.conus3km
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export HYB_ENS_PATH="" # if empty, the workflow will try to find ensembles a
export DO_ENVAR_RADAR_REF=false
export RADARREFL_TIMELEVEL="00" # 00 15 30 45 min
export ENS_SIZE=30
export ENS_BEC_LOOK_BACK_HRS=1 # define the hours going back for ensemble forecast files for the ensemble BEC

export DO_CYC=true
export CYC_INTERVAL=1
Expand Down
1 change: 1 addition & 0 deletions workflow/exp/rt_jet/exp.rt_jet_conus12km
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export HYB_WGT_STATIC=1.0
export HYB_ENS_TYPE=1 # 1.rrfs; 2.interpolated GEFS/GDAS; 0.TBD on the fly (rrfs->GDAS->3DVAR)
export HYB_ENS_PATH="" # if empty, the workflow will try to find ensembles automatically
export ENS_SIZE=30
export ENS_BEC_LOOK_BACK_HRS=1 # define the hours going back for ensemble forecast files for the ensemble BEC

export DO_CYC=true
export CYC_INTERVAL=1
Expand Down
1 change: 1 addition & 0 deletions workflow/exp/rt_jet/exp.rt_jet_conus3km
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export HYB_WGT_STATIC=1.0
export HYB_ENS_TYPE=1 # 1.rrfs; 2.interpolated GEFS/GDAS; 0.TBD on the fly (rrfs->GDAS->3DVAR)
export HYB_ENS_PATH="" # if empty, the workflow will try to find ensembles automatically
export ENS_SIZE=30
export ENS_BEC_LOOK_BACK_HRS=1 # define the hours going back for ensemble forecast files for the ensemble BEC

export DO_CYC=true
export CYC_INTERVAL=1
Expand Down
26 changes: 12 additions & 14 deletions workflow/rocoto_funcs/jedivar.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def jedivar(xmlFile, expdir, do_spinup=False):
extrn_mdl_source = os.getenv('IC_EXTRN_MDL_NAME', 'IC_PREFIX_not_defined')
physics_suite = os.getenv('PHYSICS_SUITE', 'PHYSICS_SUITE_not_defined')
ens_size = int(os.getenv('ENS_SIZE', '2'))
ens_bec_look_back_hrs = int(os.getenv('ENS_BEC_LOOK_BACK_HRS', '3'))
dcTaskEnv = {
'EXTRN_MDL_SOURCE': f'{extrn_mdl_source}',
'PHYSICS_SUITE': f'{physics_suite}',
Expand All @@ -32,6 +33,7 @@ def jedivar(xmlFile, expdir, do_spinup=False):
'HYB_WGT_STATIC': os.getenv('HYB_WGT_STATIC', '0.15'),
'HYB_ENS_TYPE': os.getenv('HYB_ENS_TYPE', '0'),
'HYB_ENS_PATH': os.getenv('HYB_ENS_PATH', ''),
'ENS_BEC_LOOK_BACK_HRS': f'{ens_bec_look_back_hrs}',
}
if do_spinup:
dcTaskEnv['DO_SPINUP'] = 'TRUE'
Expand All @@ -52,23 +54,19 @@ def jedivar(xmlFile, expdir, do_spinup=False):
ens_dep = ""
if HYB_WGT_ENS != "0" and HYB_WGT_ENS != "0.0" and HYB_ENS_TYPE == "1": # rrfsens
RUN = 'rrfs'
ens_depm1 = ""
ens_depm2 = ""
ens_depm3 = ""
for i in range(1, int(ens_size) + 1):
ensindexstr = f'mem{i:03d}'
ens_depm1 = ens_depm1 + f'\n <datadep age="00:05:00"><cyclestr offset="-1:00:00">{HYB_ENS_PATH}/{RUN}.@Y@m@d/@H/fcst/enkf/</cyclestr>{ensindexstr}/<cyclestr>mpasout.@Y-@m-@d_@H.@[email protected]</cyclestr></datadep>'
ens_depm2 = ens_depm2 + f'\n <datadep age="00:05:00"><cyclestr offset="-2:00:00">{HYB_ENS_PATH}/{RUN}.@Y@m@d/@H/fcst/enkf/</cyclestr>{ensindexstr}/<cyclestr>mpasout.@Y-@m-@d_@H.@[email protected]</cyclestr></datadep>'
ens_depm3 = ens_depm3 + f'\n <datadep age="00:05:00"><cyclestr offset="-3:00:00">{HYB_ENS_PATH}/{RUN}.@Y@m@d/@H/fcst/enkf/</cyclestr>{ensindexstr}/<cyclestr>mpasout.@Y-@m-@d_@H.@[email protected]</cyclestr></datadep>'
ens_dep0 = ""
for enshrs in range(1, int(ens_bec_look_back_hrs) + 1):
ens_depm = ""
for i in range(1, int(ens_size) + 1):
ensindexstr = f'mem{i:03d}'
ens_depm = ens_depm + f'\n <datadep age="00:05:00"><cyclestr offset="-{enshrs}:00:00">{HYB_ENS_PATH}/{RUN}.@Y@m@d/@H/fcst/enkf/</cyclestr>{ensindexstr}/<cyclestr>mpasout.@Y-@m-@d_@H.@[email protected]</cyclestr></datadep>'
ens_dep0 = ens_dep0 + f'''
<and>{ens_depm}
</and>'''

ens_dep = f'''
<or>
<and>{ens_depm1}
</and>
<and>{ens_depm2}
</and>
<and>{ens_depm3}
</and>
{ens_dep0}
</or>'''

elif HYB_WGT_ENS != "0" and HYB_WGT_ENS != "0.0" and HYB_ENS_TYPE == "2": # interpolated GDAS/GEFS
Expand Down