diff --git a/src/tools/other/mode_time_domain/2d_att.cc b/src/tools/other/mode_time_domain/2d_att.cc index 2ea1ff0844..f65ed2ae7f 100644 --- a/src/tools/other/mode_time_domain/2d_att.cc +++ b/src/tools/other/mode_time_domain/2d_att.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -399,15 +398,7 @@ a.ObjectNumber = obj_number; moments = mask_2d.calc_2d_moments(); -if ( moments.N == 0 ) { - - // mlog << Error << "\n\n calc_2d_single_atts() -> empty object!\n\n"; - - // exit ( 1 ); - - return a; - -} +if ( moments.N == 0 ) return a; a.Xbar = (moments.Sx)/(moments.N); a.Ybar = (moments.Sy)/(moments.N); @@ -430,7 +421,8 @@ values = new float [a.Area]; if ( !values ) { - mlog << Error << "\n\n calc_2d_single_atts() -> memory allocation error\n\n"; + mlog << Error << "\ncalc_2d_single_atts() -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -626,6 +618,3 @@ return; //////////////////////////////////////////////////////////////////////// - - - diff --git a/src/tools/other/mode_time_domain/2d_att_array.cc b/src/tools/other/mode_time_domain/2d_att_array.cc index 86a3f99081..b805304c0f 100644 --- a/src/tools/other/mode_time_domain/2d_att_array.cc +++ b/src/tools/other/mode_time_domain/2d_att_array.cc @@ -7,20 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - -//////////////////////////////////////////////////////////////////////// - - - // - // Warning: This file is machine generated - // - // Do not edit by hand - // - // - // Created by arraygen on September 17, 2015 10:11 am MDT - // - - //////////////////////////////////////////////////////////////////////// @@ -127,13 +113,10 @@ void SingleAtt2DArray::clear() if ( e ) { delete [] e; e = (SingleAtt2D *) nullptr; } - Nelements = 0; Nalloc = 0; -// AllocInc = 50; // don't reset AllocInc - return; @@ -174,7 +157,8 @@ SingleAtt2D * u = new SingleAtt2D [N]; if ( !u ) { - mlog << Error << "SingleAtt2DArray::extend(int) -> memory allocation error\n\n"; + mlog << Error << "\nSingleAtt2DArray::extend(int) -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -238,7 +222,8 @@ void SingleAtt2DArray::set_alloc_inc(int N) if ( N < 0 ) { - mlog << Error << "SingleAtt2DArray::set_alloc_int(int) -> bad value ... " << N << "\n\n"; + mlog << Error << "\nSingleAtt2DArray::set_alloc_int(int) -> " + << "bad value ... " << N << "\n\n"; exit ( 1 ); @@ -299,7 +284,8 @@ SingleAtt2D & SingleAtt2DArray::operator[](int N) const if ( (N < 0) || (N >= Nelements) ) { - mlog << Error << "\n\n SingleAtt2DArray::operator[](int) -> range check error ... " << N << "\n\n"; + mlog << Error << "\nSingleAtt2DArray::operator[](int) -> " + << "range check error ... " << N << "\n\n"; exit ( 1 ); } @@ -344,8 +330,8 @@ unixtime SingleAtt2DArray::valid_time(int index) const if ( (index < 0) || (index >= Nelements) ) { - mlog << Error - << "SingleAtt2DArray::valid_time(int) const -> range check error\n\n"; + mlog << Error << "\nSingleAtt2DArray::valid_time(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -365,8 +351,8 @@ int SingleAtt2DArray::lead_time(int index) const if ( (index < 0) || (index >= Nelements) ) { - mlog << Error - << "SingleAtt2DArray::lead_time(int) const -> range check error\n\n"; + mlog << Error << "\nSingleAtt2DArray::lead_time(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -386,8 +372,8 @@ int SingleAtt2DArray::time_index(int index) const if ( (index < 0) || (index >= Nelements) ) { - mlog << Error - << "SingleAtt2DArray::time_index(int) const -> range check error\n\n"; + mlog << Error << "\nSingleAtt2DArray::time_index(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -401,5 +387,3 @@ return e[index].time_index(); //////////////////////////////////////////////////////////////////////// - - diff --git a/src/tools/other/mode_time_domain/2d_moments.cc b/src/tools/other/mode_time_domain/2d_moments.cc index ed1053d819..fc3cad6289 100644 --- a/src/tools/other/mode_time_domain/2d_moments.cc +++ b/src/tools/other/mode_time_domain/2d_moments.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -25,12 +24,10 @@ using namespace std; //////////////////////////////////////////////////////////////////////// - // // Code for class Mtd_2D_Moments // - //////////////////////////////////////////////////////////////////////// @@ -177,7 +174,8 @@ void Mtd_2D_Moments::centralize() if ( N == 0 ) { - mlog << Error << "\n\n Mtd_2D_Moments::centralize() -> no data!\n\n"; + mlog << Error << "\nMtd_2D_Moments::centralize() -> " + << "no data!\n\n"; exit ( 1 ); @@ -220,7 +218,8 @@ double Mtd_2D_Moments::calc_2D_axis_plane_angle() const if ( ! IsCentralized ) { - mlog << Error << "\n\n Mtd_2D_Moments::calc_2D_axis_plane_angle() const -> moments must be centralized first!\n\n"; + mlog << Error << "\nMtd_2D_Moments::calc_2D_axis_plane_angle() const -> " + << "moments must be centralized first!\n\n"; exit ( 1 ); @@ -242,6 +241,3 @@ return angle; //////////////////////////////////////////////////////////////////////// - - - diff --git a/src/tools/other/mode_time_domain/3d_att.cc b/src/tools/other/mode_time_domain/3d_att.cc index 3f30a12786..a347be824e 100644 --- a/src/tools/other/mode_time_domain/3d_att.cc +++ b/src/tools/other/mode_time_domain/3d_att.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -779,8 +778,6 @@ IntersectionVol = 0; IsSimple = true; -// UnionVol = 0; - TimeCentroidDelta = 0.0; SpaceCentroidDist = 0.0; @@ -830,9 +827,6 @@ ObsClusterNumber = a.ObsClusterNumber; IntersectionVol = a.IntersectionVol; -// UnionVol = a.UnionVol; - - TimeCentroidDelta = a.TimeCentroidDelta; SpaceCentroidDist = a.SpaceCentroidDist; @@ -954,20 +948,6 @@ return; } -//////////////////////////////////////////////////////////////////////// - -/* -void PairAtt3D::set_union_volume(int k) - -{ - -UnionVol = k; - -return; - -} -*/ - //////////////////////////////////////////////////////////////////////// @@ -1261,7 +1241,7 @@ moments = mask.calc_3d_moments(); if ( moments.N == 0 ) { - mlog << Error << "\n\ncalc_3d_single_atts() -> " + mlog << Error << "\ncalc_3d_single_atts() -> " << "empty object!\n\n"; exit ( 1 ); @@ -1354,7 +1334,7 @@ values = new float [Vol]; if ( !values ) { - mlog << Error << "\n\ncalc_3d_single_atts() -> " + mlog << Error << "\ncalc_3d_single_atts() -> " << "memory allocation error\n\n"; exit ( 1 ); @@ -1453,7 +1433,6 @@ for (x=0; x<(fcst_obj.nx()); ++x) { } p.set_intersection_volume (IV); -// p.set_union_volume (UV); // // centroid distances @@ -1546,188 +1525,6 @@ return p; } -//////////////////////////////////////////////////////////////////////// - -/* -double calc_total_interest(const PairAtt3D & p, const MtdConfigInfo & conf) - -{ - -double t = 0.0; -double num, den; // numerator and denominator in the expression for total interest -double I, w; -PiecewiseLinear * f = 0; - -num = 0.0; -den = 0.0; - - // - // We don't need to use "is_eq" to check whether each weight is - // nonzero, because the MtdConfigInfo::read_config() function has - // already done that. That same function has already tested that - // the weights are not all zero. - // - - // - // space centroid dist - // - -w = conf.space_centroid_dist_wt; - -if ( w != 0.0 ) { - - f = conf.space_centroid_dist_if; - - I = (*f)(p.space_centroid_dist()); - - num += w*I; - - den += w; - -} - - // - // time centroid delta - // - -w = conf.time_centroid_delta_wt; - -if ( w != 0.0 ) { - - f = conf.time_centroid_delta_if; - - I = (*f)(p.time_centroid_delta()); - - num += w*I; - - den += w; - -} - - // - // speed delta - // - -w = conf.speed_delta_wt; - -if ( w != 0.0 ) { - - f = conf.speed_delta_if; - - I = (*f)(p.speed_delta()); - - num += w*I; - - den += w; - -} - - // - // direction difference - // - -w = conf.direction_diff_wt; - -if ( w != 0.0 ) { - - f = conf.direction_diff_if; - - I = (*f)(p.direction_difference()); - - num += w*I; - - den += w; - -} - - // - // volume ratio - // - -w = conf.volume_ratio_wt; - -if ( w != 0.0 ) { - - f = conf.volume_ratio_if; - - I = (*f)(p.volume_ratio()); - - num += w*I; - - den += w; - -} - - // - // axis angle difference - // - -w = conf.axis_angle_diff_wt; - -if ( w != 0.0 ) { - - f = conf.axis_angle_diff_if; - - I = (*f)(p.axis_angle_diff()); - - num += w*I; - - den += w; - -} - - // - // start time delta - // - -w = conf.start_time_delta_wt; - -if ( w != 0.0 ) { - - f = conf.start_time_delta_if; - - I = (*f)(p.start_time_delta()); - - num += w*I; - - den += w; - -} - - // - // end time delta - // - -w = conf.end_time_delta_wt; - -if ( w != 0.0 ) { - - f = conf.end_time_delta_if; - - I = (*f)(p.end_time_delta()); - - num += w*I; - - den += w; - -} - - // - // The denominator is just the sum of the weights, - // which, as stated above, we already know is nonzero. - // - -t = num/den; - - // - // done - // - -return t; - -} -*/ - //////////////////////////////////////////////////////////////////////// @@ -1738,15 +1535,6 @@ double calc_2d_dist(const double x1_grid, const double y1_grid, double dist; - // - // distance in grid units - // - -// const double dx = x1_grid - x2_grid; -// const double dy = y1_grid - y2_grid; -// -// dist = sqrt ( dx*dx + dy*dy ); - // // great circle distance // @@ -1771,8 +1559,3 @@ return dist; //////////////////////////////////////////////////////////////////////// - - - - - diff --git a/src/tools/other/mode_time_domain/3d_att_pair_array.cc b/src/tools/other/mode_time_domain/3d_att_pair_array.cc index cd5bcd1ad6..8ff840be1c 100644 --- a/src/tools/other/mode_time_domain/3d_att_pair_array.cc +++ b/src/tools/other/mode_time_domain/3d_att_pair_array.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -113,15 +112,10 @@ void PairAtt3DArray::clear() if ( e ) { delete [] e; e = (PairAtt3D *) nullptr; } - - Nelements = 0; Nalloc = 0; -// AllocInc = 100; // don't reset AllocInc - - return; } @@ -161,7 +155,8 @@ PairAtt3D * u = new PairAtt3D [N]; if ( !u ) { - mlog << Error << "PairAtt3DArray::extend(int) -> memory allocation error\n\n"; + mlog << Error << "\nPairAtt3DArray::extend(int) -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -225,7 +220,8 @@ void PairAtt3DArray::set_alloc_inc(int N) if ( N < 0 ) { - mlog << Error << "PairAtt3DArray::set_alloc_int(int) -> bad value ... " << N << "\n\n"; + mlog << Error << "\nPairAtt3DArray::set_alloc_int(int) -> " + << "bad value ... " << N << "\n\n"; exit ( 1 ); @@ -286,7 +282,8 @@ PairAtt3D & PairAtt3DArray::operator[](int N) const if ( (N < 0) || (N >= Nelements) ) { - mlog << Error << "\n\n PairAtt3DArray::operator[](int) -> range check error ... " << N << "\n\n"; + mlog << Error << "\nPairAtt3DArray::operator[](int) -> " + << "range check error ... " << N << "\n\n"; exit ( 1 ); } @@ -305,7 +302,8 @@ int PairAtt3DArray::fcst_obj_number(int k) const if ( (k < 0) || (k >= Nelements) ) { - mlog << Error << "\n\n PairAtt3DArray::fcst_obj_number(int) -> range check error\n\n"; + mlog << Error << "\nPairAtt3DArray::fcst_obj_number(int) -> " + << "range check error\n\n"; exit ( 1 ); @@ -325,7 +323,8 @@ int PairAtt3DArray::obs_obj_number(int k) const if ( (k < 0) || (k >= Nelements) ) { - mlog << Error << "\n\n PairAtt3DArray::obs_obj_number(int) -> range check error\n\n"; + mlog << Error << "\nPairAtt3DArray::obs_obj_number(int) -> " + << "range check error\n\n"; exit ( 1 ); @@ -345,7 +344,8 @@ int PairAtt3DArray::fcst_cluster_number(int k) const if ( (k < 0) || (k >= Nelements) ) { - mlog << Error << "\n\n PairAtt3DArray::fcst_cluster_number(int) -> range check error\n\n"; + mlog << Error << "\nPairAtt3DArray::fcst_cluster_number(int) -> " + << "range check error\n\n"; exit ( 1 ); @@ -365,7 +365,8 @@ int PairAtt3DArray::obs_cluster_number(int k) const if ( (k < 0) || (k >= Nelements) ) { - mlog << Error << "\n\n PairAtt3DArray::obs_cluster_number(int) -> range check error\n\n"; + mlog << Error << "\nPairAtt3DArray::obs_cluster_number(int) -> " + << "range check error\n\n"; exit ( 1 ); @@ -385,7 +386,8 @@ double PairAtt3DArray::total_interest(int k) const if ( (k < 0) || (k >= Nelements) ) { - mlog << Error << "\n\n PairAtt3DArray::total_interest(int) -> range check error\n\n"; + mlog << Error << "\nPairAtt3DArray::total_interest(int) -> " + << "range check error\n\n"; exit ( 1 ); diff --git a/src/tools/other/mode_time_domain/3d_att_single_array.cc b/src/tools/other/mode_time_domain/3d_att_single_array.cc index d8fdba1252..dabf30bdeb 100644 --- a/src/tools/other/mode_time_domain/3d_att_single_array.cc +++ b/src/tools/other/mode_time_domain/3d_att_single_array.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -113,14 +112,10 @@ void SingleAtt3DArray::clear() if ( e ) { delete [] e; e = (SingleAtt3D *) nullptr; } - - Nelements = 0; Nalloc = 0; -// AllocInc = 100; // don't reset AllocInc - return; @@ -161,7 +156,8 @@ SingleAtt3D * u = new SingleAtt3D [N]; if ( !u ) { - mlog << Error << "SingleAtt3DArray::extend(int) -> memory allocation error\n\n"; + mlog << Error << "\nSingleAtt3DArray::extend(int) -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -225,7 +221,8 @@ void SingleAtt3DArray::set_alloc_inc(int N) if ( N < 0 ) { - mlog << Error << "SingleAtt3DArray::set_alloc_int(int) -> bad value ... " << N << "\n\n"; + mlog << Error << "\nSingleAtt3DArray::set_alloc_int(int) -> " + << "bad value ... " << N << "\n\n"; exit ( 1 ); @@ -286,7 +283,8 @@ SingleAtt3D & SingleAtt3DArray::operator[](int N) const if ( (N < 0) || (N >= Nelements) ) { - mlog << Error << "\n\n SingleAtt3DArray::operator[](int) -> range check error ... " << N << "\n\n"; + mlog << Error << "\nSingleAtt3DArray::operator[](int) -> " + << "range check error ... " << N << "\n\n"; exit ( 1 ); } diff --git a/src/tools/other/mode_time_domain/3d_conv.cc b/src/tools/other/mode_time_domain/3d_conv.cc index 1ecbe0b68a..b095989391 100644 --- a/src/tools/other/mode_time_domain/3d_conv.cc +++ b/src/tools/other/mode_time_domain/3d_conv.cc @@ -244,12 +244,6 @@ file_id = 1; // This is declared static in the netCDF library header file ncG spatial_conv_radius = spatial_R; - -// mlog << Error << "\n\n" -// << " MtdFloatFile::convolve(const int) const -> still doesn't allow for bad data!\n\n" -// << "\n\n"; - - const int Nxy = Nx*Ny; const int Nxyz = Nx*Ny*Nt; @@ -263,7 +257,8 @@ for (int k=0; k memory allocation error\n\n"; + mlog << Error << "\nMtdFloatFile::convolve(const int, const int, const int) const: process() -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -278,8 +273,6 @@ max_conv_value = -1.0e100; unixtime time_start = time(nullptr); -// cout << "\n\n n = " << mtd_three_to_one(Nx, Ny, Nt, 88, 397, 0) << "\n\n"; - for (int t=0; t bad size\n\n"; + mlog << Error << "\nDataHandle::set_size() -> " + << "bad size\n\n"; exit ( 1 ); @@ -532,9 +517,6 @@ bool status = false; const int nx = mtd.nx(); const int ny = mtd.ny(); - -// mlog << Debug(5) << "In get_data_plane\n"; - for (y=0; y " + << "unable to write image file: " << filename << "\n\n"; exit ( 1 ); @@ -1038,11 +1009,10 @@ for (int x=0; x " + << "unable to write image file: " << filename << "\n\n"; exit ( 1 ); @@ -1056,7 +1026,3 @@ return; //////////////////////////////////////////////////////////////////////// - - - - diff --git a/src/tools/other/mode_time_domain/3d_moments.cc b/src/tools/other/mode_time_domain/3d_moments.cc index 7c2b4362d4..53e1b8b547 100644 --- a/src/tools/other/mode_time_domain/3d_moments.cc +++ b/src/tools/other/mode_time_domain/3d_moments.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -187,7 +186,8 @@ void Mtd_3D_Moments::centralize() if ( N == 0 ) { - mlog << Error << "\n\n Mtd_3D_Moments::centralize() -> no data!\n\n"; + mlog << Error << "\nMtd_3D_Moments::centralize() -> " + << "no data!\n\n"; exit ( 1 ); @@ -242,7 +242,8 @@ void Mtd_3D_Moments::calc_3d_velocity(double & vx, double & vy) const if ( ! IsCentralized ) { - mlog << Error << "\n\n Mtd_3D_Moments::calc_3d_velocity(double &, double &) const -> moments must be centralized first!\n\n"; + mlog << Error << "\nMtd_3D_Moments::calc_3d_velocity(double &, double &) const -> " + << "moments must be centralized first!\n\n"; exit ( 1 ); @@ -266,7 +267,8 @@ double Mtd_3D_Moments::calc_3d_axis_plane_angle() const if ( ! IsCentralized ) { - mlog << Error << "\n\n Mtd_3D_Moments::calc_3d_axis_plane_angle() const -> moments must be centralized first!\n\n"; + mlog << Error << "\nMtd_3D_Moments::calc_3d_axis_plane_angle() const -> " + << "moments must be centralized first!\n\n"; exit ( 1 ); @@ -288,6 +290,3 @@ return angle; //////////////////////////////////////////////////////////////////////// - - - diff --git a/src/tools/other/mode_time_domain/fo_graph.cc b/src/tools/other/mode_time_domain/fo_graph.cc index 48b031813a..2ecdf62c25 100644 --- a/src/tools/other/mode_time_domain/fo_graph.cc +++ b/src/tools/other/mode_time_domain/fo_graph.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -168,7 +167,8 @@ int FO_Graph::f_index(int f_num) const if ( (f_num < 0) || (f_num >= N_fcst) ) { - mlog << Error << "\n\n FO_Graph::f_index(int f_num) const -> range check error!\n\n"; + mlog << Error << "\nFO_Graph::f_index(int f_num) const -> " + << "range check error!\n\n"; exit ( 1 ); @@ -188,7 +188,8 @@ int FO_Graph::o_index(int o_num) const if ( (o_num < 0) || (o_num >= N_obs) ) { - mlog << Error << "\n\n FO_Graph::o_index(int o_num) const -> range check error!\n\n"; + mlog << Error << "\nFO_Graph::o_index(int o_num) const -> " + << "range check error!\n\n"; exit ( 1 ); @@ -214,7 +215,8 @@ if ( (n_f == 0) && (n_o == 0) ) trouble = true; if ( trouble ) { - mlog << Error << "\n\n FO_Graph::set_size(int n_f, int n_o) -> bad n_f or n_o value(s)\n\n"; + mlog << Error << "\nFO_Graph::set_size(int n_f, int n_o) -> " + << "bad n_f or n_o value(s)\n\n"; exit ( 1 ); @@ -229,9 +231,6 @@ N_total = N_fcst + N_obs; TheGraph = new FO_Node [N_total*N_total]; - - - // // done // @@ -365,7 +364,8 @@ void FO_Graph::erase_edges() if ( ! TheGraph ) { - mlog << Error << "\n\n FO_Graph::erase_edges() -> empty graph!\n\n"; + mlog << Error << "\nFO_Graph::erase_edges() -> " + << "empty graph!\n\n"; exit ( 1 ); @@ -394,7 +394,8 @@ void FO_Graph::do_dump_table(AsciiTable & table) const if ( ! TheGraph ) { - mlog << Error << "\n\n FO_Graph::dump_as_table() -> empty graph!\n\n"; + mlog << Error << "\nO_Graph::dump_as_table() -> " + << "empty graph!\n\n"; exit ( 1 ); @@ -410,16 +411,6 @@ const int obs_stop = obs_start + N_obs - 1; table.set_size(N_total + 2, N_total + 2); -// for (r=0; r<(table.nrows()); ++r) { -// -// for (c=0; c<(table.ncols()); ++c) { -// -// table.set_entry(r, c, '.'); -// -// } -// -// } - c = fcst_stop + 1; for (r=1; r<(table.nrows()); ++r) { @@ -499,7 +490,6 @@ for (j=0; j memory allocation error\n\n"; + mlog << Error << "\nFO_Node_Array::extend(int) -> " + << "memory allocation error\n\n"; exit ( 1 ); @@ -225,7 +222,8 @@ void FO_Node_Array::set_alloc_inc(int N) if ( N < 0 ) { - mlog << Error << "FO_Node_Array::set_alloc_int(int) -> bad value ... " << N << "\n\n"; + mlog << Error << "\nFO_Node_Array::set_alloc_int(int) -> " + << "bad value ... " << N << "\n\n"; exit ( 1 ); @@ -286,7 +284,8 @@ FO_Node & FO_Node_Array::operator[](int N) const if ( (N < 0) || (N >= Nelements) ) { - mlog << Error << "\n\n FO_Node_Array::operator[](int) -> range check error ... " << N << "\n\n"; + mlog << Error << "\nFO_Node_Array::operator[](int) -> " + << "range check error ... " << N << "\n\n"; exit ( 1 ); } diff --git a/src/tools/other/mode_time_domain/interest_calc.cc b/src/tools/other/mode_time_domain/interest_calc.cc index f3e98e21c6..630fb92855 100644 --- a/src/tools/other/mode_time_domain/interest_calc.cc +++ b/src/tools/other/mode_time_domain/interest_calc.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -361,6 +360,3 @@ return sum; //////////////////////////////////////////////////////////////////////// - - - diff --git a/src/tools/other/mode_time_domain/mm_engine.cc b/src/tools/other/mode_time_domain/mm_engine.cc index a170f64b64..1928c97594 100644 --- a/src/tools/other/mode_time_domain/mm_engine.cc +++ b/src/tools/other/mode_time_domain/mm_engine.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -208,12 +207,8 @@ for (j=0; j<(graph.n_fcst()); ++j) { if ( ! graph.has_fo_edge(j, k) ) continue; - // mlog << Debug(5) << "\n Merging fcst " << j << ", obs " << k << '\n' << flush; - part.merge_values(f_i, o_i); - // specialzed_dump(graph.n_fcst(), graph.n_obs(), p); - } // for k } // for j diff --git a/src/tools/other/mode_time_domain/mtd.cc b/src/tools/other/mode_time_domain/mtd.cc index 14cd5a18bb..aaad44203d 100644 --- a/src/tools/other/mode_time_domain/mtd.cc +++ b/src/tools/other/mode_time_domain/mtd.cc @@ -151,7 +151,6 @@ default_config_filename = replace_path(default_config_path); config.read_config(default_config_filename.c_str(), local_config_filename.c_str()); - // // determine the input file types // - check the config file for the file_type @@ -263,8 +262,6 @@ fcst_raw.regrid(to_grid, config.fcst_info->regrid()); // ConcatString prefix; -// int year, month, day, hour, minute, second; -// char junk[256]; prefix = make_output_prefix(config, obs_raw.start_valid_time()); @@ -394,10 +391,6 @@ MtdIntFile fo, oo; if ( have_pairs ) { - // mlog << Debug(5) << "\n Calculating pair attributes ... (Nf = " - // << (fcst_obj.n_objects()) << ", No = " - // << (obs_obj.n_objects()) << ")\n\n"; - for (j=0; j<(fcst_obj.n_objects()); ++j) { fo = fcst_obj.select(j + 1); @@ -412,9 +405,6 @@ if ( have_pairs ) { p.set_simple(); - // mlog << Debug(5) << " (F_" << j << ", O_" << k << ") " - // << p.total_interest() << '\n'; - pa_simple.add(p); } @@ -424,7 +414,6 @@ if ( have_pairs ) { } // if have_pairs - // // calculate 2d simple attributes // @@ -520,9 +509,6 @@ for (j=0; j<(obs_obj.n_objects()); ++j) { } // for j - - - // // create graph // @@ -554,26 +540,14 @@ if ( have_pairs ) { for (j=0; j 5 ) fcst_cluster_att.dump(cout); - mlog << Debug(2) << "Calculating 3D obs cluster attributes\n"; @@ -622,8 +594,6 @@ if ( have_pairs ) { att_3 = calc_3d_single_atts(mask, obs_raw, config.model.c_str(), config.inten_perc_value); - // if ( att.Xvelocity > 20.0 ) mask.write("w.nc"); - att_3.set_object_number(j + 1); // 1-based att_3.set_obs(); @@ -634,8 +604,6 @@ if ( have_pairs ) { } - // obs_cluster_att.dump(cout); - } // if have_pairs // @@ -670,12 +638,8 @@ if ( have_pairs ) { p.set_cluster(); - // p.set_total_interest(e.calc(p)); p.set_total_interest(-1.0); - // mlog << Debug(5) << " (F_" << j << ", O_" << k << ") " - // << p.total_interest() << '\n'; - pa_cluster.add(p); } @@ -787,9 +751,6 @@ if ( have_pairs ) { } // for j - - - } // if have pairs // diff --git a/src/tools/other/mode_time_domain/mtd_config_info.cc b/src/tools/other/mode_time_domain/mtd_config_info.cc index 97b9d90e29..c23af5a638 100644 --- a/src/tools/other/mode_time_domain/mtd_config_info.cc +++ b/src/tools/other/mode_time_domain/mtd_config_info.cc @@ -191,51 +191,6 @@ conf.read(default_file_name); if ( user_file_name ) conf.read(user_file_name); - // check the fuzzy-engine weights - // calculation of total interest assumes these tests - - // - // Update: these tests are not really needed since the InterestCalculator - // class checks this - // - -/* -bool all_zero = true; - -if ( is_eq(space_centroid_dist_wt, 0.0) ) space_centroid_dist_wt = 0.0; -else all_zero = false; - -if ( is_eq(time_centroid_delta_wt, 0.0) ) time_centroid_delta_wt = 0.0; -else all_zero = false; - -if ( is_eq(speed_delta_wt, 0.0) ) speed_delta_wt = 0.0; -else all_zero = false; - -if ( is_eq(direction_diff_wt, 0.0) ) direction_diff_wt = 0.0; -else all_zero = false; - -if ( is_eq(volume_ratio_wt, 0.0) ) volume_ratio_wt = 0.0; -else all_zero = false; - -if ( is_eq(axis_angle_diff_wt, 0.0) ) axis_angle_diff_wt = 0.0; -else all_zero = false; - -if ( is_eq(start_time_delta_wt, 0.0) ) start_time_delta_wt = 0.0; -else all_zero = false; - -if ( is_eq(end_time_delta_wt, 0.0) ) end_time_delta_wt = 0.0; -else all_zero = false; - - -if ( all_zero ) { - - mlog << Error << "\n\n MtdConfigInfo::read_config() -> all the fuzzy engine weights are zero!\n\n"; - - exit ( 1 ); - -} -*/ - // // done // @@ -259,10 +214,6 @@ void MtdConfigInfo::process_config(GrdFileType ftype, GrdFileType otype) bool status = false; double sum; - // Dump the contents of the config file - - // if(mlog.verbosity_level() >= 5) conf.dump(cout); - // Initialize clear(); @@ -298,19 +249,6 @@ void MtdConfigInfo::process_config(GrdFileType ftype, GrdFileType otype) fcst_info->set_dict(*(fcst_dict->lookup_dictionary(conf_key_field))); obs_info->set_dict(*(obs_dict->lookup_dictionary(conf_key_field))); - // Dump the contents of the VarInfo objects -// -// if(mlog.verbosity_level() >= 5) { -// mlog << Debug(5) -// << "Parsed forecast field:\n"; -// fcst_info->dump(cout); -// mlog << Debug(5) -// << "Parsed observation field:\n"; -// obs_info->dump(cout); -// } -// - - // No support for wind direction if(fcst_info->is_wind_direction() || obs_info->is_wind_direction()) { @@ -350,68 +288,6 @@ void MtdConfigInfo::process_config(GrdFileType ftype, GrdFileType otype) fcst_conv_thresh = fcst_dict->lookup_thresh(conf_key_conv_thresh); obs_conv_thresh = obs_dict->lookup_thresh(conf_key_conv_thresh); - // Conf: fcst.vld_thresh and obs.vld_thresh - - // fcst_vld_thresh = fcst_dict->lookup_double(conf_key_vld_thresh); - // obs_vld_thresh = obs_dict->lookup_double(conf_key_vld_thresh); - - // Conf: fcst.merge_thresh and obs.merge_thresh - - // fcst_merge_thresh = fcst_dict->lookup_thresh(conf_key_merge_thresh); - // obs_merge_thresh = obs_dict->lookup_thresh(conf_key_merge_thresh); - - // Conf: fcst.merge_flag and obs.merge_flag - - // fcst_merge_flag = int_to_mergetype(fcst_dict->lookup_int(conf_key_merge_flag)); - // obs_merge_flag = int_to_mergetype(obs_dict->lookup_int(conf_key_merge_flag)); - - // Conf: mask_missing_flag - - // mask_missing_flag = int_to_fieldtype(conf.lookup_int(conf_key_mask_missing_flag)); - - // Conf: match_flag - - // match_flag = int_to_matchtype(conf.lookup_int(conf_key_match_flag)); - - // Check that match_flag is set between 0 and 3 -/* - if(match_flag == MatchType::None && - (fcst_merge_flag != MergeType::None || obs_merge_flag != MergeType::None) ) { - mlog << Warning << "\nMtdConfigInfo::process_config() -> " - << "When matching is disabled (match_flag = " - << matchtype_to_string(match_flag) - << ") but merging is requested (fcst_merge_flag = " - << mergetype_to_string(fcst_merge_flag) - << ", obs_merge_flag = " - << mergetype_to_string(obs_merge_flag) - << ") any merging information will be discarded.\n\n"; - } -*/ - // Conf: max_centroid_dist - - // max_centroid_dist = conf.lookup_double(conf_key_max_centroid_dist); - - // Check that max_centroid_dist is > 0 -/* - if(max_centroid_dist <= 0) { - mlog << Warning << "\nMtdConfigInfo::process_config() -> " - << "max_centroid_dist (" << max_centroid_dist - << ") should be set > 0\n\n"; - } - -*/ - // Conf: mask.grid - -/* - mask_grid_name = conf.lookup_string(conf_key_mask_grid); - mask_grid_flag = int_to_fieldtype(conf.lookup_int(conf_key_mask_grid_flag)); - - // Conf: mask.poly - - mask_poly_name = conf.lookup_string(conf_key_mask_poly); - mask_poly_flag = int_to_fieldtype(conf.lookup_int(conf_key_mask_poly_flag)); -*/ - // Conf: weight dict = conf.lookup_dictionary(conf_key_weight); @@ -494,20 +370,6 @@ void MtdConfigInfo::process_config(GrdFileType ftype, GrdFileType otype) exit(1); } - // Conf: print_interest_thresh - - // print_interest_thresh = conf.lookup_double(conf_key_print_interest_thresh); - - // Check that print_interest_thresh is between 0 and 1. -/* - if(print_interest_thresh < 0 || print_interest_thresh > 1) { - mlog << Error << "\nMtdConfigInfo::process_config() -> " - << "print_interest_thresh (" << print_interest_thresh - << ") must be set between 0 and 1.\n\n"; - exit(1); - } -*/ - // Conf: nc_pairs_flag parse_nc_info(); @@ -516,10 +378,6 @@ void MtdConfigInfo::process_config(GrdFileType ftype, GrdFileType otype) parse_txt_info(); - // Conf: ct_stats_flag - - // ct_stats_flag = conf.lookup_bool(conf_key_ct_stats_flag); - // Conf: output_prefix output_prefix = conf.lookup_string(conf_key_output_prefix); @@ -564,8 +422,8 @@ e = conf.lookup(conf_key_nc_output); if ( !e ) { - mlog << Error - << "\n\n MtdConfigInfo::parse_nc_info() -> lookup failed for key \"" + mlog << Error << "\nMtdConfigInfo::parse_nc_info() -> " + << "lookup failed for key \"" << conf_key_nc_output << "\"\n\n"; exit ( 1 ); @@ -590,11 +448,9 @@ if ( type == BooleanType ) { if ( type != DictionaryType ) { - mlog << Error - << "\n\n MtdConfigInfo::parse_nc_info() -> bad type (" - << configobjecttype_to_string(type) - << ") for key \"" - << conf_key_nc_pairs_flag << "\"\n\n"; + mlog << Error << "\nMtdConfigInfo::parse_nc_info() -> " + << "bad type (" << configobjecttype_to_string(type) + << ") for key \"" << conf_key_nc_pairs_flag << "\"\n\n"; exit ( 1 ); @@ -608,10 +464,8 @@ Dictionary * d = e->dict_value(); nc_info.do_latlon = d->lookup_bool(conf_key_latlon_flag); nc_info.do_raw = d->lookup_bool(conf_key_raw_flag); -// nc_info.do_object_raw = d->lookup_bool(conf_key_object_raw_flag); nc_info.do_object_id = d->lookup_bool(conf_key_object_id_flag); nc_info.do_cluster_id = d->lookup_bool(conf_key_cluster_id_flag); -// nc_info.do_polylines = d->lookup_bool(conf_key_do_polylines_flag); // // done @@ -638,9 +492,8 @@ e = conf.lookup(key); if ( !e ) { - mlog << Error - << "\n\n MtdConfigInfo::parse_txt_info() -> lookup failed for key \"" - << key << "\"\n\n"; + mlog << Error << "\nMtdConfigInfo::parse_txt_info() -> " + << "lookup failed for key \"" << key << "\"\n\n"; exit ( 1 ); @@ -654,11 +507,9 @@ const ConfigObjectType type = e->type(); if ( type != DictionaryType ) { - mlog << Error - << "\n\n MtdConfigInfo::parse_txt_info() -> bad type (" - << configobjecttype_to_string(type) - << ") for key \"" - << key << "\"\n\n"; + mlog << Error << "\nMtdConfigInfo::parse_txt_info() -> " + << "bad type (" << configobjecttype_to_string(type) + << ") for key \"" << key << "\"\n\n"; exit ( 1 ); @@ -851,7 +702,6 @@ bool MtdNcOutInfo::all_false() const { -// bool status = do_latlon || do_raw || do_object_raw || do_object_id || do_cluster_id || do_polylines; bool status = do_latlon || do_raw || do_object_id || do_cluster_id; return !status; @@ -868,10 +718,8 @@ void MtdNcOutInfo::set_all_false() do_latlon = false; do_raw = false; -// do_object_raw = false; do_object_id = false; do_cluster_id = false; -// do_polylines = false; return; @@ -887,10 +735,8 @@ void MtdNcOutInfo::set_all_true() do_latlon = true; do_raw = true; -// do_object_raw = true; do_object_id = true; do_cluster_id = true; -// do_polylines = true; return; diff --git a/src/tools/other/mode_time_domain/mtd_file_base.cc b/src/tools/other/mode_time_domain/mtd_file_base.cc index 730cd7b6fc..f46a43392b 100644 --- a/src/tools/other/mode_time_domain/mtd_file_base.cc +++ b/src/tools/other/mode_time_domain/mtd_file_base.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -179,8 +178,6 @@ if ( G ) { G->dump(out, depth + 1); - // out << prefix << (G->xml_serialize()) << '\n'; - } else { out << prefix << "Grid = 0\n"; @@ -238,7 +235,8 @@ Grid MtdFileBase::grid() const if ( !G ) { - mlog << Error << "\n\n MtdFileBase::grid() const -> no grid!\n\n"; + mlog << Error << "\nMtdFileBase::grid() const -> " + << "no grid!\n\n"; exit ( 1 ); @@ -271,7 +269,8 @@ void MtdFileBase::latlon_to_xy(double lat, double lon, double & x, double & y) c if ( !G ) { - mlog << Error << "\n\n MtdFileBase::latlon_to_xy() -> no grid!\n\n"; + mlog << Error << "\nMtdFileBase::latlon_to_xy() -> " + << "no grid!\n\n"; exit ( 1 ); @@ -333,7 +332,8 @@ void MtdFileBase::xy_to_latlon(double x, double y, double & lat, double & lon) c if ( !G ) { - mlog << Error << "\n\n MtdFileBase::xy_to_latlon() -> no grid!\n\n"; + mlog << Error << "\nMtdFileBase::xy_to_latlon() -> " + << "no grid!\n\n"; exit ( 1 ); @@ -355,7 +355,8 @@ unixtime MtdFileBase::valid_time(int t) const if ( (t < 0) || ( t >= Nt) ) { - mlog << Error << "\n\n MtdFileBase::valid_time(int t) -> range check error\n\n"; + mlog << Error << "\nMtdFileBase::valid_time(int t) -> " + << "range check error\n\n"; exit ( 1 ); @@ -375,7 +376,8 @@ unixtime MtdFileBase::actual_valid_time(int t) const if ( (t < 0) || ( t >= (int)ActualValidTimes.size()) ) { - mlog << Error << "\n\n MtdFileBase::valid_time(int t) -> range check error\n\n"; + mlog << Error << "\nMtdFileBase::valid_time(int t) -> " + << "range check error\n\n"; exit ( 1 ); @@ -395,7 +397,8 @@ int MtdFileBase::lead_time(int index) const if ( (index < 0) || ( index >= Nt) ) { - mlog << Error << "\n\n MtdFileBase::lead_time(int t) -> range check error\n\n"; + mlog << Error << "\nMtdFileBase::lead_time(int t) -> " + << "range check error\n\n"; exit ( 1 ); @@ -452,7 +455,8 @@ status = string_to_mtdfiletype(s.text(), FileType); if ( ! status ) { - mlog << Error << "\n\n MtdFileBase::read(NcFile &) -> unable to parse filetype string \"" + mlog << Error << "\nMtdFileBase::read(NcFile &) -> " + << "unable to parse filetype string \"" << s << "\"\n\n"; exit ( 1 ); @@ -507,7 +511,6 @@ s = mtdfiletype_to_string(FileType); add_att(&f, filetype_att_name, s.text()); - // // done // @@ -526,8 +529,8 @@ void MtdFileBase::set_lead_time(int index, int value) if ( (index < 0) || (index >= Nt) ) { - mlog << Error - << "MtdFileBase::set_lead_time(int index, int value) -> range check error on index ... " + mlog << Error << "MtdFileBase::set_lead_time(int index, int value) -> " + << "range check error on index ... " << index << "\n\n"; exit ( 1 ); @@ -552,7 +555,3 @@ return; //////////////////////////////////////////////////////////////////////// - - - - diff --git a/src/tools/other/mode_time_domain/mtd_file_float.cc b/src/tools/other/mode_time_domain/mtd_file_float.cc index 715b3734b0..a05dfc2657 100644 --- a/src/tools/other/mode_time_domain/mtd_file_float.cc +++ b/src/tools/other/mode_time_domain/mtd_file_float.cc @@ -168,7 +168,6 @@ if ( f.Data ) { } - // // done // @@ -255,7 +254,8 @@ void MtdFloatFile::set_spatial_radius(int spatial_r) if ( spatial_r < 0 ) { - mlog << Error << "\n\n MtdFloatFile::set_spatial_radius(int) -> bad value ... " << spatial_r << "\n\n"; + mlog << Error << "\nMtdFloatFile::set_spatial_radius(int) -> " + << "bad value ... " << spatial_r << "\n\n"; exit ( 1 ); @@ -277,7 +277,8 @@ void MtdFloatFile::set_time_window(int beg, int end) if ( end < beg ) { - mlog << Error << "\n\n MtdFloatFile::set_time_window(int) -> bad values ... " << beg << " and " << end << "\n\n"; + mlog << Error << "\nMtdFloatFile::set_time_window(int) -> " + << "bad values ... " << beg << " and " << end << "\n\n"; exit ( 1 ); @@ -317,7 +318,8 @@ void MtdFloatFile::put(const DataPlane & plane, const int t) if ( (plane.nx() != Nx) || (plane.ny() != Ny) ) { - mlog << Error << "\n\n MtdFloatFile::put(const DataPlane &, const int) -> plane wrong size!\n\n"; + mlog << Error << "\nMtdFloatFile::put(const DataPlane &, const int) -> " + << "plane wrong size!\n\n"; exit ( 1 ); @@ -325,7 +327,8 @@ if ( (plane.nx() != Nx) || (plane.ny() != Ny) ) { if ( (t < 0) || (t >= Nt) ) { - mlog << Error << "\n\n MtdFloatFile::put(const DataPlane &, const int) -> bad time\n\n"; + mlog << Error << "\nMtdFloatFile::put(const DataPlane &, const int) -> " + << "bad time\n\n"; exit ( 1 ); @@ -359,8 +362,6 @@ for (x=0; x no data!\n\n"; + mlog << Error << "\nMtdFloatFile::threshold(double, MtdIntFile &) const -> " + << "no data!\n\n"; exit ( 1 ); @@ -542,7 +544,8 @@ void MtdFloatFile::threshold(const SingleThresh & t, MtdIntFile & out) const if ( !Data ) { - mlog << Error << "\n\n MtdFloatFile::threshold(double, MtdIntFile &) const -> no data!\n\n"; + mlog << Error << "\nMtdFloatFile::threshold(double, MtdIntFile &) const -> " + << "no data!\n\n"; exit ( 1 ); @@ -592,7 +595,6 @@ out.set_threshold(-9999.0); out.set_filetype(mtd_file_mask); - // // done // @@ -629,11 +631,9 @@ void MtdFloatFile::read(NcFile & f) { -//NcVar * var = 0; NcVar var; - // // read the base class stuff // @@ -663,7 +663,8 @@ lengths.add(Nx); if ( ! get_nc_data(&var, Data, lengths, offsets) ) { - mlog << Error << "\n\n MtdFloatFile::read(const char *) -> trouble getting data\n\n"; + mlog << Error << "\nMtdFloatFile::read(const char *) -> " + << "trouble getting data\n\n"; exit ( 1 ); @@ -685,13 +686,9 @@ void MtdFloatFile::write(NcFile & f) const { -//NcDim * nx_dim = 0; -//NcDim * ny_dim = 0; -//NcDim * nt_dim = 0; NcDim nx_dim; NcDim ny_dim; NcDim nt_dim; -//NcVar * data_var = 0; NcVar data_var ; const char format [] = "%.3f"; char junk[256]; @@ -741,24 +738,6 @@ add_var(&f, data_field_name, ncFloat, nt_dim, ny_dim, nx_dim); data_var = get_nc_var(&f, data_field_name); -//if ( !(data_var->set_cur(0, 0, 0)) ) { -// -// mlog << Error << "\n\n MtdFloatFile::write() -> trouble setting corner on data field\n\n"; -// -// exit ( 1 ); -// -//} -// -//// const time_t t_start = time(0); // for timing the data write operation -// -//if ( !(data_var->put(Data, Nt, Ny, Nx)) ) { -// -// mlog << Error << "\n\n MtdFloatFile::write() -> trouble with put in data field\n\n"; -// -// exit ( 1 ); -// -//} - LongArray offsets; // {0,0,0}; LongArray lengths; // {Nt, Ny, Nx}; @@ -769,19 +748,15 @@ lengths.add(Nt); lengths.add(Ny); lengths.add(Nx); -//if ( ! get_nc_data(&data_var, Data, (long *){Nt, Ny, Nx}, (long *){0,0,0}) ) { if ( ! get_nc_data(&data_var, Data, lengths, offsets) ) { - mlog << Error << "\n\n MtdFloatFile::read(const char *) -> trouble getting data\n\n"; + mlog << Error << "\nMtdFloatFile::read(const char *) -> " + << "trouble getting data\n\n"; exit ( 1 ); } -// const time_t t_stop = time(0); // for timing the data write operation - -// mlog << Debug(5) << "\n\n MtdFloatFile::write(): Time to write data = " << (t_stop - t_start) << " seconds\n\n" << flush; - // // done // @@ -802,11 +777,10 @@ NcFile f(_filename, NcFile::replace); if ( IS_INVALID_NC(f) ) { - mlog << Error << "\n\n MtdFloatFile::write(const char *) -> unable to open netcdf output file \"" << _filename << "\"\n\n"; + mlog << Error << "\nMtdFloatFile::write(const char *) -> " + << "unable to open netcdf output file: " << _filename << "\n\n"; - // exit ( 1 ); - - return; + exit ( 1 ); } @@ -830,7 +804,8 @@ MtdFloatFile MtdFloatFile::const_t_slice(int t) const if ( (t < 0) || (t >= Nt) ) { - mlog << Error << "\n\n MtdFloatFile MtdFloatFile::const_t_slice(int) const -> range check error\n\n"; + mlog << Error << "\nMtdFloatFile MtdFloatFile::const_t_slice(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -898,7 +873,8 @@ void MtdFloatFile::get_data_plane(const int t, DataPlane & out) if ( (t < 0) || (t >= Nt) ) { - mlog << Error << "\n\n MtdFloatFile::get_data_plane() -> range check error on t\n\n"; + mlog << Error << "\nMtdFloatFile::get_data_plane() -> " + << "range check error on t\n\n"; exit ( 1 ); @@ -933,9 +909,6 @@ for (x=0; x= Nt) ) { - mlog << Error << "\n\n " << method_name << "range check error on t\n\n"; + mlog << Error << "\n" << method_name + << "range check error on t\n\n"; exit ( 1 ); @@ -962,7 +937,8 @@ if ( (t < 0) || (t >= Nt) ) { if ( (d.nx() != Nx) || (d.ny() != Ny) ) { - mlog << Error << "\n\n " << method_name << "data plane is wrong size!\n\n"; + mlog << Error << "\n" << method_name + << "data plane is wrong size!\n\n"; exit ( 1 ); @@ -979,8 +955,9 @@ for (x=0; x=data_cnt) { - mlog << Debug(4) << method_name << "offset " << n - << " is out of range (" << " from " << x << ", " << y <<", " << t <<")\n"; + mlog << Debug(4) << method_name + << "offset " << n << " is out of range (from " + << x << ", " << y <<", " << t <<")\n"; continue; } @@ -1062,7 +1039,3 @@ return; //////////////////////////////////////////////////////////////////////// - - - - diff --git a/src/tools/other/mode_time_domain/mtd_file_int.cc b/src/tools/other/mode_time_domain/mtd_file_int.cc index 5faf6594f5..e9e72165d9 100644 --- a/src/tools/other/mode_time_domain/mtd_file_int.cc +++ b/src/tools/other/mode_time_domain/mtd_file_int.cc @@ -302,7 +302,8 @@ void MtdIntFile::set_radius(int r) if ( r < 0 ) { - mlog << Error << "\n MtdIntFile::set_radius(int) -> bad value ... " << r << "\n\n"; + mlog << Error << "\nMtdIntFile::set_radius(int) -> " + << "bad value ... " << r << "\n\n"; exit ( 1 ); @@ -325,7 +326,8 @@ void MtdIntFile::set_time_window(int beg, int end) if ( end < beg ) { - mlog << Error << "\n MtdIntFile::set_time_window(int) -> bad values ... " << beg << " and " << end << "\n\n"; + mlog << Error << "\nMtdIntFile::set_time_window(int) -> " + << "bad values ... " << beg << " and " << end << "\n\n"; exit ( 1 ); @@ -347,14 +349,6 @@ void MtdIntFile::set_threshold(double t) { -// if ( t < 0.0 ) { -// -// mlog << Error << "\n MtdIntFile::set_threshold(double) -> bad value ... " << t << "\n\n"; -// -// exit ( 1 ); -// -// } - Threshold = t; return; @@ -452,7 +446,8 @@ lengths.add(Nx); if ( ! get_nc_data(&var, Data, lengths, offsets) ) { - mlog << Error << "\n MtdIntFile::read(const char *) -> trouble getting data\n\n"; + mlog << Error << "\nMtdIntFile::read(const char *) -> " + << "trouble getting data\n\n"; exit ( 1 ); @@ -550,7 +545,8 @@ lengths.add(Nx); if ( ! put_nc_data(&data_var, Data, lengths, offsets) ) { - mlog << Error << "\n MtdIntFile::write(const char *) -> trouble getting data\n\n"; + mlog << Error << "\nMtdIntFile::write(const char *) -> " + << "trouble getting data\n\n"; exit ( 1 ); @@ -566,7 +562,8 @@ if ( is_split ) { if ( !(put_nc_data(&volumes_var, ObjVolume, Nobjects, 0)) ) { - mlog << Error << "\n MtdIntFile::write() -> trouble writing object volumes\n\n"; + mlog << Error << "\nMtdIntFile::write() -> " + << "trouble writing object volumes\n\n"; exit ( 1 ); @@ -594,7 +591,8 @@ NcFile f(_filename, NcFile::replace); if ( IS_INVALID_NC(f) ) { - mlog << Error << "\n MtdIntFile::write(const char *) -> unable to open netcdf output file \"" << _filename << "\"\n\n"; + mlog << Error << "\nMtdIntFile::write(const char *) -> " + << "unable to open netcdf output file: " << _filename << "\n\n"; // exit ( 1 ); @@ -622,7 +620,8 @@ MtdIntFile MtdIntFile::const_t_slice(const int t) const if ( (t < 0) || (t >= Nt) ) { - mlog << Error << "\n MtdIntFile MtdIntFile::const_t_slice(int) const -> range check error\n\n"; + mlog << Error << "\nMtdIntFile MtdIntFile::const_t_slice(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -691,7 +690,8 @@ MtdIntFile MtdIntFile::const_t_mask(const int t, const int obj_num) const // if ( (t < 0) || (t >= Nt) ) { - mlog << Error << "\n MtdIntFile MtdIntFile::const_t_mask(int) const -> range check error\n\n"; + mlog << Error << "\nMtdIntFile MtdIntFile::const_t_mask(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -879,7 +879,8 @@ void MtdIntFile::zero_border(int n) if ( !Data ) { - mlog << Error << "\n MtdIntFile::zero_border(int) -> no data field!\n\n"; + mlog << Error << "\nMtdIntFile::zero_border(int) -> " + << "no data field!\n\n"; exit ( 1 ); @@ -887,7 +888,8 @@ if ( !Data ) { if ( 2*n >= min(Nx, Ny) ) { - mlog << Error << "\n MtdIntFile::zero_border(int) -> border size too large!\n\n"; + mlog << Error << "\nMtdIntFile::zero_border(int) -> " + << "border size too large!\n\n"; exit ( 1 ); @@ -940,7 +942,8 @@ void MtdIntFile::set_to_zeroes() if ( !Data ) { - mlog << Error << "\n MtdIntFile::set_to_zeroes() -> no data!\n\n"; + mlog << Error << "\nMtdIntFile::set_to_zeroes() -> " + << "no data!\n\n"; exit ( 1 ); @@ -966,7 +969,8 @@ MtdIntFile MtdIntFile::split_const_t(int & n_shapes) const if ( Nt != 1 ) { - mlog << Error << "\n split_const_t(int &) -> not const-time slice!\n\n"; + mlog << Error << "\nsplit_const_t(int &) -> " + << "not const-time slice!\n\n"; exit ( 1 ); @@ -982,7 +986,6 @@ Mtd_Partition p; const MtdIntFile & id = *this; - d.set_size(Nx, Ny, 1); d.set_grid(*G); @@ -1202,7 +1205,8 @@ int MtdIntFile::volume(int k) const if ( !ObjVolume ) { - mlog << Error << "\n MtdIntFile::volume(int) -> field not split!\n\n"; + mlog << Error << "\nMtdIntFile::volume(int) -> " + << "field not split!\n\n"; exit ( 1 ); @@ -1210,7 +1214,8 @@ if ( !ObjVolume ) { if ( (k < 0) || (k >= Nobjects) ) { - mlog << Error << "\n MtdIntFile::volume(int) -> range check error!\n\n"; + mlog << Error << "\nMtdIntFile::volume(int) -> " + << "range check error!\n\n"; exit ( 1 ); @@ -1231,7 +1236,8 @@ int MtdIntFile::total_volume() const if ( !ObjVolume ) { - mlog << Error << "\n MtdIntFile::total_volume() -> field not split!\n\n"; + mlog << Error << "\nMtdIntFile::total_volume() -> " + << "field not split!\n\n"; exit ( 1 ); @@ -1295,21 +1301,8 @@ int j, k; const int n3 = Nx*Ny*Nt; int * old_to_new = (int *) nullptr; int * new_volumes = (int *) nullptr; -// double * new_intensities = (double *) nullptr; int * d = Data; - -// if ( n_new == 0 ) { -// -// mlog << Error << "\n MtdIntFile::sift_objects() -> no objects left!\n\n"; -// -// exit ( 1 ); -// -// } - - - - if ( n_new > 0 ) { old_to_new = new int [Nobjects]; @@ -1322,17 +1315,12 @@ if ( n_new > 0 ) { new_volumes[j] = ObjVolume[new_to_old[j]]; - // new_intensities[j] = MaxConvIntensity[new_to_old[j]]; - } for (j=0; j 0 ) { } -// mlog << Debug(5) << "replace count = " << replace_count << '\n' << flush; -// mlog << Debug(5) << "zero count = " << zero_count << '\n' << flush; - // // rewire // @@ -1480,7 +1465,8 @@ for (x=0; x empty object!\n\n"; + mlog << Error << "\nMtdIntFile::calc_3d_centroid() const -> " + << "empty object!\n\n"; exit ( 1 ); @@ -1528,15 +1514,7 @@ for (x=0; x empty object!\n\n"; - - // exit ( 1 ); - - return; - -} +if ( count == 0 ) return; xbar /= count; ybar /= count; @@ -1582,7 +1560,8 @@ MtdIntFile MtdIntFile::select(int n) const // 1-based if ( (n < 1) || (n > Nobjects) ) { - mlog << Error << "\n MtdIntFile::select(int) -> range check error on n ... " + mlog << Error << "\nMtdIntFile::select(int) -> " + << "range check error on n ... " << "NObjects = " << Nobjects << " ... " << "n = " << n << "\n\n"; @@ -1634,7 +1613,8 @@ MtdIntFile MtdIntFile::select_cluster(const IntArray & a) const // 1-based if ( (a.min() < 0) || (a.max() > Nobjects) ) { - mlog << Error << "\n MtdIntFile::select_cluster(const IntArray &) -> range check error\n\n"; + mlog << Error << "\nMtdIntFile::select_cluster(const IntArray &) -> " + << "range check error\n\n"; exit ( 1 ); @@ -1698,7 +1678,8 @@ int MtdIntFile::x_left(const int y) const if ( (y < 0) || (y >= Ny) ) { - mlog << Error << "\n MtdIntFile::x_left(int) -> range check error\n\n"; + mlog << Error << "\nMtdIntFile::x_left(int) -> " + << "range check error\n\n"; exit ( 1 ); @@ -1727,7 +1708,8 @@ int MtdIntFile::x_right(const int y) const if ( (y < 0) || (y >= Ny) ) { - mlog << Error << "\n MtdIntFile::x_right(int) -> range check error\n\n"; + mlog << Error << "\nMtdIntFile::x_right(int) -> " + << "range check error\n\n"; exit ( 1 ); @@ -1816,7 +1798,8 @@ Mtd_2D_Moments MtdIntFile::calc_2d_moments() const if ( Nt != 1 ) { - mlog << Error << "\n MtdIntFile::calc_2d_moments() const -> not a 2D object!\n\n"; + mlog << Error << "\nMtdIntFile::calc_2d_moments() const -> " + << "not a 2D object!\n\n"; exit ( 1 ); @@ -1877,9 +1860,6 @@ MtdIntFile after; MtdIntFile rv; Mtd_Partition p; const int zero_border_size = 2; -// int imin, imax; - - // // find the partition @@ -1920,8 +1900,6 @@ for (j=1; j<(mask.nt()); ++j) { } -// p.dump(cout); - n_shapes = p.n_elements(); // @@ -1958,7 +1936,8 @@ for (t=0; t<(mask.nt()); ++t) { if ( nc < 0 ) { - mlog << Error << "\n split(const MtdIntFile &, int &) -> can't find cell!\n\n"; + mlog << Error << "\nsplit(const MtdIntFile &, int &) -> " + << "can't find cell!\n\n"; exit ( 1 ); @@ -1992,7 +1971,8 @@ void adjust_obj_numbers(MtdIntFile & s, int delta) if ( s.nt() != 1 ) { - mlog << Error << "\n adjust_obj_numbers() -> not const-time slice!\n\n"; + mlog << Error << "\nadjust_obj_numbers() -> " + << "not const-time slice!\n\n"; exit ( 1 ); @@ -2047,8 +2027,6 @@ for (x=0; x trouble opening output file \"" - << output_filename << "\"\n\n"; + mlog << Error << "\ndo_mtd_nc_output() -> " + << "trouble opening output file: " + << output_filename << "\n\n"; exit ( 1 ); @@ -140,8 +141,9 @@ NcFile out(output_filename, NcFile::replace); if ( IS_INVALID_NC(out) ) { - mlog << Error << "\n\n do_mtd_nc_output[single]() -> trouble opening output file \"" - << output_filename << "\"\n\n"; + mlog << Error << "\ndo_mtd_nc_output[single]() -> " + << "trouble opening output file: " + << output_filename << "\n\n"; exit ( 1 ); @@ -216,7 +218,6 @@ add_att(&lon_var, "long_name", "Longitude"); float * lat_data = new float [nx*ny]; float * lon_data = new float [nx*ny]; - Lat = lat_data; Lon = lon_data; @@ -315,7 +316,6 @@ long offsets[3] = {0,0,0}; long lengths[3] = {nt,ny, nx}; put_nc_data(&var, id.data(), lengths, offsets); - // // done // diff --git a/src/tools/other/mode_time_domain/mtd_partition.cc b/src/tools/other/mode_time_domain/mtd_partition.cc index 22bf007ef7..192ed95de9 100644 --- a/src/tools/other/mode_time_domain/mtd_partition.cc +++ b/src/tools/other/mode_time_domain/mtd_partition.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -199,28 +198,6 @@ return; } -//////////////////////////////////////////////////////////////////////// - -/* -bool EquivalenceClass::has(int k) const - -{ - -int j; -int * e = E; - -for (j=0; j= Nelements) ) { - mlog << Error << "\n\n EquivalenceClass::element(int) const -> range check error\n\n"; + mlog << Error << "\nEquivalenceClass::element(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -529,28 +507,6 @@ return; } -//////////////////////////////////////////////////////////////////////// - -/* -bool Mtd_Partition::has(int k) const - -{ - -int j; -EquivalenceClass ** c = C; - -for (j=0; jhas(k) ) return true; - -} - - -return false; - -} -*/ - //////////////////////////////////////////////////////////////////////// @@ -560,7 +516,8 @@ bool Mtd_Partition::has(int index, int k) const if ( (index < 0) || (index >= Nelements) ) { - mlog << Error << "\n\n Mtd_Partition::has(int index, int k) const -> range check error on index\n\n"; + mlog << Error << "\nMtd_Partition::has(int index, int k) const -> " + << "range check error on index\n\n"; exit ( 1 ); @@ -602,7 +559,8 @@ void Mtd_Partition::merge_classes(int nclass_1, int nclass_2) if ( (nclass_1 < 0) || (nclass_1 >= Nelements) || (nclass_2 < 0) || (nclass_2 >= Nelements) ) { - mlog << Error << "\n\n Mtd_Partition::merge_classes() -> range check error\n\n"; + mlog << Error << "\nMtd_Partition::merge_classes() -> " + << "range check error\n\n"; exit ( 1 ); @@ -662,7 +620,8 @@ nclass_2 = which_class(value_2); if ( (nclass_1 < 0) || (nclass_2 < 0) ) { - mlog << Error << "\n\n Mtd_Partition::merge_values() -> bad values ... " + mlog << Error << "\nMtd_Partition::merge_values() -> " + << "bad values ... " << "(value_1, value_2) = " << value_1 << ", " << value_2 << " ... " << "(nclass_1, nclass_2) = " << nclass_1 << ", " << nclass_2 << "\n\n"; @@ -711,7 +670,8 @@ const EquivalenceClass * Mtd_Partition::operator()(int k) const if ( (k < 0) || (k >= Nelements) ) { - mlog << Error << "\n\n Mtd_Partition::operator()(int) const -> range check error\n\n"; + mlog << Error << "\nMtd_Partition::operator()(int) const -> " + << "range check error\n\n"; exit ( 1 ); @@ -778,8 +738,6 @@ for (j=0; j mtd_read_data(MtdConfigInfo & config, VarInfo & varinfo, { +static const char *method_name = "mtd_read_data() -> "; + if ( filenames.n() < 2 ) { - mlog << Error << "\n\n mtd_read_data() -> need at least 2 data files!\n\n"; + mlog << Error << "\n" << method_name + << "need at least 2 data files!\n\n"; exit ( 1 ); @@ -52,14 +55,15 @@ vector valid_times; for (j=0; j<(filenames.n()); ++j) { - mlog << Debug(2) - << "mtd_read_data() -> processing file \"" << filenames[j] << "\"\n"; + mlog << Debug(2) << method_name + << "processing file: " << filenames[j] << "\n"; data_2d_file = factory.new_met_2d_data_file(filenames[j].c_str(), varinfo.file_type()); if ( ! data_2d_file->data_plane(varinfo, plane) ) { - mlog << Error << "\n\n mtd_read_data() -> unable to get data plane at time " << j << "\n\n"; + mlog << Error << "\n" << method_name + << "unable to get data plane at time " << j << "\n\n"; exit ( 1 ); @@ -67,7 +71,8 @@ for (j=0; j<(filenames.n()); ++j) { if ( ! data_2d_file->data_plane(varinfo, plane) ) { - mlog << Error << "\n\n mtd_read_data() -> unable to get data plane at time " << j << "\n\n"; + mlog << Error << "\n" << method_name + << "unable to get data plane at time " << j << "\n\n"; exit ( 1 ); @@ -157,9 +162,13 @@ if (variableTimeIncs) { unixtime umean = (unixtime)mean; unixtime uvar = (unixtime)var; unixtime suvar = (unixtime)svar; - mlog << Warning << "\n\n mtd_read_data() -> File time increments are not constant, could be problematic\n"; - mlog << Warning << " mtd_read_data() -> Using MODE of the increments, mode=" << dt_start << "\n"; - mlog << Warning << " mtd_read_data() -> Time increment properties: mean=" << umean << " variance=" << uvar << " sqrt(var)=" << suvar << "\n\n"; + mlog << Warning << "\n" << method_name + << "file time increments are not constant, could be problematic\n\n"; + mlog << Warning << "\n" << method_name + << "using MODE of the increments, mode=" << dt_start << "\n\n"; + mlog << Warning << "\n" << method_name + << "Time increment properties: mean=" << umean << " variance=" << uvar + << " sqrt(var)=" << suvar << "\n\n"; } } diff --git a/src/tools/other/mode_time_domain/mtd_txt_output.cc b/src/tools/other/mode_time_domain/mtd_txt_output.cc index f1ee61aa5d..b3f9ea14b4 100644 --- a/src/tools/other/mode_time_domain/mtd_txt_output.cc +++ b/src/tools/other/mode_time_domain/mtd_txt_output.cc @@ -7,7 +7,6 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - //////////////////////////////////////////////////////////////////////// @@ -56,13 +55,13 @@ ofstream out; AsciiTable table; const int Nobj = fcst_att.n() + obs_att.n(); - out.open(output_filename); if ( ! out ) { - mlog << Error << "\n\n do_3d_single_txt_output() -> unable to open output filename \"" - << output_filename << "\'\n\n"; + mlog << Error << "\ndo_3d_single_txt_output() -> " + << "unable to open output filename: " + << output_filename << "\n\n"; exit ( 1 ); @@ -172,13 +171,13 @@ ofstream out; AsciiTable table; const int Nobj = att.n(); - out.open(output_filename); if ( ! out ) { - mlog << Error << "\n\n do_3d_single_txt_output[single]() -> unable to open output filename \"" - << output_filename << "\'\n\n"; + mlog << Error << "\ndo_3d_single_txt_output[single]() -> " + << "unable to open output filename: " + << output_filename << "\n\n"; exit ( 1 ); @@ -322,8 +321,9 @@ out.open(output_filename); if ( ! out ) { - mlog << Error << "\n\n do_3d_pair_txt_output() -> unable to open output filename \"" - << output_filename << "\'\n\n"; + mlog << Error << "\ndo_3d_pair_txt_output() -> " + << "unable to open output filename: " + << output_filename << "\n\n"; exit ( 1 ); @@ -415,13 +415,13 @@ ofstream out; AsciiTable table; const int n_total = fcst_simple_att.n() + obs_simple_att.n() + fcst_cluster_att.n() + obs_cluster_att.n(); - out.open(output_filename); if ( ! out ) { - mlog << Error << "\n\n do_2d_txt_output() -> unable to open output filename \"" - << output_filename << "\'\n\n"; + mlog << Error << "\ndo_2d_txt_output() -> " + << "unable to open output filename: " + << output_filename << "\n\n"; exit ( 1 ); @@ -613,13 +613,13 @@ ofstream out; AsciiTable table; const int n_total = att.n(); - out.open(output_filename); if ( ! out ) { - mlog << Error << "\n\n do_2d_txt_output[single]() -> unable to open output filename \"" - << output_filename << "\'\n\n"; + mlog << Error << "\ndo_2d_txt_output[single]() -> " + << "unable to open output filename: " + << output_filename << "\n\n"; exit ( 1 ); diff --git a/src/tools/other/mode_time_domain/mtdfiletype_to_string.cc b/src/tools/other/mode_time_domain/mtdfiletype_to_string.cc index e7a2ff1a4e..0208bf537e 100644 --- a/src/tools/other/mode_time_domain/mtdfiletype_to_string.cc +++ b/src/tools/other/mode_time_domain/mtdfiletype_to_string.cc @@ -73,6 +73,7 @@ else if ( strcmp(text, "mtd_file_conv" ) == 0 ) { t = mtd_file_conv; re else if ( strcmp(text, "mtd_file_mask" ) == 0 ) { t = mtd_file_mask; return true; } else if ( strcmp(text, "mtd_file_object" ) == 0 ) { t = mtd_file_object; return true; } else if ( strcmp(text, "no_mtd_file_type") == 0 ) { t = no_mtd_file_type; return true; } + // // nope //