Skip to content

Commit

Permalink
Per #3000, change 9 warning messages to Debug(2) log messages to mini…
Browse files Browse the repository at this point in the history
…mize the number of warning messages Point2Grid writes. However, do retain the warnings about problems writing the grid mapping output file.
  • Loading branch information
JohnHalleyGotway committed Oct 21, 2024
1 parent a9f21fa commit 0582846
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
// 002 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main
// 003 10-03-23 Prestopnik MET #2227 Remove namespace std and netCDF from header files
// 004 05-20-24 Howard Soh MET #2867 Fix -qc ADP bug.
// 004 06-24-24 Halley Gotway MET #2880 Filter obs_quality.
// 005 06-24-24 Halley Gotway MET #2880 Filter obs_quality.
// 006 10-21-24 Halley Gotway MET #3000 Reduce warnings.
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -864,8 +865,8 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI
}
}
if (empty_input) {
mlog << Warning << "\n" << method_name
<< error_msg << "\tBut ignored because of empty input\n\n";
mlog << Debug(2) << method_name
<< error_msg << "\tBut ignored because of empty input\n";
}
else {
mlog << Error << "\n" << method_name
Expand Down Expand Up @@ -1159,14 +1160,14 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI
log_msg << ".";
if (0 == var_count) {
if (0 == filtered_count) {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "No valid data for the variable ["
<< vinfo->name() << "]\n\n";
<< vinfo->name() << "]\n";
}
else {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "No valid data after filtering.\n\t"
<< log_msg << "\n\n";
<< log_msg << "\n";
}
}
else {
Expand Down Expand Up @@ -1644,8 +1645,8 @@ static void regrid_nc_variable(NcFile *nc_in, Met2dDataFile *fr_mtddf,
<< "]\n";

if (to_cell_cnt == 0) {
mlog << Warning << "\n" << method_name
<< " There are no matching cells between input and the target grid.\n\n";
mlog << Debug(2) << method_name
<< " There are no matching cells between input and the target grid.\n";
}

mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took "
Expand Down Expand Up @@ -2025,8 +2026,8 @@ static bool get_grid_mapping(const Grid &to_grid, IntArray *cellMapping,

int obs_count = obs_index_array.n();
if (0 == obs_count) {
mlog << Warning << "\n" << method_name
<< "no valid point observation data!\n\n";
mlog << Debug(2) << method_name
<< "no valid point observation data!\n";
return status;
}

Expand Down Expand Up @@ -2054,8 +2055,8 @@ static bool get_grid_mapping(const Grid &to_grid, IntArray *cellMapping,
}

if (0 == count_in_grid)
mlog << Warning << "\n" << method_name
<< "no valid point observation data within to grid\n\n";
mlog << Debug(2) << method_name
<< "no valid point observation data within to grid\n";
else {
status = true;
mlog << Debug(3) << method_name << "count in grid: " << count_in_grid
Expand Down Expand Up @@ -2622,10 +2623,10 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
}
}
else {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "QC var name (" << qc_var_name
<< " for " << GET_NC_NAME(var_adp)
<< ") does not exist.\n\n";
<< ") does not exist.\n";
}
}
}
Expand All @@ -2641,7 +2642,7 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
mlog << Debug(3) << method_name << "found QC var: " << qc_var_name << ".\n";
}
else {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "QC var name (" << qc_var_name
<< ") does not exist.\n";
}
Expand Down Expand Up @@ -2839,8 +2840,8 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
}

if (to_cell_count == 0) {
mlog << Warning << "\n" << method_name
<< "No valid data!\n\n";
mlog << Debug(2) << method_name
<< "No valid data!\n";
}

mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took "
Expand Down

0 comments on commit 0582846

Please sign in to comment.