dvalters / HAIL-CAESAR

The High-Performance Architecture-Independent LISFLOOD-CAESAR model of floodplain, river, and sediment dynamics
http://dvalters.github.io/HAIL-CAESAR
GNU General Public License v3.0
38 stars 12 forks source link

Segfault in zero_and_calc_drainage_area #11

Open dvalters opened 6 years ago

dvalters commented 6 years ago

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
}