Skip to content

Commit

Permalink
Further changes to enable the capability to verify against a benchmar…
Browse files Browse the repository at this point in the history
…k forecast instead of obs. Details below.

* Remove other changes (besides the metatasks that were removed in the previous commit) that were part of the attempt to loop over various field groups to obtain a meta-metatask.  This includes uncommenting commented-out parts of the verify_*.yaml files.
* Introduce new metatasks (metatask_GridStat_SFC_UPA_all_mems and metatask_GridStat_SFC_UPA_ensmeanprob) for using GridStat for the SFC and UPA field groups when the verification is being performed against a benchmark forecast (as opposed to against obs).
* In setup.py, change the way certain vx (metatasks) are removed from the workflow so that the metatasks are grouped by field group, not observation type. This makes it more convenient to include/exclude the vx metatasks since they are also field-group based, not obtype based.
* Bug fix in the way the variable FIELDNAME_IN_MET_FILEDIR_NAMES is set in exregional_run_met_gridstat_or_pointstat_vx.sh in the case in which the verification is being performed against a benchmark forecast (as opposed to against obs).
  • Loading branch information
gsketefian committed Dec 2, 2024
1 parent 6c26b4f commit 5fc6a96
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 166 deletions.
84 changes: 59 additions & 25 deletions parm/wflow/verify_det.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ default_task_verify_det: &default_task_verify_det
queue: '&QUEUE_DEFAULT;'
walltime: 00:30:00


metatask_GridStat_APCP_all_accums_all_mems:
var:
ACCUM_HH: '&ACCUM_HH_APCP;'
Expand Down Expand Up @@ -54,6 +55,7 @@ metatask_GridStat_APCP_all_accums_all_mems:
attrs:
task: run_MET_PcpCombine_APCP#ACCUM_HH#h_fcst_#mem_name#


metatask_GridStat_ASNOW_all_accums_all_mems:
var:
ACCUM_HH: '&ACCUM_HH_ASNOW;'
Expand Down Expand Up @@ -87,14 +89,15 @@ metatask_GridStat_ASNOW_all_accums_all_mems:
attrs:
task: run_MET_PcpCombine_ASNOW#ACCUM_HH#h_fcst_#mem_name#


metatask_GridStat_REFC_RETOP_all_mems:
var:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
metatask_GridStat_REFC_RETOP_#mem_name#:
var:
FIELD_GROUP: '{%- for var in verification.VX_GRIDTOGRID_FIELD_GROUPS %}
{%- if var in ["REFC", "RETOP", "SFC", "UPA"] %}
FIELD_GROUP: '{%- for var in verification.VX_FIELD_GROUPS %}
{%- if var in ["REFC", "RETOP"] %}
{{- "%s " % var }}
{%- endif %}
{%- endfor %}'
Expand All @@ -108,8 +111,7 @@ metatask_GridStat_REFC_RETOP_all_mems:
METPLUSTOOLNAME: 'GRIDSTAT'
ENSMEM_INDX: "#mem_indx#"
ENSMEM_NAME: "#mem_name#"
#FCST_LEVEL: 'L0'
FCST_LEVEL: 'all'
FCST_LEVEL: 'L0'
FCST_THRESH: 'all'
walltime: 02:00:00
dependency:
Expand Down Expand Up @@ -138,13 +140,45 @@ metatask_GridStat_REFC_RETOP_all_mems:
age: 00:00:00:30
text: !cycstr '{{ workflow.EXPTDIR }}/@Y@m@d@H/post_files_exist_#mem_name#.txt'


metatask_GridStat_SFC_UPA_all_mems:
var:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
metatask_GridStat_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_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:
<<: *default_vars
OBS_DIR: '&NDAS_OBS_DIR;'
FIELD_GROUP: '#FIELD_GROUP#'
METPLUSTOOLNAME: 'GRIDSTAT'
ENSMEM_INDX: "#mem_indx#"
ENSMEM_NAME: "#mem_name#"
FCST_LEVEL: 'all'
FCST_THRESH: 'all'
walltime: 02:00:00
dependency:
datadep_post_files_exist:
attrs:
age: 00:00:00:30
text: !cycstr '{{ workflow.EXPTDIR }}/@Y@m@d@H/post_files_exist_#mem_name#.txt'


metatask_PointStat_SFC_UPA_all_mems:
var:
mem_indx: '&ENSMEM_INDICES;'
mem_name: '&ENSMEM_NAMES;'
metatask_PointStat_SFC_UPA_#mem_name#:
var:
FIELD_GROUP: '{%- for var in verification.VX_GRIDTOPOINT_FIELD_GROUPS %}
FIELD_GROUP: '{%- for var in verification.VX_FIELD_GROUPS %}
{%- if var in ["SFC", "UPA"] %}
{{- "%s " % var }}
{%- endif %}
Expand All @@ -163,26 +197,26 @@ metatask_PointStat_SFC_UPA_all_mems:
FCST_THRESH: 'all'
walltime: 01:00:00
dependency:
# and:
# datadep_all_pb2nc_obs_ndas_complete:
# attrs:
# age: 00:00:00:30
# # Check that the flag files that indicate that the Pb2NC tasks are
# # complete are all present before launching any PointStat task.
# text: '{%- set num_obs_days = workflow.OBS_DAYS_ALL_CYCLES_INST|length %}
# {%- set indent = " " %}
# {%- set indent_p2 = indent + " " %}
# {%- for n in range(0, num_obs_days) %}
# {%- set yyyymmdd = workflow.OBS_DAYS_ALL_CYCLES_INST[n] %}
# {%- if n == 0 %}
# {{- workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
# {%- else %}
# {{- indent ~ "</datadep>\n" }}
# {{- indent ~ "<datadep age=\"00:00:00:30\">\n" }}
# {{- indent_p2 ~ workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
# {%- endif %}
# {%- if n != num_obs_days-1 %} {{- "\n" }} {%- endif %}
# {%- endfor %}'
and:
datadep_all_pb2nc_obs_ndas_complete:
attrs:
age: 00:00:00:30
# Check that the flag files that indicate that the Pb2NC tasks are
# complete are all present before launching any PointStat task.
text: '{%- set num_obs_days = workflow.OBS_DAYS_ALL_CYCLES_INST|length %}
{%- set indent = " " %}
{%- set indent_p2 = indent + " " %}
{%- for n in range(0, num_obs_days) %}
{%- set yyyymmdd = workflow.OBS_DAYS_ALL_CYCLES_INST[n] %}
{%- if n == 0 %}
{{- workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
{%- else %}
{{- indent ~ "</datadep>\n" }}
{{- indent ~ "<datadep age=\"00:00:00:30\">\n" }}
{{- indent_p2 ~ workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
{%- endif %}
{%- if n != num_obs_days-1 %} {{- "\n" }} {%- endif %}
{%- endfor %}'
datadep_post_files_exist:
attrs:
age: 00:00:00:30
Expand Down
68 changes: 48 additions & 20 deletions parm/wflow/verify_ens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,26 @@ metatask_GenEnsProd_EnsembleStat_SFC_UPA:
METPLUSTOOLNAME: 'ENSEMBLESTAT'
walltime: 01:00:00
dependency:
# and:
# datadep_all_pb2nc_obs_ndas_complete: &all_pb2nc_obs_ndas_complete
# attrs:
# age: 00:00:00:30
# # Check that the flag files that indicate that the Pb2NC tasks are
# # complete are all present before launching any EnsembleStat task.
# text: '{%- set num_obs_days = workflow.OBS_DAYS_ALL_CYCLES_INST|length %}
# {%- set indent = " " %}
# {%- set indent_p2 = indent + " " %}
# {%- for n in range(0, num_obs_days) %}
# {%- set yyyymmdd = workflow.OBS_DAYS_ALL_CYCLES_INST[n] %}
# {%- if n == 0 %}
# {{- workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
# {%- else %}
# {{- indent ~ "</datadep>\n" }}
# {{- indent ~ "<datadep age=\"00:00:00:30\">\n" }}
# {{- indent_p2 ~ workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
# {%- endif %}
# {%- if n != num_obs_days-1 %} {{- "\n" }} {%- endif %}
# {%- endfor %}'
and:
datadep_all_pb2nc_obs_ndas_complete: &all_pb2nc_obs_ndas_complete
attrs:
age: 00:00:00:30
# Check that the flag files that indicate that the Pb2NC tasks are
# complete are all present before launching any EnsembleStat task.
text: '{%- set num_obs_days = workflow.OBS_DAYS_ALL_CYCLES_INST|length %}
{%- set indent = " " %}
{%- set indent_p2 = indent + " " %}
{%- for n in range(0, num_obs_days) %}
{%- set yyyymmdd = workflow.OBS_DAYS_ALL_CYCLES_INST[n] %}
{%- if n == 0 %}
{{- workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
{%- else %}
{{- indent ~ "</datadep>\n" }}
{{- indent ~ "<datadep age=\"00:00:00:30\">\n" }}
{{- indent_p2 ~ workflow.WFLOW_FLAG_FILES_DIR ~ "/run_met_pb2nc_obs_ndas_" ~ yyyymmdd ~ "_complete.txt" }}
{%- endif %}
{%- if n != num_obs_days-1 %} {{- "\n" }} {%- endif %}
{%- endfor %}'
taskdep_genensprod:
attrs:
task: run_MET_GenEnsProd_vx_#FIELD_GROUP#
Expand Down Expand Up @@ -281,6 +281,34 @@ metatask_GridStat_REFC_RETOP_ensprob:
attrs:
task: run_MET_GenEnsProd_vx_#FIELD_GROUP#


metatask_GridStat_SFC_UPA_ensmeanprob:
var:
stat: MEAN PROB
statlc: mean prob
metatask_GridStat_SFC_UPA_ens#statlc#:
var:
FIELD_GROUP: '{%- for var in verification.VX_FIELD_GROUPS %}
{%- if var in ["SFC", "UPA"] %}
{{- "%s " % var }}
{%- endif %}
{%- endfor %}'
task_run_MET_GridStat_vx_#FIELD_GROUP#_ens#statlc#:
<<: *default_task_verify_ens
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_GRIDSTAT_OR_POINTSTAT_VX_ENS#stat#"'
envars:
<<: *default_vars
OBS_DIR: '&NDAS_OBS_DIR;'
FIELD_GROUP: '#FIELD_GROUP#'
METPLUSTOOLNAME: 'GRIDSTAT'
FCST_LEVEL: 'all'
FCST_THRESH: 'all'
dependency:
taskdep_genensprod:
attrs:
task: run_MET_GenEnsProd_vx_#FIELD_GROUP#


metatask_PointStat_SFC_UPA_ensmeanprob:
var:
stat: MEAN PROB
Expand Down
48 changes: 24 additions & 24 deletions parm/wflow/verify_pre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,30 @@ task_get_obs_ndas:
partition: '{% if platform.get("PARTITION_HPSS") %}&PARTITION_HPSS;{% else %}None{% endif %}'
walltime: 02:00:00

#task_run_MET_Pb2nc_obs_NDAS:
# <<: *default_task_verify_pre
# attrs:
# cycledefs: cycledefs_obs_days_inst
# maxtries: '2'
# command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_PB2NC_OBS"'
# envars:
# <<: *default_vars
# FIELD_GROUP: 'SFC'
# FCST_OR_OBS: OBS
# OBS_DIR: '&NDAS_OBS_DIR;'
# METPLUSTOOLNAME: 'PB2NC'
# dependency:
# and:
# datadep:
# text: "&NDAS_OBS_DIR;"
# or:
# not:
# taskvalid:
# attrs:
# task: get_obs_ndas
# taskdep:
# attrs:
# task: get_obs_ndas
task_run_MET_Pb2nc_obs_NDAS:
<<: *default_task_verify_pre
attrs:
cycledefs: cycledefs_obs_days_inst
maxtries: '2'
command: '&LOAD_MODULES_RUN_TASK; "run_vx" "&JOBSdir;/JREGIONAL_RUN_MET_PB2NC_OBS"'
envars:
<<: *default_vars
FIELD_GROUP: 'SFC'
FCST_OR_OBS: OBS
OBS_DIR: '&NDAS_OBS_DIR;'
METPLUSTOOLNAME: 'PB2NC'
dependency:
and:
datadep:
text: "&NDAS_OBS_DIR;"
or:
not:
taskvalid:
attrs:
task: get_obs_ndas
taskdep:
attrs:
task: get_obs_ndas

metatask_PcpCombine_APCP_all_accums_obs_CCPA:
var:
Expand Down
25 changes: 8 additions & 17 deletions scripts/exregional_run_met_gridstat_or_pointstat_vx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,18 @@ CDATE="${PDY}${cyc}"
#
#-----------------------------------------------------------------------
#
FIELDNAME_IN_MET_FILEDIR_NAMES=""
# Note that ACCUM_HH will not be defined for the REFC, RETOP, SFC, and
# UPA field groups.
set_vx_params \
field_group="${FIELD_GROUP}" \
accum_hh="${ACCUM_HH:-}" \
outvarname_obtype="obtype" \
outvarname_grid_or_point="grid_or_point" \
outvarname_fieldname_in_MET_filedir_names="FIELDNAME_IN_MET_FILEDIR_NAMES"

if [ $(boolify "${VX_VERIFY_AGAINST_BENCHMARK_FCST}") = "TRUE" ]; then

obtype="${VX_BENCHMARK_FCST_MODEL_NAME}"
grid_or_point="grid"
FIELDNAME_IN_MET_FILEDIR_NAMES="${VX_BENCHMARK_FCST_MODEL_NAME}"

else

# Note that ACCUM_HH will not be defined for the REFC, RETOP, SFC, and
# UPA field groups.
set_vx_params \
field_group="${FIELD_GROUP}" \
accum_hh="${ACCUM_HH:-}" \
outvarname_obtype="obtype" \
outvarname_grid_or_point="grid_or_point" \
outvarname_fieldname_in_MET_filedir_names="FIELDNAME_IN_MET_FILEDIR_NAMES"

fi
#
#-----------------------------------------------------------------------
Expand Down Expand Up @@ -215,8 +208,6 @@ elif [ "${grid_or_point}" = "point" ]; then

OBS_INPUT_DIR="${vx_output_basedir}/metprd/Pb2nc_obs"
OBS_INPUT_FN_TEMPLATE="${OBS_NDAS_SFCandUPA_FN_TEMPLATE_PB2NC_OUTPUT}"
OBS_INPUT_DIR="${NDAS_OBS_DIR}"
OBS_INPUT_FN_TEMPLATE="${OBS_NDAS_FN_TEMPLATES[1]}"
FCST_INPUT_DIR="${vx_fcst_input_basedir}"
FCST_INPUT_FN_TEMPLATE="${FCST_SUBDIR_TEMPLATE:+${FCST_SUBDIR_TEMPLATE}/}${FCST_FN_TEMPLATE}"

Expand Down
Loading

0 comments on commit 5fc6a96

Please sign in to comment.