From c6c50b074ec09a1cb8d63c11ba16ef39cffedb17 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Thu, 17 Feb 2022 11:29:44 -0700 Subject: [PATCH] Per #1583, shifting gears back to the simpler solution of supporting HiRA as an interpolation method for Ensemble-Stat. Having the entire HiRA dictionary in Ensemble-Stat brings unecessary complications when the only part that we actually want/need is the size and shape. This simpler solution requires less documentation updates and should have not upstream impacts on METplus. --- met/data/config/ConfigConstants | 1 + met/src/basic/vx_config/config_util.cc | 1 + met/src/basic/vx_util/interp_mthd.cc | 2 ++ met/src/basic/vx_util/interp_mthd.h | 4 +++- met/src/basic/vx_util/interp_util.cc | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/met/data/config/ConfigConstants b/met/data/config/ConfigConstants index ee0d4855c0..29b2590ada 100644 --- a/met/data/config/ConfigConstants +++ b/met/data/config/ConfigConstants @@ -88,6 +88,7 @@ AW_MEAN = 20; GAUSSIAN = 21; MAXGAUSS = 22; GEOG_MATCH = 23; +HIRA = 24; // Interpolation types NONE = 1; diff --git a/met/src/basic/vx_config/config_util.cc b/met/src/basic/vx_config/config_util.cc index bfdeef07b2..c226c7ac83 100644 --- a/met/src/basic/vx_config/config_util.cc +++ b/met/src/basic/vx_config/config_util.cc @@ -2279,6 +2279,7 @@ InterpMthd int_to_interpmthd(int i) { else if(i == conf_const.lookup_int(interpmthd_gaussian_str)) m = InterpMthd_Gaussian; else if(i == conf_const.lookup_int(interpmthd_maxgauss_str)) m = InterpMthd_MaxGauss; else if(i == conf_const.lookup_int(interpmthd_geog_match_str)) m = InterpMthd_Geog_Match; + else if(i == conf_const.lookup_int(interpmthd_hira_str)) m = InterpMthd_HiRA; else { mlog << Error << "\nconf_int_to_interpmthd() -> " << "Unexpected value of " << i diff --git a/met/src/basic/vx_util/interp_mthd.cc b/met/src/basic/vx_util/interp_mthd.cc index dcd9ff5ac4..d84bf9c4ab 100644 --- a/met/src/basic/vx_util/interp_mthd.cc +++ b/met/src/basic/vx_util/interp_mthd.cc @@ -44,6 +44,7 @@ ConcatString interpmthd_to_string(const InterpMthd m) { case(InterpMthd_Gaussian): out = interpmthd_gaussian_str; break; case(InterpMthd_MaxGauss): out = interpmthd_maxgauss_str; break; case(InterpMthd_Geog_Match): out = interpmthd_geog_match_str; break; + case(InterpMthd_HiRA): out = interpmthd_hira_str; break; case(InterpMthd_None): default: out = interpmthd_none_str; break; @@ -77,6 +78,7 @@ InterpMthd string_to_interpmthd(const char *mthd_str) { else if(strcmp(mthd_str, interpmthd_gaussian_str ) == 0) m = InterpMthd_Gaussian; else if(strcmp(mthd_str, interpmthd_maxgauss_str ) == 0) m = InterpMthd_MaxGauss; else if(strcmp(mthd_str, interpmthd_geog_match_str) == 0) m = InterpMthd_Geog_Match; + else if(strcmp(mthd_str, interpmthd_hira_str) == 0) m = InterpMthd_HiRA; else m = InterpMthd_None; return(m); diff --git a/met/src/basic/vx_util/interp_mthd.h b/met/src/basic/vx_util/interp_mthd.h index e65be8f7ef..39c4b23e87 100644 --- a/met/src/basic/vx_util/interp_mthd.h +++ b/met/src/basic/vx_util/interp_mthd.h @@ -42,7 +42,8 @@ enum InterpMthd { InterpMthd_Lower_Left, InterpMthd_Gaussian, InterpMthd_MaxGauss, - InterpMthd_Geog_Match + InterpMthd_Geog_Match, + InterpMthd_HiRA }; // @@ -69,6 +70,7 @@ static const char interpmthd_lower_left_str[] = "LOWER_LEFT"; static const char interpmthd_gaussian_str[] = "GAUSSIAN"; static const char interpmthd_maxgauss_str[] = "MAXGAUSS"; static const char interpmthd_geog_match_str[] = "GEOG_MATCH"; +static const char interpmthd_hira_str[] = "HIRA"; /////////////////////////////////////////////////////////////////////////////// diff --git a/met/src/basic/vx_util/interp_util.cc b/met/src/basic/vx_util/interp_util.cc index 631b88d265..bdaf7a573d 100644 --- a/met/src/basic/vx_util/interp_util.cc +++ b/met/src/basic/vx_util/interp_util.cc @@ -1020,6 +1020,7 @@ double compute_sfc_interp(const DataPlane &dp, mlog << Error << "\ncompute_sfc_interp() -> " << "unsupported interpolation method encountered: " << interpmthd_to_string(mthd) << "(" << mthd << ")\n\n"; + exit(1); } delete gt;