Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in zero_and_calc_drainage_area #11

Open
dvalters opened this issue Jun 6, 2018 · 0 comments
Open

Segfault in zero_and_calc_drainage_area #11

dvalters opened this issue Jun 6, 2018 · 0 comments
Assignees
Labels

Comments

@dvalters
Copy link
Owner

dvalters commented Jun 6, 2018

Segfaults here: where area is set to one at i=4020, y=1 (from gdb backtrace)

From Freya's larger DEM mexico. (Sent to email for further debugging)

void LSDCatchmentModel::zero_and_calc_drainage_area()
{
  // Zeros the area and are-depth arrays
  // Sets area_depth to ones as a flag but
  // zeros the ones outisde the catchment
  for(unsigned i=1; i<=imax; i++)
  {
    for(unsigned j=1; j<=jmax; j++)
    {
      area_depth[i][j]=1;       <----------SEGFAULT 
      area[i][j] = 0;
      if (elev[i][j] == -9999)
      {
        area_depth[i][j] = 0.0;
      }
    }
  }
  drainage_area_D8();   // This refers to a newer area getting method in CaesarLisflood
}
@dvalters dvalters added the bug? label Jun 6, 2018
@dvalters dvalters self-assigned this Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant