diff --git a/met/src/tools/other/mode_time_domain/3d_att.cc b/met/src/tools/other/mode_time_domain/3d_att.cc index 0fc640ff05..6c10fadfda 100644 --- a/met/src/tools/other/mode_time_domain/3d_att.cc +++ b/met/src/tools/other/mode_time_domain/3d_att.cc @@ -1261,7 +1261,8 @@ moments = mask.calc_3d_moments(); if ( moments.N == 0 ) { - mlog << Error << "\n\n calc_3d_single_atts() -> empty object!\n\n"; + mlog << Error << "\n\ncalc_3d_single_atts() -> " + << "empty object!\n\n"; exit ( 1 ); @@ -1322,16 +1323,22 @@ for (j=0,x_old=0,y_old=0; j 0 ) { - } else { - dist += calc_2d_dist(xbar_2d, ybar_2d, x_old, y_old, *grid); - } // else + } + + // + // update old (x, y) with current + // + + x_old = xbar_2d; + y_old = ybar_2d; } @@ -1347,7 +1354,8 @@ values = new float [Vol]; if ( !values ) { - mlog << Error << "\n\n calc_3d_single_atts() -> memory allocation error\n\n"; + mlog << Error << "\n\ncalc_3d_single_atts() -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -1390,8 +1398,6 @@ a.Ptile_User = percentile_f(values, n, (double) (a.Ptile_Value/100.0)); if ( values ) { delete [] values; values = 0; } -// a.dump(cout); - return ( a ); }