Skip to content

Commit

Permalink
Per #1494, update the logic for all the calls to process_data_plane()…
Browse files Browse the repository at this point in the history
… to account for the fact that it now returns a bool instead of void.
  • Loading branch information
JohnHalleyGotway committed Dec 4, 2020
1 parent a9a5150 commit 5ee160f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 29 deletions.
7 changes: 3 additions & 4 deletions met/src/libcode/vx_data2d_grib/data2d_grib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ int MetGrib1DataFile::data_plane_array(VarInfo &vinfo,
rotate_winds(vinfo_grib_winds, cur_plane);
}

if(status) status = process_data_plane(&vinfo, cur_plane);

if(!status) {
cur_plane.clear();
lower = upper = bad_data_int;
Expand All @@ -544,9 +546,6 @@ int MetGrib1DataFile::data_plane_array(VarInfo &vinfo,
<< " from GRIB file \"" << filename() << "\".\n\n";
continue;
}
else {
process_data_plane(&vinfo, cur_plane);
}

// Add current record to the data plane array
plane_array.add(cur_plane, (double) lower, (double) upper);
Expand Down Expand Up @@ -712,7 +711,7 @@ bool MetGrib1DataFile::data_plane_scalar(VarInfoGrib &vinfo_grib,
// Read current record
status = get_data_plane(r, plane);

if(status) process_data_plane(&vinfo_grib, plane);
if(status) status = process_data_plane(&vinfo_grib, plane);

break;
}
Expand Down
12 changes: 5 additions & 7 deletions met/src/libcode/vx_data2d_grib2/data2d_grib2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ bool MetGrib2DataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {

plane = plane_array[0];

process_data_plane(vinfo_g2, plane);

return true;
return(process_data_plane(vinfo_g2, plane));

} // END: if( 1 > listMatch.size() )

Expand Down Expand Up @@ -235,7 +233,7 @@ bool MetGrib2DataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {
// check the data plane for wind rotation
plane = check_uv_rotation(vinfo_g2, listMatch[0], plane);

if(read_success) process_data_plane(vinfo_g2, plane);
if(read_success) read_success = process_data_plane(vinfo_g2, plane);

return read_success;
}
Expand Down Expand Up @@ -350,9 +348,9 @@ int MetGrib2DataFile::data_plane_array( VarInfo &vinfo,
lvl_upper = ( (double)(*it)->LvlVal2 ) / 100.0;
}

process_data_plane(vinfo_g2, plane);

plane_array.add(plane, lvl_lower, lvl_upper);
if(process_data_plane(vinfo_g2, plane)) {
plane_array.add(plane, lvl_lower, lvl_upper);
}
}

return num_read;
Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_data2d_nc_met/data2d_nc_met.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ bool MetNcMetDataFile::data_plane(VarInfo &vinfo, DataPlane &plane)
status = false;
}

process_data_plane(&vinfo, plane);
status = process_data_plane(&vinfo, plane);

// Set the VarInfo object's name, long_name, level, and units strings
if(info->name_att.length() > 0) vinfo.set_name(info->name_att);
Expand Down
4 changes: 2 additions & 2 deletions met/src/libcode/vx_data2d_nc_pinterp/data2d_nc_pinterp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ bool MetNcPinterpDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {
status = false;
}

process_data_plane(&vinfo, plane);
status = process_data_plane(&vinfo, plane);

// Set the VarInfo object's name, long_name, and units strings
if(info->name_att.length() > 0) vinfo.set_name(info->name_att);
Expand Down Expand Up @@ -255,7 +255,7 @@ int MetNcPinterpDataFile::data_plane_array(VarInfo &vinfo,
status = false;
}

process_data_plane(&vinfo, cur_plane);
status = process_data_plane(&vinfo, cur_plane);

// Add current plane to the data plane array
plane_array.add(cur_plane, pressure, pressure);
Expand Down
16 changes: 1 addition & 15 deletions met/src/libcode/vx_data2d_nccf/data2d_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ bool MetNcCFDataFile::data_plane(VarInfo &vinfo, DataPlane &plane)
status = false;
}

process_data_plane(&vinfo, plane);
status = process_data_plane(&vinfo, plane);

// Set the VarInfo object's name, long_name, level, and units strings

Expand All @@ -287,22 +287,8 @@ bool MetNcCFDataFile::data_plane(VarInfo &vinfo, DataPlane &plane)

if (info->units_att.length() > 0)
vinfo.set_units(info->units_att.c_str());

// print a report
double plane_min, plane_max;
plane.data_range(plane_min, plane_max);
mlog << Debug(4) << "\n"
<< "Data plane information:\n"
<< " plane min: " << plane_min << "\n"
<< " plane max: " << plane_max << "\n"
<< " valid time: " << unix_to_yyyymmdd_hhmmss(plane.valid()) << "\n"
<< " lead time: " << sec_to_hhmmss(plane.lead()) << "\n"
<< " init time: " << unix_to_yyyymmdd_hhmmss(plane.init()) << "\n"
<< " accum time: " << sec_to_hhmmss(plane.accum()) << "\n";
}



return status;
}

Expand Down

0 comments on commit 5ee160f

Please sign in to comment.