Skip to content

Commit

Permalink
Per #2979, for the develop branch, also replace nc_utils_local.h/.cc …
Browse files Browse the repository at this point in the history
…with calls to common library code. Also remove commented out code.
  • Loading branch information
JohnHalleyGotway committed Sep 26, 2024
1 parent 5fbc31a commit 67eb4f9
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 448 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ test_velocity_LDADD = \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_partition.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_read_data.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_txt_output.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-nc_utils_local.o \
-lvx_pxm \
-lvx_plot_util \
-lvx_nav \
Expand Down
2 changes: 0 additions & 2 deletions internal/test_util/tools/other/mode_time_domain/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ test_velocity_DEPENDENCIES = ${top_builddir}/src/tools/other/mode_time_domain/mt
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_partition.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_read_data.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_txt_output.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-nc_utils_local.o \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
Expand Down Expand Up @@ -377,7 +376,6 @@ test_velocity_LDADD = \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_partition.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_read_data.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-mtd_txt_output.o \
${top_builddir}/src/tools/other/mode_time_domain/mtd-nc_utils_local.o \
-lvx_pxm \
-lvx_plot_util \
-lvx_nav \
Expand Down
4 changes: 0 additions & 4 deletions src/tools/other/mode_time_domain/2d_moments.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class Mtd_2D_Moments {

int area() const;


//
// do stuff
//
Expand All @@ -66,11 +65,8 @@ class Mtd_2D_Moments {

void centralize();


double calc_2D_axis_plane_angle() const;



};


Expand Down
6 changes: 0 additions & 6 deletions src/tools/other/mode_time_domain/3d_att.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,6 @@ class PairAtt3D {

void dump(std::ostream &, int depth = 0) const;

// SingleAtt3D Fcst;
// SingleAtt3D Obs;

//
// set stuff
//
Expand Down Expand Up @@ -395,7 +392,6 @@ inline int PairAtt3D::fcst_cluster_number() const { return FcstClusterNumber; }
inline int PairAtt3D::obs_cluster_number() const { return ObsClusterNumber; }

inline int PairAtt3D::intersection_vol () const { return IntersectionVol; }
// inline int PairAtt3D::union_vol () const { return UnionVol; }

inline double PairAtt3D::time_centroid_delta () const { return TimeCentroidDelta; }
inline double PairAtt3D::space_centroid_dist () const { return SpaceCentroidDist; }
Expand Down Expand Up @@ -430,8 +426,6 @@ extern PairAtt3D calc_3d_pair_atts(const Object & _fcst_obj,
const SingleAtt3D & _fa,
const SingleAtt3D & _oa);

// extern double calc_total_interest(const PairAtt3D &, const MtdConfigInfo &);


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

Expand Down
1 change: 0 additions & 1 deletion src/tools/other/mode_time_domain/3d_att_pair_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class PairAtt3DArray {

void patch_cluster_numbers(const MM_Engine &);


};


Expand Down
3 changes: 0 additions & 3 deletions src/tools/other/mode_time_domain/3d_moments.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ class Mtd_3D_Moments {

void centralize();


void calc_3d_velocity(double & vx, double & vy) const;

double calc_3d_axis_plane_angle() const;



};


Expand Down
1 change: 0 additions & 1 deletion src/tools/other/mode_time_domain/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ include ${top_srcdir}/Make-include
bin_PROGRAMS = mtd
mtd_SOURCES = mtd.cc \
mtdfiletype_to_string.cc mtdfiletype_to_string.h \
nc_utils_local.cc nc_utils_local.h \
3d_moments.cc 3d_moments.h \
2d_moments.cc 2d_moments.h \
fo_node.cc fo_node.h \
Expand Down
34 changes: 7 additions & 27 deletions src/tools/other/mode_time_domain/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_mtd_OBJECTS = mtd-mtd.$(OBJEXT) mtd-mtdfiletype_to_string.$(OBJEXT) \
mtd-nc_utils_local.$(OBJEXT) mtd-3d_moments.$(OBJEXT) \
mtd-2d_moments.$(OBJEXT) mtd-fo_node.$(OBJEXT) \
mtd-fo_node_array.$(OBJEXT) mtd-fo_graph.$(OBJEXT) \
mtd-mtd_config_info.$(OBJEXT) mtd-mtd_file_base.$(OBJEXT) \
mtd-mtd_file_float.$(OBJEXT) mtd-mtd_file_int.$(OBJEXT) \
mtd-mtd_read_data.$(OBJEXT) mtd-3d_att.$(OBJEXT) \
mtd-3d_att_single_array.$(OBJEXT) \
mtd-3d_moments.$(OBJEXT) mtd-2d_moments.$(OBJEXT) \
mtd-fo_node.$(OBJEXT) mtd-fo_node_array.$(OBJEXT) \
mtd-fo_graph.$(OBJEXT) mtd-mtd_config_info.$(OBJEXT) \
mtd-mtd_file_base.$(OBJEXT) mtd-mtd_file_float.$(OBJEXT) \
mtd-mtd_file_int.$(OBJEXT) mtd-mtd_read_data.$(OBJEXT) \
mtd-3d_att.$(OBJEXT) mtd-3d_att_single_array.$(OBJEXT) \
mtd-3d_att_pair_array.$(OBJEXT) mtd-2d_att.$(OBJEXT) \
mtd-2d_att_array.$(OBJEXT) mtd-3d_conv.$(OBJEXT) \
mtd-mtd_txt_output.$(OBJEXT) mtd-mtd_nc_output.$(OBJEXT) \
Expand Down Expand Up @@ -152,8 +151,7 @@ am__depfiles_remade = ./$(DEPDIR)/mtd-2d_att.Po \
./$(DEPDIR)/mtd-mtd_partition.Po \
./$(DEPDIR)/mtd-mtd_read_data.Po \
./$(DEPDIR)/mtd-mtd_txt_output.Po \
./$(DEPDIR)/mtd-mtdfiletype_to_string.Po \
./$(DEPDIR)/mtd-nc_utils_local.Po
./$(DEPDIR)/mtd-mtdfiletype_to_string.Po
am__mv = mv -f
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
Expand Down Expand Up @@ -372,7 +370,6 @@ top_srcdir = @top_srcdir@
MAINTAINERCLEANFILES = Makefile.in
mtd_SOURCES = mtd.cc \
mtdfiletype_to_string.cc mtdfiletype_to_string.h \
nc_utils_local.cc nc_utils_local.h \
3d_moments.cc 3d_moments.h \
2d_moments.cc 2d_moments.h \
fo_node.cc fo_node.h \
Expand Down Expand Up @@ -543,7 +540,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtd-mtd_read_data.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtd-mtd_txt_output.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtd-mtdfiletype_to_string.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtd-nc_utils_local.Po@am__quote@ # am--include-marker

$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
Expand Down Expand Up @@ -593,20 +589,6 @@ mtd-mtdfiletype_to_string.obj: mtdfiletype_to_string.cc
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mtd_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mtd-mtdfiletype_to_string.obj `if test -f 'mtdfiletype_to_string.cc'; then $(CYGPATH_W) 'mtdfiletype_to_string.cc'; else $(CYGPATH_W) '$(srcdir)/mtdfiletype_to_string.cc'; fi`

mtd-nc_utils_local.o: nc_utils_local.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mtd_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mtd-nc_utils_local.o -MD -MP -MF $(DEPDIR)/mtd-nc_utils_local.Tpo -c -o mtd-nc_utils_local.o `test -f 'nc_utils_local.cc' || echo '$(srcdir)/'`nc_utils_local.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mtd-nc_utils_local.Tpo $(DEPDIR)/mtd-nc_utils_local.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='nc_utils_local.cc' object='mtd-nc_utils_local.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mtd_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mtd-nc_utils_local.o `test -f 'nc_utils_local.cc' || echo '$(srcdir)/'`nc_utils_local.cc

mtd-nc_utils_local.obj: nc_utils_local.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mtd_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mtd-nc_utils_local.obj -MD -MP -MF $(DEPDIR)/mtd-nc_utils_local.Tpo -c -o mtd-nc_utils_local.obj `if test -f 'nc_utils_local.cc'; then $(CYGPATH_W) 'nc_utils_local.cc'; else $(CYGPATH_W) '$(srcdir)/nc_utils_local.cc'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mtd-nc_utils_local.Tpo $(DEPDIR)/mtd-nc_utils_local.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='nc_utils_local.cc' object='mtd-nc_utils_local.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mtd_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mtd-nc_utils_local.obj `if test -f 'nc_utils_local.cc'; then $(CYGPATH_W) 'nc_utils_local.cc'; else $(CYGPATH_W) '$(srcdir)/nc_utils_local.cc'; fi`

mtd-3d_moments.o: 3d_moments.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mtd_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mtd-3d_moments.o -MD -MP -MF $(DEPDIR)/mtd-3d_moments.Tpo -c -o mtd-3d_moments.o `test -f '3d_moments.cc' || echo '$(srcdir)/'`3d_moments.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mtd-3d_moments.Tpo $(DEPDIR)/mtd-3d_moments.Po
Expand Down Expand Up @@ -1051,7 +1033,6 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/mtd-mtd_read_data.Po
-rm -f ./$(DEPDIR)/mtd-mtd_txt_output.Po
-rm -f ./$(DEPDIR)/mtd-mtdfiletype_to_string.Po
-rm -f ./$(DEPDIR)/mtd-nc_utils_local.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
Expand Down Expand Up @@ -1120,7 +1101,6 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/mtd-mtd_read_data.Po
-rm -f ./$(DEPDIR)/mtd-mtd_txt_output.Po
-rm -f ./$(DEPDIR)/mtd-mtdfiletype_to_string.Po
-rm -f ./$(DEPDIR)/mtd-nc_utils_local.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

Expand Down
7 changes: 0 additions & 7 deletions src/tools/other/mode_time_domain/fo_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
////////////////////////////////////////////////////////////////////////


// typedef int GraphNodeType;


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


class FO_Graph {

private:
Expand Down Expand Up @@ -100,7 +94,6 @@ class FO_Graph {
void dump_as_table(std::ostream &) const;
void dump_as_table(const int) const; // dumps to mlog with the given verbosity level


};


Expand Down
1 change: 0 additions & 1 deletion src/tools/other/mode_time_domain/interest_calc.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class InterestCalculator {

double operator()(const PairAtt3D &);


};


Expand Down
21 changes: 9 additions & 12 deletions src/tools/other/mode_time_domain/mtd_file_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
#include "mtd_file.h"
#include "mtd_partition.h"
#include "mtd_nc_defs.h"
#include "nc_utils_local.h"
#include "mtdfiletype_to_string.h"
#include "get_met_grid.h"
#include "write_netcdf.h"

#include "vx_math.h"
#include "vx_nc_util.h"

using namespace std;
using namespace netCDF;
Expand Down Expand Up @@ -414,7 +413,6 @@ void MtdFileBase::read(NcFile & f)

{

//NcDim * dim = 0;
NcDim dim;

// Nx, Ny, Nt
Expand All @@ -428,8 +426,6 @@ Ny = GET_NC_SIZE(dim);
dim = get_nc_dim(&f, nt_dim_name);
Nt = GET_NC_SIZE(dim);

//dim = 0;

// Grid

G = new Grid;
Expand All @@ -438,17 +434,19 @@ read_netcdf_grid(&f, *G);

// timestamp info

StartValidTime = parse_start_time(string_att(f, start_time_att_name));
ConcatString s;

get_att_value_string(&f, start_time_att_name, s);

DeltaT = string_att_as_int (f, delta_t_att_name);
StartValidTime = timestring_to_unix(s.text());

DeltaT = get_att_value_int(&f, delta_t_att_name);

// FileType

// ConcatString s = (string)string_att(f, filetype_att_name);
ConcatString s;
bool status = false;

s.add(string_att(f, filetype_att_name));
get_att_value_string(&f, filetype_att_name, s);

status = string_to_mtdfiletype(s.text(), FileType);

Expand All @@ -461,7 +459,6 @@ if ( ! status ) {

}


//
// done
//
Expand Down Expand Up @@ -494,7 +491,7 @@ write_netcdf_proj(&f, *G, ny_dim, nx_dim);

// timestamp info

s = start_time_string(StartValidTime);
s = unix_to_yyyymmdd_hhmmss(StartValidTime);

add_att(&f, start_time_att_name, s.text());

Expand Down
29 changes: 3 additions & 26 deletions src/tools/other/mode_time_domain/mtd_file_float.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "mtd_file.h"
#include "mtd_partition.h"
#include "mtd_nc_defs.h"
#include "nc_utils_local.h"

#include "vx_math.h"
#include "vx_nc_util.h"

using namespace std;
using namespace netCDF;
Expand Down Expand Up @@ -642,33 +642,15 @@ MtdFileBase::read(f);

// DataMin, DataMax

DataMin = string_att_as_double (f, min_value_att_name);
DataMax = string_att_as_double (f, max_value_att_name);
DataMin = get_att_value_double(&f, min_value_att_name);
DataMax = get_att_value_double(&f, max_value_att_name);

// Data

set_size(Nx, Ny, Nt);

var = get_nc_var(&f, data_field_name);

//if ( !(var->set_cur(0, 0, 0)) ) {
//
// mlog << Error << "\n\n MtdFloatFile::read() -> trouble setting corner\n\n";
//
// exit ( 1 );
//
//}
//
//// const time_t t_start = time(0); // for timing the data read operation
//
//if ( ! (var->get(Data, Nt, Ny, Nx)) ) {
//
// mlog << Error << "\n\n MtdFloatFile::read(const char *) -> trouble getting data\n\n";
//
// exit ( 1 );
//
//}

LongArray offsets; // {0,0,0};
LongArray lengths; // {Nt, Ny, Nx};

Expand All @@ -679,7 +661,6 @@ lengths.add(Nt);
lengths.add(Ny);
lengths.add(Nx);

//if ( ! get_nc_data(&var, Data, (long *){Nt, Ny, Nx}, (long *){0,0,0}) ) {
if ( ! get_nc_data(&var, Data, lengths, offsets) ) {

mlog << Error << "\n\n MtdFloatFile::read(const char *) -> trouble getting data\n\n";
Expand All @@ -688,10 +669,6 @@ if ( ! get_nc_data(&var, Data, lengths, offsets) ) {

}

// const time_t t_stop = time(0); // for timing the data read operation

// mlog << Debug(5) << "\n\n MtdFloatFile::read(): Time to read data = " << (t_stop - t_start) << " seconds\n\n" << flush;

//
// done
//
Expand Down
Loading

0 comments on commit 67eb4f9

Please sign in to comment.