Skip to content

Commit

Permalink
Per #3006, saving compiling state
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Dec 27, 2024
1 parent 0b93009 commit eda1b90
Show file tree
Hide file tree
Showing 18 changed files with 814 additions and 1,051 deletions.
1 change: 1 addition & 0 deletions src/libcode/vx_data2d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ libvx_data2d_a_SOURCES = \
leveltype_to_string.cc leveltype_to_string.h \
level_info.cc level_info.h \
var_info.cc var_info.h \
var_info_pairs.cc var_info_pairs.h \
data_class.cc data_class.h \
data2d_utils.cc data2d_utils.h \
table_lookup.cc table_lookup.h \
Expand Down
22 changes: 21 additions & 1 deletion src/libcode/vx_data2d/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ am_libvx_data2d_a_OBJECTS = \
libvx_data2d_a-leveltype_to_string.$(OBJEXT) \
libvx_data2d_a-level_info.$(OBJEXT) \
libvx_data2d_a-var_info.$(OBJEXT) \
libvx_data2d_a-var_info_pairs.$(OBJEXT) \
libvx_data2d_a-data_class.$(OBJEXT) \
libvx_data2d_a-data2d_utils.$(OBJEXT) \
libvx_data2d_a-table_lookup.$(OBJEXT) \
Expand All @@ -137,7 +138,8 @@ am__depfiles_remade = ./$(DEPDIR)/libvx_data2d_a-data2d_utils.Po \
./$(DEPDIR)/libvx_data2d_a-leveltype_to_string.Po \
./$(DEPDIR)/libvx_data2d_a-mask_filters.Po \
./$(DEPDIR)/libvx_data2d_a-table_lookup.Po \
./$(DEPDIR)/libvx_data2d_a-var_info.Po
./$(DEPDIR)/libvx_data2d_a-var_info.Po \
./$(DEPDIR)/libvx_data2d_a-var_info_pairs.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 @@ -361,6 +363,7 @@ libvx_data2d_a_SOURCES = \
leveltype_to_string.cc leveltype_to_string.h \
level_info.cc level_info.h \
var_info.cc var_info.h \
var_info_pairs.cc var_info_pairs.h \
data_class.cc data_class.h \
data2d_utils.cc data2d_utils.h \
table_lookup.cc table_lookup.h \
Expand Down Expand Up @@ -423,6 +426,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-mask_filters.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-table_lookup.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-var_info.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-var_info_pairs.Po@am__quote@ # am--include-marker

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

libvx_data2d_a-var_info_pairs.o: var_info_pairs.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_data2d_a-var_info_pairs.o -MD -MP -MF $(DEPDIR)/libvx_data2d_a-var_info_pairs.Tpo -c -o libvx_data2d_a-var_info_pairs.o `test -f 'var_info_pairs.cc' || echo '$(srcdir)/'`var_info_pairs.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_data2d_a-var_info_pairs.Tpo $(DEPDIR)/libvx_data2d_a-var_info_pairs.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='var_info_pairs.cc' object='libvx_data2d_a-var_info_pairs.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) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_data2d_a-var_info_pairs.o `test -f 'var_info_pairs.cc' || echo '$(srcdir)/'`var_info_pairs.cc

libvx_data2d_a-var_info_pairs.obj: var_info_pairs.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_data2d_a-var_info_pairs.obj -MD -MP -MF $(DEPDIR)/libvx_data2d_a-var_info_pairs.Tpo -c -o libvx_data2d_a-var_info_pairs.obj `if test -f 'var_info_pairs.cc'; then $(CYGPATH_W) 'var_info_pairs.cc'; else $(CYGPATH_W) '$(srcdir)/var_info_pairs.cc'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_data2d_a-var_info_pairs.Tpo $(DEPDIR)/libvx_data2d_a-var_info_pairs.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='var_info_pairs.cc' object='libvx_data2d_a-var_info_pairs.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) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_data2d_a-var_info_pairs.obj `if test -f 'var_info_pairs.cc'; then $(CYGPATH_W) 'var_info_pairs.cc'; else $(CYGPATH_W) '$(srcdir)/var_info_pairs.cc'; fi`

libvx_data2d_a-data_class.o: data_class.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_data2d_a-data_class.o -MD -MP -MF $(DEPDIR)/libvx_data2d_a-data_class.Tpo -c -o libvx_data2d_a-data_class.o `test -f 'data_class.cc' || echo '$(srcdir)/'`data_class.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_data2d_a-data_class.Tpo $(DEPDIR)/libvx_data2d_a-data_class.Po
Expand Down Expand Up @@ -673,6 +691,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/libvx_data2d_a-mask_filters.Po
-rm -f ./$(DEPDIR)/libvx_data2d_a-table_lookup.Po
-rm -f ./$(DEPDIR)/libvx_data2d_a-var_info.Po
-rm -f ./$(DEPDIR)/libvx_data2d_a-var_info_pairs.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
Expand Down Expand Up @@ -725,6 +744,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/libvx_data2d_a-mask_filters.Po
-rm -f ./$(DEPDIR)/libvx_data2d_a-table_lookup.Po
-rm -f ./$(DEPDIR)/libvx_data2d_a-var_info.Po
-rm -f ./$(DEPDIR)/libvx_data2d_a-var_info_pairs.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

Expand Down
224 changes: 224 additions & 0 deletions src/libcode/vx_data2d/var_info_pairs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1992 - 2024
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Research Applications Lab (RAL)
// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

///////////////////////////////////////////////////////////////////////////////
//
// Filename: var_info_pairs.cc
//
// Description:
//
// Mod# Date Name Description
// ---- ---- ---- -----------
//
///////////////////////////////////////////////////////////////////////////////

#include <map>
#include <stdlib.h>
#include <string.h>
#include <strings.h>

#include "var_info.h"
#include "var_info_pairs.h"

#include "util_constants.h"

#include "vx_math.h"
#include "vx_util.h"
#include "vx_log.h"
#include "vx_data2d.h"

using namespace std;

///////////////////////////////////////////////////////////////////////////////
//
// Code for class VarInfoPairs
//
///////////////////////////////////////////////////////////////////////////////

VarInfoPairs::VarInfoPairs() {

init_from_scratch();
}

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

VarInfoPairs::~VarInfoPairs() {

clear();
}

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

VarInfoPairs::VarInfoPairs(const VarInfoPairs &f) {

init_from_scratch();

assign(f);
}

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

VarInfoPairs & VarInfoPairs::operator=(const VarInfoPairs &f) {

if ( this == &f ) return *this;

assign(f);

return *this;
}

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

VarInfo *VarInfoPairs::clone() const {

VarInfoPairs *ret = new VarInfoPairs(*this);

return (VarInfo *)ret;
}

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

void VarInfoPairs::init_from_scratch() {

// First call the parent's initialization
VarInfo::init_from_scratch();

clear();

return;
}

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

void VarInfoPairs::assign(const VarInfoPairs &v) {

// First call the parent's assign
VarInfo::assign(v);

return;
}

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

void VarInfoPairs::clear() {

// First call the parent's clear
VarInfo::clear();

return;
}

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

void VarInfoPairs::dump(ostream &out) const {

// Dump out the contents
out << "VarInfoPairs::dump():\n";

VarInfo::dump(out);

return;
}

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

void VarInfoPairs::set_dict(Dictionary & dict) {
VarInfo::set_dict(dict);
}

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

bool VarInfoPairs::is_precipitation() const {
bool status = false;

//
// Check set_attrs entry
//
if(!is_bad_data(SetAttrIsPrecipitation)) {
return(SetAttrIsPrecipitation != 0);
}

return status;
}

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

bool VarInfoPairs::is_specific_humidity() const {
bool status = false;

//
// Check set_attrs entry
//
if(!is_bad_data(SetAttrIsSpecificHumidity)) {
return(SetAttrIsSpecificHumidity != 0);
}

return status;
}

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

bool VarInfoPairs::is_u_wind() const {
bool status = false;

//
// Check set_attrs entry
//
if(!is_bad_data(SetAttrIsUWind)) {
return(SetAttrIsUWind != 0);
}

return status;
}

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

bool VarInfoPairs::is_v_wind() const {
bool status = false;

//
// Check set_attrs entry
//
if(!is_bad_data(SetAttrIsVWind)) {
return(SetAttrIsVWind != 0);
}

return status;
}

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

bool VarInfoPairs::is_wind_speed() const {
bool status = false;

//
// Check set_attrs entry
//
if(!is_bad_data(SetAttrIsWindSpeed)) {
return(SetAttrIsWindSpeed != 0);
}

return status;
}

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

bool VarInfoPairs::is_wind_direction() const {
bool status = false;

//
// Check set_attrs entry
//
if(!is_bad_data(SetAttrIsWindDirection)) {
return(SetAttrIsWindDirection != 0);
}

return status;
}

///////////////////////////////////////////////////////////////////////////////
73 changes: 73 additions & 0 deletions src/libcode/vx_data2d/var_info_pairs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1992 - 2024
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Research Applications Lab (RAL)
// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*


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

#ifndef __VAR_INFO_PAIRS_H__
#define __VAR_INFO_PAIRS_H__

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

#include "var_info.h"
#include "vx_config.h"

#include "data_file_type.h"

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

class VarInfoPairs : public VarInfo {

private:

void init_from_scratch();
void assign(const VarInfoPairs &);

public:
VarInfoPairs();
~VarInfoPairs();
VarInfoPairs(const VarInfoPairs &);
VarInfoPairs & operator=(const VarInfoPairs &);
VarInfo *clone() const;

void dump(std::ostream &) const;
void clear();

//
// get stuff
//

GrdFileType file_type() const;

//
// set stuff
//

void set_dict(Dictionary &);

//
// do stuff
//

bool is_precipitation() const;
bool is_specific_humidity() const;
bool is_u_wind() const;
bool is_v_wind() const;
bool is_wind_speed() const;
bool is_wind_direction() const;
};

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

inline GrdFileType VarInfoPairs::file_type() const { return FileType_Pairs; }

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

#endif // __VAR_INFO_PAIRS_H__

///////////////////////////////////////////////////////////////////////////////
5 changes: 5 additions & 0 deletions src/libcode/vx_data2d_factory/var_info_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "var_info_nc_cf.h"
#include "var_info_nc_met.h"
#include "var_info_nc_wrf.h"
#include "var_info_pairs.h"
#include "var_info_ugrid.h"

#ifdef WITH_PYTHON
Expand Down Expand Up @@ -115,6 +116,10 @@ VarInfo * VarInfoFactory::new_var_info(GrdFileType type)
ugrid_compile_error(method_name);
#endif

case FileType_Pairs:
vi = new VarInfoPairs;
break;

case FileType_HdfEos:
mlog << Error << "\n" << method_name
<< "Support for GrdFileType = " << grdfiletype_to_string(type)
Expand Down
Loading

0 comments on commit eda1b90

Please sign in to comment.