From 7b144f6f4debceea3a6774ac855c1296e3000c94 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
 <41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 15 May 2023 13:27:22 -0600
Subject: [PATCH] Update develop-ref after #2543 (#2544)

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Seth Linden <linden@seneca.rap.ucar.edu>
Co-authored-by: jprestop <jpresto@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: Seth Linden <linden@ucar.edu>
Co-authored-by: lisagoodrich <33230218+lisagoodrich@users.noreply.github.com>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: Lisa Goodrich <lisag@ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
fix #2389 develop flowchart (#2392)
Fix Python environment issue (#2407)
fix definitions of G172 and G220 based on comments in NOAA-EMC/NCEPLIBS-w3emc#157. (#2406)
fix #2380 develop override (#2382)
fix #2408 develop empty config (#2410)
fix #2390 develop compile zlib (#2404)
fix #2412 develop climo (#2422)
fix #2437 develop convert (#2439)
fix for develop, for #2437, forgot one reference to the search_parent for a dictionary lookup.
fix #2452 develop airnow (#2454)
fix #2449 develop pdf (#2464)
fix #2402 develop sonarqube (#2468)
fix #2426 develop buoy (#2475)
fix 2518 dtypes appf docs (#2519)
fix 2531 compilation errors (#2533)
fix #2531 compilation_errors_configure (#2535)
---
 .github/workflows/update_truth.yml            |   2 +-
 docs/Users_Guide/config_options.rst           | 112 +++++++++---------
 .../test_unit/config/TCStatConfig_ALAL2010    |   2 +-
 src/libcode/vx_statistics/contable_stats.cc   |  44 +++----
 4 files changed, 77 insertions(+), 83 deletions(-)

diff --git a/.github/workflows/update_truth.yml b/.github/workflows/update_truth.yml
index a5cc330cab..cf9734e449 100644
--- a/.github/workflows/update_truth.yml
+++ b/.github/workflows/update_truth.yml
@@ -1,4 +1,4 @@
-name: Create Truth Data Update Pull Request
+name: Update Truth Data
 
 on:
   workflow_dispatch:
diff --git a/docs/Users_Guide/config_options.rst b/docs/Users_Guide/config_options.rst
index 3239becefc..d60967cbd3 100644
--- a/docs/Users_Guide/config_options.rst
+++ b/docs/Users_Guide/config_options.rst
@@ -2406,7 +2406,7 @@ are empty. Note: grib_code 11 is equivalent to obs_var "TMP".
 Settings specific to individual tools
 -------------------------------------
 
-EnsembleStatConfig_default
+GenEnsProdConfig_default
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 ens
@@ -2501,6 +2501,64 @@ combination of the categorical threshold (cat_thresh), neighborhood width
      ];
   }
 
+ensemble_flag
+"""""""""""""
+  
+The "ensemble_flag" entry is a dictionary of boolean value indicating
+which ensemble products should be generated:
+
+* "latlon" for a grid of the Latitude and Longitude fields
+
+* "mean" for the simple ensemble mean
+  
+* "stdev" for the ensemble standard deviation
+  
+* "minus" for the mean minus one standard deviation
+  
+* "plus" for the mean plus one standard deviation
+  
+* "min" for the ensemble minimum
+  
+* "max" for the ensemble maximum
+  
+* "range" for the range of ensemble values
+  
+* "vld_count" for the number of valid ensemble members
+  
+* "frequency" for the ensemble relative frequency meeting a threshold
+  
+* "nep" for the neighborhood ensemble probability
+  
+* "nmep" for the neighborhood maximum ensemble probability
+  
+* "rank" to write the rank for the gridded observation field to separate
+  NetCDF output file.
+  
+* "weight" to write the grid weights specified in grid_weight_flag to the
+  rank NetCDF output file.
+
+.. code-block:: none
+		
+  ensemble_flag = {
+    latlon     = TRUE;
+     mean      = TRUE;
+     stdev     = TRUE;
+     minus     = TRUE;
+     plus      = TRUE;
+     min       = TRUE;
+     max       = TRUE;
+     range     = TRUE;
+     vld_count = TRUE;
+     frequency = TRUE;
+     nep       = FALSE;
+     nmep      = FALSE;
+     rank      = TRUE;
+     weight    = FALSE;
+  }
+  
+EnsembleStatConfig_default
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 fcst, obs
 """""""""
 
@@ -2643,58 +2701,6 @@ levels, and range of values.
      max              = NA;
   }
 
-ensemble_flag
-"""""""""""""
-  
-The "ensemble_flag" entry is a dictionary of boolean value indicating
-which ensemble products should be generated:
-
-* "mean" for the simple ensemble mean
-  
-* "stdev" for the ensemble standard deviation
-  
-* "minus" for the mean minus one standard deviation
-  
-* "plus" for the mean plus one standard deviation
-  
-* "min" for the ensemble minimum
-  
-* "max" for the ensemble maximum
-  
-* "range" for the range of ensemble values
-  
-* "vld_count" for the number of valid ensemble members
-  
-* "frequency" for the ensemble relative frequency meeting a threshold
-  
-* "nep" for the neighborhood ensemble probability
-  
-* "nmep" for the neighborhood maximum ensemble probability
-  
-* "rank" to write the rank for the gridded observation field to separate
-  NetCDF output file.
-  
-* "weight" to write the grid weights specified in grid_weight_flag to the
-  rank NetCDF output file.
-
-.. code-block:: none
-		
-  ensemble_flag = {
-     mean      = TRUE;
-     stdev     = TRUE;
-     minus     = TRUE;
-     plus      = TRUE;
-     min       = TRUE;
-     max       = TRUE;
-     range     = TRUE;
-     vld_count = TRUE;
-     frequency = TRUE;
-     nep       = FALSE;
-     nmep      = FALSE;
-     rank      = TRUE;
-     weight    = FALSE;
-  }
-
 rng
 """
 
diff --git a/internal/test_unit/config/TCStatConfig_ALAL2010 b/internal/test_unit/config/TCStatConfig_ALAL2010
index 05bf63a7a1..46b630969d 100644
--- a/internal/test_unit/config/TCStatConfig_ALAL2010
+++ b/internal/test_unit/config/TCStatConfig_ALAL2010
@@ -212,7 +212,7 @@ jobs = [
    "-job filter  -amodel AHWI  -rirw_track BDECK -rirw_thresh <=-30 -rirw_exact TRUE  -dump_row ${MET_TEST_OUTPUT}/tc_stat/ALAL2010_AHWI_rw.tcst",
    "-job rirw                  -rirw_window 00   -rirw_thresh <=-15 -out_line_type CTC,CTS,MPR",
    "-job rirw                  -rirw_window 12   -rirw_thresh <=-15 -out_line_type CTC,CTS,MPR",
-   "-job rirw                  -rirw_window 12   -rirw_thresh <=-15 -out_line_type CTC,CTS -out_stat ${MET_TEST_OUTPUT}/tc_stat/ALAL2010_rirw.stat"
+   "-job rirw                  -rirw_window 12   -rirw_thresh <=-15 -out_line_type CTC,CTS -by amodel -out_stat ${MET_TEST_OUTPUT}/tc_stat/ALAL2010_rirw.stat"
 ];
 
 //
diff --git a/src/libcode/vx_statistics/contable_stats.cc b/src/libcode/vx_statistics/contable_stats.cc
index 02aa6dfbbb..9df41040a0 100644
--- a/src/libcode/vx_statistics/contable_stats.cc
+++ b/src/libcode/vx_statistics/contable_stats.cc
@@ -811,14 +811,11 @@ if ( Nrows != Ncols )  {
 
 const int N = total();
 
-if ( N == 0 )  {
-
-   mlog << Error << "\nContingencyTable::gheidke() -> "
-        << "table empty!\n\n";
-
-   exit ( 1 );
+   //
+   //  MET #2542: return bad data for empty tables rather than erroring out
+   //
 
-}
+if ( N == 0 ) return ( bad_data_double );
 
 const double DN = (double) N;
 int j, k, m, n;
@@ -912,14 +909,11 @@ if ( ec_value < 0.0 || ec_value >= 1.0 )  {
 
 const int N = total();
 
-if ( N == 0 )  {
-
-   mlog << Error << "\nContingencyTable::gheidke_ec(double) -> "
-        << "table empty!\n\n";
-
-   exit ( 1 );
+   //
+   //  MET #2542: return bad data for empty tables rather than erroring out
+   //
 
-}
+if ( N == 0 ) return ( bad_data_double );
 
 int j, sum;
 double num, denom, ans;
@@ -977,14 +971,11 @@ if ( Nrows != Ncols )  {
 
 const int N = total();
 
-if ( N == 0 )  {
-
-   mlog << Error << "\nContingencyTable::gkuiper() -> "
-        << "table empty!\n\n";
-
-   exit ( 1 );
+   //
+   //  MET #2542: return bad data for empty tables rather than erroring out
+   //
 
-}
+if ( N == 0 ) return ( bad_data_double );
 
 const double DN = (double) N;
 int j, k, m, n;
@@ -1077,14 +1068,11 @@ if ( Nrows != Ncols )  {
 
 const int N = total();
 
-if ( N == 0 )  {
-
-   mlog << Error << "\nContingencyTable::gerrity() -> "
-        << "table empty!\n\n";
-
-   exit ( 1 );
+   //
+   //  MET #2542: return bad data for empty tables rather than erroring out
+   //
 
-}
+if ( N == 0 ) return ( bad_data_double );
 
 int j, k, m, n;
 const double DN = (double) N;