diff --git a/docs/Users_Guide/point-stat.rst b/docs/Users_Guide/point-stat.rst index c5bb22b5e9..68fa6a4b7c 100644 --- a/docs/Users_Guide/point-stat.rst +++ b/docs/Users_Guide/point-stat.rst @@ -487,7 +487,7 @@ Note that writing out matched pair data (MPR lines) for a large number of cases If all line types corresponding to a particular verification method are set to NONE, the computation of those statistics will be skipped in the code and thus make the Point-Stat tool run more efficiently. For example, if FHO, CTC, and CTS are all set to NONE, the Point-Stat tool will skip the categorical verification step. -The default SEEPS climo file exists at MET_BASE/share/met/climo/seeps/PPT24_seepsweights.nc. It can be overridden by using the environment variable, MET_SEEPS_POINT_CLIMO_NAME. +The default SEEPS climo file exists at MET_BASE/climo/seeps/PPT24_seepsweights.nc. It can be overridden by using the environment variable, MET_SEEPS_POINT_CLIMO_NAME. .. _point_stat-output: diff --git a/docs/Users_Guide/reformat_point.rst b/docs/Users_Guide/reformat_point.rst index 6cc614abf5..f2bbf92e6a 100644 --- a/docs/Users_Guide/reformat_point.rst +++ b/docs/Users_Guide/reformat_point.rst @@ -1164,10 +1164,10 @@ The script can be found at: .. code-block:: none - MET_BASE/shared/met/utility/print_pointnc2ascii.py + MET_BASE/utility/print_pointnc2ascii.py For how to use the script, issue the command: .. code-block:: none - python3 MET_BASE/shared/met/utility/print_pointnc2ascii.py -h + python3 MET_BASE/utility/print_pointnc2ascii.py -h diff --git a/src/libcode/vx_seeps/seeps.cc b/src/libcode/vx_seeps/seeps.cc index 469217251c..df5f47e757 100644 --- a/src/libcode/vx_seeps/seeps.cc +++ b/src/libcode/vx_seeps/seeps.cc @@ -30,8 +30,10 @@ bool standalone_debug_seeps = false; static SeepsClimo *seeps_climo = 0; static std::map seeps_climo_grid_map_00; -static const char *def_seeps_filename = "MET_BASE/climo/seeps/PPT24_seepsweights.nc"; -static const char *def_seeps_grid_filename = "MET_BASE/climo/seeps/PPT24_seepsweights_grid.nc"; +static const char *def_seeps_filename = + "MET_BASE/climo/seeps/PPT24_seepsweights.nc"; +static const char *def_seeps_grid_filename = + "MET_BASE/climo/seeps/PPT24_seepsweights_grid.nc"; static const char *var_name_sid = "sid"; static const char *var_name_lat = "lat"; @@ -200,8 +202,10 @@ SeepsClimo::SeepsClimo() { if (seeps_ready) read_seeps_scores(seeps_name); else { mlog << Error << "\nSeepsClimo::SeepsClimo() -> " - << "The SEEPS climo data \"" << seeps_name << "\" is missing!" - << " Turn off SEEPS and SEEPS_MPR to continue\n\n"; + << "The SEEPS point climo data \"" << seeps_name << "\" is missing!\n" + << "Set the " << MET_ENV_SEEPS_POINT_CLIMO_NAME + << " environment variable to define its location " + << "or disable output for SEEPS and SEEPS_MPR.\n\n"; exit(1); } } @@ -312,10 +316,13 @@ SeepsRecord *SeepsClimo::get_record(int sid, int month, int hour) { } else { mlog << Error << "\n" << method_name - << "The SEEPS climo data is missing!" - << " Turn off SEEPS and SEEPS_MPR to continue\n\n"; + << "The SEEPS point climo data is missing!\n" + << "Set the " << MET_ENV_SEEPS_POINT_CLIMO_NAME + << " environment variable to define its location " + << "or disable output for SEEPS and SEEPS_MPR.\n\n"; exit(1); } + return record; } @@ -326,22 +333,22 @@ ConcatString SeepsClimo::get_seeps_climo_filename() { const char *method_name = "SeepsClimo::get_seeps_climo_filename() -> "; // Use the MET_TMP_DIR environment variable, if set. - bool use_env = get_env(MET_ENV_SEEPS_CLIMO_NAME, seeps_filename); + bool use_env = get_env(MET_ENV_SEEPS_POINT_CLIMO_NAME, seeps_filename); if(use_env) seeps_filename = replace_path(seeps_filename); else seeps_filename = replace_path(def_seeps_filename); if (seeps_ready = file_exists(seeps_filename.c_str())) { - mlog << Debug(7) << method_name << "SEEPS climo name=\"" + mlog << Debug(7) << method_name << "SEEPS point climo name=\"" << seeps_filename.c_str() << "\"\n"; } else { - ConcatString message = " "; + ConcatString message = ""; if (use_env) { message.add("from the env. name "); - message.add(MET_ENV_SEEPS_CLIMO_NAME); + message.add(MET_ENV_SEEPS_POINT_CLIMO_NAME); } mlog << Warning << "\n" << method_name - << "The SEEPS climo name \"" << seeps_filename.c_str() + << "The SEEPS point climo name \"" << seeps_filename.c_str() << "\"" << message << " does not exist!\n\n"; } @@ -652,8 +659,10 @@ SeepsClimoGrid::SeepsClimoGrid(int month, int hour) : month{month}, hour{hour} if (seeps_ready) read_seeps_scores(seeps_name); else { mlog << Error << "\nSeepsClimoGrid::SeepsClimoGrid -> " - << "The SEEPS climo data \"" << seeps_name << "\" is missing!" - << " Turn off SEEPS to continue\n\n"; + << "The SEEPS grid climo data \"" << seeps_name << "\" is missing!\n" + << "Set the " << MET_ENV_SEEPS_GRID_CLIMO_NAME + << " environment variable to define its location " + << "or disable output for SEEPS.\n\n"; exit(1); } @@ -769,24 +778,24 @@ ConcatString SeepsClimoGrid::get_seeps_climo_filename() { const char *method_name = "SeepsClimoGrid::get_seeps_climo_filename() -> "; // Use the MET_TMP_DIR environment variable, if set. - bool use_env = get_env(MET_ENV_SEEPS_CLIMO_GRID_NAME, seeps_filename); + bool use_env = get_env(MET_ENV_SEEPS_GRID_CLIMO_NAME, seeps_filename); if(use_env) { seeps_filename = replace_path(seeps_filename); } else seeps_filename = replace_path(def_seeps_grid_filename); if (seeps_ready = file_exists(seeps_filename.c_str())) { - mlog << Debug(7) << method_name << "SEEPS climo name=\"" + mlog << Debug(7) << method_name << "SEEPS grid climo name=\"" << seeps_filename.c_str() << "\"\n"; } else { - ConcatString message = " "; + ConcatString message = ""; if (use_env) { message.add("from the env. name "); - message.add(MET_ENV_SEEPS_CLIMO_GRID_NAME); + message.add(MET_ENV_SEEPS_GRID_CLIMO_NAME); } mlog << Warning << "\n" << method_name - << "The SEEPS climo name \"" << seeps_filename.c_str() + << "The SEEPS grid climo name \"" << seeps_filename.c_str() << "\"" << message << " does not exist!\n\n"; } diff --git a/src/libcode/vx_seeps/seeps.h b/src/libcode/vx_seeps/seeps.h index ae5915298e..47ee2ad3df 100644 --- a/src/libcode/vx_seeps/seeps.h +++ b/src/libcode/vx_seeps/seeps.h @@ -24,8 +24,8 @@ //////////////////////////////////////////////////////////////////////// -static const char *MET_ENV_SEEPS_CLIMO_NAME = "MET_SEEPS_POINT_CLIMO_NAME"; -static const char *MET_ENV_SEEPS_CLIMO_GRID_NAME = "MET_SEEPS_GRID_CLIMO_NAME"; +static const char *MET_ENV_SEEPS_POINT_CLIMO_NAME = "MET_SEEPS_POINT_CLIMO_NAME"; +static const char *MET_ENV_SEEPS_GRID_CLIMO_NAME = "MET_SEEPS_GRID_CLIMO_NAME"; static const char *dim_name_nstn = "nstn"; diff --git a/src/libcode/vx_statistics/pair_data_point.cc b/src/libcode/vx_statistics/pair_data_point.cc index ff7df4262e..ca965a2520 100644 --- a/src/libcode/vx_statistics/pair_data_point.cc +++ b/src/libcode/vx_statistics/pair_data_point.cc @@ -70,8 +70,8 @@ void PairDataPoint::init_from_scratch() { seeps_mpr.clear(); seeps.clear(); + seeps_climo = NULL; clear(); - seeps_climo = get_seeps_climo(); return; } @@ -180,8 +180,16 @@ bool PairDataPoint::add_point_pair(const char *sid, double lat, double lon, //////////////////////////////////////////////////////////////////////// +void PairDataPoint::load_seeps_climo() { + if (NULL == seeps_climo) seeps_climo = get_seeps_climo(); +} + +//////////////////////////////////////////////////////////////////////// + void PairDataPoint::set_seeps_thresh(const SingleThresh &p1_thresh) { - seeps_climo->set_p1_thresh(p1_thresh); + if (NULL != seeps_climo) seeps_climo->set_p1_thresh(p1_thresh); + else mlog << Warning << "\nPairDataPoint::set_seeps_thresh() ignored t1_threshold." + << " Load SEEPS climo first\n\n"; } //////////////////////////////////////////////////////////////////////// @@ -291,7 +299,7 @@ SeepsScore *PairDataPoint::compute_seeps(const char *sid, double f, int month, day, year, hour, minute, second; int sid_no = atoi(sid); - if (sid_no) { + if (sid_no && NULL != seeps_climo) { unix_to_mdyhms(ut, month, day, year, hour, minute, second); seeps = seeps_climo->get_seeps_score(sid_no, f, o, month, hour); if (mlog.verbosity_level() >= seeps_debug_level @@ -1470,6 +1478,18 @@ void VxPairDataPoint::set_obs_perc_value(int percentile) { //////////////////////////////////////////////////////////////////////// +void VxPairDataPoint::load_seeps_climo() { + for(int i=0; i < n_msg_typ; i++){ + for(int j=0; j < n_mask; j++){ + for(int k=0; k < n_interp; k++){ + pd[i][j][k].load_seeps_climo(); + } + } + } +} + +//////////////////////////////////////////////////////////////////////// + void VxPairDataPoint::set_seeps_thresh(const SingleThresh &p1_thresh) { for(int i=0; i < n_msg_typ; i++){ for(int j=0; j < n_mask; j++){ diff --git a/src/libcode/vx_statistics/pair_data_point.h b/src/libcode/vx_statistics/pair_data_point.h index ab44e87d17..f98a1ee376 100644 --- a/src/libcode/vx_statistics/pair_data_point.h +++ b/src/libcode/vx_statistics/pair_data_point.h @@ -34,6 +34,7 @@ class PairDataPoint : public PairBase { void assign(const PairDataPoint &); SeepsClimo *seeps_climo; + public: PairDataPoint(); @@ -58,6 +59,7 @@ class PairDataPoint : public PairBase { bool add_point_pair(const char *, double, double, double, double, unixtime, double, double, double, double, const char *, double, double, double); + void load_seeps_climo(); void set_seeps_thresh(const SingleThresh &p1_thresh); void set_seeps_score(SeepsScore *, int index=-1); @@ -227,6 +229,7 @@ class VxPairDataPoint { void set_mpr_thresh(const StringArray &, const ThreshArray &); + void load_seeps_climo(); void set_seeps_thresh(const SingleThresh &p1_thresh); void set_climo_cdf_info_ptr(const ClimoCDFInfo *); diff --git a/src/tools/core/point_stat/point_stat_conf_info.cc b/src/tools/core/point_stat/point_stat_conf_info.cc index 6579d04574..48af077157 100644 --- a/src/tools/core/point_stat/point_stat_conf_info.cc +++ b/src/tools/core/point_stat/point_stat_conf_info.cc @@ -1079,7 +1079,11 @@ void PointStatVxOpt::set_vx_pd(PointStatConfInfo *conf_info) { vx_pd.set_duplicate_flag(duplicate_flag); vx_pd.set_obs_summary(obs_summary); vx_pd.set_obs_perc_value(obs_perc); - vx_pd.set_seeps_thresh(seeps_p1_thresh); + if (output_flag[i_seeps_mpr] != STATOutputType_None + || output_flag[i_seeps] != STATOutputType_None) { + vx_pd.load_seeps_climo(); + vx_pd.set_seeps_thresh(seeps_p1_thresh); + } return; }