From 76219cd410be2e6ffea551ed6777c5194eddfbca Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:44:24 -0600 Subject: [PATCH] Feature #2429 MvMODE multivar intensity (#2603) --- docs/Users_Guide/glossary.rst | 10 +++++++- docs/Users_Guide/wrappers.rst | 23 +++++++++++++++---- .../wrappers/mode/test_mode_wrapper.py | 7 ++++-- metplus/wrappers/mode_wrapper.py | 13 +++++++---- parm/met_config/MODEConfig_wrapped | 7 ++++-- .../use_cases/met_tool_wrapper/MODE/MODE.conf | 3 ++- ...MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf | 3 ++- 7 files changed, 50 insertions(+), 16 deletions(-) diff --git a/docs/Users_Guide/glossary.rst b/docs/Users_Guide/glossary.rst index d268fdb793..39962c70e1 100644 --- a/docs/Users_Guide/glossary.rst +++ b/docs/Users_Guide/glossary.rst @@ -10420,7 +10420,15 @@ METplus Configuration Glossary | *Used by:* TCDiag MODE_MULTIVAR_INTENSITY_FLAG - Specify the value for 'multivar_intensity_flag' in the MET configuration file for MODE. + .. warning:: **DEPRECATED:** Please use :term:`MODE_MULTIVAR_INTENSITY_COMPARE_FCST` and :term:`MODE_MULTIVAR_INTENSITY_COMPARE_OBS` instead. + + MODE_MULTIVAR_INTENSITY_COMPARE_FCST + Specify the value for 'multivar_intensity_compare_fcst' in the MET configuration file for MODE. + + | *Used by:* MODE + + MODE_MULTIVAR_INTENSITY_COMPARE_OBS + Specify the value for 'multivar_intensity_compare_obs' in the MET configuration file for MODE. | *Used by:* MODE diff --git a/docs/Users_Guide/wrappers.rst b/docs/Users_Guide/wrappers.rst index 7f06973a12..e78b2fa2a3 100644 --- a/docs/Users_Guide/wrappers.rst +++ b/docs/Users_Guide/wrappers.rst @@ -4587,7 +4587,8 @@ METplus Configuration | :term:`FCST_MODE_IS_PROB` | :term:`FCST_MODE_PROB_IN_GRIB_PDS` | :term:`MODE_MULTIVAR_LOGIC` -| :term:`MODE_MULTIVAR_INTENSITY_FLAG` +| :term:`MODE_MULTIVAR_INTENSITY_COMPARE_FCST` +| :term:`MODE_MULTIVAR_INTENSITY_COMPARE_OBS` | :term:`FCST_MODE_VAR_NAME` | :term:`FCST_MODE_VAR_LEVELS` | :term:`FCST_MODE_VAR_THRESH` @@ -4738,8 +4739,20 @@ ${METPLUS_MULTIVAR_LOGIC} * - :term:`MODE_MULTIVAR_LOGIC` - multivar_logic -${METPLUS_MULTIVAR_INTENSITY_FLAG} -"""""""""""""""""""""""""""""""""" +${METPLUS_MULTIVAR_INTENSITY_COMPARE_FCST} +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. list-table:: + :widths: 5 5 + :header-rows: 1 + + * - METplus Config(s) + - MET Config File + * - :term:`MODE_MULTIVAR_INTENSITY_COMPARE_FCST` + - multivar_intensity_compare_fcst + +${METPLUS_MULTIVAR_INTENSITY_COMPARE_OBS} +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. list-table:: :widths: 5 5 @@ -4747,8 +4760,8 @@ ${METPLUS_MULTIVAR_INTENSITY_FLAG} * - METplus Config(s) - MET Config File - * - :term:`MODE_MULTIVAR_INTENSITY_FLAG` - - multivar_intensity_flag + * - :term:`MODE_MULTIVAR_INTENSITY_COMPARE_OBS` + - multivar_intensity_compare_obs ${METPLUS_FCST_FIELD} """"""""""""""""""""" diff --git a/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py b/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py index f64953e87a..cf2806c2e4 100644 --- a/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py +++ b/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py @@ -366,8 +366,11 @@ def test_mode_missing_inputs(metplus_config, get_test_data_dir, ({'MODE_MASK_MISSING_FLAG': 'BOTH', }, {'METPLUS_MASK_MISSING_FLAG': 'mask_missing_flag = BOTH;'}), - ({'MODE_MULTIVAR_INTENSITY_FLAG': 'false, true,true', }, - {'METPLUS_MULTIVAR_INTENSITY_FLAG': 'multivar_intensity_flag = [FALSE, TRUE, TRUE];'}), + ({'MODE_MULTIVAR_INTENSITY_COMPARE_FCST': '2, 3', }, + {'METPLUS_MULTIVAR_INTENSITY_COMPARE_FCST': 'multivar_intensity_compare_fcst = [2, 3];'}), + + ({'MODE_MULTIVAR_INTENSITY_COMPARE_OBS': '1,3', }, + {'METPLUS_MULTIVAR_INTENSITY_COMPARE_OBS': 'multivar_intensity_compare_obs = [1, 3];'}), ({'MODE_FCST_MULTIVAR_NAME': 'Snow', }, {'METPLUS_FCST_MULTIVAR_NAME': 'multivar_name = "Snow";'}), diff --git a/metplus/wrappers/mode_wrapper.py b/metplus/wrappers/mode_wrapper.py index 36a83c3941..13190a3b33 100755 --- a/metplus/wrappers/mode_wrapper.py +++ b/metplus/wrappers/mode_wrapper.py @@ -65,7 +65,8 @@ class MODEWrapper(CompareGriddedWrapper): 'METPLUS_FCST_FILE_TYPE', 'METPLUS_OBS_FILE_TYPE', 'METPLUS_MULTIVAR_LOGIC', - 'METPLUS_MULTIVAR_INTENSITY_FLAG', + 'METPLUS_MULTIVAR_INTENSITY_COMPARE_FCST', + 'METPLUS_MULTIVAR_INTENSITY_COMPARE_OBS', 'METPLUS_FCST_MULTIVAR_NAME', 'METPLUS_FCST_MULTIVAR_LEVEL', 'METPLUS_OBS_MULTIVAR_NAME', @@ -441,9 +442,13 @@ def create_c_dict(self): self.handle_mask(single_value=True, get_flags=True) - self.add_met_config(name='multivar_intensity_flag', data_type='list', - extra_args={'remove_quotes': True, - 'uppercase': True}) + self.add_met_config(name='multivar_intensity_compare_fcst', + data_type='list', + extra_args={'remove_quotes': True}) + self.add_met_config(name='multivar_intensity_compare_obs', + data_type='list', + extra_args={'remove_quotes': True}) + # skip RuntimeFreq input file logic - remove once integrated c_dict['FIND_FILES'] = False return c_dict diff --git a/parm/met_config/MODEConfig_wrapped b/parm/met_config/MODEConfig_wrapped index 54af9bcf4b..d010683d96 100644 --- a/parm/met_config/MODEConfig_wrapped +++ b/parm/met_config/MODEConfig_wrapped @@ -54,8 +54,11 @@ ${METPLUS_QUILT} //multivar_logic = ${METPLUS_MULTIVAR_LOGIC} -//multivar_intensity_flag = -${METPLUS_MULTIVAR_INTENSITY_FLAG} +//multivar_intensity_compare_fcst = +${METPLUS_MULTIVAR_INTENSITY_COMPARE_FCST} + +//multivar_intensity_compare_obs = +${METPLUS_MULTIVAR_INTENSITY_COMPARE_OBS} // // Forecast and observation fields to be verified diff --git a/parm/use_cases/met_tool_wrapper/MODE/MODE.conf b/parm/use_cases/met_tool_wrapper/MODE/MODE.conf index 55fbba5a5f..429b71f6e6 100644 --- a/parm/use_cases/met_tool_wrapper/MODE/MODE.conf +++ b/parm/use_cases/met_tool_wrapper/MODE/MODE.conf @@ -115,7 +115,8 @@ OBTYPE = WRF MODE_CONFIG_FILE = {PARM_BASE}/met_config/MODEConfig_wrapped #MODE_MULTIVAR_LOGIC = -#MODE_MULTIVAR_INTENSITY_FLAG = +#MODE_MULTIVAR_INTENSITY_COMPARE_FCST = +#MODE_MULTIVAR_INTENSITY_COMPARE_OBS = MODE_REGRID_TO_GRID = NONE #MODE_REGRID_METHOD = diff --git a/parm/use_cases/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf b/parm/use_cases/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf index 1f3764074d..ccf6a7a33d 100644 --- a/parm/use_cases/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf +++ b/parm/use_cases/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf @@ -25,7 +25,8 @@ OBTYPE = ANALYSIS # Run MODE to output super objects MODE_MULTIVAR_LOGIC = #1 && #2 && #3 -MODE_MULTIVAR_INTENSITY_FLAG = FALSE,TRUE,TRUE +MODE_MULTIVAR_INTENSITY_COMPARE_FCST = 2, 3 +MODE_MULTIVAR_INTENSITY_COMPARE_OBS = 2, 3 FCST_MODE_INPUT_DIR = {INPUT_BASE}/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl FCST_MODE_INPUT_TEMPLATE = hrrr.t{init?fmt=%H}z.wrfprsf{lead?fmt=%H}.sub.grib2,hrrr.t{init?fmt=%H}z.wrfprsf{lead?fmt=%H}.sub.grib2,hrrr.t{init?fmt=%H}z.wrfprsf{lead?fmt=%H}.sub.grib2