diff --git a/docs/Users_Guide/glossary.rst b/docs/Users_Guide/glossary.rst index e2e52287fd..a89e6a2712 100644 --- a/docs/Users_Guide/glossary.rst +++ b/docs/Users_Guide/glossary.rst @@ -10388,3 +10388,28 @@ METplus Configuration Glossary Specify the value for 'regrid.censor_val' in the MET configuration file for TCRMW. | *Used by:* TCRMW + + MODE_MULTIVAR_INTENSITY + Specify the value for 'multivar_intensity' in the MET configuration file for MODE. + + | *Used by:* MODE + + MODE_FCST_MULTIVAR_NAME + Specify the value for 'fcst.multivar_name' in the MET configuration file for MODE. + + | *Used by:* MODE + + MODE_FCST_MULTIVAR_UNITS + Specify the value for 'fcst.multivar_units' in the MET configuration file for MODE. + + | *Used by:* MODE + + MODE_OBS_MULTIVAR_NAME + Specify the value for 'obs.multivar_name' in the MET configuration file for MODE. + + | *Used by:* MODE + + MODE_OBS_MULTIVAR_UNITS + Specify the value for 'obs.multivar_units' 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 a900dcd864..872107e198 100644 --- a/docs/Users_Guide/wrappers.rst +++ b/docs/Users_Guide/wrappers.rst @@ -4055,16 +4055,21 @@ METplus Configuration | :term:`FCST_MODE_IS_PROB` | :term:`FCST_MODE_PROB_IN_GRIB_PDS` | :term:`MODE_MULTIVAR_LOGIC` +| :term:`MODE_MULTIVAR_INTENSITY` | :term:`FCST_MODE_VAR_NAME` | :term:`FCST_MODE_VAR_LEVELS` | :term:`FCST_MODE_VAR_THRESH` | :term:`FCST_MODE_VAR_OPTIONS` | :term:`MODE_FCST_FILE_TYPE` +| :term:`MODE_FCST_MULTIVAR_NAME` +| :term:`MODE_FCST_MULTIVAR_UNITS` | :term:`OBS_MODE_VAR_NAME` | :term:`OBS_MODE_VAR_LEVELS` | :term:`OBS_MODE_VAR_THRESH` | :term:`OBS_MODE_VAR_OPTIONS` | :term:`MODE_OBS_FILE_TYPE` +| :term:`MODE_OBS_MULTIVAR_NAME` +| :term:`MODE_OBS_MULTIVAR_UNITS` | .. warning:: **DEPRECATED:** @@ -4184,6 +4189,17 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`MODE_MULTIVAR_LOGIC` - multivar_logic +**${METPLUS_MULTIVAR_INTENSITY}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`MODE_MULTIVAR_INTENSITY` + - multivar_intensity + **${METPLUS_FCST_FIELD}** .. list-table:: @@ -4258,6 +4274,28 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`MODE_FCST_FILE_TYPE` - fcst.file_type +**${METPLUS_FCST_MULTIVAR_NAME}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`MODE_FCST_MULTIVAR_NAME` + - fcst.multivar_name + +**${METPLUS_FCST_MULTIVAR_UNITS}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`MODE_FCST_MULTIVAR_UNITS` + - fcst.multivar_units + **${METPLUS_OBS_FIELD}** @@ -4333,6 +4371,28 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`MODE_OBS_FILE_TYPE` - obs.file_type +**${METPLUS_OBS_MULTIVAR_NAME}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`MODE_OBS_MULTIVAR_NAME` + - obs.multivar_name + +**${METPLUS_OBS_MULTIVAR_UNITS}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`MODE_OBS_MULTIVAR_UNITS` + - obs.multivar_units + **${METPLUS_MASK_POLY}** .. list-table:: diff --git a/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py b/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py index 07ff4bb110..4781dfe073 100644 --- a/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py +++ b/internal/tests/pytests/wrappers/mode/test_mode_wrapper.py @@ -329,6 +329,21 @@ def set_minimum_config_settings(config): ({'MODE_MASK_MISSING_FLAG': 'BOTH', }, {'METPLUS_MASK_MISSING_FLAG': 'mask_missing_flag = BOTH;'}), + ({'MODE_MULTIVAR_INTENSITY': 'false, true,true', }, + {'METPLUS_MULTIVAR_INTENSITY': 'multivar_intensity = [FALSE, TRUE, TRUE];'}), + + ({'MODE_FCST_MULTIVAR_NAME': 'Snow', }, + {'METPLUS_FCST_MULTIVAR_NAME': 'multivar_name = "Snow";'}), + + ({'MODE_FCST_MULTIVAR_UNITS': 'L0', }, + {'METPLUS_FCST_MULTIVAR_UNITS': 'multivar_units = "L0";'}), + + ({'MODE_OBS_MULTIVAR_NAME': 'Precip', }, + {'METPLUS_OBS_MULTIVAR_NAME': 'multivar_name = "Precip";'}), + + ({'MODE_OBS_MULTIVAR_UNITS': 'Z10', }, + {'METPLUS_OBS_MULTIVAR_UNITS': 'multivar_units = "Z10";'}), + ] ) @pytest.mark.wrapper_a diff --git a/metplus/util/met_config.py b/metplus/util/met_config.py index e652b4f22d..fcebe2ec63 100644 --- a/metplus/util/met_config.py +++ b/metplus/util/met_config.py @@ -492,6 +492,9 @@ def set_met_config_list(config, c_dict, mp_config, met_config_name, if not remove_quotes: conf_value = f'"{conf_value}"' + if kwargs.get('uppercase', False): + conf_value = conf_value.upper() + out_values.append(conf_value) out_value = f"[{', '.join(out_values)}]" diff --git a/metplus/wrappers/mode_wrapper.py b/metplus/wrappers/mode_wrapper.py index 7d9a044b5e..e4bbd089ec 100755 --- a/metplus/wrappers/mode_wrapper.py +++ b/metplus/wrappers/mode_wrapper.py @@ -61,6 +61,11 @@ class MODEWrapper(CompareGriddedWrapper): 'METPLUS_FCST_FILE_TYPE', 'METPLUS_OBS_FILE_TYPE', 'METPLUS_MULTIVAR_LOGIC', + 'METPLUS_MULTIVAR_INTENSITY', + 'METPLUS_FCST_MULTIVAR_NAME', + 'METPLUS_FCST_MULTIVAR_UNITS', + 'METPLUS_OBS_MULTIVAR_NAME', + 'METPLUS_OBS_MULTIVAR_UNITS', ] # handle deprecated env vars used pre v4.0.0 @@ -408,12 +413,30 @@ def create_c_dict(self): extra_args={'remove_quotes': True, 'uppercase': True}) + self.add_met_config(name='multivar_name', data_type='string', + env_var_name='FCST_MULTIVAR_NAME', + metplus_configs=[f'{tool}_FCST_MULTIVAR_NAME']) + self.add_met_config(name='multivar_units', data_type='string', + env_var_name='FCST_MULTIVAR_UNITS', + metplus_configs=[f'{tool}_FCST_MULTIVAR_UNITS']) + + self.add_met_config(name='multivar_name', data_type='string', + env_var_name='OBS_MULTIVAR_NAME', + metplus_configs=[f'{tool}_OBS_MULTIVAR_NAME']) + self.add_met_config(name='multivar_units', data_type='string', + env_var_name='OBS_MULTIVAR_UNITS', + metplus_configs=[f'{tool}_OBS_MULTIVAR_UNITS']) + c_dict['MERGE_CONFIG_FILE'] = ( self.config.getraw('config', f'{tool}_MERGE_CONFIG_FILE', '') ) self.handle_mask(single_value=True, get_flags=True) + self.add_met_config(name='multivar_intensity', data_type='list', + extra_args={'remove_quotes': True, + 'uppercase': True}) + # handle setting VERIF_MASK for old wrapped MET config files self.add_met_config(name='poly', data_type='list', diff --git a/parm/met_config/MODEConfig_wrapped b/parm/met_config/MODEConfig_wrapped index 0ddcdceb69..bb5108b418 100644 --- a/parm/met_config/MODEConfig_wrapped +++ b/parm/met_config/MODEConfig_wrapped @@ -54,6 +54,9 @@ ${METPLUS_QUILT} //multivar_logic = ${METPLUS_MULTIVAR_LOGIC} +//multivar_intensity = +${METPLUS_MULTIVAR_INTENSITY} + // // Forecast and observation fields to be verified // @@ -70,6 +73,8 @@ fcst = { ${METPLUS_FCST_MERGE_THRESH} ${METPLUS_FCST_MERGE_FLAG} ${METPLUS_FCST_FILE_TYPE} + ${METPLUS_FCST_MULTIVAR_NAME} + ${METPLUS_FCST_MULTIVAR_UNITS} } obs = { @@ -85,6 +90,8 @@ obs = { ${METPLUS_OBS_MERGE_THRESH} ${METPLUS_OBS_MERGE_FLAG} ${METPLUS_OBS_FILE_TYPE} + ${METPLUS_OBS_MULTIVAR_NAME} + ${METPLUS_OBS_MULTIVAR_UNITS} } //////////////////////////////////////////////////////////////////////////////// diff --git a/parm/use_cases/met_tool_wrapper/MODE/MODE.conf b/parm/use_cases/met_tool_wrapper/MODE/MODE.conf index 07b392a36c..69fc6e7f6e 100644 --- a/parm/use_cases/met_tool_wrapper/MODE/MODE.conf +++ b/parm/use_cases/met_tool_wrapper/MODE/MODE.conf @@ -75,6 +75,9 @@ FCST_MODE_MERGE_FLAG = NONE #MODE_FCST_CENSOR_VAL = #MODE_FCST_VLD_THRESH = +#MODE_FCST_MULTIVAR_NAME = +#MODE_FCST_MULTIVAR_UNITS = + OBS_VAR1_NAME = RH OBS_VAR1_LEVELS = P500 @@ -92,6 +95,9 @@ OBS_MODE_MERGE_FLAG = NONE #MODE_OBS_CENSOR_VAL = #MODE_OBS_VLD_THRESH = +#MODE_OBS_MULTIVAR_NAME = +#MODE_OBS_MULTIVAR_UNITS = + ### # MODE Settings @@ -109,6 +115,7 @@ OBTYPE = WRF MODE_CONFIG_FILE = {PARM_BASE}/met_config/MODEConfig_wrapped #MODE_MULTIVAR_LOGIC = +#MODE_MULTIVAR_INTENSITY = MODE_REGRID_TO_GRID = NONE #MODE_REGRID_METHOD =