5.2.4.3. Ensemble-Stat: Basic Post-Processing only

Creates ensemble fields from ensemble members. This is a forecast-only example (HRRR-e:NA:Grib2)

Scientific Objective

Post-process ensemble members to derive simple (non-bias-corrected) mean, standard deviation (spread), minimum, maximum, and range fields for use in other MET tools.

Datasets

  • Forecast dataset: HRRRE 3 member ensemble netcdf 3 hour precipitation accumulation

METplus Components

This use case runs Ensemble-Stat on HRRRE data from 3 members after running it through pcp_combine to create a 3 hour precipitation accumulation

METplus Workflow

The following tools are used for each run time: EnsembleStat

This example loops by initialization time. For each initialization time it will process forecast leads 3, 6, 9 and 12

Run times:

Init: 2019-05-19_12Z
Forecast lead: 3
Init: 2019-05-19_12Z
Forecast lead: 6
Init: 2019-05-19_12Z
Forecast lead: 9
Init: 2019-05-19_12Z
Forecast lead: 12
Init: 2019-05-20_00Z
Forecast lead: 3
Init: 2019-05-20_00Z
Forecast lead: 6
Init: 2019-05-20_00Z
Forecast lead: 9
Init: 2019-05-20_00Z
Forecast lead: 12

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 with the -c option, i.e. -c parm/use_cases/model_applications/precipitation/EnsembleStat_fcstHRRRE_FcstOnly_NetCDF.conf

[config]

## Configuration-related settings such as the process list, begin and end times, etc.
PROCESS_LIST = EnsembleStat 

# time looping - options are INIT, VALID, RETRO, and REALTIME
# If set to INIT or RETRO:
#   INIT_TIME_FMT, INIT_BEG, INIT_END, and INIT_INCREMENT must also be set
# If set to VALID or REALTIME:
#   VALID_TIME_FMT, VALID_BEG, VALID_END, and VALID_INCREMENT must also be set
LOOP_BY = INIT

# Format of INIT_BEG and INT_END using % items
# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc.
# see www.strftime.org for more information
# %Y%m%d%H expands to YYYYMMDDHH
INIT_TIME_FMT = %Y%m%d%H

# Start time for METplus run - must match INIT_TIME_FMT
INIT_BEG=2019051912

# End time for METplus run - must match INIT_TIME_FMT
INIT_END=2019052000 

# Increment between METplus runs (in seconds if no units are specified)
#  Must be >= 60 seconds
INIT_INCREMENT=43200

# List of forecast leads to process for each run time (init or valid)
# In hours if units are not specified
# If unset, defaults to 0 (don't loop through forecast leads)
LEAD_SEQ = 3,6,9,12

# Order of loops to process data - Options are times, processes
# Not relevant if only one item is in the PROCESS_LIST
# times = run all wrappers in the PROCESS_LIST for a single run time, then
#   increment the run time and run all wrappers again until all times have
#   been evaluated.
# processes = run the first wrapper in the PROCESS_LIST for all times
#   specified, then repeat for the next item in the PROCESS_LIST until all
#   wrappers have been run
LOOP_ORDER = processes

# Name to identify model (forecast) data in output
MODEL = HRRRE
ENSEMBLE_STAT_N_MEMBERS = 3

#Accumulation
FCST_VAR1_NAME = APCP_03_A3_ENS_MEAN

OBS_VAR1_NAME = APCP_03
#OBS_VAR1_LEVELS = A03


# The MET ensemble_stat logging level
# 0 quiet to 5 loud, Verbosity setting for MET output, 2 is default.
# This takes precendence over the general MET logging level set in metplus_logging.conf
#LOG_ENSEMBLE_STAT_VERBOSITY = 3

# MET Configuration files for EnsembleSTat
ENSEMBLE_STAT_CONFIG_FILE = {CONFIG_DIR}/EnsembleStatConfig_APCP03

[dir]
# MET config directory.
# CONFIG_DIR and the value it expands to is set as an environment variable
# and is used in the MET configuration file.
CONFIG_DIR={PARM_BASE}/use_cases/model_applications/precipitation

# input and output directories for ensemble_stat 
# Input File Directories, GRID_STAT and POINT_STAT
FCST_ENSEMBLE_STAT_INPUT_DIR = {INPUT_BASE}/model_applications/precipitation/HRRRE/pcp_combine

# Ensemble stat output directory
ENSEMBLE_STAT_OUTPUT_DIR = {OUTPUT_BASE}/{MODEL}/ensemble

ENSEMBLE_STAT_INPUT_DIR = {INPUT_BASE}/model_applications/precipitation/HRRRE/pcp_combine
ENSEMBLE_STAT_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/precipitation/EnsembleSTat_fcstHRRRE_FcstOnly_NetCDF/EnsembleStat

[filename_templates]

FCST_ENSEMBLE_STAT_INPUT_TEMPLATE = hrrre01_{init?fmt=%Y%m%d%H}f{lead?fmt=%HHH}_A03.nc,
    hrrre02_{init?fmt=%Y%m%d%H}f{lead?fmt=%HHH}_A03.nc,
    hrrre03_{init?fmt=%Y%m%d%H}f{lead?fmt=%HHH}_A03.nc


ENSEMBLE_STAT_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H%M}

MET Configuration

METplus sets environment variables based on the values in the METplus configuration file. These variables are referenced in the MET configuration file. 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 not controlled by an environment variable, you can add additional environment variables to be set only within the METplus environment using the [user_env_vars] section of the METplus configuration files. See the ‘User Defined Config’ section on the ‘System Configuration’ page of the METplus User’s Guide for more information.

////////////////////////////////////////////////////////////////////////////////
//
// Ensemble-Stat configuration file.
//
// For additional information, see the MET_BASE/config/README file.
//
////////////////////////////////////////////////////////////////////////////////

//
// Output model name to be written
//
model = "${MODEL}";

//
// Output description to be written
// May be set separately in each "obs.field" entry
//
desc = "NA";

//
// Output observation type to be written
//
obtype = "ANALYS";

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

//
// Verification grid
// May be set separately in each "field" entry
//
regrid = {
   to_grid    = NONE;
   method     = NEAREST;
   width      = 1;
   vld_thresh = 0.5;
   shape      = SQUARE;
}

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

//
// May be set separately in each "field" entry
//
censor_thresh = [];
censor_val    = [];
cat_thresh    = [];
nc_var_str    = "";

//
// Ensemble product fields to be processed
//
ens = {
   ens_thresh = 0.5;
   vld_thresh = 1.0;

   field = [
      {
         name       = "APCP_03";
         level      = "(*,*)";
      }
   ];
}

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

//
// Forecast and observation fields to be verified
//
fcst = {
   field = [
   ];
}
obs = fcst;

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

//
// Point observation filtering options
// May be set separately in each "obs.field" entry
//
message_type   = [ "ADPUPA" ];
sid_exc        = [];
obs_thresh     = [ NA ];
obs_quality    = [];
duplicate_flag = NONE;
obs_summary    = NONE;
obs_perc_value = 50;
skip_const     = FALSE;

//
// Mapping of message type group name to comma-separated list of values.
//
message_type_group_map = [
   { key = "SURFACE"; val = "ADPSFC,SFCSHP,MSONET";               },
   { key = "ANYAIR";  val = "AIRCAR,AIRCFT";                      },
   { key = "ANYSFC";  val = "ADPSFC,SFCSHP,ADPUPA,PROFLR,MSONET"; },
   { key = "ONLYSF";  val = "ADPSFC,SFCSHP";                      }
];

//
// Ensemble bin sizes
// May be set separately in each "obs.field" entry
//
ens_ssvar_bin_size = 1.0;
ens_phist_bin_size = 0.05;

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

//
// Climatology mean data
//
climo_mean = {

   file_name = [];
   field     = [];

   regrid = {
      method     = NEAREST;
      width      = 1;
      vld_thresh = 0.5;
      shape      = SQUARE;
   }

   time_interp_method = DW_MEAN;
   match_day          = FALSE;
   time_step          = 21600;
}

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

//
// Point observation time window
//
obs_window = {
   beg = -5400;
   end =  5400;
}

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

//
// Verification masking regions
//
mask = {
   grid    = [ "FULL" ];
   poly    = [];
   sid     = [];
}

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

//
// Confidence interval settings
//
ci_alpha  = [ 0.05 ];

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

//
// Interpolation methods
//
interp = {
   field      = BOTH;
   vld_thresh = 1.0;
   shape  = SQUARE;

   type = [
      {
         method = NEAREST;
         width  = 1;
      }
   ];
}

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

//
// Statistical output types
//
output_flag = {
   rhist = NONE;
   phist = NONE;
   orank = NONE;
   ssvar = NONE;
   relp  = NONE;
}

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

//
// Ensemble product output types
//
ensemble_flag = {
   latlon    = TRUE;
   mean      = TRUE;
   stdev     = TRUE;
   minus     = FALSE;
   plus      = FALSE;
   min       = TRUE;
   max       = TRUE;
   range     = TRUE;
   vld_count = TRUE;
   frequency = TRUE;
   rank      = FALSE;
   weight    = FALSE;
}

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

//
// Random number generator
//
rng = {
   type = "mt19937";
   seed = "";
}

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

grid_weight_flag = NONE;
output_prefix    = "APCP_03";
version          = "V9.0";

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

See the following files for more information about the environment variables set in this configuration file.

parm/use_cases/met_tool_wrapper/EnsembleStat.py

Running METplus

This use case can be run two ways:

  1. Passing in EnsembleStat_fcstHRRRE_FcstOnly_NetCDF.conf then a user-specific system configuration file:

    master_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/precipitation/EnsembleStat_fcstHRRRE_FcstOnly_NetCDF.conf -c /path/to/user_system.conf
    
  2. Modifying the configurations in parm/metplus_config, then passing in EnsembleStat_fcstHRRRE_FcstOnly_NetCDF.conf:

    master_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/precipitation/EnsembleStat_fcstHRRRE_FcstOnly_NetCDF.conf
    

The former method is recommended. Whether you add them to a user-specific configuration file or modify the metplus_config files, the following variables must be set correctly:

  • INPUT_BASE - Path to directory where sample data tarballs are unpacked (See Datasets section to obtain tarballs). This is not required to run METplus, but it is required to run the examples in parm/use_cases

  • OUTPUT_BASE - Path where METplus output will be written. This must be in a location where you have write permissions

  • MET_INSTALL_DIR - Path to location where MET is installed locally

Example User Configuration File:

[dir]
INPUT_BASE = /path/to/sample/input/data
OUTPUT_BASE = /path/to/output/dir
MET_INSTALL_DIR = /path/to/met-X.Y

NOTE: All of these items must be found under the [dir] section.

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 model_applications/precipitation/EnsembleStat_fcstHRRRE_FcstOnly_NetCDF/EnsembleStat (relative to OUTPUT_BASE) The following folder/file combination will be created:

-201905191200

  • ensemble_stat_APCP_03_20190519_150000V_ens.nc

  • ensemble_stat_APCP_03_20190519_180000V_ens.nc

  • ensemble_stat_APCP_03_20190519_210000V_ens.nc

  • ensemble_stat_APCP_03_20190520_000000V_ens.nc

-201905200000

  • ensemble_stat_APCP_03_20190520_030000V_ens.nc

  • ensemble_stat_APCP_03_20190520_060000V_ens.nc

  • ensemble_stat_APCP_03_20190520_090000V_ens.nc

  • ensemble_stat_APCP_03_20190520_120000V_ens.nc