Skip to content

Commit

Permalink
Per #1954, ci-run-unit fix failure from unit_point2grid.xml. Had to a…
Browse files Browse the repository at this point in the history
…dd Grid::is_set() function to prevent checking the GridInfo class info prior to the grid being defined.
  • Loading branch information
JohnHalleyGotway committed Sep 16, 2022
1 parent c164c34 commit fe6b03d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libcode/vx_data2d_nc_met/met_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ string x_dim_name, y_dim_name;
// semilatlon dimension names
//

if ( grid.info().sl ) {
if ( grid.is_set() && grid.info().sl ) {

if ( gDimNames.has("latlon") ) x_dim_name = "latlon";
else if ( gDimNames.has("lon") ) x_dim_name = "lon";
Expand Down
8 changes: 8 additions & 0 deletions src/libcode/vx_grid/grid_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ class Grid : public GridInterface {

void dump(ostream &, int = 0) const;

bool is_set() const;

void set (const char *); // lookup by name
void set (const LambertData &);
void set (const StereographicData &);
Expand Down Expand Up @@ -269,6 +271,12 @@ class Grid : public GridInterface {
////////////////////////////////////////////////////////////////////////


inline bool Grid::is_set() const { return ( rep != 0 ); }


////////////////////////////////////////////////////////////////////////


extern bool operator==(const Grid &, const Grid &);
extern bool operator!=(const Grid &, const Grid &);
extern bool operator==(const GridInfo &, const GridInfo &);
Expand Down
3 changes: 2 additions & 1 deletion src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ int get_obs_type(NcFile *nc) {
input_type = "OBS_MET";
}

mlog << Debug(5) << method_name << "input type: \"" << input_type << "\".\n";
mlog << Debug(5) << method_name << "input type: \"" << input_type << "\"\n";

return obs_type;
}

Expand Down

0 comments on commit fe6b03d

Please sign in to comment.