MODE: Multivariate

model_applications/ short_range/ MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf

Scientific Objective

This use case demonstrates how to run Multivariate MODE to identify complex objects from two or more fields defined by a logical expression. This use case identifies blizzard-like objects defined by the intersection of : 1) the presence of snow precipitation type, 2) 10-m winds > 20 mph, and 3) visibility < 1/2 mile. The use of multivariate MODE is well-suited to assess the structure and placement of complex high-impact events such as blizzard conditions and heavy snow bands. Output from this use-case consists of the MODE ASCII, NetCDF, and PostScript files for the MODE forecast and observation super objects.

In this case, MODE super object intensity statistics were ouput for both 10-m wind and visibility. Using the the MODE_MULTIVAR_INTENSITY_FLAG, the user can control for which variables super object intensity statistics will be output. If all are set to False, then no intensity information will be output and only statistics relative to the super-object geometry will be available. In the case no requested intesities, the parameters MODE_FCST/OBS_MULTIVAR_NAME and/or MODE_FCST/OBS_MULTIVAR_LEVEL may be used as identifiers for the super-object.

Datasets

Forecast dataset: 1-hour HRRR in grib2

Observation dataset: MRMS and HRRR analysis in grib2

The forecast and observation fields are only a subset of the full domain in order for a faster run-time of Multivariate MODE. An example command using wgrib2 to create the HRRR subdomain is:

wgrib2 infile.grib2 -new_grid_winds earth -new_grid lambert:262.5:38.5:38.5:38.5 -83.0:400:3000 37.0:400:3000 outfile.grib2

Location: All of the input data required for this use case can be found in the short_range sample data tarball. Navigate to METplus Releases and download sample data for the appropriate release.

This tarball should be unpacked into the directory that you will set the value of INPUT_BASE. See Running METplus for more information.

METplus Components

This use case utilizes the METplus MODE wrapper, ingesting multiple variables to output complex super objects based on a user-defined logical expression.

METplus Workflow

MODE is the only tool called and ingests multiple fields to create a complex super object.

This example runs a single forecast hour.

Initialization: 2021020100
Forecast lead: 21

METplus Configuration

METplus first loads all of the configuration files found in parm/metplus_config, then it loads any configuration files passed to METplus via the command line: parm/use_cases/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf

[config]

# Documentation for this use-case can be found at:
# https://metplus.readthedocs.io/en/latest/generated/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.html

# Processes to run
PROCESS_LIST = MODE

# Time Info
LOOP_ORDER = times
LOOP_BY = INIT

INIT_TIME_FMT = %Y%m%d%H
INIT_BEG = 2021020100
INIT_END = 2021020100

LEAD_SEQ = 21

MODEL = HRRR
OBTYPE = ANALYSIS

##################################
# Multivariate MODE Configurations
##################################

# Run MODE to output super objects
MODE_MULTIVAR_LOGIC = #1 && #2 && #3
MODE_MULTIVAR_INTENSITY_FLAG = FALSE,TRUE,TRUE

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

OBS_MODE_INPUT_DIR = {INPUT_BASE}/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl
OBS_MODE_INPUT_TEMPLATE = PrecipFlag_00.00_{valid?fmt=%Y%m%d}-{valid?fmt=%2H}0000.sub.grib2,hrrr.t{valid?fmt=%H}z.wrfprsf00.sub.grib2,hrrr.t{valid?fmt=%H}z.wrfprsf00.sub.grib2

MODE_OUTPUT_DIR = {OUTPUT_BASE}/mode
MODE_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/f{lead?fmt=%2H}

FCST_VAR1_NAME = CSNOW
FCST_VAR1_LEVELS = L0
FCST_VAR1_OPTIONS = conv_radius = 0; conv_thresh = ==1; merge_flag = NONE

OBS_VAR1_NAME = PrecipFlag
OBS_VAR1_LEVELS = L0
OBS_VAR1_OPTIONS = conv_radius = 0; conv_thresh = ==3; merge_flag = NONE

FCST_VAR2_NAME = VIS
FCST_VAR2_LEVELS = L0
FCST_VAR2_OPTIONS = conv_radius = 5; conv_thresh = <=804.672; merge_thresh = <=1207.008; merge_flag = THRESH 

OBS_VAR2_NAME = VIS
OBS_VAR2_LEVELS = L0
OBS_VAR2_OPTIONS = conv_radius = 5; conv_thresh = <=804.672; merge_thresh = <=1207.008; merge_flag = THRESH

FCST_VAR3_NAME = WIND
FCST_VAR3_LEVELS = Z10
FCST_VAR3_OPTIONS = conv_radius = 5; conv_thresh = >=8.9408; merge_thresh = >=6.7056; merge_flag = THRESH

OBS_VAR3_NAME = WIND
OBS_VAR3_LEVELS = Z10
OBS_VAR3_OPTIONS = conv_radius = 5; conv_thresh = >=8.9408; merge_thresh = >=6.7056; merge_flag = THRESH

MODE_FCST_FILTER_ATTR_NAME = AREA
MODE_FCST_FILTER_ATTR_THRESH = >=25
MODE_OBS_FILTER_ATTR_NAME = AREA
MODE_OBS_FILTER_ATTR_THRESH = >=25

MODE_MATCH_FLAG = MERGE_BOTH

MODE_REGRID_TO_GRID = FCST
MODE_REGRID_METHOD = NEAREST
MODE_REGRID_WIDTH = 1
MODE_REGRID_VLD_THRESH = 0.5

MODE_OUTPUT_PREFIX = {MODEL}_vs_{OBTYPE}

MODE_GRID_RES = 3

MODE_NC_PAIRS_FLAG_LATLON = TRUE
MODE_NC_PAIRS_FLAG_RAW = TRUE
MODE_NC_PAIRS_FLAG_OBJECT_RAW = TRUE
MODE_NC_PAIRS_FLAG_OBJECT_ID = TRUE
MODE_NC_PAIRS_FLAG_CLUSTER_ID = TRUE
MODE_NC_PAIRS_FLAG_POLYLINES = TRUE

MODE_QUILT = False

MODE_PS_PLOT_FLAG = TRUE
MODE_CT_STATS_FLAG = TRUE

MET Configuration

METplus sets environment variables based on user settings in the METplus configuration file. See How METplus controls MET config file settings for more details.

YOU SHOULD NOT SET ANY OF THESE ENVIRONMENT VARIABLES YOURSELF! THEY WILL BE OVERWRITTEN BY METPLUS WHEN IT CALLS THE MET TOOLS!

If there is a setting in the MET configuration file that is currently not supported by METplus you’d like to control, please refer to: Overriding Unsupported MET config file settings

Note

See the MODE MET Configuration section of the User’s Guide for more information on the environment variables used in the file below:

////////////////////////////////////////////////////////////////////////////////
//
// MODE configuration file.
//
// For additional information, see the MET_BASE/config/README file.
//
////////////////////////////////////////////////////////////////////////////////

//
// Output model name to be written
//
// model =
${METPLUS_MODEL}

//
// Output description to be written
//
// desc =
${METPLUS_DESC}

//
// Output observation type to be written
//
// obtype =
${METPLUS_OBTYPE}

////////////////////////////////////////////////////////////////////////////////

//
// Verification grid
//
// regrid = {
${METPLUS_REGRID_DICT}

////////////////////////////////////////////////////////////////////////////////

//
// Approximate grid resolution (km)
//
// grid_res =
${METPLUS_GRID_RES}

////////////////////////////////////////////////////////////////////////////////

//
// Run all permutations of radius and threshold
//
// quilt =
${METPLUS_QUILT}

//
// MODE Multivar boolean combination logic
//
//multivar_logic =
${METPLUS_MULTIVAR_LOGIC}

//multivar_intensity_flag =
${METPLUS_MULTIVAR_INTENSITY_FLAG}

//
// Forecast and observation fields to be verified
//
fcst = {
   ${METPLUS_FCST_FIELD}

   ${METPLUS_FCST_CENSOR_THRESH}
   ${METPLUS_FCST_CENSOR_VAL}
   ${METPLUS_FCST_CONV_RADIUS}
   ${METPLUS_FCST_CONV_THRESH}
   ${METPLUS_FCST_VLD_THRESH}
   ${METPLUS_FCST_FILTER_ATTR_NAME}
   ${METPLUS_FCST_FILTER_ATTR_THRESH}
   ${METPLUS_FCST_MERGE_THRESH}
   ${METPLUS_FCST_MERGE_FLAG}
   ${METPLUS_FCST_FILE_TYPE}
   ${METPLUS_FCST_MULTIVAR_NAME}
   ${METPLUS_FCST_MULTIVAR_LEVEL}
}

obs = {
   ${METPLUS_OBS_FIELD}

   ${METPLUS_OBS_CENSOR_THRESH}
   ${METPLUS_OBS_CENSOR_VAL}
   ${METPLUS_OBS_CONV_RADIUS}
   ${METPLUS_OBS_CONV_THRESH}
   ${METPLUS_OBS_VLD_THRESH}
   ${METPLUS_OBS_FILTER_ATTR_NAME}
   ${METPLUS_OBS_FILTER_ATTR_THRESH}
   ${METPLUS_OBS_MERGE_THRESH}
   ${METPLUS_OBS_MERGE_FLAG}
   ${METPLUS_OBS_FILE_TYPE}
   ${METPLUS_OBS_MULTIVAR_NAME}
   ${METPLUS_OBS_MULTIVAR_LEVEL}
}

////////////////////////////////////////////////////////////////////////////////

//
// Handle missing data
//
// mask_missing_flag =
${METPLUS_MASK_MISSING_FLAG}

//
// Match objects between the forecast and observation fields
//
//match_flag =
${METPLUS_MATCH_FLAG}

//
// Maximum centroid distance for objects to be compared
//
//max_centroid_dist =
${METPLUS_MAX_CENTROID_DIST}

////////////////////////////////////////////////////////////////////////////////

//
// Verification masking regions
//
//mask = {
${METPLUS_MASK_DICT}

////////////////////////////////////////////////////////////////////////////////

//
// Fuzzy engine weights
//
//weight = {
${METPLUS_WEIGHT_DICT}

////////////////////////////////////////////////////////////////////////////////

//
// Fuzzy engine interest functions
//
interest_function = {

   ${METPLUS_INTEREST_FUNCTION_CENTROID_DIST}

   ${METPLUS_INTEREST_FUNCTION_BOUNDARY_DIST}

   ${METPLUS_INTEREST_FUNCTION_CONVEX_HULL_DIST}

   angle_diff = (
      (  0.0, 1.0 )
      ( 30.0, 1.0 )
      ( 90.0, 0.0 )
   );

   aspect_diff = (
      (  0.00, 1.0 )
      (  0.10, 1.0 )
      (  0.75, 0.0 )
   );

   corner   = 0.8;
   ratio_if = (
      (    0.0, 0.0 )
      ( corner, 1.0 )
      (    1.0, 1.0 )
   );

   area_ratio = ratio_if;

   int_area_ratio = (
      ( 0.00, 0.00 )
      ( 0.10, 0.50 )
      ( 0.25, 1.00 )
      ( 1.00, 1.00 )
   );

   curvature_ratio = ratio_if;

   complexity_ratio = ratio_if;

   inten_perc_ratio = ratio_if;
}

////////////////////////////////////////////////////////////////////////////////

//
// Total interest threshold for determining matches
//
//total_interest_thresh =
${METPLUS_TOTAL_INTEREST_THRESH}

//
// Interest threshold for printing output pair information
//
print_interest_thresh = 0.0;

////////////////////////////////////////////////////////////////////////////////

//
// Plotting information
//
met_data_dir = "MET_BASE";

fcst_raw_plot = {
   color_table      = "MET_BASE/colortables/met_default.ctable";
   plot_min         = 0.0;
   plot_max         = 0.0;
}

obs_raw_plot = {
   color_table      = "MET_BASE/colortables/met_default.ctable";
   plot_min         = 0.0;
   plot_max         = 0.0;
}

object_plot = {
   color_table      = "MET_BASE/colortables/mode_obj.ctable";
}

//
// Boolean for plotting on the region of valid data within the domain
//
plot_valid_flag = FALSE;

//
// Plot polyline edges using great circle arcs instead of straight lines
//
plot_gcarc_flag = FALSE;

////////////////////////////////////////////////////////////////////////////////

//
// NetCDF matched pairs, PostScript, and contingency table output files
//
//ps_plot_flag =
${METPLUS_PS_PLOT_FLAG}

//nc_pairs_flag = {
${METPLUS_NC_PAIRS_FLAG_DICT}

//ct_stats_flag =
${METPLUS_CT_STATS_FLAG}


////////////////////////////////////////////////////////////////////////////////

shift_right = 0;   //  grid squares

////////////////////////////////////////////////////////////////////////////////

${METPLUS_OUTPUT_PREFIX}
//version        = "V10.0";

tmp_dir = "${MET_TMP_DIR}";

////////////////////////////////////////////////////////////////////////////////

${METPLUS_MET_CONFIG_OVERRIDES}

Running METplus

Pass the use case configuration file to the run_metplus.py script along with any user-specific system configuration files if desired:

run_metplus.py /path/to/METplus/parm/use_cases/model_applications/short_range/MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.conf /path/to/user_system.conf

See Running METplus for more information.

Expected Output

A successful run will output the following both to the screen and to the logfile:

INFO: METplus has successfully finished running.

Refer to the value set for OUTPUT_BASE to find where the output data was generated. Output for this use case will be found in OUTPUT_BASE and will contain the following files in the directory mode/2021020100/f21:

  • mode_Fcst_VIS_L0_Obs_VIS_L0_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A_cts.txt

  • mode_Fcst_VIS_L0_Obs_VIS_L0_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A_obj.nc

  • mode_Fcst_VIS_L0_Obs_VIS_L0_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A_obj.txt

  • mode_Fcst_VIS_L0_Obs_VIS_L0_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A.ps

  • mode_Fcst_WIND_Z10_Obs_WIND_Z10_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A_cts.txt

  • mode_Fcst_WIND_Z10_Obs_WIND_Z10_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A_obj.nc

  • mode_Fcst_WIND_Z10_Obs_WIND_Z10_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A_obj.txt

  • mode_Fcst_WIND_Z10_Obs_WIND_Z10_HRRR_vs_ANALYSIS_210000L_20210201_210000V_000000A.ps

Keywords

Note

  • MODEToolUseCase

  • ShortRangeAppUseCase

  • GRIB2FileUseCase

  • RegriddingInToolUseCase

  • NOAAWPCOrgUseCase

  • NCAROrgUseCase

  • DiagnosticsUseCase

Navigate to the METplus Quick Search for Use Cases page to discover other similar use cases.

sphinx_gallery_thumbnail_path = ‘_static/short_range-MODEMultivar_fcstHRRR_obsMRMS_HRRRanl.png’

Total running time of the script: (0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery