Skip to content

Commit

Permalink
#1817 Added to_north argument at two_to_one()
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Jun 18, 2021
1 parent 0c79e00 commit d747c73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions met/src/basic/vx_util/data_plane.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ return;

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

int DataPlane::two_to_one(int x, int y) const {
int DataPlane::two_to_one(int x, int y, bool to_north) const {
int n;

if((x < 0) || (x >= Nx) || (y < 0) || (y >= Ny)) {
Expand All @@ -420,7 +420,7 @@ int DataPlane::two_to_one(int x, int y) const {
exit(1);
}

n = y*Nx + x; // don't change this! lots of downstream code depends on this!
n = (to_north ? y : (Ny-1-y))*Nx + x; // don't change this! lots of downstream code depends on this!

return(n);
}
Expand Down
2 changes: 1 addition & 1 deletion met/src/basic/vx_util/data_plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class DataPlane {

void replace_bad_data(const double value);

int two_to_one(int x, int y) const;
int two_to_one(int x, int y, bool to_north=true) const;
void one_to_two(int n, int &x, int &y) const;

bool s_is_on(int x, int y) const;
Expand Down

0 comments on commit d747c73

Please sign in to comment.