Skip to content

Commit

Permalink
Modifications to generalize the way ensemble forecast members are num…
Browse files Browse the repository at this point in the history
…bered and named. Details below.

Direct modifications:
* Introduce the new app configuration parameters `ENSMEM_BASENAME` and `NDIGITS_IN_ENSMEM_NAMES`.
* Remove the variable `VX_NDIGITS_ENSMEM_NAMES` since the role of this variable is now filled by `NDIGITS_IN_ENSMEM_NAMES`.
* Use `ENSMEM_BASENAME` and `NDIGITS_IN_ENSMEM_NAMES` in `setup.py` to generate the names of the ensemble members during the experiment generation step and saving the lists containing these names (and indices) in `var_defns.yaml` and `rocoto_defns.yaml`.
* Use the new lists defined in `rocoto_defns.yaml` in the various workflow config files to set values of ensemble member names  in the rocoto XML (instead of including code in the config files to re-generate the names for each metatask).
* Make sure generation of ensemble member names for all vx tasks is done in `setup.py` and passed to the ex-scripts instead of in the ex-scripts themselves.

Other modifications:
* Remove unused environment variables (e.g. `SLASH_ENSMEM_SUBDIR_OR_NULL`) in various workflow config files.
* For consistency with the way the (meta)tasks are named, rename some tags in the workflow config files (e.g change `envars_GenEnsProd_CCPA` to `envars_GenEnsProd_APCP`).
  • Loading branch information
gsketefian committed Nov 27, 2024
1 parent e257413 commit ca67bb6
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 152 deletions.
3 changes: 1 addition & 2 deletions jobs/JREGIONAL_CHECK_POST_OUTPUT
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
ensmem_name="mem${ENSMEM_INDX}"
cycle_dir="$EXPTDIR/$CDATE"
mkdir -p "${cycle_dir}"
touch "${cycle_dir}/post_files_exist_${ensmem_name}.txt"
touch "${cycle_dir}/post_files_exist_${ENSMEM_NAME}.txt"
#
#-----------------------------------------------------------------------
#
Expand Down
7 changes: 6 additions & 1 deletion parm/wflow/default_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ rocoto:
RUN: '{{ nco.RUN_default }}'
SCRIPTSdir: '{{ user.SCRIPTSdir }}'
SENDCOM: '{{ nco.SENDCOM_default }}'
SLASH_ENSMEM_SUBDIR: '{% if global.DO_ENSEMBLE %}{{ "/mem#mem#" }}{% else %}{{ "/" }}{% endif %}'
ENSMEM_INDICES: '{%- for mem_indx in global.ENSMEM_INDS %}
{{- mem_indx ~ " " }}
{%- endfor %}'
ENSMEM_NAMES: '{%- for mem_name in global.ENSMEM_NAMES %}
{{- mem_name ~ " " }}
{%- endfor %}'
USHdir: '{{ user.USHdir }}'
WARMSTART_CYCLE_DIR: '{{ workflow.WARMSTART_CYCLE_DIR }}'
WORKFLOW_ID: '{{ workflow.WORKFLOW_ID }}'
Expand Down
72 changes: 26 additions & 46 deletions parm/wflow/verify_det.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ metatask_GridStat_APCP_all_accums_all_mems:
{%- endfor %}'
metatask_GridStat_APCP#ACCUM_HH#h_all_mems:
var:
mem: '{%- if global.DO_ENSEMBLE %}
{%- for m in range(1, global.NUM_ENS_MEMBERS+1) %}
{{- "%03d "%m }}
{%- endfor %}
{%- else %}
{{- "000"|string }}
{%- endif %}'
task_run_MET_GridStat_vx_APCP#ACCUM_HH#h_mem#mem#:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
task_run_MET_GridStat_vx_APCP#ACCUM_HH#h_#mem_name#:
<<: *default_task_verify_det
attrs:
<<: *default_attrs
Expand All @@ -50,8 +45,8 @@ metatask_GridStat_APCP_all_accums_all_mems:
ACCUM_HH: '#ACCUM_HH#'
METPLUSTOOLNAME: 'GRIDSTAT'
OBTYPE: 'CCPA'
ENSMEM_INDX: "#mem#"
SLASH_ENSMEM_SUBDIR_OR_NULL: '{% if global.DO_ENSEMBLE %}{{ "/mem#mem#" }}{% endif %}'
ENSMEM_INDX: "#mem_indx#"
ENSMEM_NAME: "#mem_name#"
OBS_AVAIL_INTVL_HRS: '{{- verification.CCPA_OBS_AVAIL_INTVL_HRS }}'
FCST_LEVEL: 'A#ACCUM_HH#'
FCST_THRESH: 'all'
Expand All @@ -63,7 +58,7 @@ metatask_GridStat_APCP_all_accums_all_mems:
task: run_MET_PcpCombine_APCP#ACCUM_HH#h_obs_CCPA
taskdep_pcpcombine_fcst:
attrs:
task: run_MET_PcpCombine_APCP#ACCUM_HH#h_fcst_mem#mem#
task: run_MET_PcpCombine_APCP#ACCUM_HH#h_fcst_#mem_name#

metatask_GridStat_ASNOW_all_accums_all_mems:
var:
Expand All @@ -74,14 +69,9 @@ metatask_GridStat_ASNOW_all_accums_all_mems:
{%- endfor %}'
metatask_GridStat_ASNOW#ACCUM_HH#h_all_mems:
var:
mem: '{%- if global.DO_ENSEMBLE %}
{%- for m in range(1, global.NUM_ENS_MEMBERS+1) %}
{{- "%03d "%m }}
{%- endfor %}
{%- else %}
{{- "000"|string }}
{%- endif %}'
task_run_MET_GridStat_vx_ASNOW#ACCUM_HH#h_mem#mem#:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
task_run_MET_GridStat_vx_ASNOW#ACCUM_HH#h_#mem_name#:
<<: *default_task_verify_det
attrs:
<<: *default_attrs
Expand All @@ -94,8 +84,8 @@ metatask_GridStat_ASNOW_all_accums_all_mems:
ACCUM_HH: '#ACCUM_HH#'
METPLUSTOOLNAME: 'GRIDSTAT'
OBTYPE: 'NOHRSC'
ENSMEM_INDX: "#mem#"
SLASH_ENSMEM_SUBDIR_OR_NULL: '{% if global.DO_ENSEMBLE %}{{ "/mem#mem#" }}{% endif %}'
ENSMEM_INDX: "#mem_indx#"
ENSMEM_NAME: "#mem_name#"
OBS_AVAIL_INTVL_HRS: '{{- verification.NOHRSC_OBS_AVAIL_INTVL_HRS }}'
FCST_LEVEL: 'A#ACCUM_HH#'
FCST_THRESH: 'all'
Expand All @@ -107,25 +97,20 @@ metatask_GridStat_ASNOW_all_accums_all_mems:
task: run_MET_PcpCombine_ASNOW#ACCUM_HH#h_obs_NOHRSC
taskdep_pcpcombine_fcst:
attrs:
task: run_MET_PcpCombine_ASNOW#ACCUM_HH#h_fcst_mem#mem#
task: run_MET_PcpCombine_ASNOW#ACCUM_HH#h_fcst_#mem_name#

metatask_GridStat_REFC_RETOP_all_mems:
var:
mem: '{%- if global.DO_ENSEMBLE %}
{%- for m in range(1, global.NUM_ENS_MEMBERS+1) %}
{{- "%03d "%m }}
{%- endfor %}
{%- else %}
{{- "000"|string }}
{%- endif %}'
metatask_GridStat_REFC_RETOP_mem#mem#:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
metatask_GridStat_REFC_RETOP_#mem_name#:
var:
FIELD_GROUP: '{%- for var in verification.VX_FIELD_GROUPS %}
{%- if var in ["REFC", "RETOP"] %}
{{- "%s " % var }}
{%- endif %}
{%- endfor %}'
task_run_MET_GridStat_vx_#FIELD_GROUP#_mem#mem#:
task_run_MET_GridStat_vx_#FIELD_GROUP#_#mem_name#:
<<: *default_task_verify_det
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GRIDSTAT_OR_POINTSTAT_VX"'
envars:
Expand All @@ -134,8 +119,8 @@ metatask_GridStat_REFC_RETOP_all_mems:
FIELD_GROUP: '#FIELD_GROUP#'
METPLUSTOOLNAME: 'GRIDSTAT'
OBTYPE: 'MRMS'
ENSMEM_INDX: "#mem#"
SLASH_ENSMEM_SUBDIR_OR_NULL: '{% if global.DO_ENSEMBLE %}{{ "/mem#mem#" }}{% endif %}'
ENSMEM_INDX: "#mem_indx#"
ENSMEM_NAME: "#mem_name#"
OBS_AVAIL_INTVL_HRS: '{{- verification.MRMS_OBS_AVAIL_INTVL_HRS }}'
FCST_LEVEL: 'L0'
FCST_THRESH: 'all'
Expand Down Expand Up @@ -164,25 +149,20 @@ metatask_GridStat_REFC_RETOP_all_mems:
datadep_post_files_exist:
attrs:
age: 00:00:00:30
text: !cycstr '{{ workflow.EXPTDIR }}/@Y@m@d@H/post_files_exist_mem#mem#.txt'
text: !cycstr '{{ workflow.EXPTDIR }}/@Y@m@d@H/post_files_exist_#mem_name#.txt'

metatask_PointStat_SFC_UPA_all_mems:
var:
mem: '{%- if global.DO_ENSEMBLE %}
{%- for m in range(1, global.NUM_ENS_MEMBERS+1) %}
{{- "%03d "%m }}
{%- endfor %}
{%- else %}
{{- "000"|string }}
{%- endif %}'
metatask_PointStat_SFC_UPA_mem#mem#:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
metatask_PointStat_SFC_UPA_#mem_name#:
var:
FIELD_GROUP: '{%- for var in verification.VX_FIELD_GROUPS %}
{%- if var in ["SFC", "UPA"] %}
{{- "%s " % var }}
{%- endif %}
{%- endfor %}'
task_run_MET_PointStat_vx_#FIELD_GROUP#_mem#mem#:
task_run_MET_PointStat_vx_#FIELD_GROUP#_#mem_name#:
<<: *default_task_verify_det
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GRIDSTAT_OR_POINTSTAT_VX"'
envars:
Expand All @@ -191,8 +171,8 @@ metatask_PointStat_SFC_UPA_all_mems:
FIELD_GROUP: '#FIELD_GROUP#'
METPLUSTOOLNAME: 'POINTSTAT'
OBTYPE: 'NDAS'
ENSMEM_INDX: "#mem#"
SLASH_ENSMEM_SUBDIR_OR_NULL: '{% if global.DO_ENSEMBLE %}{{ "/mem#mem#" }}{% endif %}'
ENSMEM_INDX: "#mem_indx#"
ENSMEM_NAME: "#mem_name#"
OBS_AVAIL_INTVL_HRS: '{{- verification.NDAS_OBS_AVAIL_INTVL_HRS }}'
FCST_LEVEL: 'all'
FCST_THRESH: 'all'
Expand Down Expand Up @@ -221,4 +201,4 @@ metatask_PointStat_SFC_UPA_all_mems:
datadep_post_files_exist:
attrs:
age: 00:00:00:30
text: !cycstr '{{ workflow.EXPTDIR }}/@Y@m@d@H/post_files_exist_mem#mem#.txt'
text: !cycstr '{{ workflow.EXPTDIR }}/@Y@m@d@H/post_files_exist_#mem_name#.txt'
36 changes: 20 additions & 16 deletions parm/wflow/verify_ens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ metatask_GenEnsProd_EnsembleStat_APCP_all_accums:
{{- "%02d " % ah }}
{%- endif %}
{%- endfor %}'
task_run_MET_GenEnsProd_vx_APCP#ACCUM_HH#h: &task_GenEnsProd_CCPA
task_run_MET_GenEnsProd_vx_APCP#ACCUM_HH#h: &task_GenEnsProd_APCP
<<: *default_task_verify_ens
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GENENSPROD_OR_ENSEMBLESTAT"'
envars: &envars_GenEnsProd_CCPA
envars: &envars_GenEnsProd_APCP
<<: *default_vars
ACCUM_HH: '#ACCUM_HH#'
OBS_DIR: '&CCPA_OBS_DIR;'
Expand All @@ -40,14 +40,15 @@ metatask_GenEnsProd_EnsembleStat_APCP_all_accums:
OBTYPE: 'CCPA'
FCST_LEVEL: 'A#ACCUM_HH#'
FCST_THRESH: 'all'
ENSMEM_NAMES_STR: '&ENSMEM_NAMES;'
dependency:
metataskdep_pcpcombine_fcst:
attrs:
metatask: PcpCombine_APCP#ACCUM_HH#h_all_mems
task_run_MET_EnsembleStat_vx_APCP#ACCUM_HH#h:
<<: *task_GenEnsProd_CCPA
<<: *task_GenEnsProd_APCP
envars:
<<: *envars_GenEnsProd_CCPA
<<: *envars_GenEnsProd_APCP
METPLUSTOOLNAME: 'ENSEMBLESTAT'
FCST_THRESH: 'none'
dependency:
Expand All @@ -66,10 +67,10 @@ metatask_GenEnsProd_EnsembleStat_ASNOW_all_accums:
{{- "%02d " % ah }}
{%- endif %}
{%- endfor %}'
task_run_MET_GenEnsProd_vx_ASNOW#ACCUM_HH#h: &task_GenEnsProd_NOHRSC
task_run_MET_GenEnsProd_vx_ASNOW#ACCUM_HH#h: &task_GenEnsProd_ASNOW
<<: *default_task_verify_ens
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GENENSPROD_OR_ENSEMBLESTAT"'
envars: &envars_GenEnsProd_NOHRSC
envars: &envars_GenEnsProd_ASNOW
<<: *default_vars
ACCUM_HH: '#ACCUM_HH#'
OBS_DIR: '&NOHRSC_OBS_DIR;'
Expand All @@ -78,15 +79,16 @@ metatask_GenEnsProd_EnsembleStat_ASNOW_all_accums:
OBTYPE: 'NOHRSC'
FCST_LEVEL: 'A#ACCUM_HH#'
FCST_THRESH: 'all'
ENSMEM_NAMES_STR: '&ENSMEM_NAMES;'
dependency:
and:
metataskdep_pcpcombine_fcst:
attrs:
metatask: PcpCombine_ASNOW#ACCUM_HH#h_all_mems
task_run_MET_EnsembleStat_vx_ASNOW#ACCUM_HH#h:
<<: *task_GenEnsProd_NOHRSC
<<: *task_GenEnsProd_ASNOW
envars:
<<: *envars_GenEnsProd_NOHRSC
<<: *envars_GenEnsProd_ASNOW
METPLUSTOOLNAME: 'ENSEMBLESTAT'
FCST_THRESH: 'none'
dependency:
Expand All @@ -105,10 +107,10 @@ metatask_GenEnsProd_EnsembleStat_REFC_RETOP:
{{- "%s " % var }}
{%- endif %}
{%- endfor %}'
task_run_MET_GenEnsProd_vx_#FIELD_GROUP#: &task_GenEnsProd_MRMS
task_run_MET_GenEnsProd_vx_#FIELD_GROUP#: &task_GenEnsProd_REFC_RETOP
<<: *default_task_verify_ens
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GENENSPROD_OR_ENSEMBLESTAT"'
envars: &envars_GenEnsProd_MRMS
envars: &envars_GenEnsProd_REFC_RETOP
<<: *default_vars
ACCUM_HH: '01'
OBS_DIR: '&MRMS_OBS_DIR;'
Expand All @@ -117,14 +119,15 @@ metatask_GenEnsProd_EnsembleStat_REFC_RETOP:
OBTYPE: 'MRMS'
FCST_LEVEL: 'L0'
FCST_THRESH: 'all'
ENSMEM_NAMES_STR: '&ENSMEM_NAMES;'
dependency:
metataskdep_check_post_output: &check_post_output
attrs:
metatask: check_post_output_all_mems
task_run_MET_EnsembleStat_vx_#FIELD_GROUP#:
<<: *task_GenEnsProd_MRMS
<<: *task_GenEnsProd_REFC_RETOP
envars:
<<: *envars_GenEnsProd_MRMS
<<: *envars_GenEnsProd_REFC_RETOP
METPLUSTOOLNAME: 'ENSEMBLESTAT'
FCST_LEVEL: 'L0'
FCST_THRESH: 'none'
Expand Down Expand Up @@ -160,10 +163,10 @@ metatask_GenEnsProd_EnsembleStat_SFC_UPA:
{{- "%s " % var }}
{%- endif %}
{%- endfor %}'
task_run_MET_GenEnsProd_vx_#FIELD_GROUP#: &task_GenEnsProd_NDAS
task_run_MET_GenEnsProd_vx_#FIELD_GROUP#: &task_GenEnsProd_SFC_UPA
<<: *default_task_verify_ens
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GENENSPROD_OR_ENSEMBLESTAT"'
envars: &envars_GenEnsProd_NDAS
envars: &envars_GenEnsProd_SFC_UPA
<<: *default_vars
OBS_DIR: '&NDAS_OBS_DIR;'
FIELD_GROUP: '#FIELD_GROUP#'
Expand All @@ -172,14 +175,15 @@ metatask_GenEnsProd_EnsembleStat_SFC_UPA:
ACCUM_HH: '01'
FCST_LEVEL: 'all'
FCST_THRESH: 'all'
ENSMEM_NAMES_STR: '&ENSMEM_NAMES;'
walltime: 04:15:00
dependency:
metataskdep_check_post_output:
<<: *check_post_output
task_run_MET_EnsembleStat_vx_#FIELD_GROUP#:
<<: *task_GenEnsProd_NDAS
<<: *task_GenEnsProd_SFC_UPA
envars:
<<: *envars_GenEnsProd_NDAS
<<: *envars_GenEnsProd_SFC_UPA
METPLUSTOOLNAME: 'ENSEMBLESTAT'
walltime: 01:00:00
dependency:
Expand Down
Loading

0 comments on commit ca67bb6

Please sign in to comment.