Skip to content

Commit

Permalink
Per #2795, move the warning message about level mismatch from the con…
Browse files Browse the repository at this point in the history
…fig validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.
  • Loading branch information
JohnHalleyGotway committed Apr 29, 2024
1 parent d4c4eba commit ad49366
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 38 deletions.
49 changes: 30 additions & 19 deletions src/tools/core/point_stat/point_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,45 +606,56 @@ void process_fcst_climo_files() {
// the forecast and climatological fields for verification
for(int i=0; i<conf_info.get_n_vx(); i++) {

VarInfo *fcst_info = conf_info.vx_opt[i].vx_pd.fcst_info;
VarInfo *obs_info = conf_info.vx_opt[i].vx_pd.obs_info;

// Read the gridded data from the input forecast file
n_fcst = fcst_mtddf->data_plane_array(
*conf_info.vx_opt[i].vx_pd.fcst_info, fcst_dpa);
mlog << Debug(2)
<< "\n" << sep_str << "\n\n"
<< "Reading data for "
<< conf_info.vx_opt[i].vx_pd.fcst_info->magic_str()
<< ".\n";
n_fcst = fcst_mtddf->data_plane_array(*fcst_info, fcst_dpa);
mlog << Debug(2) << "\n" << sep_str << "\n\n"
<< "Reading data for " << fcst_info->magic_str() << ".\n";

// Check for zero fields
if(n_fcst == 0) {
mlog << Warning << "\nprocess_fcst_climo_files() -> "
<< "no fields matching "
<< conf_info.vx_opt[i].vx_pd.fcst_info->magic_str()
<< " found in file: "
<< fcst_file << "\n\n";
<< "no fields matching " << fcst_info->magic_str()
<< " found in file: " << fcst_file << "\n\n";
continue;
}

// For multiple individual forecast levels, print a warning
// if the observations levels are not fully covered.
if(n_fcst > 1 &&
!is_eq(fcst_info->level().lower(), fcst_info->level().upper()) &&
(obs_info->level().lower() < fcst_info->level().lower() ||
obs_info->level().upper() > fcst_info->level().upper())) {
mlog << Warning << "\nprocess_fcst_climo_files() -> "
<< "The forecast level range (" << fcst_info->magic_str()
<< ") does not fully contain the observation level range ("
<< obs_info->magic_str() << "). No vertical interpolation "
<< "will be performed for observations falling outside "
<< "the range of forecast levels. Instead, they will be "
<< "matched to the single nearest forecast level.\n\n";
}

// Setup the first pass through the data
if(is_first_pass) setup_first_pass(fcst_dpa[0], fcst_mtddf->grid());

// Regrid, if necessary
if(!(fcst_mtddf->grid() == grid)) {
mlog << Debug(1)
<< "Regridding " << fcst_dpa.n_planes()
<< " forecast field(s) for "
<< conf_info.vx_opt[i].vx_pd.fcst_info->magic_str()
<< " forecast field(s) for " << fcst_info->magic_str()
<< " to the verification grid.\n";

// Loop through the forecast fields
for(j=0; j<fcst_dpa.n_planes(); j++) {
fcst_dpa[j] = met_regrid(fcst_dpa[j], fcst_mtddf->grid(), grid,
conf_info.vx_opt[i].vx_pd.fcst_info->regrid());
fcst_info->regrid());
}
}

// Rescale probabilities from [0, 100] to [0, 1]
if(conf_info.vx_opt[i].vx_pd.fcst_info->p_flag()) {
if(fcst_info->p_flag()) {
for(j=0; j<fcst_dpa.n_planes(); j++) {
rescale_probability(fcst_dpa[j]);
}
Expand Down Expand Up @@ -685,8 +696,8 @@ void process_fcst_climo_files() {

// Dump out the number of levels found
mlog << Debug(2)
<< "For " << conf_info.vx_opt[i].vx_pd.fcst_info->magic_str()
<< " found " << n_fcst << " forecast levels, "
<< "For " << fcst_info->magic_str() << " found "
<< n_fcst << " forecast levels, "
<< cmn_dpa.n_planes() << " climatology mean levels, and "
<< csd_dpa.n_planes() << " climatology standard deviation levels.\n";

Expand Down Expand Up @@ -1825,8 +1836,8 @@ void do_hira_ens(int i_vx, const PairDataPoint *pd_ptr) {
conf_info.vx_opt[i_vx].hira_info.width[i],
grid.wrap_lon());
if (nullptr == gt) {
mlog << Warning
<< "\nPdo_hira_ens() Fail to get GridTemplate for " << i << "-th width.\n\n";
mlog << Warning << "\ndo_hira_ens() -> "
<< "failed to get GridTemplate for " << i << "-th width.\n\n";
continue;
}

Expand Down
19 changes: 0 additions & 19 deletions src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -851,25 +851,6 @@ void PointStatVxOpt::process_config(GrdFileType ftype,
vx_pd.obs_info->dump(cout);
}

// Check the levels for the forecast and observation fields. If the
// forecast field is a range of pressure levels, check to see if the
// range of observation field pressure levels is wholly contained in the
// fcst levels. If not, print a warning message.
if(vx_pd.fcst_info->level().type() == LevelType_Pres &&
!is_eq(vx_pd.fcst_info->level().lower(), vx_pd.fcst_info->level().upper()) &&
(vx_pd.obs_info->level().lower() < vx_pd.fcst_info->level().lower() ||
vx_pd.obs_info->level().upper() > vx_pd.fcst_info->level().upper())) {

mlog << Warning
<< "\nPointStatVxOpt::process_config() -> "
<< "The range of requested observation pressure levels "
<< "is not contained within the range of requested "
<< "forecast pressure levels. No vertical interpolation "
<< "will be performed for observations falling outside "
<< "the range of forecast levels. Instead, they will be "
<< "matched to the single nearest forecast level.\n\n";
}

// No support for wind direction
if(vx_pd.fcst_info->is_wind_direction() ||
vx_pd.obs_info->is_wind_direction()) {
Expand Down

0 comments on commit ad49366

Please sign in to comment.