diff --git a/internal/test_util/libcode/vx_series_data/test_series_data.cc b/internal/test_util/libcode/vx_series_data/test_series_data.cc index d9cd9f0cb3..c717ec8f7f 100644 --- a/internal/test_util/libcode/vx_series_data/test_series_data.cc +++ b/internal/test_util/libcode/vx_series_data/test_series_data.cc @@ -7,6 +7,8 @@ // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/basic/vx_cal/time_array.h b/src/basic/vx_cal/time_array.h index ecfa15e1aa..1eabd0b081 100644 --- a/src/basic/vx_cal/time_array.h +++ b/src/basic/vx_cal/time_array.h @@ -60,7 +60,7 @@ class TimeArray { void extend(int, bool exact = true); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; unixtime operator[](int) const; diff --git a/src/basic/vx_cal/vx_cal.h b/src/basic/vx_cal/vx_cal.h index 74885b50a1..272ee17d75 100644 --- a/src/basic/vx_cal/vx_cal.h +++ b/src/basic/vx_cal/vx_cal.h @@ -180,14 +180,14 @@ static const double TIME_EPSILON = 0.001; // Bad Data Values // -static const int bad_data_int = -9999; -static const long long bad_data_ll = -9999LL; -static const float bad_data_float = -9999.f; -static const double bad_data_double = -9999.0; -static const char bad_data_str[] = "-9999"; -static const char bad_data_char = '\0'; -static const char na_str[] = "NA"; -static const string na_string = "NA"; +static const int bad_data_int = -9999; +static const long long bad_data_ll = -9999LL; +static const float bad_data_float = -9999.f; +static const double bad_data_double = -9999.0; +static const char bad_data_str[] = "-9999"; +static const char bad_data_char = '\0'; +static const char na_str[] = "NA"; +static const std::string na_string = "NA"; //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_config/config_file.h b/src/basic/vx_config/config_file.h index e5a2953692..d079daffba 100644 --- a/src/basic/vx_config/config_file.h +++ b/src/basic/vx_config/config_file.h @@ -48,7 +48,7 @@ class MetConfig : public Dictionary { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff diff --git a/src/basic/vx_config/config_util.h b/src/basic/vx_config/config_util.h index d39d08b615..45de85dd0f 100644 --- a/src/basic/vx_config/config_util.h +++ b/src/basic/vx_config/config_util.h @@ -33,9 +33,9 @@ static const char conf_key_old_prepbufr_map[] = "obs_prefbufr_map"; // for ba extern ConcatString parse_conf_version(Dictionary *dict); extern ConcatString parse_conf_string(Dictionary *dict, const char *, bool check_empty = true); extern GrdFileType parse_conf_file_type(Dictionary *dict); -extern map +extern std::map parse_conf_output_flag(Dictionary *dict, const STATLineType *, int); -extern map +extern std::map parse_conf_output_stats(Dictionary *dict); extern int parse_conf_n_vx(Dictionary *dict); extern Dictionary parse_conf_i_vx_dict(Dictionary *dict, int index); @@ -43,7 +43,7 @@ extern StringArray parse_conf_tc_model(Dictionary *dict, bool error_out = de extern StringArray parse_conf_message_type(Dictionary *dict, bool error_out = default_dictionary_error_out); extern StringArray parse_conf_sid_list(Dictionary *dict, const char *); extern void parse_sid_mask(const ConcatString &, StringArray &, ConcatString &); -extern vector +extern std::vector parse_conf_llpnt_mask(Dictionary *dict); extern StringArray parse_conf_obs_qty_inc(Dictionary *dict); extern StringArray parse_conf_obs_qty_exc(Dictionary *dict); @@ -51,16 +51,16 @@ extern NumArray parse_conf_ci_alpha(Dictionary *dict); extern NumArray parse_conf_eclv_points(Dictionary *dict); extern ClimoCDFInfo parse_conf_climo_cdf(Dictionary *dict); extern TimeSummaryInfo parse_conf_time_summary(Dictionary *dict); -extern map parse_conf_key_value_map( +extern std::map parse_conf_key_value_map( Dictionary *dict, const char *conf_key_map_name, const char *caller=0); extern void parse_add_conf_key_value_map( - Dictionary *dict, const char *conf_key_map_name, map *m); -extern map + Dictionary *dict, const char *conf_key_map_name, std::map *m); +extern std::map parse_conf_message_type_map(Dictionary *dict); -extern map +extern std::map parse_conf_message_type_group_map(Dictionary *dict); -extern map parse_conf_metadata_map(Dictionary *dict); -extern map +extern std::map parse_conf_metadata_map(Dictionary *dict); +extern std::map parse_conf_obs_name_map(Dictionary *dict); extern BootInfo parse_conf_boot(Dictionary *dict); extern RegridInfo parse_conf_regrid(Dictionary *dict, bool error_out = default_dictionary_error_out); @@ -74,7 +74,7 @@ extern ConcatString parse_conf_tmp_dir(Dictionary *dict); extern GridDecompType parse_conf_grid_decomp_flag(Dictionary *dict); extern WaveletType parse_conf_wavelet_type(Dictionary *dict); extern PlotInfo parse_conf_plot_info(Dictionary *dict); -extern map +extern std::map parse_conf_filter_attr_map(Dictionary *dict); extern void parse_conf_range_int(Dictionary *dict, int &beg, int &end); extern void parse_conf_range_double(Dictionary *dict, double &beg, double &end); diff --git a/src/basic/vx_config/dictionary.h b/src/basic/vx_config/dictionary.h index 6319e8d78c..4265b7c3d1 100644 --- a/src/basic/vx_config/dictionary.h +++ b/src/basic/vx_config/dictionary.h @@ -85,9 +85,9 @@ class DictionaryEntry { void clear(); - void dump(ostream & out, int = 0) const; + void dump(std::ostream & out, int = 0) const; - void dump_config_format(ostream & out, int = 0) const; + void dump_config_format(std::ostream & out, int = 0) const; // // set stuff @@ -219,9 +219,9 @@ class Dictionary { void clear(); - virtual void dump(ostream &, int = 0) const; + virtual void dump(std::ostream &, int = 0) const; - virtual void dump_config_format(ostream & out, int = 0) const; + virtual void dump_config_format(std::ostream & out, int = 0) const; // // set stuff @@ -365,9 +365,9 @@ class DictionaryStack { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; - void dump_config_format(ostream & out, int = 0) const; + void dump_config_format(std::ostream & out, int = 0) const; // // set stuff diff --git a/src/basic/vx_config/icode.h b/src/basic/vx_config/icode.h index 816beaf969..37ba172584 100644 --- a/src/basic/vx_config/icode.h +++ b/src/basic/vx_config/icode.h @@ -153,7 +153,7 @@ class IcodeCell { double as_double() const; - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; @@ -203,7 +203,7 @@ class IcodeVector { void add (const IcodeVector &); void add_front (const IcodeVector &); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; bool is_mark() const; bool is_mark(int) const; @@ -257,9 +257,9 @@ class CellStack { int depth() const; - void dump_cell(ostream &, int n, int depth = 0) const; + void dump_cell(std::ostream &, int n, int depth = 0) const; - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; @@ -311,7 +311,7 @@ class ICVStack { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; diff --git a/src/basic/vx_config/idstack.h b/src/basic/vx_config/idstack.h index f2f36fe909..5fc487f6c0 100644 --- a/src/basic/vx_config/idstack.h +++ b/src/basic/vx_config/idstack.h @@ -24,8 +24,6 @@ #include "indent.h" -using namespace std; - //////////////////////////////////////////////////////////////////////// @@ -50,13 +48,13 @@ class Identifier { Identifier(const Identifier &); Identifier & operator=(const Identifier &); - string name; + std::string name; void clear(); void set(const char *); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; @@ -143,7 +141,7 @@ class IdentifierArray { void add(const Identifier &); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; bool has(const char *) const; diff --git a/src/basic/vx_config/threshold.h b/src/basic/vx_config/threshold.h index e35c894618..eccbee8ac3 100644 --- a/src/basic/vx_config/threshold.h +++ b/src/basic/vx_config/threshold.h @@ -168,7 +168,7 @@ class ThreshNode { virtual void multiply_by(const double) = 0; - virtual void get_simple_nodes(vector &) const = 0; + virtual void get_simple_nodes(std::vector &) const = 0; ConcatString s; ConcatString abbr_s; @@ -210,7 +210,7 @@ class Or_Node : public ThreshNode { void multiply_by(const double); - void get_simple_nodes(vector &) const; + void get_simple_nodes(std::vector &) const; ThreshNode * left_child; ThreshNode * right_child; @@ -259,7 +259,7 @@ class And_Node : public ThreshNode { void multiply_by(const double); - void get_simple_nodes(vector &) const; + void get_simple_nodes(std::vector &) const; ThreshNode * copy() const; @@ -310,7 +310,7 @@ class Not_Node : public ThreshNode { void multiply_by(const double); - void get_simple_nodes(vector &) const; + void get_simple_nodes(std::vector &) const; ThreshNode * copy() const; @@ -375,7 +375,7 @@ class Simple_Node : public ThreshNode { bool need_perc() const; - void get_simple_nodes(vector &) const; + void get_simple_nodes(std::vector &) const; // // do stuff @@ -421,7 +421,7 @@ class SingleThresh { SingleThresh(const char *); SingleThresh & operator=(const SingleThresh &); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; bool operator==(const SingleThresh &) const; @@ -446,7 +446,7 @@ class SingleThresh { PercThreshType get_ptype() const; double get_pvalue() const; double get_climo_prob() const; - void get_simple_nodes(vector &) const; + void get_simple_nodes(std::vector &) const; void multiply_by(const double); diff --git a/src/basic/vx_log/file_fxns.h b/src/basic/vx_log/file_fxns.h index 5ffaa463fe..84dd361302 100644 --- a/src/basic/vx_log/file_fxns.h +++ b/src/basic/vx_log/file_fxns.h @@ -37,9 +37,9 @@ extern ConcatString replace_path(const char * path); extern int met_open(const char *path, int oflag); -extern void met_open(ifstream &in, const char *path); +extern void met_open(std::ifstream &in, const char *path); -extern void met_open(ofstream &out, const char *path); +extern void met_open(std::ofstream &out, const char *path); extern FILE * met_fopen(const char *path, const char *mode); diff --git a/src/basic/vx_log/vx_log.h b/src/basic/vx_log/vx_log.h index b8f26c758c..6aa7e5a2d7 100644 --- a/src/basic/vx_log/vx_log.h +++ b/src/basic/vx_log/vx_log.h @@ -17,8 +17,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include "concat_string.h" #include "indent.h" #include "string_array.h" diff --git a/src/basic/vx_math/hist.h b/src/basic/vx_math/hist.h index 00e282dd9a..f1f26292ed 100644 --- a/src/basic/vx_math/hist.h +++ b/src/basic/vx_math/hist.h @@ -115,7 +115,7 @@ inline int Histogram::too_small_count () const { return ( TooSmallCount ); } //////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const Histogram &); +extern std::ostream & operator<<(std::ostream &, const Histogram &); //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_math/is_bad_data.h b/src/basic/vx_math/is_bad_data.h index d8bc9b92a1..601949a0c9 100644 --- a/src/basic/vx_math/is_bad_data.h +++ b/src/basic/vx_math/is_bad_data.h @@ -28,22 +28,22 @@ inline int is_bad_data(int a) { - if(a == bad_data_int || isnan(a)) return(1); + if(a == bad_data_int || std::isnan(a)) return(1); else return(0); } inline int is_bad_data(long long a) { - if(a == bad_data_ll || isnan(a)) return(1); + if(a == bad_data_ll || std::isnan(a)) return(1); else return(0); } inline int is_bad_data(double a) { - if(fabs(a - bad_data_double) < default_tol || isnan(a)) return(1); + if(fabs(a - bad_data_double) < default_tol || std::isnan(a)) return(1); else return(0); } inline int is_bad_data(float a) { - if(fabs(a - bad_data_float) < default_tol || isnan(a)) return(1); + if(fabs(a - bad_data_float) < default_tol || std::isnan(a)) return(1); else return(0); } diff --git a/src/basic/vx_math/pwl.h b/src/basic/vx_math/pwl.h index 2290e33c19..410fe66993 100644 --- a/src/basic/vx_math/pwl.h +++ b/src/basic/vx_math/pwl.h @@ -62,7 +62,7 @@ class PiecewiseLinear { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // // set stuff diff --git a/src/basic/vx_math/vx_vector.h b/src/basic/vx_math/vx_vector.h index 59dc87daf1..53ad9daac1 100644 --- a/src/basic/vx_math/vx_vector.h +++ b/src/basic/vx_math/vx_vector.h @@ -53,7 +53,7 @@ class Vector { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff @@ -166,7 +166,7 @@ extern void latlon_to_vector(double lat, double lon, double & x, double & y, d //////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const Vector &); +extern std::ostream & operator<<(std::ostream &, const Vector &); //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/GridOffset.h b/src/basic/vx_util/GridOffset.h index dc3b9ec147..4af50d0328 100644 --- a/src/basic/vx_util/GridOffset.h +++ b/src/basic/vx_util/GridOffset.h @@ -17,6 +17,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 01-01-99 Rehak Initial version. +// 001 09-06-22 Prestopnik MET #2227 Remove namesapce std from header files // /////////////////////////////////////////////////////////////////////////////// @@ -29,8 +30,6 @@ /////////////////////////////////////////////////////////////////////////////// -using namespace std; - class GridOffset { public: diff --git a/src/basic/vx_util/GridTemplate.h b/src/basic/vx_util/GridTemplate.h index be191ebecf..552dcff295 100644 --- a/src/basic/vx_util/GridTemplate.h +++ b/src/basic/vx_util/GridTemplate.h @@ -18,6 +18,7 @@ // ---- ---- ---- ----------- // 000 01-01-99 Rehak Initial version. // 001 09-07-21 Halley Gotway Add wrap_lon. +// 002 09-07-22 Prestopnik MET #2227 Remove namespace std from header files // /////////////////////////////////////////////////////////////////////////////// @@ -34,8 +35,6 @@ /////////////////////////////////////////////////////////////////////////////// -using namespace std; - class GridTemplate { public: @@ -118,20 +117,20 @@ class GridTemplate { bool _wrapLon; // The offsets that make up the circle - vector _offsetList; + std::vector _offsetList; // The offsets that define the first and last rows and columns - vector _offsetLftEdge; // not allocated - vector _offsetRgtEdge; // not allocated - vector _offsetTopEdge; // not allocated - vector _offsetBotEdge; // not allocated + std::vector _offsetLftEdge; // not allocated + std::vector _offsetRgtEdge; // not allocated + std::vector _offsetTopEdge; // not allocated + std::vector _offsetBotEdge; // not allocated // Iterator for finding points within a grid - mutable vector::const_iterator _pointInGridIterator; - mutable vector::const_iterator _pointInLftEdgeIterator; - mutable vector::const_iterator _pointInRgtEdgeIterator; - mutable vector::const_iterator _pointInTopEdgeIterator; - mutable vector::const_iterator _pointInBotEdgeIterator; + mutable std::vector::const_iterator _pointInGridIterator; + mutable std::vector::const_iterator _pointInLftEdgeIterator; + mutable std::vector::const_iterator _pointInRgtEdgeIterator; + mutable std::vector::const_iterator _pointInTopEdgeIterator; + mutable std::vector::const_iterator _pointInBotEdgeIterator; mutable GridPoint _pointInGridBase; mutable int _pointInGridNumX; @@ -168,12 +167,12 @@ class GridTemplateFactory { }; // String corresponding to the enumerated values above - vector enum_to_string; + std::vector enum_to_string; - GridTemplates string2Enum(string target); - string enum2String(GridTemplates gt); + GridTemplates string2Enum(std::string target); + std::string enum2String(GridTemplates gt); - GridTemplate* buildGT(string gt, int width, bool wrap_lon); + GridTemplate* buildGT(std::string gt, int width, bool wrap_lon); GridTemplate* buildGT(GridTemplates gt, int width, bool wrap_lon); }; diff --git a/src/basic/vx_util/ascii_header.h b/src/basic/vx_util/ascii_header.h index 5c0a498c77..24181e3d2a 100644 --- a/src/basic/vx_util/ascii_header.h +++ b/src/basic/vx_util/ascii_header.h @@ -13,8 +13,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include @@ -105,8 +103,8 @@ class AsciiHeader { void assign(const AsciiHeader &); - StringArray Versions; - vector Headers; + StringArray Versions; + std::vector Headers; public: diff --git a/src/basic/vx_util/ascii_table.h b/src/basic/vx_util/ascii_table.h index c13c67c904..6e6ee96290 100644 --- a/src/basic/vx_util/ascii_table.h +++ b/src/basic/vx_util/ascii_table.h @@ -357,7 +357,7 @@ inline bool AsciiTable::decimal_points_aligned() const { return ( DecimalPointsA // externs // -extern ostream & operator<<(ostream &, AsciiTable &); +extern std::ostream & operator<<(std::ostream &, AsciiTable &); extern void justified_item(const char * text, const int field_width, const char pad, const AsciiTableJust just, char * out); diff --git a/src/basic/vx_util/command_line.h b/src/basic/vx_util/command_line.h index 9acbc3fa9b..7c02bf589a 100644 --- a/src/basic/vx_util/command_line.h +++ b/src/basic/vx_util/command_line.h @@ -57,7 +57,7 @@ class CLOptionInfo { // command-line option info void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString option_text; @@ -101,7 +101,7 @@ class CLOptionInfoArray { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; void set_alloc_inc(int = 0); // 0 means default value (16) @@ -112,7 +112,7 @@ class CLOptionInfoArray { CLOptionInfo & operator[](int) const; - int lookup(const string &) const; + int lookup(const std::string &) const; }; @@ -143,7 +143,7 @@ class CommandLine { void do_log(); void get_n_args(StringArray &, const int Nargs, - const string & switch_name, const int pos); + const std::string & switch_name, const int pos); int get_unlimited_args(StringArray &, const int pos); @@ -159,7 +159,7 @@ class CommandLine { bool AllowUnrecognizedSwitches; // default: false - bool is_switch(const string &) const; + bool is_switch(const std::string &) const; public: @@ -170,7 +170,7 @@ class CommandLine { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // // set stuff @@ -197,7 +197,7 @@ class CommandLine { int length(int) const; // length of jth arg - bool has_option(const string &) const; + bool has_option(const std::string &) const; int next_option(int & index) const; // -1 if no option found @@ -207,11 +207,11 @@ class CommandLine { void shift_down(int pos, int k); - const string operator[](int) const; + const std::string operator[](int) const; void parse(); - void add(CLSetFunction, const string & text, int n_args); // n_args not including switch + void add(CLSetFunction, const std::string & text, int n_args); // n_args not including switch }; diff --git a/src/basic/vx_util/crc_array.h b/src/basic/vx_util/crc_array.h index 7d86fe97e9..2b7dcb52e3 100644 --- a/src/basic/vx_util/crc_array.h +++ b/src/basic/vx_util/crc_array.h @@ -101,9 +101,9 @@ class CRC_Array { void extend(int, bool exact = true); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; - void dump_one_line(ostream & out, int depth) const; + void dump_one_line(std::ostream & out, int depth) const; // // set stuff @@ -330,7 +330,7 @@ return; template -void CRC_Array::dump(ostream & out, int depth) const +void CRC_Array::dump(std::ostream & out, int depth) const { @@ -364,7 +364,7 @@ return; template -void CRC_Array::dump_one_line(ostream & out, int depth) const +void CRC_Array::dump_one_line(std::ostream & out, int depth) const { @@ -385,7 +385,7 @@ for (j=0; j -void CRR_Array::dump(ostream & out, int depth) const +void CRR_Array::dump(std::ostream & out, int depth) const { diff --git a/src/basic/vx_util/data_line.h b/src/basic/vx_util/data_line.h index c64b6fc4b4..4608e8a2bd 100644 --- a/src/basic/vx_util/data_line.h +++ b/src/basic/vx_util/data_line.h @@ -48,7 +48,7 @@ class PyLineDataFile; // forward reference class DataLine { friend class LineDataFile; - friend ostream & operator<<(ostream &, const DataLine &); + friend std::ostream & operator<<(std::ostream &, const DataLine &); friend Logger & operator<<(Logger &, const DataLine &); protected: @@ -96,7 +96,7 @@ class DataLine { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // // retrieve stuff @@ -178,7 +178,7 @@ class LineDataFile { LineDataFile(); virtual ~LineDataFile(); - ifstream * in; + std::ifstream * in; int open(const char *); @@ -217,7 +217,7 @@ inline const StringArray & LineDataFile::header() const { return ( Header ); } //////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const DataLine &); +extern std::ostream & operator<<(std::ostream &, const DataLine &); //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/data_plane.cc b/src/basic/vx_util/data_plane.cc index bde7f982bc..0fd0c00efa 100644 --- a/src/basic/vx_util/data_plane.cc +++ b/src/basic/vx_util/data_plane.cc @@ -16,6 +16,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 11-01-11 Halley Gotway +// 001 22-09-29 Prestopnik MET #2227 Remove namespace std from header files // /////////////////////////////////////////////////////////////////////////////// @@ -663,7 +664,7 @@ if ( N == 0 ) return; // no shift, so do nothing int x, y, x_new; int index_old, index_new; -std::vector new_data(Nxy); +vector new_data(Nxy); for (x=0; x #include @@ -43,7 +46,7 @@ //////////////////////////////////////////////////////////////////////// -static std::string met_cmdline = ""; +static string met_cmdline = ""; static int met_start_time; static int met_end_time; @@ -146,7 +149,7 @@ void segv_handler(int signum) { void set_handlers() { - set_new_handler(oom); + set_new_handler(oom); } //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/main.h b/src/basic/vx_util/main.h index a008a26c7c..7cbedef200 100644 --- a/src/basic/vx_util/main.h +++ b/src/basic/vx_util/main.h @@ -20,8 +20,6 @@ #include #include -using namespace std; - //////////////////////////////////////////////////////////////////////// #define MET_BUF_SIZE 4096 @@ -29,7 +27,7 @@ using namespace std; //////////////////////////////////////////////////////////////////////// //extern void log_event(int event_id, string event_msg); -extern string get_current_time(); +extern std::string get_current_time(); //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/mask_poly.h b/src/basic/vx_util/mask_poly.h index a568318ae0..640124b260 100644 --- a/src/basic/vx_util/mask_poly.h +++ b/src/basic/vx_util/mask_poly.h @@ -61,7 +61,7 @@ class MaskPoly { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // // set stuff diff --git a/src/basic/vx_util/ncrr_array.h b/src/basic/vx_util/ncrr_array.h index 68fbd40592..dc508ca380 100644 --- a/src/basic/vx_util/ncrr_array.h +++ b/src/basic/vx_util/ncrr_array.h @@ -77,7 +77,7 @@ class NCRR_Array { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff @@ -254,7 +254,7 @@ return; template -void NCRR_Array::dump(ostream & out, int depth) const +void NCRR_Array::dump(std::ostream & out, int depth) const { diff --git a/src/basic/vx_util/num_array.h b/src/basic/vx_util/num_array.h index 72d7ec00e8..be43623ff8 100644 --- a/src/basic/vx_util/num_array.h +++ b/src/basic/vx_util/num_array.h @@ -35,7 +35,7 @@ class NumArray { void assign(const NumArray &); - vector e; + std::vector e; bool Sorted; @@ -53,7 +53,7 @@ class NumArray { void extend(int); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; double operator[](int) const; diff --git a/src/basic/vx_util/observation.h b/src/basic/vx_util/observation.h index 58d9e29285..62dd3fe688 100644 --- a/src/basic/vx_util/observation.h +++ b/src/basic/vx_util/observation.h @@ -37,23 +37,23 @@ class Observation public: - Observation(const string &header_type, const string &station_id, + Observation(const std::string &header_type, const std::string &station_id, const time_t valid_time, const double latitude, const double longitude, const double elevation, - const string &quality_flag, + const std::string &quality_flag, const int grib_code, const double pressure_level_hpa, const double height_m, const double value, - const string &var_name = ""); + const std::string &var_name = ""); - Observation(const string &header_type, const string &station_id, + Observation(const std::string &header_type, const std::string &station_id, const time_t start_time, const time_t end_time, const double latitude, const double longitude, const double elevation, - const string &quality_flag, + const std::string &quality_flag, const int grib_code, const double pressure_level_hpa, const double height_m, const double value, - const string &var_name = ""); + const std::string &var_name = ""); //////////////////////// #ifdef ENABLE_PYTHON @@ -85,12 +85,12 @@ class Observation hdrIndex = headerIndex; } - string getHeaderType() const + std::string getHeaderType() const { return _headerType; } - string getStationId() const + std::string getStationId() const { return _stationId; } @@ -100,7 +100,7 @@ class Observation return _validTime; } - string getValidTimeString() const + std::string getValidTimeString() const { return _getTimeString(_validTime); } @@ -120,7 +120,7 @@ class Observation return _elevation; } - string getQualityFlag() const + std::string getQualityFlag() const { return _qualityFlag; } @@ -155,7 +155,7 @@ class Observation return _value; } - string getVarName() const + std::string getVarName() const { return _varName; } @@ -201,26 +201,26 @@ class Observation // Protected members // /////////////////////// - string _headerType; - string _stationId; - time_t _validTime; - double _latitude; - double _longitude; - double _elevation; - string _qualityFlag; - string _varName; - int varCode; - long hdrIndex; - double _pressureLevel; - double _height; - double _value; + std::string _headerType; + std::string _stationId; + time_t _validTime; + double _latitude; + double _longitude; + double _elevation; + std::string _qualityFlag; + std::string _varName; + int varCode; + long hdrIndex; + double _pressureLevel; + double _height; + double _value; /////////////////////// // Protected methods // /////////////////////// - static string _getTimeString(const time_t &unix_time) + static std::string _getTimeString(const time_t &unix_time) { struct tm *time_struct = gmtime(&unix_time); @@ -232,14 +232,14 @@ class Observation time_struct->tm_mday, time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); - return string(time_string); + return std::string(time_string); } - static string _getTimeString(const time_t &start_time, + static std::string _getTimeString(const time_t &start_time, const time_t &end_time) { - string start_time_string = _getTimeString(start_time); - string end_time_string = _getTimeString(end_time); + std::string start_time_string = _getTimeString(start_time); + std::string end_time_string = _getTimeString(end_time); char time_string[tmp_buf_size]; @@ -247,7 +247,7 @@ class Observation "%s-%s", start_time_string.c_str(), end_time_string.c_str()); - return string(time_string); + return std::string(time_string); } }; diff --git a/src/basic/vx_util/polyline.h b/src/basic/vx_util/polyline.h index 1278a71508..c3a31455d8 100644 --- a/src/basic/vx_util/polyline.h +++ b/src/basic/vx_util/polyline.h @@ -51,7 +51,7 @@ class Polyline { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ///////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/stat_column_defs.h b/src/basic/vx_util/stat_column_defs.h index 111829c07a..9fca87257c 100644 --- a/src/basic/vx_util/stat_column_defs.h +++ b/src/basic/vx_util/stat_column_defs.h @@ -437,16 +437,16 @@ static const int n_genmpr_columns = sizeof(genmpr_columns)/sizeof(*genmpr_ //////////////////////////////////////////////////////////////////////// -inline int get_n_mctc_columns (int n) { return(3 + n*n); } // n = N_CAT -inline int get_n_pct_columns (int n) { return(3 + 3*(max(1, n)-1)); } // n = N_THRESH -inline int get_n_pstd_columns (int n) { return(17 + max(1, n) ); } // n = N_THRESH -inline int get_n_pjc_columns (int n) { return(3 + 7*(max(1, n)-1)); } // n = N_THRESH -inline int get_n_prc_columns (int n) { return(3 + 3*(max(1, n)-1)); } // n = N_THRESH -inline int get_n_eclv_columns (int n) { return(4 + 2*n); } // n = N_PNT -inline int get_n_rhist_columns (int n) { return(2 + n); } // n = N_RANK -inline int get_n_phist_columns (int n) { return(3 + n); } // n = N_BINS -inline int get_n_relp_columns (int n) { return(2 + n); } // n = N_ENS -inline int get_n_orank_columns (int n) { return(20 + n); } // n = N_ENS +inline int get_n_mctc_columns (int n) { return(3 + n*n); } // n = N_CAT +inline int get_n_pct_columns (int n) { return(3 + 3*(std::max(1, n)-1)); } // n = N_THRESH +inline int get_n_pstd_columns (int n) { return(17 + std::max(1, n) ); } // n = N_THRESH +inline int get_n_pjc_columns (int n) { return(3 + 7*(std::max(1, n)-1)); } // n = N_THRESH +inline int get_n_prc_columns (int n) { return(3 + 3*(std::max(1, n)-1)); } // n = N_THRESH +inline int get_n_eclv_columns (int n) { return(4 + 2*n); } // n = N_PNT +inline int get_n_rhist_columns (int n) { return(2 + n); } // n = N_RANK +inline int get_n_phist_columns (int n) { return(3 + n); } // n = N_BINS +inline int get_n_relp_columns (int n) { return(2 + n); } // n = N_ENS +inline int get_n_orank_columns (int n) { return(20 + n); } // n = N_ENS //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/thresh_array.h b/src/basic/vx_util/thresh_array.h index c3f6cafb2d..7a74dee69c 100644 --- a/src/basic/vx_util/thresh_array.h +++ b/src/basic/vx_util/thresh_array.h @@ -43,7 +43,7 @@ class ThreshArray { void extend(int, bool exact = true); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; bool operator==(const ThreshArray &) const; SingleThresh operator[](int) const; @@ -74,7 +74,7 @@ class ThreshArray { void multiply_by(const double); - void get_simple_nodes(vector &); + void get_simple_nodes(std::vector &); ConcatString get_str(const char * = thresh_default_sep, int precision = thresh_default_precision) const; diff --git a/src/basic/vx_util_math/so3.h b/src/basic/vx_util_math/so3.h index ecbfdbd952..dc4f1ad0c9 100644 --- a/src/basic/vx_util_math/so3.h +++ b/src/basic/vx_util_math/so3.h @@ -60,7 +60,7 @@ class SO3 { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // diff --git a/src/libcode/vx_afm/afm.h b/src/libcode/vx_afm/afm.h index 2d00ad58ff..cbe3c34d27 100644 --- a/src/libcode/vx_afm/afm.h +++ b/src/libcode/vx_afm/afm.h @@ -51,7 +51,7 @@ class AfmBBox { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int L; int B; @@ -82,7 +82,7 @@ class LigatureInfo { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; char * successor_name; @@ -116,7 +116,7 @@ class AfmCharMetrics { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int ascii_code; @@ -154,7 +154,7 @@ class PCC { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; char * name; @@ -184,7 +184,7 @@ class AfmCompositeInfo { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; char * name; @@ -215,7 +215,7 @@ class KPX { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; char * name1; @@ -249,7 +249,7 @@ class Afm { void do_fontbbox(AfmLine &); - ifstream * in; // used for reading + std::ifstream * in; // used for reading int line_number; // void patch_ligatures(LigatureInfo &); @@ -263,7 +263,7 @@ class Afm { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int read(const ConcatString&); diff --git a/src/libcode/vx_afm/afm_line.h b/src/libcode/vx_afm/afm_line.h index 3ccc32b241..07f3b5af8b 100644 --- a/src/libcode/vx_afm/afm_line.h +++ b/src/libcode/vx_afm/afm_line.h @@ -28,7 +28,7 @@ class AfmLine { - friend istream & operator>>(istream &, AfmLine &); + friend std::istream & operator>>(std::istream &, AfmLine &); private: @@ -70,7 +70,7 @@ class AfmLine { //////////////////////////////////////////////////////////////////////// -extern istream & operator>>(istream &, AfmLine &); +extern std::istream & operator>>(std::istream &, AfmLine &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_afm/afm_token.h b/src/libcode/vx_afm/afm_token.h index 158afed618..0153481327 100644 --- a/src/libcode/vx_afm/afm_token.h +++ b/src/libcode/vx_afm/afm_token.h @@ -44,7 +44,7 @@ class AfmToken { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // void set_string(const char *); void set_string(const ConcatString); diff --git a/src/libcode/vx_analysis_util/by_case_info.h b/src/libcode/vx_analysis_util/by_case_info.h index e95bd49846..1084c5331b 100644 --- a/src/libcode/vx_analysis_util/by_case_info.h +++ b/src/libcode/vx_analysis_util/by_case_info.h @@ -45,7 +45,7 @@ class ByCaseInfo { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void add(const ModeLine &); diff --git a/src/libcode/vx_analysis_util/mode_atts.h b/src/libcode/vx_analysis_util/mode_atts.h index a20570ddc7..851a7eb653 100644 --- a/src/libcode/vx_analysis_util/mode_atts.h +++ b/src/libcode/vx_analysis_util/mode_atts.h @@ -65,7 +65,7 @@ class ModeAttributes { void clear(); - void dump(ostream & out, int depth = 0) const; + void dump(std::ostream & out, int depth = 0) const; int is_keeper(const ModeLine &) const; @@ -587,7 +587,7 @@ class ModeAttributes { //////////////////////////////////////////////////////////////////////// -extern void mode_atts_usage(ostream &); +extern void mode_atts_usage(std::ostream &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_analysis_util/mode_job.h b/src/libcode/vx_analysis_util/mode_job.h index 7e9c2668cc..e7d2958c44 100644 --- a/src/libcode/vx_analysis_util/mode_job.h +++ b/src/libcode/vx_analysis_util/mode_job.h @@ -62,13 +62,13 @@ class BasicModeAnalysisJob { virtual void clear(); - virtual void dump(ostream &, int depth = 0) const; + virtual void dump(std::ostream &, int depth = 0) const; virtual void add_column_by_name (const char *); virtual void add_column_by_number (int); // numbers start at zero - virtual void do_output(ostream &) const = 0; + virtual void do_output(std::ostream &) const = 0; virtual void setup() = 0; @@ -84,8 +84,8 @@ class BasicModeAnalysisJob { int n_lines_read; int n_lines_kept; - ostream * dumpfile; // NOT allocated, so don't delete - ostream * outfile; // NOT allocated, so don't delete + std::ostream * dumpfile; // NOT allocated, so don't delete + std::ostream * outfile; // NOT allocated, so don't delete int n_dump; // number of lines written to dump file AsciiTable dump_at; // AsciiTable object to buffer dump data @@ -123,7 +123,7 @@ class SummaryJob : public BasicModeAnalysisJob { void clear(); - void do_output(ostream &) const; + void do_output(std::ostream &) const; void setup(); @@ -154,7 +154,7 @@ class ByCaseJob : public BasicModeAnalysisJob { void clear(); - void do_output(ostream &) const; + void do_output(std::ostream &) const; void setup(); diff --git a/src/libcode/vx_analysis_util/mode_line.h b/src/libcode/vx_analysis_util/mode_line.h index d02d261449..9f111a4c47 100644 --- a/src/libcode/vx_analysis_util/mode_line.h +++ b/src/libcode/vx_analysis_util/mode_line.h @@ -48,7 +48,7 @@ class ModeLine : public DataLine { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int read_line(LineDataFile *); // virtual from base class diff --git a/src/libcode/vx_analysis_util/stat_job.h b/src/libcode/vx_analysis_util/stat_job.h index 50cf4a91af..2645e884e2 100644 --- a/src/libcode/vx_analysis_util/stat_job.h +++ b/src/libcode/vx_analysis_util/stat_job.h @@ -117,7 +117,7 @@ class STATAnalysisJob { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; ////////////////////////////////////////////////////////////////// @@ -225,11 +225,11 @@ class STATAnalysisJob { NumArray weight; // Numeric column thresholds - map column_thresh_map; + std::map column_thresh_map; // ASCII column string matching - map column_str_inc_map; - map column_str_exc_map; + std::map column_str_inc_map; + std::map column_str_exc_map; StringArray hdr_name; StringArray hdr_value; @@ -243,12 +243,12 @@ class STATAnalysisJob { // Variables used to the store the analysis job specification // char *dump_row; // dump rows used to a file - ofstream *dr_out; // output file stream for dump row + std::ofstream *dr_out; // output file stream for dump row int n_dump; // number of lines written to dump row AsciiTable dump_at; // AsciiTable for buffering dump row data char *stat_file; // dump output statistics to a STAT file - ofstream *stat_out; // output file stream for -out_stat + std::ofstream *stat_out; // output file stream for -out_stat AsciiTable stat_at; // AsciiTable for buffering output STAT data int stat_row; // Counter for the current stat row diff --git a/src/libcode/vx_analysis_util/stat_line.h b/src/libcode/vx_analysis_util/stat_line.h index e7b63ee9d5..6c2a4282d0 100644 --- a/src/libcode/vx_analysis_util/stat_line.h +++ b/src/libcode/vx_analysis_util/stat_line.h @@ -49,7 +49,7 @@ class STATLine : public DataLine { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int read_line(LineDataFile *); // virtual from base class diff --git a/src/libcode/vx_analysis_util/time_series.h b/src/libcode/vx_analysis_util/time_series.h index 0474bc6503..10aab9b890 100644 --- a/src/libcode/vx_analysis_util/time_series.h +++ b/src/libcode/vx_analysis_util/time_series.h @@ -52,7 +52,7 @@ class TimeSeries { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void set(unixtime _start, int _delta, int _n); diff --git a/src/libcode/vx_color/color.h b/src/libcode/vx_color/color.h index 986287aa6c..5c0126d2e5 100644 --- a/src/libcode/vx_color/color.h +++ b/src/libcode/vx_color/color.h @@ -67,7 +67,7 @@ class Color { void reverse_video(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; bool is_gray () const; @@ -172,7 +172,7 @@ class CtableEntry { double value_low () const; double value_high () const; - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; @@ -191,9 +191,9 @@ inline double CtableEntry::value_high() const { return ( ValueHi ); } //////////////////////////////////////////////////////////////////////// -extern istream & operator>>(istream &, CtableEntry &); +extern std::istream & operator>>(std::istream &, CtableEntry &); -extern ostream & operator<<(ostream &, const CtableEntry &); +extern std::ostream & operator<<(std::ostream &, const CtableEntry &); //////////////////////////////////////////////////////////////////////// @@ -264,7 +264,7 @@ class ColorTable { double gamma() const; - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; CtableEntry operator[](int) const; diff --git a/src/libcode/vx_color/color_list.h b/src/libcode/vx_color/color_list.h index 8bcee60348..aebf35b641 100644 --- a/src/libcode/vx_color/color_list.h +++ b/src/libcode/vx_color/color_list.h @@ -47,7 +47,7 @@ class ClistEntry { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void set_name(const std::string); @@ -102,7 +102,7 @@ class ColorList { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int n_elements() const; diff --git a/src/libcode/vx_data2d/data_class.h b/src/libcode/vx_data2d/data_class.h index 401cd4e0c7..06aecd0739 100644 --- a/src/libcode/vx_data2d/data_class.h +++ b/src/libcode/vx_data2d/data_class.h @@ -50,7 +50,7 @@ class Met2dData { void mtdd_clear(); - virtual void dump(ostream &, int depth = 0) const = 0; // dump grid and filename, etc., not data + virtual void dump(std::ostream &, int depth = 0) const = 0; // dump grid and filename, etc., not data // // set stuff @@ -105,7 +105,7 @@ class Met2dDataFile : public Met2dData { void mtddf_clear(); - virtual void dump(ostream &, int depth = 0) const = 0; // dump grid and filename, etc., not data + virtual void dump(std::ostream &, int depth = 0) const = 0; // dump grid and filename, etc., not data // // set stuff diff --git a/src/libcode/vx_data2d/level_info.h b/src/libcode/vx_data2d/level_info.h index 445528017a..377550de62 100644 --- a/src/libcode/vx_data2d/level_info.h +++ b/src/libcode/vx_data2d/level_info.h @@ -63,7 +63,7 @@ class LevelInfo void clear(); - void dump(ostream &) const; + void dump(std::ostream &) const; // // get stuff diff --git a/src/libcode/vx_data2d/table_lookup.h b/src/libcode/vx_data2d/table_lookup.h index d6ae3fa6f7..a234bf72bb 100644 --- a/src/libcode/vx_data2d/table_lookup.h +++ b/src/libcode/vx_data2d/table_lookup.h @@ -43,7 +43,7 @@ class Grib1TableEntry { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; int code; int table_number; @@ -94,7 +94,7 @@ class Grib2TableEntry { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; int index_a; // Section 0 Discipline int mtab_set; // Section 1 Master Tables Version Number used by set_var @@ -139,8 +139,8 @@ class TableFlatFile { void assign(const TableFlatFile &); - bool read_grib1(istream &, const char * filename, const int n); - bool read_grib2(istream &, const char * filename, const int n); + bool read_grib1(std::istream &, const char * filename, const int n); + bool read_grib2(std::istream &, const char * filename, const int n); void extend_grib1(int); void extend_grib2(int); @@ -164,7 +164,7 @@ class TableFlatFile { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff diff --git a/src/libcode/vx_data2d/var_info.h b/src/libcode/vx_data2d/var_info.h index d32715d130..7ac6399f6b 100644 --- a/src/libcode/vx_data2d/var_info.h +++ b/src/libcode/vx_data2d/var_info.h @@ -96,7 +96,7 @@ class VarInfo void clear(); - virtual void dump(ostream &) const; + virtual void dump(std::ostream &) const; // // get stuff @@ -158,7 +158,7 @@ class VarInfo void set_req_name(const char *); void set_name(const char *); - void set_name(const string); + void set_name(const std::string); void set_units(const char *); void set_level_info(const LevelInfo &); void set_req_level_name(const char *); @@ -272,7 +272,7 @@ struct InputInfo { class EnsVarInfo { private: - vector inputs; // Vector of InputInfo + std::vector inputs; // Vector of InputInfo VarInfo * ctrl_info; // Field info for control member public: diff --git a/src/libcode/vx_data2d_factory/is_netcdf_file.cc b/src/libcode/vx_data2d_factory/is_netcdf_file.cc index 805ce8ee81..3e72029514 100644 --- a/src/libcode/vx_data2d_factory/is_netcdf_file.cc +++ b/src/libcode/vx_data2d_factory/is_netcdf_file.cc @@ -25,6 +25,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "is_netcdf_file.h" #include "vx_nc_util.h" diff --git a/src/libcode/vx_data2d_grib/data2d_grib.h b/src/libcode/vx_data2d_grib/data2d_grib.h index 6c72eaca1c..275d77b36e 100644 --- a/src/libcode/vx_data2d_grib/data2d_grib.h +++ b/src/libcode/vx_data2d_grib/data2d_grib.h @@ -78,7 +78,7 @@ class MetGrib1DataFile : public Met2dDataFile { void close(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; bool read_record(const int, const bool read_plane = true); diff --git a/src/libcode/vx_data2d_grib/grib_classes.h b/src/libcode/vx_data2d_grib/grib_classes.h index 3b0295cf45..eab0f7b3ac 100644 --- a/src/libcode/vx_data2d_grib/grib_classes.h +++ b/src/libcode/vx_data2d_grib/grib_classes.h @@ -18,8 +18,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -366,9 +364,9 @@ class GribRecord { public: - vector data; // allocated + std::vector data; // allocated - vector bitmap; // allocated + std::vector bitmap; // allocated Section0_Header * is; // allocated unsigned char * pds; // allocated @@ -579,13 +577,13 @@ extern double char4_to_dbl(const unsigned char *); extern unsigned int char3_to_int(const unsigned char *); extern unsigned int char2_to_int(const unsigned char *); -extern ostream & operator<<(ostream &, const GribRecord &); +extern std::ostream & operator<<(std::ostream &, const GribRecord &); -extern ostream & operator<<(ostream &, const Section0_Header &); -extern ostream & operator<<(ostream &, const Section1_Header &); -extern ostream & operator<<(ostream &, const Section2_Header &); -extern ostream & operator<<(ostream &, const Section3_Header &); -extern ostream & operator<<(ostream &, const Section4_Header &); +extern std::ostream & operator<<(std::ostream &, const Section0_Header &); +extern std::ostream & operator<<(std::ostream &, const Section1_Header &); +extern std::ostream & operator<<(std::ostream &, const Section2_Header &); +extern std::ostream & operator<<(std::ostream &, const Section3_Header &); +extern std::ostream & operator<<(std::ostream &, const Section4_Header &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_grib/grib_strings.h b/src/libcode/vx_data2d_grib/grib_strings.h index 2fddd2dcef..0b51dd9121 100644 --- a/src/libcode/vx_data2d_grib/grib_strings.h +++ b/src/libcode/vx_data2d_grib/grib_strings.h @@ -13,20 +13,16 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - -//////////////////////////////////////////////////////////////////////// - #include "vx_util.h" //////////////////////////////////////////////////////////////////////// -static const string missing_str = "MISSING"; -static const char ugrd_abbr_str[] = "UGRD"; -static const char vgrd_abbr_str[] = "VGRD"; -static const string ugrd_vgrd_abbr_str = "UGRD_VGRD"; -static const string wind_abbr_str = "WIND"; -static const string wdir_abbr_str = "WDIR"; +static const std::string missing_str = "MISSING"; +static const char ugrd_abbr_str[] = "UGRD"; +static const char vgrd_abbr_str[] = "VGRD"; +static const std::string ugrd_vgrd_abbr_str = "UGRD_VGRD"; +static const std::string wind_abbr_str = "WIND"; +static const std::string wdir_abbr_str = "WDIR"; //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_grib/var_info_grib.h b/src/libcode/vx_data2d_grib/var_info_grib.h index 9a0b9bf4ce..ef5acef9dc 100644 --- a/src/libcode/vx_data2d_grib/var_info_grib.h +++ b/src/libcode/vx_data2d_grib/var_info_grib.h @@ -68,7 +68,7 @@ class VarInfoGrib : public VarInfo VarInfoGrib(const VarInfoGrib &); VarInfoGrib & operator=(const VarInfoGrib &); - void dump(ostream &) const; + void dump(std::ostream &) const; void clear(); // diff --git a/src/libcode/vx_data2d_grib2/var_info_grib2.h b/src/libcode/vx_data2d_grib2/var_info_grib2.h index a6bf0fcd5e..8f5bb6a7c5 100644 --- a/src/libcode/vx_data2d_grib2/var_info_grib2.h +++ b/src/libcode/vx_data2d_grib2/var_info_grib2.h @@ -19,8 +19,6 @@ #include #include -using namespace std; - #include "vx_config.h" #include "vx_util.h" #include "var_info.h" diff --git a/src/libcode/vx_data2d_nc_met/data2d_nc_met.h b/src/libcode/vx_data2d_nc_met/data2d_nc_met.h index eb72f67605..3cd2d02bb3 100644 --- a/src/libcode/vx_data2d_nc_met/data2d_nc_met.h +++ b/src/libcode/vx_data2d_nc_met/data2d_nc_met.h @@ -17,9 +17,6 @@ //////////////////////////////////////////////////////////////////////// -#include -using namespace netCDF; - #include "data_plane.h" #include "data_class.h" #include "var_info_nc_met.h" @@ -80,7 +77,7 @@ class MetNcMetDataFile : public Met2dDataFile { void close (); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; }; diff --git a/src/libcode/vx_data2d_nc_met/get_met_grid.cc b/src/libcode/vx_data2d_nc_met/get_met_grid.cc index c6882057e3..576ef42435 100644 --- a/src/libcode/vx_data2d_nc_met/get_met_grid.cc +++ b/src/libcode/vx_data2d_nc_met/get_met_grid.cc @@ -18,6 +18,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "get_met_grid.h" #include "nc_utils.h" diff --git a/src/libcode/vx_data2d_nc_met/get_met_grid.h b/src/libcode/vx_data2d_nc_met/get_met_grid.h index 5315025b6e..dee95da870 100644 --- a/src/libcode/vx_data2d_nc_met/get_met_grid.h +++ b/src/libcode/vx_data2d_nc_met/get_met_grid.h @@ -14,15 +14,14 @@ //////////////////////////////////////////////////////////////////////// #include -using namespace netCDF; #include "vx_grid.h" //////////////////////////////////////////////////////////////////////// -extern void read_netcdf_grid(NcFile *, Grid &); +extern void read_netcdf_grid(netCDF::NcFile *, Grid &); -extern int has_variable(NcFile *, const char *); +extern int has_variable(netCDF::NcFile *, const char *); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_nc_met/met_file.cc b/src/libcode/vx_data2d_nc_met/met_file.cc index 306abee1c2..decf37371c 100644 --- a/src/libcode/vx_data2d_nc_met/met_file.cc +++ b/src/libcode/vx_data2d_nc_met/met_file.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_math.h" #include "vx_cal.h" #include "vx_log.h" diff --git a/src/libcode/vx_data2d_nc_met/met_file.h b/src/libcode/vx_data2d_nc_met/met_file.h index d2321f97c7..e3a9070a43 100644 --- a/src/libcode/vx_data2d_nc_met/met_file.h +++ b/src/libcode/vx_data2d_nc_met/met_file.h @@ -57,9 +57,9 @@ class MetNcFile { void close(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; - NcFile * Nc; // allocated + netCDF::NcFile * Nc; // allocated // // dimensions @@ -67,12 +67,12 @@ class MetNcFile { int Ndims; - NcDim ** Dim; // allocated + netCDF::NcDim ** Dim; // allocated StringArray DimNames; - NcDim * Xdim; // not allocated - NcDim * Ydim; // not allocated + netCDF::NcDim * Xdim; // not allocated + netCDF::NcDim * Ydim; // not allocated // // variables @@ -92,9 +92,9 @@ class MetNcFile { // data // - double data(NcVar *, const LongArray &) const; + double data(netCDF::NcVar *, const LongArray &) const; - bool data(NcVar *, const LongArray &, DataPlane &) const; + bool data(netCDF::NcVar *, const LongArray &, DataPlane &) const; bool data(const char *, const LongArray &, DataPlane &, NcVarInfo *&) const; diff --git a/src/libcode/vx_data2d_nc_met/var_info_nc_met.h b/src/libcode/vx_data2d_nc_met/var_info_nc_met.h index bc2e0d0673..fb39471352 100644 --- a/src/libcode/vx_data2d_nc_met/var_info_nc_met.h +++ b/src/libcode/vx_data2d_nc_met/var_info_nc_met.h @@ -42,7 +42,7 @@ class VarInfoNcMet : public VarInfo VarInfoNcMet(const VarInfoNcMet &); VarInfoNcMet & operator=(const VarInfoNcMet &); - void dump(ostream &) const; + void dump(std::ostream &) const; void clear(); // diff --git a/src/libcode/vx_data2d_nc_pinterp/data2d_nc_pinterp.h b/src/libcode/vx_data2d_nc_pinterp/data2d_nc_pinterp.h index d9538dfa09..9356cd5128 100644 --- a/src/libcode/vx_data2d_nc_pinterp/data2d_nc_pinterp.h +++ b/src/libcode/vx_data2d_nc_pinterp/data2d_nc_pinterp.h @@ -18,7 +18,6 @@ #include -using namespace netCDF; #include "data_plane.h" #include "data_class.h" @@ -80,7 +79,7 @@ class MetNcPinterpDataFile : public Met2dDataFile { void close (); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; }; diff --git a/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.h b/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.h index 6294ed82cf..190de35fa0 100644 --- a/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.h +++ b/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.h @@ -22,7 +22,6 @@ #include -using namespace netCDF; #include "vx_grid.h" @@ -32,7 +31,7 @@ using namespace netCDF; extern bool get_pinterp_grid(const char * pinterp_filename, Grid &); -extern bool get_pinterp_grid(NcFile &, Grid &); +extern bool get_pinterp_grid(netCDF::NcFile &, Grid &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_nc_pinterp/pinterp_file.cc b/src/libcode/vx_data2d_nc_pinterp/pinterp_file.cc index 964d32cad6..c718944ad3 100644 --- a/src/libcode/vx_data2d_nc_pinterp/pinterp_file.cc +++ b/src/libcode/vx_data2d_nc_pinterp/pinterp_file.cc @@ -19,6 +19,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_math.h" #include "vx_cal.h" #include "vx_log.h" diff --git a/src/libcode/vx_data2d_nc_pinterp/pinterp_file.h b/src/libcode/vx_data2d_nc_pinterp/pinterp_file.h index 631b7b4a02..2947562bd1 100644 --- a/src/libcode/vx_data2d_nc_pinterp/pinterp_file.h +++ b/src/libcode/vx_data2d_nc_pinterp/pinterp_file.h @@ -24,7 +24,6 @@ #include #include -using namespace netCDF; #include "vx_grid.h" #include "data_plane.h" @@ -53,10 +52,10 @@ class PinterpFile { void close(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; - NcFile * Nc; // allocated + netCDF::NcFile * Nc; // allocated // // time @@ -77,14 +76,14 @@ class PinterpFile { int Ndims; - NcDim ** Dim; // allocated + netCDF::NcDim ** Dim; // allocated StringArray DimNames; - NcDim * Xdim; // not allocated - NcDim * Ydim; // not allocated - NcDim * Zdim; // not allocated - NcDim * Tdim; // not allocated + netCDF::NcDim * Xdim; // not allocated + netCDF::NcDim * Ydim; // not allocated + netCDF::NcDim * Zdim; // not allocated + netCDF::NcDim * Tdim; // not allocated // // variables @@ -108,9 +107,9 @@ class PinterpFile { // data // - double data(NcVar *, const LongArray &) const; + double data(netCDF::NcVar *, const LongArray &) const; - bool data(NcVar *, const LongArray &, DataPlane &, double & pressure) const; + bool data(netCDF::NcVar *, const LongArray &, DataPlane &, double & pressure) const; bool data(const char *, const LongArray &, DataPlane &, double & pressure, NcVarInfo *&) const; diff --git a/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.h b/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.h index bff8f90389..921d477b42 100644 --- a/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.h +++ b/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.h @@ -201,7 +201,7 @@ class VarInfoNcPinterp : public VarInfo VarInfoNcPinterp(const VarInfoNcPinterp &); VarInfoNcPinterp & operator=(const VarInfoNcPinterp &); - void dump(ostream &) const; + void dump(std::ostream &) const; void clear(); // diff --git a/src/libcode/vx_data2d_nccf/data2d_nccf.cc b/src/libcode/vx_data2d_nccf/data2d_nccf.cc index c36f55fef6..61a87cf472 100644 --- a/src/libcode/vx_data2d_nccf/data2d_nccf.cc +++ b/src/libcode/vx_data2d_nccf/data2d_nccf.cc @@ -17,6 +17,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "data2d_nccf.h" #include "vx_math.h" #include "vx_log.h" diff --git a/src/libcode/vx_data2d_nccf/data2d_nccf.h b/src/libcode/vx_data2d_nccf/data2d_nccf.h index 4abc64d934..1340b62e2b 100644 --- a/src/libcode/vx_data2d_nccf/data2d_nccf.h +++ b/src/libcode/vx_data2d_nccf/data2d_nccf.h @@ -17,9 +17,6 @@ //////////////////////////////////////////////////////////////////////// -#include -using namespace netCDF; - #include "data_plane.h" #include "data_class.h" #include "var_info_nccf.h" diff --git a/src/libcode/vx_data2d_nccf/nccf_file.cc b/src/libcode/vx_data2d_nccf/nccf_file.cc index 0f45544ae3..3e3cfcdbad 100644 --- a/src/libcode/vx_data2d_nccf/nccf_file.cc +++ b/src/libcode/vx_data2d_nccf/nccf_file.cc @@ -22,6 +22,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_math.h" #include "vx_cal.h" #include "vx_log.h" diff --git a/src/libcode/vx_data2d_nccf/nccf_file.h b/src/libcode/vx_data2d_nccf/nccf_file.h index 9aa9308f16..8d7f0e7abf 100644 --- a/src/libcode/vx_data2d_nccf/nccf_file.h +++ b/src/libcode/vx_data2d_nccf/nccf_file.h @@ -23,9 +23,6 @@ #include -#include -using namespace netCDF; - #include "vx_grid.h" #include "nc_utils.h" #include "data_plane.h" @@ -107,9 +104,9 @@ class NcCfFile { // data // - double getData(NcVar *, const LongArray &) const; + double getData(netCDF::NcVar *, const LongArray &) const; - bool getData(NcVar *, const LongArray &, DataPlane &) const; + bool getData(netCDF::NcVar *, const LongArray &, DataPlane &) const; bool getData(const char *, const LongArray &, DataPlane &, NcVarInfo *&) const; @@ -120,7 +117,7 @@ class NcCfFile { static const double DELTA_TOLERANCE; - NcFile * _ncFile; // allocated + netCDF::NcFile * _ncFile; // allocated // // dimensions @@ -128,7 +125,7 @@ class NcCfFile { int _numDims; - NcDim ** _dims; // allocated + netCDF::NcDim ** _dims; // allocated StringArray _dimNames; @@ -136,14 +133,14 @@ class NcCfFile { // variables. Note that these are pointers into the _dims and Var // arrays so should not be deleted. - NcDim *_xDim; - NcDim *_yDim; - NcDim *_tDim; + netCDF::NcDim *_xDim; + netCDF::NcDim *_yDim; + netCDF::NcDim *_tDim; - NcVar *_latVar; - NcVar *_lonVar; - NcVar *_xCoordVar; - NcVar *_yCoordVar; + netCDF::NcVar *_latVar; + netCDF::NcVar *_lonVar; + netCDF::NcVar *_xCoordVar; + netCDF::NcVar *_yCoordVar; NcVarInfo *_time_var_info; void init_from_scratch(); @@ -163,29 +160,29 @@ class NcCfFile { // grid member with that information. void read_netcdf_grid(); - void get_grid_from_grid_mapping(const NcVarAtt *grid_mapping_att); + void get_grid_from_grid_mapping(const netCDF::NcVarAtt *grid_mapping_att); - void get_grid_mapping_albers_conical_equal_area(const NcVar *grid_mapping_var); - void get_grid_mapping_azimuthal_equidistant(const NcVar *grid_mapping_var); - void get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_mapping_var); - void get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mapping_var); - void get_grid_mapping_lambert_cylindrical_equal_area(const NcVar *grid_mapping_var); - void get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var); - void get_grid_mapping_mercator(const NcVar *grid_mapping_var); - void get_grid_mapping_orthographic(const NcVar *grid_mapping_var); - void get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_var); - void get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_mapping_var); - void get_grid_mapping_stereographic(const NcVar *grid_mapping_var); - void get_grid_mapping_transverse_mercator(const NcVar *grid_mapping_var); - void get_grid_mapping_vertical_perspective(const NcVar *grid_mapping_var); - void get_grid_mapping_geostationary(const NcVar *grid_mapping_var); + void get_grid_mapping_albers_conical_equal_area(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_azimuthal_equidistant(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_lambert_azimuthal_equal_area(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_lambert_conformal_conic(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_lambert_cylindrical_equal_area(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_latitude_longitude(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_mercator(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_orthographic(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_polar_stereographic(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_rotated_latitude_longitude(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_stereographic(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_transverse_mercator(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_vertical_perspective(const netCDF::NcVar *grid_mapping_var); + void get_grid_mapping_geostationary(const netCDF::NcVar *grid_mapping_var); - bool get_grid_from_coordinates(const NcVar *data_var); + bool get_grid_from_coordinates(const netCDF::NcVar *data_var); bool get_grid_from_dimensions(); - void get_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, + void get_grid_from_lat_lon_vars(netCDF::NcVar *lat_var, netCDF::NcVar *lon_var, const long lat_counts, const long lon_counts); - LatLonData get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, + LatLonData get_data_from_lat_lon_vars(netCDF::NcVar *lat_var, netCDF::NcVar *lon_var, const long lat_counts, const long lon_counts, bool &swap_to_north); }; diff --git a/src/libcode/vx_data2d_python/data2d_python.h b/src/libcode/vx_data2d_python/data2d_python.h index 161b0a83fb..bb837ef5a4 100644 --- a/src/libcode/vx_data2d_python/data2d_python.h +++ b/src/libcode/vx_data2d_python/data2d_python.h @@ -84,7 +84,7 @@ class MetPythonDataFile : public Met2dDataFile { void close(); - void dump (ostream &, int depth = 0) const; + void dump (std::ostream &, int depth = 0) const; bool data_plane(VarInfo &, DataPlane &); diff --git a/src/libcode/vx_data2d_python/var_info_python.h b/src/libcode/vx_data2d_python/var_info_python.h index a9d9f781fa..776f0f4087 100644 --- a/src/libcode/vx_data2d_python/var_info_python.h +++ b/src/libcode/vx_data2d_python/var_info_python.h @@ -42,7 +42,7 @@ class VarInfoPython : public VarInfo VarInfoPython(const VarInfoPython &); VarInfoPython & operator=(const VarInfoPython &); - void dump(ostream &) const; + void dump(std::ostream &) const; void clear(); // diff --git a/src/libcode/vx_gis/dbf_file.h b/src/libcode/vx_gis/dbf_file.h index 78fc40e73f..03928046bc 100644 --- a/src/libcode/vx_gis/dbf_file.h +++ b/src/libcode/vx_gis/dbf_file.h @@ -71,7 +71,7 @@ class DbfHeader { void set_subrecords(int fd); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; DbfSubRecord * lookup_subrec(const char * text) const; // matches field_name @@ -119,13 +119,13 @@ class DbfSubRecord { void set(unsigned char * buf); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; //////////////////////////////////////////////////////////////////////// -void dump_record(ostream &, const int depth, const unsigned char * buf, const DbfHeader &); +void dump_record(std::ostream &, const int depth, const unsigned char * buf, const DbfHeader &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_gis/shp_array.h b/src/libcode/vx_gis/shp_array.h index 06f6aaeb4a..f0df12982d 100644 --- a/src/libcode/vx_gis/shp_array.h +++ b/src/libcode/vx_gis/shp_array.h @@ -78,7 +78,7 @@ class Shp_Array { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; void extend(int, bool exact = true); @@ -232,7 +232,7 @@ return; template -void Shp_Array::dump(ostream & out, int depth) const +void Shp_Array::dump(std::ostream & out, int depth) const { diff --git a/src/libcode/vx_gis/shp_file.h b/src/libcode/vx_gis/shp_file.h index 821f0145ce..87e9f65031 100644 --- a/src/libcode/vx_gis/shp_file.h +++ b/src/libcode/vx_gis/shp_file.h @@ -61,7 +61,7 @@ struct ShpFileHeader { void set(unsigned char * buf); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; @@ -84,7 +84,7 @@ struct ShpRecordHeader { void set(unsigned char * buf); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; diff --git a/src/libcode/vx_gis/shp_point_record.h b/src/libcode/vx_gis/shp_point_record.h index 62e529f8d3..006223c6f7 100644 --- a/src/libcode/vx_gis/shp_point_record.h +++ b/src/libcode/vx_gis/shp_point_record.h @@ -61,7 +61,7 @@ struct ShpPointRecord { // this should really be a class, not a struct void set(unsigned char * buf); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; diff --git a/src/libcode/vx_gis/shp_poly_record.h b/src/libcode/vx_gis/shp_poly_record.h index bccc220387..5bd6e23777 100644 --- a/src/libcode/vx_gis/shp_poly_record.h +++ b/src/libcode/vx_gis/shp_poly_record.h @@ -69,7 +69,7 @@ struct ShpPolyRecord { // this should really be a class, not a struct void set(unsigned char * buf); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int start_index(int partno) const; int stop_index(int partno) const; diff --git a/src/libcode/vx_gis/shx_file.h b/src/libcode/vx_gis/shx_file.h index b4d788183f..c57809865f 100644 --- a/src/libcode/vx_gis/shx_file.h +++ b/src/libcode/vx_gis/shx_file.h @@ -43,7 +43,7 @@ struct ShxRecord { void set(unsigned char * buf); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; diff --git a/src/libcode/vx_gnomon/gnomon.h b/src/libcode/vx_gnomon/gnomon.h index 81e280526a..2be3503707 100644 --- a/src/libcode/vx_gnomon/gnomon.h +++ b/src/libcode/vx_gnomon/gnomon.h @@ -16,11 +16,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - -//////////////////////////////////////////////////////////////////////// - - class GnomonicProjection { private: diff --git a/src/libcode/vx_grid/gaussian_grid.h b/src/libcode/vx_grid/gaussian_grid.h index d8d28d16f1..056a2699cb 100644 --- a/src/libcode/vx_grid/gaussian_grid.h +++ b/src/libcode/vx_grid/gaussian_grid.h @@ -73,7 +73,7 @@ class GaussianGrid : public GridRep { virtual ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_grid/grid_base.h b/src/libcode/vx_grid/grid_base.h index 9da7246b72..20fe27ae31 100644 --- a/src/libcode/vx_grid/grid_base.h +++ b/src/libcode/vx_grid/grid_base.h @@ -133,7 +133,7 @@ class GridInterface { // pure abstract class for grid public interface virtual ConcatString name() const = 0; - virtual void dump(ostream &, int = 0) const = 0; + virtual void dump(std::ostream &, int = 0) const = 0; virtual GridInfo info() const = 0; @@ -163,7 +163,7 @@ class GridRep : public GridInterface { GridRep(); virtual ~GridRep(); - virtual void dump(ostream &, int = 0) const = 0; + virtual void dump(std::ostream &, int = 0) const = 0; virtual ConcatString serialize(const char *sep=" ") const = 0; @@ -215,7 +215,7 @@ class Grid : public GridInterface { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; bool is_set() const; diff --git a/src/libcode/vx_grid/latlon_grid.h b/src/libcode/vx_grid/latlon_grid.h index 646e6df0c4..d419802c65 100644 --- a/src/libcode/vx_grid/latlon_grid.h +++ b/src/libcode/vx_grid/latlon_grid.h @@ -69,7 +69,7 @@ class LatLonGrid : public GridRep { virtual ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_grid/latlon_grid_defs.h b/src/libcode/vx_grid/latlon_grid_defs.h index adb3d521ef..9a88bd5a3f 100644 --- a/src/libcode/vx_grid/latlon_grid_defs.h +++ b/src/libcode/vx_grid/latlon_grid_defs.h @@ -70,7 +70,7 @@ struct RotatedLatLonData { void dump() const; // doesn't work if verbosity level < 4 - void dump(ostream &, int depth) const; + void dump(std::ostream &, int depth) const; }; diff --git a/src/libcode/vx_grid/lc_grid.h b/src/libcode/vx_grid/lc_grid.h index 3d9ffc4f27..cd105c5f49 100644 --- a/src/libcode/vx_grid/lc_grid.h +++ b/src/libcode/vx_grid/lc_grid.h @@ -110,7 +110,7 @@ class LambertGrid : public GridRep { ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_grid/merc_grid.h b/src/libcode/vx_grid/merc_grid.h index c262cd9ebe..37c17fc5cc 100644 --- a/src/libcode/vx_grid/merc_grid.h +++ b/src/libcode/vx_grid/merc_grid.h @@ -93,7 +93,7 @@ class MercatorGrid : public GridRep { ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_grid/rot_latlon_grid.h b/src/libcode/vx_grid/rot_latlon_grid.h index b6eb9e8442..c381fc99c1 100644 --- a/src/libcode/vx_grid/rot_latlon_grid.h +++ b/src/libcode/vx_grid/rot_latlon_grid.h @@ -62,7 +62,7 @@ class RotatedLatLonGrid : public LatLonGrid { virtual ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_grid/semilatlon_grid.h b/src/libcode/vx_grid/semilatlon_grid.h index a6a07d6c66..9ca66cf9f8 100644 --- a/src/libcode/vx_grid/semilatlon_grid.h +++ b/src/libcode/vx_grid/semilatlon_grid.h @@ -77,7 +77,7 @@ class SemiLatLonGrid : public GridRep { ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_grid/st_grid.h b/src/libcode/vx_grid/st_grid.h index 5ee9747f5b..53d5150b9b 100644 --- a/src/libcode/vx_grid/st_grid.h +++ b/src/libcode/vx_grid/st_grid.h @@ -91,7 +91,7 @@ class StereographicGrid : public GridRep { ConcatString name() const; - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize(const char *sep=" ") const; diff --git a/src/libcode/vx_nc_obs/nc_obs_util.cc b/src/libcode/vx_nc_obs/nc_obs_util.cc index 4cd19a3b83..73db28167a 100644 --- a/src/libcode/vx_nc_obs/nc_obs_util.cc +++ b/src/libcode/vx_nc_obs/nc_obs_util.cc @@ -18,6 +18,9 @@ using namespace std; #include +#include +using namespace netCDF; + #include "vx_nc_util.h" #include "nc_obs_util.h" diff --git a/src/libcode/vx_nc_obs/nc_obs_util.h b/src/libcode/vx_nc_obs/nc_obs_util.h index 2d8a06ca2c..30586f6a4c 100644 --- a/src/libcode/vx_nc_obs/nc_obs_util.h +++ b/src/libcode/vx_nc_obs/nc_obs_util.h @@ -14,7 +14,6 @@ #define __NC_OBS_UTIL_H__ #include -using namespace netCDF; #include "nc_summary.h" #include "met_point_data.h" @@ -88,61 +87,61 @@ struct NetcdfObsVars { int raw_hdr_cnt ; // raw data (PrepBufr) header array count int deflate_level; - NcDim strl_dim ; // header string dimension (16 bytes) - NcDim strl2_dim ; // header string dimension (40 bytes) - NcDim strl3_dim ; // header string dimension (80 bytes) - NcDim hdr_typ_dim ; // header message type dimension - NcDim hdr_sid_dim ; // header station id dimension - NcDim hdr_vld_dim ; // header valid time dimension - NcDim hdr_arr_dim ; // Header array width (V1.0, not used from V1.2) - NcDim obs_arr_dim ; // Observation array width (V1.0, not used from V1.2) - NcDim obs_dim ; // Observation array length (V1.0) - NcDim hdr_dim ; // Header array length (V1.0) - NcDim pb_hdr_dim ; // PrepfBufr Header array length (V1.2) - - NcVar hdr_typ_tbl_var ; // Message type (string) (V1.1) - NcVar hdr_sid_tbl_var ; // Station ID (string) (V1.1) - NcVar hdr_vld_tbl_var ; // Valid time (string) (V1.1) - NcVar obs_qty_tbl_var ; // Quality flag (V1.0) - NcVar hdr_typ_var ; // Message type (string to index with V1.2) - NcVar hdr_sid_var ; // Station ID (string to index with V1.2) - NcVar hdr_vld_var ; // Valid time (string to index with V1.2) - NcVar hdr_arr_var ; // Header array (V1.0, Removed from V1.2) - NcVar hdr_lat_var ; // Header array (latitude) (V1.2) - NcVar hdr_lon_var ; // Header array (longitude) (V1.2) - NcVar hdr_elv_var ; // Header array (elevation) (V1.2) - NcVar hdr_prpt_typ_var ; // Header array (PB report type) (V1.2) - NcVar hdr_irpt_typ_var ; // Header array (In report type) (V1.2) - NcVar hdr_inst_typ_var ; // Header array (instrument type) (V1.2) - NcVar obs_qty_var ; // Quality flag (unlimited dimension) (V1.2: Changed data type to int - was string) - NcVar obs_arr_var ; // Observation array (unlimited dimension) (V1.0, Removed from V1.2) - NcVar obs_hid_var ; // Observation header index array (unlimited dimension) (V1.2) - NcVar obs_gc_var ; // Observation GRIB code array (unlimited dimension) (V1.2) - NcVar obs_vid_var ; // Observation variable index array (unlimited dimension) (V1.2) - NcVar obs_lvl_var ; // Observation level array (unlimited dimension) (V1.2) - NcVar obs_hgt_var ; // Observation hight array (unlimited dimension) (V1.2) - NcVar obs_val_var ; // Observation value array (unlimited dimension) (V1.2) + netCDF::NcDim strl_dim ; // header string dimension (16 bytes) + netCDF::NcDim strl2_dim ; // header string dimension (40 bytes) + netCDF::NcDim strl3_dim ; // header string dimension (80 bytes) + netCDF::NcDim hdr_typ_dim ; // header message type dimension + netCDF::NcDim hdr_sid_dim ; // header station id dimension + netCDF::NcDim hdr_vld_dim ; // header valid time dimension + netCDF::NcDim hdr_arr_dim ; // Header array width (V1.0, not used from V1.2) + netCDF::NcDim obs_arr_dim ; // Observation array width (V1.0, not used from V1.2) + netCDF::NcDim obs_dim ; // Observation array length (V1.0) + netCDF::NcDim hdr_dim ; // Header array length (V1.0) + netCDF::NcDim pb_hdr_dim ; // PrepfBufr Header array length (V1.2) + + netCDF::NcVar hdr_typ_tbl_var ; // Message type (string) (V1.1) + netCDF::NcVar hdr_sid_tbl_var ; // Station ID (string) (V1.1) + netCDF::NcVar hdr_vld_tbl_var ; // Valid time (string) (V1.1) + netCDF::NcVar obs_qty_tbl_var ; // Quality flag (V1.0) + netCDF::NcVar hdr_typ_var ; // Message type (string to index with V1.2) + netCDF::NcVar hdr_sid_var ; // Station ID (string to index with V1.2) + netCDF::NcVar hdr_vld_var ; // Valid time (string to index with V1.2) + netCDF::NcVar hdr_arr_var ; // Header array (V1.0, Removed from V1.2) + netCDF::NcVar hdr_lat_var ; // Header array (latitude) (V1.2) + netCDF::NcVar hdr_lon_var ; // Header array (longitude) (V1.2) + netCDF::NcVar hdr_elv_var ; // Header array (elevation) (V1.2) + netCDF::NcVar hdr_prpt_typ_var ; // Header array (PB report type) (V1.2) + netCDF::NcVar hdr_irpt_typ_var ; // Header array (In report type) (V1.2) + netCDF::NcVar hdr_inst_typ_var ; // Header array (instrument type) (V1.2) + netCDF::NcVar obs_qty_var ; // Quality flag (unlimited dimension) (V1.2: Changed data type to int - was string) + netCDF::NcVar obs_arr_var ; // Observation array (unlimited dimension) (V1.0, Removed from V1.2) + netCDF::NcVar obs_hid_var ; // Observation header index array (unlimited dimension) (V1.2) + netCDF::NcVar obs_gc_var ; // Observation GRIB code array (unlimited dimension) (V1.2) + netCDF::NcVar obs_vid_var ; // Observation variable index array (unlimited dimension) (V1.2) + netCDF::NcVar obs_lvl_var ; // Observation level array (unlimited dimension) (V1.2) + netCDF::NcVar obs_hgt_var ; // Observation hight array (unlimited dimension) (V1.2) + netCDF::NcVar obs_val_var ; // Observation value array (unlimited dimension) (V1.2) // Optional variables - NcVar obs_var ; // Observation variable name (V1.1) - NcVar unit_var ; // The unit of the observation variable (V1.1) - NcVar desc_var ; // The description of the observation variable (V1.1) + netCDF::NcVar obs_var ; // Observation variable name (V1.1) + netCDF::NcVar unit_var ; // The unit of the observation variable (V1.1) + netCDF::NcVar desc_var ; // The description of the observation variable (V1.1) NetcdfObsVars(); bool is_valid(bool exit_on_error=false); void reset(bool _use_var_id = true); - void create_dimensions(NcFile *f_out); - void create_hdr_vars (NcFile *f_out, const int hdr_count); - void create_obs_vars (NcFile *f_out); - void create_obs_name_vars (NcFile *f_out, const int var_count, const int unit_count); - void create_table_vars (NcFile *f_out, MetPointHeader &hdr_data, NcDataBuffer &data_buffer); - void create_pb_hdrs (NcFile *f_out, const int hdr_count); - NcDim create_var_obs_var (NcFile *f_out, int var_count); + void create_dimensions(netCDF::NcFile *f_out); + void create_hdr_vars (netCDF::NcFile *f_out, const int hdr_count); + void create_obs_vars (netCDF::NcFile *f_out); + void create_obs_name_vars (netCDF::NcFile *f_out, const int var_count, const int unit_count); + void create_table_vars (netCDF::NcFile *f_out, MetPointHeader &hdr_data, NcDataBuffer &data_buffer); + void create_pb_hdrs (netCDF::NcFile *f_out, const int hdr_count); + netCDF::NcDim create_var_obs_var (netCDF::NcFile *f_out, int var_count); int get_hdr_index(); int get_obs_index(); - void read_dims_vars(NcFile *f_in); + void read_dims_vars(netCDF::NcFile *f_in); void read_header_data(MetPointHeader &hdr_data); bool read_obs_data(int buf_size, int offset, int qty_len, float *obs_arr, int *qty_idx_arr, char *obs_qty_buf); @@ -175,21 +174,21 @@ struct NcPointObsData : public MetPointObsData { extern bool add_nc_header_prepbufr (const int pb_report_type, const int in_report_type, const int instrument_type); -extern long count_nc_headers (vector< Observation > &observations); +extern long count_nc_headers (std::vector< Observation > &observations); extern int get_nc_hdr_cur_index(); extern int get_nc_obs_buf_index(); extern bool is_using_var_id (const char * nc_name); -extern bool is_using_var_id (NcFile * nc_file); +extern bool is_using_var_id (netCDF::NcFile * nc_file); extern void reset_header_buffer(int buf_size, bool reset_all=false); extern void set_header_buffer (int buf_size, bool reset_all=false); -extern string seconds_to_time_string(const int secs); +extern std::string seconds_to_time_string(const int secs); extern void write_nc_obs_buffer (const int buf_size); -extern int write_nc_string_array (NcVar *ncVar, StringArray &strArray, +extern int write_nc_string_array (netCDF::NcVar *ncVar, StringArray &strArray, const int str_len); #endif /* __NC_OBS_UTIL_H__ */ diff --git a/src/libcode/vx_nc_obs/nc_point_obs.cc b/src/libcode/vx_nc_obs/nc_point_obs.cc index 559693e462..fa0f49c2fb 100644 --- a/src/libcode/vx_nc_obs/nc_point_obs.cc +++ b/src/libcode/vx_nc_obs/nc_point_obs.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_log.h" #include "is_bad_data.h" diff --git a/src/libcode/vx_nc_obs/nc_point_obs.h b/src/libcode/vx_nc_obs/nc_point_obs.h index 4b957638f4..a678dc16c3 100644 --- a/src/libcode/vx_nc_obs/nc_point_obs.h +++ b/src/libcode/vx_nc_obs/nc_point_obs.h @@ -35,7 +35,7 @@ class MetNcPointObs : public MetPointData { protected: bool keep_nc; - NcFile *obs_nc; // allocated + netCDF::NcFile *obs_nc; // allocated NetcdfObsVars obs_vars; void init_from_scratch(); @@ -47,7 +47,7 @@ class MetNcPointObs : public MetPointData { bool open(const char * filename); void close(); - bool set_netcdf(NcFile *nc_file, bool _keep_nc=false); + bool set_netcdf(netCDF::NcFile *nc_file, bool _keep_nc=false); bool is_using_obs_arr(); diff --git a/src/libcode/vx_nc_obs/nc_point_obs_out.h b/src/libcode/vx_nc_obs/nc_point_obs_out.h index 34ce1c5ebf..42f1381b3f 100644 --- a/src/libcode/vx_nc_obs/nc_point_obs_out.h +++ b/src/libcode/vx_nc_obs/nc_point_obs_out.h @@ -60,10 +60,10 @@ class MetNcPointObsOut : public MetNcPointObs { void init_buffer(); void init_obs_vars(bool using_var_id, int deflate_level, bool attr_agl=false); - bool init_netcdf(int obs_count, int hdr_count, string program_name); + bool init_netcdf(int obs_count, int hdr_count, std::string program_name); void reset_header_buffer(int buf_size, bool reset_all); - void set_nc_out_data(vector observations, + void set_nc_out_data(std::vector observations, SummaryObs *summary_obs, TimeSummaryInfo summary_info, int processed_hdr_cnt=0); void set_using_var_id(bool using_var_id); @@ -75,7 +75,7 @@ class MetNcPointObsOut : public MetNcPointObs { void write_observation(); void write_observation(const float obs_arr[OBS_ARRAY_LEN], const char *obs_qty); void write_obs_data(); - int write_obs_data(const vector< Observation > observations, + int write_obs_data(const std::vector< Observation > observations, const bool do_header = true); bool write_to_netcdf(StringArray obs_names, StringArray obs_units, StringArray obs_descs); diff --git a/src/libcode/vx_nc_obs/nc_summary.cc b/src/libcode/vx_nc_obs/nc_summary.cc index 2dba528bb0..8a8cdb57b9 100644 --- a/src/libcode/vx_nc_obs/nc_summary.cc +++ b/src/libcode/vx_nc_obs/nc_summary.cc @@ -18,6 +18,9 @@ using namespace std; #include +#include +using namespace netCDF; + #include "write_netcdf.h" #include "nc_obs_util.h" diff --git a/src/libcode/vx_nc_obs/nc_summary.h b/src/libcode/vx_nc_obs/nc_summary.h index 7cebff8932..b1b7614a4c 100644 --- a/src/libcode/vx_nc_obs/nc_summary.h +++ b/src/libcode/vx_nc_obs/nc_summary.h @@ -14,7 +14,6 @@ #define __NC_SUMMARY_H__ #include -using namespace netCDF; #include "nc_utils.h" #include "nc_obs_util.h" #include "vx_summary.h" @@ -25,18 +24,18 @@ using namespace netCDF; struct NcObsOutputData { int processed_hdr_cnt; int deflate_level; - vector observations; + std::vector observations; SummaryObs *summary_obs; TimeSummaryInfo summary_info; }; //////////////////////////////////////////////////////////////////////// -extern string _secsToTimeString(const int secs); +extern std::string _secsToTimeString(const int secs); // Not moved to nc_obs_util to reduce the dependency (library) -extern void write_summary_attributes(NcFile *, TimeSummaryInfo); +extern void write_summary_attributes(netCDF::NcFile *, TimeSummaryInfo); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_nc_util/grid_output.cc b/src/libcode/vx_nc_util/grid_output.cc index 1b9a0b1ccd..50823033bd 100644 --- a/src/libcode/vx_nc_util/grid_output.cc +++ b/src/libcode/vx_nc_util/grid_output.cc @@ -19,6 +19,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "grid_output.h" #include "vx_log.h" #include "nc_utils.h" diff --git a/src/libcode/vx_nc_util/grid_output.h b/src/libcode/vx_nc_util/grid_output.h index 671ebaa43a..a06fbaa183 100644 --- a/src/libcode/vx_nc_util/grid_output.h +++ b/src/libcode/vx_nc_util/grid_output.h @@ -18,7 +18,6 @@ #include -using namespace netCDF; #include "vx_grid.h" @@ -26,7 +25,7 @@ using namespace netCDF; //////////////////////////////////////////////////////////////////////// -extern void grid_output(const GridInfo &, NcFile *, NcDim &, NcDim &); +extern void grid_output(const GridInfo &, netCDF::NcFile *, netCDF::NcDim &, netCDF::NcDim &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_nc_util/nc_utils.cc b/src/libcode/vx_nc_util/nc_utils.cc index dcfa3a2ea3..3441b2744e 100644 --- a/src/libcode/vx_nc_util/nc_utils.cc +++ b/src/libcode/vx_nc_util/nc_utils.cc @@ -975,8 +975,8 @@ char get_char_val(NcFile * nc, const char * var_name, const int index) { char get_char_val(NcVar *var, const int index) { char k; - std::vector start; - std::vector count; + vector start; + vector count; // // Retrieve the character array value from the NetCDF variable. @@ -1002,8 +1002,8 @@ ConcatString* get_string_val(NcFile * nc, const char * var_name, const int index ConcatString* get_string_val(NcVar *var, const int index, const int len, ConcatString &tmp_cs) { char tmp_str[len]; - std::vector start; - std::vector count; + vector start; + vector count; const char *method_name = "get_string_val() "; if (2 != get_dim_count(var)) { @@ -1052,8 +1052,8 @@ int get_int_var(NcFile * nc, const char * var_name, const int index) { int get_int_var(NcVar * var, const int index) { int k; - std::vector start; - std::vector count; + vector start; + vector count; const char *method_name = "get_int_var() "; k = bad_data_int; @@ -1089,8 +1089,8 @@ int get_int_var(NcVar * var, const int index) { double get_nc_time(NcVar * var, const int index) { double k; - std::vector start; - std::vector count; + vector start; + vector count; const char *method_name = "get_nc_time() -> "; k = bad_data_double; @@ -1177,8 +1177,8 @@ float get_float_var(NcFile * nc, const char * var_name, const int index) { float get_float_var(NcVar * var, const int index) { float k; - std::vector start; - std::vector count; + vector start; + vector count; const char *method_name = "get_float_var() -> "; k = bad_data_float; @@ -2541,8 +2541,8 @@ void copy_nc_atts(NcFile *nc_from, NcFile *nc_to, const bool all_attrs) { //////////////////////////////////////////////////////////////////////// void copy_nc_atts(NcVar *var_from, NcVar *var_to, const bool all_attrs) { - std::map ncAttMap = var_from->getAtts(); - for (std::map::iterator itr = ncAttMap.begin(); + map ncAttMap = var_from->getAtts(); + for (map::iterator itr = ncAttMap.begin(); itr != ncAttMap.end(); ++itr) { if (all_attrs || ( (itr->first != "scale_factor") @@ -2706,7 +2706,7 @@ bool has_var(NcFile *nc, const char * var_name) { //////////////////////////////////////////////////////////////////////// NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, const int deflate_level) { - std::vector ncDimVector; + vector ncDimVector; string new_var_name = var_name; patch_nc_name(&new_var_name); NcVar var = nc->addVar(new_var_name, ncType, ncDimVector); diff --git a/src/libcode/vx_nc_util/nc_utils.h b/src/libcode/vx_nc_util/nc_utils.h index 58fed1d8c3..199173e263 100644 --- a/src/libcode/vx_nc_util/nc_utils.h +++ b/src/libcode/vx_nc_util/nc_utils.h @@ -13,13 +13,11 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include -using namespace netCDF; + #ifndef ncbyte typedef signed char ncbyte; // from ncvalues.h #endif /* ncbyte */ @@ -35,7 +33,7 @@ typedef unsigned char uchar; //////////////////////////////////////////////////////////////////////// -static const string C_unknown_str = string("unknown"); +static const std::string C_unknown_str = std::string("unknown"); #define IS_VALID_NC(ncObj) (!ncObj.isNull()) #define IS_VALID_NC_P(ncObjPtr) ((ncObjPtr != 0 && !ncObjPtr->isNull())) @@ -86,65 +84,65 @@ static const string C_unknown_str = string("unknown"); #define OBS_BUFFER_SIZE (128 * 1024) -static const char nc_dim_nhdr[] = "nhdr"; -static const char nc_dim_nhdr_typ[] = "nhdr_typ"; -static const char nc_dim_nhdr_sid[] = "nhdr_sid"; -static const char nc_dim_nhdr_vld[] = "nhdr_vld"; -static const char nc_dim_npbhdr[] = "npbhdr"; -static const char nc_dim_nobs[] = "nobs"; -static const char nc_dim_nqty[] = "nobs_qty"; -static const char nc_dim_hdr_arr[] = "hdr_arr_len"; -static const char nc_dim_obs_arr[] = "obs_arr_len"; -static const char nc_dim_mxstr[] = "mxstr"; -static const char nc_dim_mxstr2[] = "mxstr2"; -static const char nc_dim_mxstr3[] = "mxstr3"; -static const char nc_dim_nvar[] = "obs_var_num"; -static const char nc_dim_unit[] = "unit_len"; -static const char nc_dim_desc[] = "desc_len"; -static const char nc_var_desc[] = "obs_desc"; -static const char nc_var_hdr_arr[] = "hdr_arr"; -static const char nc_var_hdr_lat[] = "hdr_lat"; -static const char nc_var_hdr_lon[] = "hdr_lon"; -static const char nc_var_hdr_elv[] = "hdr_elv"; -static const char nc_var_hdr_typ[] = "hdr_typ"; -static const char nc_var_hdr_sid[] = "hdr_sid"; -static const char nc_var_hdr_vld[] = "hdr_vld"; -static const char nc_var_hdr_prpt_typ[] = "hdr_prpt_typ"; -static const char nc_var_hdr_irpt_typ[] = "hdr_irpt_typ"; -static const char nc_var_hdr_inst_typ[] = "hdr_inst_typ"; -static const char nc_var_hdr_typ_tbl[] = "hdr_typ_table"; -static const char nc_var_hdr_sid_tbl[] = "hdr_sid_table"; -static const char nc_var_hdr_vld_tbl[] = "hdr_vld_table"; -static const char nc_var_obs_arr[] = "obs_arr"; -static const char nc_var_obs_hid[] = "obs_hid"; -static const char nc_var_obs_gc[] = "obs_gc"; -static const char nc_var_obs_vid[] = "obs_vid"; -static const char nc_var_obs_lvl[] = "obs_lvl"; -static const char nc_var_obs_hgt[] = "obs_hgt"; -static const char nc_var_obs_val[] = "obs_val"; -static const char nc_var_obs_qty[] = "obs_qty"; -static const char nc_var_obs_qty_tbl[] = "obs_qty_table"; -static const char nc_var_obs_var[] = "obs_var"; -static const char nc_var_unit[] = "obs_unit"; -static const string nc_att_use_var_id = "use_var_id"; -static const char nc_att_obs_version[] = "MET_Obs_version"; -static const char nc_att_met_point_nccf[] = "MET_point_NCCF"; - -static const string add_offset_att_name = "add_offset"; -static const string axis_att_name = "axis"; -static const string bounds_att_name = "bounds"; -static const string coordinates_att_name = "coordinates"; -static const string coordinate_axis_type_att_name = "_CoordinateAxisType"; -static const string description_att_name = "description"; -static const string fill_value_att_name = "_FillValue"; -static const string grid_mapping_att_name = "grid_mapping"; -static const string grid_mapping_name_att_name = "grid_mapping_name"; -static const string long_name_att_name = "long_name"; -static const string missing_value_att_name = "missing_value"; -static const string projection_att_name = "Projection"; -static const string scale_factor_att_name = "scale_factor"; -static const string standard_name_att_name = "standard_name"; -static const string units_att_name = "units"; +static const char nc_dim_nhdr[] = "nhdr"; +static const char nc_dim_nhdr_typ[] = "nhdr_typ"; +static const char nc_dim_nhdr_sid[] = "nhdr_sid"; +static const char nc_dim_nhdr_vld[] = "nhdr_vld"; +static const char nc_dim_npbhdr[] = "npbhdr"; +static const char nc_dim_nobs[] = "nobs"; +static const char nc_dim_nqty[] = "nobs_qty"; +static const char nc_dim_hdr_arr[] = "hdr_arr_len"; +static const char nc_dim_obs_arr[] = "obs_arr_len"; +static const char nc_dim_mxstr[] = "mxstr"; +static const char nc_dim_mxstr2[] = "mxstr2"; +static const char nc_dim_mxstr3[] = "mxstr3"; +static const char nc_dim_nvar[] = "obs_var_num"; +static const char nc_dim_unit[] = "unit_len"; +static const char nc_dim_desc[] = "desc_len"; +static const char nc_var_desc[] = "obs_desc"; +static const char nc_var_hdr_arr[] = "hdr_arr"; +static const char nc_var_hdr_lat[] = "hdr_lat"; +static const char nc_var_hdr_lon[] = "hdr_lon"; +static const char nc_var_hdr_elv[] = "hdr_elv"; +static const char nc_var_hdr_typ[] = "hdr_typ"; +static const char nc_var_hdr_sid[] = "hdr_sid"; +static const char nc_var_hdr_vld[] = "hdr_vld"; +static const char nc_var_hdr_prpt_typ[] = "hdr_prpt_typ"; +static const char nc_var_hdr_irpt_typ[] = "hdr_irpt_typ"; +static const char nc_var_hdr_inst_typ[] = "hdr_inst_typ"; +static const char nc_var_hdr_typ_tbl[] = "hdr_typ_table"; +static const char nc_var_hdr_sid_tbl[] = "hdr_sid_table"; +static const char nc_var_hdr_vld_tbl[] = "hdr_vld_table"; +static const char nc_var_obs_arr[] = "obs_arr"; +static const char nc_var_obs_hid[] = "obs_hid"; +static const char nc_var_obs_gc[] = "obs_gc"; +static const char nc_var_obs_vid[] = "obs_vid"; +static const char nc_var_obs_lvl[] = "obs_lvl"; +static const char nc_var_obs_hgt[] = "obs_hgt"; +static const char nc_var_obs_val[] = "obs_val"; +static const char nc_var_obs_qty[] = "obs_qty"; +static const char nc_var_obs_qty_tbl[] = "obs_qty_table"; +static const char nc_var_obs_var[] = "obs_var"; +static const char nc_var_unit[] = "obs_unit"; +static const std::string nc_att_use_var_id = "use_var_id"; +static const char nc_att_obs_version[] = "MET_Obs_version"; +static const char nc_att_met_point_nccf[] = "MET_point_NCCF"; + +static const std::string add_offset_att_name = "add_offset"; +static const std::string axis_att_name = "axis"; +static const std::string bounds_att_name = "bounds"; +static const std::string coordinates_att_name = "coordinates"; +static const std::string coordinate_axis_type_att_name = "_CoordinateAxisType"; +static const std::string description_att_name = "description"; +static const std::string fill_value_att_name = "_FillValue"; +static const std::string grid_mapping_att_name = "grid_mapping"; +static const std::string grid_mapping_name_att_name = "grid_mapping_name"; +static const std::string long_name_att_name = "long_name"; +static const std::string missing_value_att_name = "missing_value"; +static const std::string projection_att_name = "Projection"; +static const std::string scale_factor_att_name = "scale_factor"; +static const std::string standard_name_att_name = "standard_name"; +static const std::string units_att_name = "units"; static const char nc_time_unit_exp[] = "^[a-z|A-Z]* since [0-9]\\{1,4\\}-[0-9]\\{1,2\\}-[0-9]\\{1,2\\}"; @@ -159,206 +157,206 @@ static const int exit_code_no_obs_vars = 4; //////////////////////////////////////////////////////////////////////// -extern bool get_att_value(const NcAtt *, int &value); -extern bool get_att_value(const NcAtt *, float &value); -extern bool get_att_value(const NcAtt *, double &value); - -extern bool get_att_value_chars (const NcAtt *, ConcatString &); -extern int get_att_value_int (const NcAtt *); -extern long long get_att_value_llong (const NcAtt *); -extern double get_att_value_double (const NcAtt *); -extern void get_att_value_doubles(const NcAtt *, NumArray &); -extern float get_att_value_float (const NcAtt *); - -extern bool get_att_value_string(const NcVar *, const ConcatString &, ConcatString &); -extern int get_att_value_int (const NcVar *, const ConcatString &); -extern long long get_att_value_llong (const NcVar *, const ConcatString &); -extern double get_att_value_double(const NcVar *, const ConcatString &); - -extern bool get_att_value_string(const NcFile *, const ConcatString& , ConcatString &); -extern int get_att_value_int (const NcFile *, const ConcatString& ); -extern long long get_att_value_llong (const NcFile *, const ConcatString& ); -extern double get_att_value_double(const NcFile *, const ConcatString& ); -extern bool get_att_no_leap_year(const NcVar *); - -extern NcVarAtt *get_nc_att(const NcVar *, const ConcatString &, bool exit_on_error = false); -extern NcGroupAtt *get_nc_att(const NcFile *, const ConcatString &, bool exit_on_error = false); - -extern bool get_nc_att_value(const NcVarAtt *, string &); -extern bool get_nc_att_value(const NcVarAtt *, int &, bool exit_on_error = true); -extern bool get_nc_att_value(const NcVarAtt *, float &, bool exit_on_error = true); -extern bool get_nc_att_value(const NcVarAtt *, double &, bool exit_on_error = true); -extern bool get_nc_att_value(const NcVar *, const ConcatString &, ConcatString &, bool exit_on_error = false); -extern bool get_nc_att_value(const NcVar *, const ConcatString &, int &, bool exit_on_error = false); -extern bool get_nc_att_value(const NcVar *, const ConcatString &, float &, bool exit_on_error = false); -extern bool get_nc_att_value(const NcVar *, const ConcatString &, double &, bool exit_on_error = false); - -extern bool has_att(NcFile *, const ConcatString name, bool exit_on_error=false); -extern bool has_att(NcVar *, const ConcatString name, bool do_log=false); -extern bool has_unsigned_attribute(NcVar *); - -extern bool get_global_att(const NcGroupAtt *, ConcatString &); +extern bool get_att_value(const netCDF::NcAtt *, int &value); +extern bool get_att_value(const netCDF::NcAtt *, float &value); +extern bool get_att_value(const netCDF::NcAtt *, double &value); + +extern bool get_att_value_chars (const netCDF::NcAtt *, ConcatString &); +extern int get_att_value_int (const netCDF::NcAtt *); +extern long long get_att_value_llong (const netCDF::NcAtt *); +extern double get_att_value_double (const netCDF::NcAtt *); +extern void get_att_value_doubles(const netCDF::NcAtt *, NumArray &); +extern float get_att_value_float (const netCDF::NcAtt *); + +extern bool get_att_value_string(const netCDF::NcVar *, const ConcatString &, ConcatString &); +extern int get_att_value_int (const netCDF::NcVar *, const ConcatString &); +extern long long get_att_value_llong (const netCDF::NcVar *, const ConcatString &); +extern double get_att_value_double(const netCDF::NcVar *, const ConcatString &); + +extern bool get_att_value_string(const netCDF::NcFile *, const ConcatString& , ConcatString &); +extern int get_att_value_int (const netCDF::NcFile *, const ConcatString& ); +extern long long get_att_value_llong (const netCDF::NcFile *, const ConcatString& ); +extern double get_att_value_double(const netCDF::NcFile *, const ConcatString& ); +extern bool get_att_no_leap_year(const netCDF::NcVar *); + +extern netCDF::NcVarAtt *get_nc_att(const netCDF::NcVar *, const ConcatString &, bool exit_on_error = false); +extern netCDF::NcGroupAtt *get_nc_att(const netCDF::NcFile *, const ConcatString &, bool exit_on_error = false); + +extern bool get_nc_att_value(const netCDF::NcVarAtt *, std::string &); +extern bool get_nc_att_value(const netCDF::NcVarAtt *, int &, bool exit_on_error = true); +extern bool get_nc_att_value(const netCDF::NcVarAtt *, float &, bool exit_on_error = true); +extern bool get_nc_att_value(const netCDF::NcVarAtt *, double &, bool exit_on_error = true); +extern bool get_nc_att_value(const netCDF::NcVar *, const ConcatString &, ConcatString &, bool exit_on_error = false); +extern bool get_nc_att_value(const netCDF::NcVar *, const ConcatString &, int &, bool exit_on_error = false); +extern bool get_nc_att_value(const netCDF::NcVar *, const ConcatString &, float &, bool exit_on_error = false); +extern bool get_nc_att_value(const netCDF::NcVar *, const ConcatString &, double &, bool exit_on_error = false); + +extern bool has_att(netCDF::NcFile *, const ConcatString name, bool exit_on_error=false); +extern bool has_att(netCDF::NcVar *, const ConcatString name, bool do_log=false); +extern bool has_unsigned_attribute(netCDF::NcVar *); + +extern bool get_global_att(const netCDF::NcGroupAtt *, ConcatString &); extern bool get_global_att(const char *, const ConcatString &, bool &); extern bool get_global_att(const char *, const ConcatString &, ConcatString &); -extern bool get_global_att(const NcFile *, const ConcatString &, ConcatString &, bool error_out = false); -extern bool get_global_att(const NcFile *, const ConcatString &, int &, bool error_out = false); -extern bool get_global_att(const NcFile *, const ConcatString &, bool &, bool error_out = false); -extern bool get_global_att(const NcFile *, const ConcatString &, float &, bool error_out = false); -extern bool get_global_att(const NcFile *, const ConcatString &, double &, bool error_out = false); +extern bool get_global_att(const netCDF::NcFile *, const ConcatString &, ConcatString &, bool error_out = false); +extern bool get_global_att(const netCDF::NcFile *, const ConcatString &, int &, bool error_out = false); +extern bool get_global_att(const netCDF::NcFile *, const ConcatString &, bool &, bool error_out = false); +extern bool get_global_att(const netCDF::NcFile *, const ConcatString &, float &, bool error_out = false); +extern bool get_global_att(const netCDF::NcFile *, const ConcatString &, double &, bool error_out = false); -extern int get_version_no(const NcFile *); -extern bool is_version_less_than_1_02(const NcFile *nc); +extern int get_version_no(const netCDF::NcFile *); +extern bool is_version_less_than_1_02(const netCDF::NcFile *nc); -extern void add_att(NcFile *, const string &, const int ); -extern void add_att(NcFile *, const string &, const string); -extern void add_att(NcFile *, const string &, const char *); -extern void add_att(NcFile *, const string &, const ConcatString); -extern void add_att(NcVar *, const string &, const string); -extern void add_att(NcVar *, const string &, const int ); -extern void add_att(NcVar *, const string &, const float ); -extern void add_att(NcVar *, const string &, const double); +extern void add_att(netCDF::NcFile *, const std::string &, const int ); +extern void add_att(netCDF::NcFile *, const std::string &, const std::string); +extern void add_att(netCDF::NcFile *, const std::string &, const char *); +extern void add_att(netCDF::NcFile *, const std::string &, const ConcatString); +extern void add_att(netCDF::NcVar *, const std::string &, const std::string); +extern void add_att(netCDF::NcVar *, const std::string &, const int ); +extern void add_att(netCDF::NcVar *, const std::string &, const float ); +extern void add_att(netCDF::NcVar *, const std::string &, const double); -extern int get_var_names(NcFile *, StringArray *varNames); +extern int get_var_names(netCDF::NcFile *, StringArray *varNames); -extern bool get_var_att_float (const NcVar *, const ConcatString &, float &); -extern bool get_var_att_double(const NcVar *, const ConcatString &, double &); +extern bool get_var_att_float (const netCDF::NcVar *, const ConcatString &, float &); +extern bool get_var_att_double(const netCDF::NcVar *, const ConcatString &, double &); template -extern bool get_var_fill_value(const NcVar *var, T &att_val); -extern bool get_var_axis(const NcVar *var, ConcatString &att_val); -extern bool get_var_grid_mapping(const NcVar *var, ConcatString &att_val); -extern bool get_var_grid_mapping_name(const NcVar *var, ConcatString &att_val); -extern bool get_var_long_name(const NcVar *, ConcatString &); -extern double get_var_missing_value(const NcVar *); -extern bool get_var_standard_name(const NcVar *, ConcatString &); -extern bool get_var_units(const NcVar *, ConcatString &); +extern bool get_var_fill_value(const netCDF::NcVar *var, T &att_val); +extern bool get_var_axis(const netCDF::NcVar *var, ConcatString &att_val); +extern bool get_var_grid_mapping(const netCDF::NcVar *var, ConcatString &att_val); +extern bool get_var_grid_mapping_name(const netCDF::NcVar *var, ConcatString &att_val); +extern bool get_var_long_name(const netCDF::NcVar *, ConcatString &); +extern double get_var_missing_value(const netCDF::NcVar *); +extern bool get_var_standard_name(const netCDF::NcVar *, ConcatString &); +extern bool get_var_units(const netCDF::NcVar *, ConcatString &); extern bool args_ok(const LongArray &); -extern char get_char_val(NcFile *, const char * var_name, const int index); -extern char get_char_val(NcVar *var, const int index); +extern char get_char_val(netCDF::NcFile *, const char * var_name, const int index); +extern char get_char_val(netCDF::NcVar *var, const int index); -extern int get_int_var(NcFile *, const char * var_name, const int index); -extern int get_int_var(NcVar *, const int index); +extern int get_int_var(netCDF::NcFile *, const char * var_name, const int index); +extern int get_int_var(netCDF::NcVar *, const int index); -extern double get_nc_time(NcVar *, int index = 0); +extern double get_nc_time(netCDF::NcVar *, int index = 0); -extern float get_float_var(NcFile *, const char * var_name, const int index = 0); -extern float get_float_var(NcVar *, int const index = 0); +extern float get_float_var(netCDF::NcFile *, const char * var_name, const int index = 0); +extern float get_float_var(netCDF::NcVar *, int const index = 0); -extern ConcatString* get_string_val(NcFile *, const char * var_name, const int index, +extern ConcatString* get_string_val(netCDF::NcFile *, const char * var_name, const int index, const int len, ConcatString &tmp_cs); -extern ConcatString* get_string_val(NcVar *var, const int index, const int len, ConcatString &tmp_cs); - -extern bool get_nc_data(NcVar *, int *data); -extern bool get_nc_data(NcVar *, char *data); -extern bool get_nc_data(NcVar *, uchar *data); -extern bool get_nc_data(NcVar *, float *data); -extern bool get_nc_data(NcVar *, double *data); -extern bool get_nc_data(NcVar *, time_t *data); -extern bool get_nc_data(NcVar *, ncbyte *data); -extern bool get_nc_data(NcVar *, unsigned short *data); - -extern bool get_nc_data(NcVar *, int *data, const long *curs); -extern bool get_nc_data(NcVar *, char *data, const long *curs); -extern bool get_nc_data(NcVar *, short *data, const long *curs); -extern bool get_nc_data(NcVar *, float *data, const long *curs); -extern bool get_nc_data(NcVar *, double *data, const long *curs); - -extern bool get_nc_data(NcVar *, int *data, const long dim, const long cur=0); -extern bool get_nc_data(NcVar *, char *data, const long dim, const long cur=0); -extern bool get_nc_data(NcVar *, float *data, const long dim, const long cur=0); -extern bool get_nc_data(NcVar *, double *data, const long dim, const long cur=0); -extern bool get_nc_data(NcVar *, ncbyte *data, const long dim, const long cur=0); - -extern bool get_nc_data(NcVar *, int *data, const long *dims, const long *curs); -extern bool get_nc_data(NcVar *, char *data, const long *dims, const long *curs); -extern bool get_nc_data(NcVar *, short *data, const long *dims, const long *curs); -extern bool get_nc_data(NcVar *, float *data, const long *dims, const long *curs); -extern bool get_nc_data(NcVar *, double *data, const long *dims, const long *curs); -extern bool get_nc_data(NcVar *, ncbyte *data, const long *dims, const long *curs); - -extern bool get_nc_data_to_array(NcVar *, StringArray *); -extern bool get_nc_data_to_array(NcFile *, const char *, StringArray *); -extern int get_nc_string_length(NcVar *); -extern int get_nc_string_length(NcFile *, NcVar, const char *var_name); - -extern bool put_nc_data(NcVar *, const int *data ); -extern bool put_nc_data(NcVar *, const char *data ); -extern bool put_nc_data(NcVar *, const float *data ); -extern bool put_nc_data(NcVar *, const double *data ); -extern bool put_nc_data(NcVar *, const ncbyte *data ); - -extern bool put_nc_data(NcVar *, const int data, const long offset0=0, const long offset1=-1, const long c2=-1); -extern bool put_nc_data(NcVar *, const char data, const long offset0=0, const long offset1=-1, const long c2=-1); -extern bool put_nc_data(NcVar *, const float data, const long offset0=0, const long offset1=-1, const long c2=-1); -extern bool put_nc_data(NcVar *, const double data, const long offset0=0, const long offset1=-1, const long c2=-1); -extern bool put_nc_data(NcVar *, const ncbyte data, const long offset0=0, const long offset1=-1, const long c2=-1); - -extern bool put_nc_data(NcVar *, const int *data, const long length, const long offset); -extern bool put_nc_data(NcVar *, const char *data, const long length, const long offset); -extern bool put_nc_data(NcVar *, const float *data, const long length, const long offset); -extern bool put_nc_data(NcVar *, const double *data, const long length, const long offset); -extern bool put_nc_data(NcVar *, const ncbyte *data, const long length, const long offset); -extern bool put_nc_data(NcVar *, const int *data, const long *lengths, const long *offsets); -extern bool put_nc_data(NcVar *, const char *data, const long *lengths, const long *offsets); -extern bool put_nc_data(NcVar *, const float *data, const long *lengths, const long *offsets); - -extern bool put_nc_data_with_dims(NcVar *, const int *data, const int len0, +extern ConcatString* get_string_val(netCDF::NcVar *var, const int index, const int len, ConcatString &tmp_cs); + +extern bool get_nc_data(netCDF::NcVar *, int *data); +extern bool get_nc_data(netCDF::NcVar *, char *data); +extern bool get_nc_data(netCDF::NcVar *, uchar *data); +extern bool get_nc_data(netCDF::NcVar *, float *data); +extern bool get_nc_data(netCDF::NcVar *, double *data); +extern bool get_nc_data(netCDF::NcVar *, time_t *data); +extern bool get_nc_data(netCDF::NcVar *, ncbyte *data); +extern bool get_nc_data(netCDF::NcVar *, unsigned short *data); + +extern bool get_nc_data(netCDF::NcVar *, int *data, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, char *data, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, short *data, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, float *data, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, double *data, const long *curs); + +extern bool get_nc_data(netCDF::NcVar *, int *data, const long dim, const long cur=0); +extern bool get_nc_data(netCDF::NcVar *, char *data, const long dim, const long cur=0); +extern bool get_nc_data(netCDF::NcVar *, float *data, const long dim, const long cur=0); +extern bool get_nc_data(netCDF::NcVar *, double *data, const long dim, const long cur=0); +extern bool get_nc_data(netCDF::NcVar *, ncbyte *data, const long dim, const long cur=0); + +extern bool get_nc_data(netCDF::NcVar *, int *data, const long *dims, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, char *data, const long *dims, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, short *data, const long *dims, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, float *data, const long *dims, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, double *data, const long *dims, const long *curs); +extern bool get_nc_data(netCDF::NcVar *, ncbyte *data, const long *dims, const long *curs); + +extern bool get_nc_data_to_array(netCDF::NcVar *, StringArray *); +extern bool get_nc_data_to_array(netCDF::NcFile *, const char *, StringArray *); +extern int get_nc_string_length(netCDF::NcVar *); +extern int get_nc_string_length(netCDF::NcFile *, netCDF::NcVar, const char *var_name); + +extern bool put_nc_data(netCDF::NcVar *, const int *data ); +extern bool put_nc_data(netCDF::NcVar *, const char *data ); +extern bool put_nc_data(netCDF::NcVar *, const float *data ); +extern bool put_nc_data(netCDF::NcVar *, const double *data ); +extern bool put_nc_data(netCDF::NcVar *, const ncbyte *data ); + +extern bool put_nc_data(netCDF::NcVar *, const int data, const long offset0=0, const long offset1=-1, const long c2=-1); +extern bool put_nc_data(netCDF::NcVar *, const char data, const long offset0=0, const long offset1=-1, const long c2=-1); +extern bool put_nc_data(netCDF::NcVar *, const float data, const long offset0=0, const long offset1=-1, const long c2=-1); +extern bool put_nc_data(netCDF::NcVar *, const double data, const long offset0=0, const long offset1=-1, const long c2=-1); +extern bool put_nc_data(netCDF::NcVar *, const ncbyte data, const long offset0=0, const long offset1=-1, const long c2=-1); + +extern bool put_nc_data(netCDF::NcVar *, const int *data, const long length, const long offset); +extern bool put_nc_data(netCDF::NcVar *, const char *data, const long length, const long offset); +extern bool put_nc_data(netCDF::NcVar *, const float *data, const long length, const long offset); +extern bool put_nc_data(netCDF::NcVar *, const double *data, const long length, const long offset); +extern bool put_nc_data(netCDF::NcVar *, const ncbyte *data, const long length, const long offset); +extern bool put_nc_data(netCDF::NcVar *, const int *data, const long *lengths, const long *offsets); +extern bool put_nc_data(netCDF::NcVar *, const char *data, const long *lengths, const long *offsets); +extern bool put_nc_data(netCDF::NcVar *, const float *data, const long *lengths, const long *offsets); + +extern bool put_nc_data_with_dims(netCDF::NcVar *, const int *data, const int len0, const int len1=0, const int len2=0); -extern bool put_nc_data_with_dims(NcVar *, const int *data, const long len0, +extern bool put_nc_data_with_dims(netCDF::NcVar *, const int *data, const long len0, const long len1=0, const long len2=0); -extern bool put_nc_data_with_dims(NcVar *, const float *data, const int len0, +extern bool put_nc_data_with_dims(netCDF::NcVar *, const float *data, const int len0, const int len1=0, const int len2=0); -extern bool put_nc_data_with_dims(NcVar *, const float *data, const long len0, +extern bool put_nc_data_with_dims(netCDF::NcVar *, const float *data, const long len0, const long len1=0, const long len2=0); -extern bool put_nc_data_with_dims(NcVar *, const double *data, const int len0, +extern bool put_nc_data_with_dims(netCDF::NcVar *, const double *data, const int len0, const int len1=0, const int len2=0); -extern bool put_nc_data_with_dims(NcVar *, const double *data, const long len0, +extern bool put_nc_data_with_dims(netCDF::NcVar *, const double *data, const long len0, const long len1=0, const long len2=0); -extern NcVar get_var(NcFile *, const char * var_name); // exit if not exists -extern NcVar get_nc_var(NcFile *, const char * var_name, bool log_as_error=false); // continue even though not exists - -extern NcVar *copy_nc_var(NcFile *, NcVar *, const int deflate_level=DEF_DEFLATE_LEVEL, const bool all_attrs=true); -extern void copy_nc_att(NcFile *, NcVar *, const ConcatString attr_name); -extern void copy_nc_att( NcVar *, NcVar *, const ConcatString attr_name); -extern void copy_nc_atts(NcFile *, NcFile *, const bool all_attrs=true); -extern void copy_nc_atts( NcVar *, NcVar *, const bool all_attrs=true); -extern void copy_nc_var_data(NcVar *, NcVar *); - -extern bool has_var(NcFile *, const char * var_name); - -extern NcVar add_var(NcFile *, const string &, const NcType, const int deflate_level=DEF_DEFLATE_LEVEL); -extern NcVar add_var(NcFile *, const string &, const NcType, const NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); -extern NcVar add_var(NcFile *, const string &, const NcType, const NcDim, const NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); -extern NcVar add_var(NcFile *, const string &, const NcType, const NcDim, const NcDim, const NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); -extern NcVar add_var(NcFile *, const string &, const NcType, const NcDim, const NcDim, const NcDim, const NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); -extern NcVar add_var(NcFile *, const string &, const NcType, const vector, const int deflate_level=DEF_DEFLATE_LEVEL); - -extern NcDim add_dim(NcFile *, const string &); -extern NcDim add_dim(NcFile *, const string &, const size_t); -extern bool has_dim(NcFile *, const char *dim_name); -extern bool get_dim(const NcFile *, const ConcatString &, int &, bool error_out = false); -extern int get_dim_count(const NcVar *); -extern int get_dim_count(const NcFile *); -extern int get_dim_size(const NcDim *); -extern int get_dim_size(const NcVar *, const int dim_offset); -extern int get_dim_value(const NcFile *, const string &, const bool error_out = false); -extern NcDim get_nc_dim(const NcFile *, const string &dim_name); -extern NcDim get_nc_dim(const NcVar *, const string &dim_name); -extern NcDim get_nc_dim(const NcVar *, const int dim_offset); -extern bool get_dim_names(const NcVar *var, StringArray *dimNames); -extern bool get_dim_names(const NcFile *nc, StringArray *dimNames); - -extern NcVar get_nc_var_lat(const NcFile *nc); -extern NcVar get_nc_var_lon(const NcFile *nc); -extern NcVar get_nc_var_time(const NcFile *nc); -extern int get_index_at_nc_data(NcVar *var, double value, const string dim_name, bool is_time=false); -extern NcFile* open_ncfile(const char * nc_name, bool write = false); - -extern int get_data_size(NcVar *); -extern unixtime get_reference_unixtime(NcVar *time_var, int &sec_per_unit, +extern netCDF::NcVar get_var(netCDF::NcFile *, const char * var_name); // exit if not exists +extern netCDF::NcVar get_nc_var(netCDF::NcFile *, const char * var_name, bool log_as_error=false); // continue even though not exists + +extern netCDF::NcVar *copy_nc_var(netCDF::NcFile *, netCDF::NcVar *, const int deflate_level=DEF_DEFLATE_LEVEL, const bool all_attrs=true); +extern void copy_nc_att(netCDF::NcFile *, netCDF::NcVar *, const ConcatString attr_name); +extern void copy_nc_att( netCDF::NcVar *, netCDF::NcVar *, const ConcatString attr_name); +extern void copy_nc_atts(netCDF::NcFile *, netCDF::NcFile *, const bool all_attrs=true); +extern void copy_nc_atts( netCDF::NcVar *, netCDF::NcVar *, const bool all_attrs=true); +extern void copy_nc_var_data(netCDF::NcVar *, netCDF::NcVar *); + +extern bool has_var(netCDF::NcFile *, const char * var_name); + +extern netCDF::NcVar add_var(netCDF::NcFile *, const std::string &, const netCDF::NcType, const int deflate_level=DEF_DEFLATE_LEVEL); +extern netCDF::NcVar add_var(netCDF::NcFile *, const std::string &, const netCDF::NcType, const netCDF::NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); +extern netCDF::NcVar add_var(netCDF::NcFile *, const std::string &, const netCDF::NcType, const netCDF::NcDim, const netCDF::NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); +extern netCDF::NcVar add_var(netCDF::NcFile *, const std::string &, const netCDF::NcType, const netCDF::NcDim, const netCDF::NcDim, const netCDF::NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); +extern netCDF::NcVar add_var(netCDF::NcFile *, const std::string &, const netCDF::NcType, const netCDF::NcDim, const netCDF::NcDim, const netCDF::NcDim, const netCDF::NcDim, const int deflate_level=DEF_DEFLATE_LEVEL); +extern netCDF::NcVar add_var(netCDF::NcFile *, const std::string &, const netCDF::NcType, const std::vector, const int deflate_level=DEF_DEFLATE_LEVEL); + +extern netCDF::NcDim add_dim(netCDF::NcFile *, const std::string &); +extern netCDF::NcDim add_dim(netCDF::NcFile *, const std::string &, const size_t); +extern bool has_dim(netCDF::NcFile *, const char *dim_name); +extern bool get_dim(const netCDF::NcFile *, const ConcatString &, int &, bool error_out = false); +extern int get_dim_count(const netCDF::NcVar *); +extern int get_dim_count(const netCDF::NcFile *); +extern int get_dim_size(const netCDF::NcDim *); +extern int get_dim_size(const netCDF::NcVar *, const int dim_offset); +extern int get_dim_value(const netCDF::NcFile *, const std::string &, const bool error_out = false); +extern netCDF::NcDim get_nc_dim(const netCDF::NcFile *, const std::string &dim_name); +extern netCDF::NcDim get_nc_dim(const netCDF::NcVar *, const std::string &dim_name); +extern netCDF::NcDim get_nc_dim(const netCDF::NcVar *, const int dim_offset); +extern bool get_dim_names(const netCDF::NcVar *var, StringArray *dimNames); +extern bool get_dim_names(const netCDF::NcFile *nc, StringArray *dimNames); + +extern netCDF::NcVar get_nc_var_lat(const netCDF::NcFile *nc); +extern netCDF::NcVar get_nc_var_lon(const netCDF::NcFile *nc); +extern netCDF::NcVar get_nc_var_time(const netCDF::NcFile *nc); +extern int get_index_at_nc_data(netCDF::NcVar *var, double value, const std::string dim_name, bool is_time=false); +extern netCDF::NcFile* open_ncfile(const char * nc_name, bool write = false); + +extern int get_data_size(netCDF::NcVar *); +extern unixtime get_reference_unixtime(netCDF::NcVar *time_var, int &sec_per_unit, bool &no_leap_year); extern bool is_nc_unit_time(const char *units); diff --git a/src/libcode/vx_nc_util/nc_utils.hpp b/src/libcode/vx_nc_util/nc_utils.hpp index f66b665a29..ceb5bd2807 100644 --- a/src/libcode/vx_nc_util/nc_utils.hpp +++ b/src/libcode/vx_nc_util/nc_utils.hpp @@ -13,21 +13,21 @@ //////////////////////////////////////////////////////////////////////// -extern bool get_att_value(const NcAtt *att, int &att_val); -extern bool get_att_value(const NcAtt *att, ConcatString &value); -extern bool get_att_value(const NcAtt *att, ncbyte &att_val); -extern bool get_att_value(const NcAtt *att, short &att_val); -extern bool get_att_value(const NcAtt *att, int &att_val); -extern bool get_att_value(const NcAtt *att, unsigned int &att_val); -extern bool get_att_value(const NcAtt *att, float &att_val); -extern bool get_att_value(const NcAtt *att, double &att_val); -extern ConcatString get_log_msg_for_att(const NcVarAtt *att); -extern ConcatString get_log_msg_for_att(const NcVarAtt *att, string var_name, +extern bool get_att_value(const netCDF::NcAtt *att, int &att_val); +extern bool get_att_value(const netCDF::NcAtt *att, ConcatString &value); +extern bool get_att_value(const netCDF::NcAtt *att, ncbyte &att_val); +extern bool get_att_value(const netCDF::NcAtt *att, short &att_val); +extern bool get_att_value(const netCDF::NcAtt *att, int &att_val); +extern bool get_att_value(const netCDF::NcAtt *att, unsigned int &att_val); +extern bool get_att_value(const netCDF::NcAtt *att, float &att_val); +extern bool get_att_value(const netCDF::NcAtt *att, double &att_val); +extern ConcatString get_log_msg_for_att(const netCDF::NcVarAtt *att); +extern ConcatString get_log_msg_for_att(const netCDF::NcVarAtt *att, std::string var_name, const ConcatString att_name); -extern double get_var_add_offset(const NcVar *var); -extern double get_var_scale_factor(const NcVar *var); -extern bool has_add_offset_attr(NcVar *var); -extern bool has_scale_factor_attr(NcVar *var); +extern double get_var_add_offset(const netCDF::NcVar *var); +extern double get_var_scale_factor(const netCDF::NcVar *var); +extern bool has_add_offset_attr(netCDF::NcVar *var); +extern bool has_scale_factor_attr(netCDF::NcVar *var); extern void set_def_fill_value(ncbyte *val); extern void set_def_fill_value(char *val); extern void set_def_fill_value(double *val); @@ -45,7 +45,7 @@ extern void set_def_fill_value(unsigned short *val); //////////////////////////////////////////////////////////////////////// template -bool get_att_num_value_(const NcAtt *att, T &att_val, int matching_type) { +bool get_att_num_value_(const netCDF::NcAtt *att, T &att_val, int matching_type) { bool status = false; if (IS_VALID_NC_P(att)) { int nc_type_id = GET_NC_TYPE_ID_P(att); @@ -54,7 +54,7 @@ bool get_att_num_value_(const NcAtt *att, T &att_val, int matching_type) { status = true; } else if (NC_CHAR == nc_type_id) { - string att_value; + std::string att_value; att->getValues(att_value); if (matching_type == NC_FLOAT) att_val = atof(att_value.c_str()); @@ -71,7 +71,7 @@ bool get_att_num_value_(const NcAtt *att, T &att_val, int matching_type) { //////////////////////////////////////////////////////////////////////// template -bool get_nc_att_value_(const NcVar *var, const ConcatString &att_name, +bool get_nc_att_value_(const netCDF::NcVar *var, const ConcatString &att_name, T &att_val, bool exit_on_error, T bad_data, const char *caller_name) { bool status = false; @@ -82,8 +82,8 @@ bool get_nc_att_value_(const NcVar *var, const ConcatString &att_name, // // Retrieve the NetCDF variable attribute. // - NcVarAtt *att = get_nc_att(var, att_name); - status = get_att_value((NcAtt *)att, att_val); + netCDF::NcVarAtt *att = get_nc_att(var, att_name); + status = get_att_value((netCDF::NcAtt *)att, att_val); if (!status) { mlog << Error << "\n" << caller_name << get_log_msg_for_att(att, GET_SAFE_NC_NAME_P(var), att_name); @@ -100,7 +100,7 @@ bool get_nc_att_value_(const NcVar *var, const ConcatString &att_name, //////////////////////////////////////////////////////////////////////// template -bool get_nc_att_value_(const NcVarAtt *att, T &att_val, bool exit_on_error, +bool get_nc_att_value_(const netCDF::NcVarAtt *att, T &att_val, bool exit_on_error, T bad_data, const char *caller_name) { bool status = true; @@ -110,7 +110,7 @@ bool get_nc_att_value_(const NcVarAtt *att, T &att_val, bool exit_on_error, // // Retrieve the NetCDF variable attribute. // - status = get_att_value((NcAtt *)att, att_val); + status = get_att_value((netCDF::NcAtt *)att, att_val); if (!status) { mlog << Error << "\n" << caller_name << get_log_msg_for_att(att); @@ -123,16 +123,16 @@ bool get_nc_att_value_(const NcVarAtt *att, T &att_val, bool exit_on_error, //////////////////////////////////////////////////////////////////////// template -bool get_global_att_value_(const NcFile *nc, const ConcatString& att_name, +bool get_global_att_value_(const netCDF::NcFile *nc, const ConcatString& att_name, T &att_val, T bad_data, bool error_out, const char *caller_name) { bool status = false; // Initialize att_val = bad_data; - NcGroupAtt *nc_att = get_nc_att(nc, att_name); + netCDF::NcGroupAtt *nc_att = get_nc_att(nc, att_name); if (IS_VALID_NC_P(nc_att)) { - status = get_att_value((NcAtt *)nc_att, att_val); - string data_type = GET_NC_TYPE_NAME_P(nc_att); + status = get_att_value((netCDF::NcAtt *)nc_att, att_val); + std::string data_type = GET_NC_TYPE_NAME_P(nc_att); if (error_out && !status) { mlog << Error << caller_name << "The data type \"" << data_type @@ -154,14 +154,14 @@ bool get_global_att_value_(const NcFile *nc, const ConcatString& att_name, //////////////////////////////////////////////////////////////////////// template -bool get_var_att_num_(const NcVar *var, const ConcatString &att_name, +bool get_var_att_num_(const netCDF::NcVar *var, const ConcatString &att_name, T &att_val, T bad_data) { bool status = false; // Initialize att_val = bad_data; - NcVarAtt *att = get_nc_att(var, att_name); + netCDF::NcVarAtt *att = get_nc_att(var, att_name); // Look for a match if (IS_VALID_NC_P(att)) { att->getValues(&att_val); @@ -175,10 +175,10 @@ bool get_var_att_num_(const NcVar *var, const ConcatString &att_name, //////////////////////////////////////////////////////////////////////// template -bool get_var_fill_value(const NcVar *var, T &att_val) { +bool get_var_fill_value(const netCDF::NcVar *var, T &att_val) { bool found = false; - NcVarAtt *att = get_nc_att(var, fill_value_att_name); + netCDF::NcVarAtt *att = get_nc_att(var, fill_value_att_name); if (IS_INVALID_NC_P(att)) { if (att) delete att; att = get_nc_att(var, missing_value_att_name); @@ -258,7 +258,7 @@ void apply_scale_factor_(T *data, const int cell_count, // - template _ reads data and applies scale_factor and add_offset. template -bool get_nc_data_t(NcVar *var, T *data) { +bool get_nc_data_t(netCDF::NcVar *var, T *data) { bool return_status = false; if (IS_VALID_NC_P(var)) { @@ -272,7 +272,7 @@ bool get_nc_data_t(NcVar *var, T *data) { //////////////////////////////////////////////////////////////////////// template -bool get_nc_data_(NcVar *var, T *data, const T met_missing) { +bool get_nc_data_(netCDF::NcVar *var, T *data, const T met_missing) { //const char *method_name = "get_nc_data_() "; int data_size = get_data_size(var); @@ -302,7 +302,7 @@ bool get_nc_data_(NcVar *var, T *data, const T met_missing) { //////////////////////////////////////////////////////////////////////// template -bool get_nc_data_(NcVar *var, T *data, T bad_data, const long *dims, const long *curs) { +bool get_nc_data_(netCDF::NcVar *var, T *data, T bad_data, const long *dims, const long *curs) { bool return_status = false; const char *method_name = "get_nc_data_(T, *dims, *curs) "; @@ -315,7 +315,7 @@ bool get_nc_data_(NcVar *var, T *data, T bad_data, const long *dims, const long for (int idx = 0 ; idx < dimC; idx++) { int dim_size = get_dim_size(var, idx); if ((curs[idx]+dims[idx]) > dim_size) { - NcDim nc_dim = get_nc_dim(var, idx); + netCDF::NcDim nc_dim = get_nc_dim(var, idx); mlog << Error << "\n" << method_name << "The start offset and count (" << curs[idx] << ", " << dims[idx] << ") exceeds the dimension[" << idx << "] " << dim_size << " " @@ -358,7 +358,7 @@ bool get_nc_data_(NcVar *var, T *data, T bad_data, const long *dims, const long //////////////////////////////////////////////////////////////////////// template -bool get_nc_data_(NcVar *var, T *data, T met_missing, const long dim, const long cur) { +bool get_nc_data_(netCDF::NcVar *var, T *data, T met_missing, const long dim, const long cur) { bool return_status = false; const char *method_name = "get_nc_data_(T, dim, cur) "; for (int idx=0; idx dim_size) && (0 < dim_size)) { - NcDim nc_dim = get_nc_dim(var, dim_idx); + netCDF::NcDim nc_dim = get_nc_dim(var, dim_idx); mlog << Error << "\n" << method_name << "The start offset and count (" << cur << " + " << dim << ") exceeds the dimension " << dim_size << " " << (IS_VALID_NC(nc_dim) ? GET_NC_NAME(nc_dim) : " ") @@ -415,7 +415,7 @@ bool get_nc_data_(NcVar *var, T *data, T met_missing, const long dim, const long // read a single data template -bool get_nc_data_(NcVar *var, T *data, T bad_data, const long *curs) { +bool get_nc_data_(netCDF::NcVar *var, T *data, T bad_data, const long *curs) { bool return_status = false; const char *method_name = "get_nc_data_(*curs) "; @@ -436,7 +436,7 @@ bool get_nc_data_(NcVar *var, T *data, T bad_data, const long *curs) { //////////////////////////////////////////////////////////////////////// template -void copy_nc_data_t(NcVar *var, float *data, const T *packed_data, +void copy_nc_data_t(netCDF::NcVar *var, float *data, const T *packed_data, const int cell_count, const char *data_type, double add_offset, double scale_factor, bool has_missing, T missing_value) { @@ -525,7 +525,7 @@ void copy_nc_data_t(NcVar *var, float *data, const T *packed_data, //////////////////////////////////////////////////////////////////////// template -void copy_nc_data_(NcVar *var, float *data, const T *packed_data, +void copy_nc_data_(netCDF::NcVar *var, float *data, const T *packed_data, const int cell_count, const char *data_type, double add_offset, double scale_factor) { T missing_value; @@ -538,7 +538,7 @@ void copy_nc_data_(NcVar *var, float *data, const T *packed_data, //////////////////////////////////////////////////////////////////////// template -void copy_nc_data_t(NcVar *var, double *data, const T *packed_data, +void copy_nc_data_t(netCDF::NcVar *var, double *data, const T *packed_data, const int cell_count, const char *data_type, double add_offset, double scale_factor, bool has_missing, T missing_value) { @@ -622,7 +622,7 @@ void copy_nc_data_t(NcVar *var, double *data, const T *packed_data, //////////////////////////////////////////////////////////////////////// template -void copy_nc_data_(NcVar *var, double *data, const T *packed_data, +void copy_nc_data_(netCDF::NcVar *var, double *data, const T *packed_data, const int cell_count, const char *data_type, double add_offset, double scale_factor) { T missing_value; @@ -635,8 +635,8 @@ void copy_nc_data_(NcVar *var, double *data, const T *packed_data, //////////////////////////////////////////////////////////////////////// template -bool put_nc_data_T(NcVar *var, const T data, long offset0, long offset1, long offset2) { - vector offsets; +bool put_nc_data_T(netCDF::NcVar *var, const T data, long offset0, long offset1, long offset2) { + std::vector offsets; offsets.push_back((size_t)offset0); if (0 <= offset1) { offsets.push_back((size_t)offset1); @@ -651,8 +651,8 @@ bool put_nc_data_T(NcVar *var, const T data, long offset0, long offset1, long of //////////////////////////////////////////////////////////////////////// template -bool put_nc_data_T(NcVar *var, const T *data, const long length, const long offset) { - vector offsets, counts; +bool put_nc_data_T(netCDF::NcVar *var, const T *data, const long length, const long offset) { + std::vector offsets, counts; int dim_count = get_dim_count(var); offsets.push_back(offset); if (dim_count >= 2) { @@ -667,9 +667,9 @@ bool put_nc_data_T(NcVar *var, const T *data, const long length, const long o //////////////////////////////////////////////////////////////////////// template -bool put_nc_data_T(NcVar *var, const T *data , const long *lengths, const long *offsets) { +bool put_nc_data_T(netCDF::NcVar *var, const T *data , const long *lengths, const long *offsets) { int dim = get_dim_count(var); - vector nc_offsets, counts; + std::vector nc_offsets, counts; for (int idx = 0 ; idx < dim; idx++) { nc_offsets.push_back(offsets[idx]); } @@ -683,9 +683,9 @@ bool put_nc_data_T(NcVar *var, const T *data , const long *lengths, const long * //////////////////////////////////////////////////////////////////////// template -bool put_nc_data_T_with_dims(NcVar *var, const T *data, +bool put_nc_data_T_with_dims(netCDF::NcVar *var, const T *data, const long len0, const long len1, const long len2) { - vector offsets, counts; + std::vector offsets, counts; if (0 < len0) { offsets.push_back(0); counts.push_back(len0); diff --git a/src/libcode/vx_nc_util/nc_var_info.cc b/src/libcode/vx_nc_util/nc_var_info.cc index 4c3e9173cd..1764eb9bce 100644 --- a/src/libcode/vx_nc_util/nc_var_info.cc +++ b/src/libcode/vx_nc_util/nc_var_info.cc @@ -12,6 +12,9 @@ using namespace std; +#include +using namespace netCDF; + #include #include #include diff --git a/src/libcode/vx_nc_util/nc_var_info.h b/src/libcode/vx_nc_util/nc_var_info.h index 3a8e6b3681..ab01c5869b 100644 --- a/src/libcode/vx_nc_util/nc_var_info.h +++ b/src/libcode/vx_nc_util/nc_var_info.h @@ -22,20 +22,19 @@ #include -using namespace netCDF; #include "vx_util.h" //////////////////////////////////////////////////////////////////////// -static const string accum_time_att_name = "accum_time"; -static const string accum_time_sec_att_name = "accum_time_sec"; -static const string init_time_att_name = "init_time"; -static const string init_time_ut_att_name = "init_time_ut"; -static const string level_att_name = "level"; -static const string name_att_name = "name"; -static const string valid_time_att_name = "valid_time"; -static const string valid_time_ut_att_name = "valid_time_ut"; +static const std::string accum_time_att_name = "accum_time"; +static const std::string accum_time_sec_att_name = "accum_time_sec"; +static const std::string init_time_att_name = "init_time"; +static const std::string init_time_ut_att_name = "init_time_ut"; +static const std::string level_att_name = "level"; +static const std::string name_att_name = "name"; +static const std::string valid_time_att_name = "valid_time"; +static const std::string valid_time_ut_att_name = "valid_time_ut"; //////////////////////////////////////////////////////////////////////// @@ -57,10 +56,10 @@ class NcVarInfo { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; - NcVar * var; // not allocated + netCDF::NcVar * var; // not allocated ConcatString name; @@ -82,7 +81,7 @@ class NcVarInfo { int Ndims; - NcDim ** Dims; // allocated + netCDF::NcDim ** Dims; // allocated int x_slot; // starting from zero int y_slot; // @@ -102,14 +101,14 @@ extern bool get_att_level(const NcVarInfo &, ConcatString &); extern bool get_att_name(const NcVarInfo &, ConcatString &); // unixtimes could be ints or strings -extern bool get_att_unixtime(const NcVar *, const ConcatString, unixtime &); +extern bool get_att_unixtime(const netCDF::NcVar *, const ConcatString, unixtime &); extern bool get_att_unixtime(const NcVarInfo &, const ConcatString, unixtime &); -extern unixtime get_att_value_unixtime(const NcAtt *); +extern unixtime get_att_value_unixtime(const netCDF::NcAtt *); -extern unixtime get_att_value_unixtime(const NcAtt *); +extern unixtime get_att_value_unixtime(const netCDF::NcAtt *); -extern NcVarInfo* find_var_info_by_dim_name(NcVarInfo *vars, const string dim_name, +extern NcVarInfo* find_var_info_by_dim_name(NcVarInfo *vars, const std::string dim_name, const int nvars); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_nc_util/write_netcdf.cc b/src/libcode/vx_nc_util/write_netcdf.cc index 798c155032..7d5e037007 100644 --- a/src/libcode/vx_nc_util/write_netcdf.cc +++ b/src/libcode/vx_nc_util/write_netcdf.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_log.h" #include "vx_cal.h" #include "vx_util.h" @@ -160,7 +163,7 @@ void write_netcdf_latlon_2d(NcFile *f_out, NcDim *lat_dim, NcDim *lon_dim, NcVar lat_var, lon_var; float *lat_data = (float *) 0; float *lon_data = (float *) 0; - std::vector dims; + vector dims; long counts[2] = {grid.ny(), grid.nx()}; long offsets[2] = {0 , 0}; @@ -216,8 +219,8 @@ void write_netcdf_grid_weight(NcFile *f_out, NcDim *lat_dim, NcDim *lon_dim, //NcVar *wgt_var = (NcVar *) 0; NcVar wgt_var ; float *wgt_data = (float *) 0; - std::vector dims; - std::vector count; + vector dims; + vector count; // Define Variables dims.push_back(*lat_dim); diff --git a/src/libcode/vx_nc_util/write_netcdf.h b/src/libcode/vx_nc_util/write_netcdf.h index 79f76e044c..3b5e1339e9 100644 --- a/src/libcode/vx_nc_util/write_netcdf.h +++ b/src/libcode/vx_nc_util/write_netcdf.h @@ -14,7 +14,6 @@ //////////////////////////////////////////////////////////////////////// #include -using namespace netCDF; #include "vx_grid.h" #include "vx_config.h" @@ -27,15 +26,15 @@ static const float FILL_VALUE = -9999.f; //////////////////////////////////////////////////////////////////////// -extern void write_netcdf_global (NcFile *, const char *, const char *, +extern void write_netcdf_global (netCDF::NcFile *, const char *, const char *, const char *model_name = (const char *) 0, const char *obtype = (const char *) 0, const char *desc = (const char *) 0); -extern void write_netcdf_proj (NcFile *, const Grid &, NcDim &, NcDim &); -extern void write_netcdf_latlon (NcFile *, NcDim *, NcDim *, const Grid &); -extern void write_netcdf_grid_weight(NcFile *, NcDim *, NcDim *, const GridWeightType, const DataPlane &); -extern void write_netcdf_var_times (NcVar *, const DataPlane &); -extern void write_netcdf_var_times (NcVar *, const unixtime, const unixtime, const int); +extern void write_netcdf_proj (netCDF::NcFile *, const Grid &, netCDF::NcDim &, netCDF::NcDim &); +extern void write_netcdf_latlon (netCDF::NcFile *, netCDF::NcDim *, netCDF::NcDim *, const Grid &); +extern void write_netcdf_grid_weight(netCDF::NcFile *, netCDF::NcDim *, netCDF::NcDim *, const GridWeightType, const DataPlane &); +extern void write_netcdf_var_times (netCDF::NcVar *, const DataPlane &); +extern void write_netcdf_var_times (netCDF::NcVar *, const unixtime, const unixtime, const int); diff --git a/src/libcode/vx_plot_util/map_region.h b/src/libcode/vx_plot_util/map_region.h index b228642231..94b6d36b6a 100644 --- a/src/libcode/vx_plot_util/map_region.h +++ b/src/libcode/vx_plot_util/map_region.h @@ -64,7 +64,7 @@ class MapRegion { //////////////////////////////////////////////////////////////////////// -extern bool operator>>(istream &, MapRegion &); +extern bool operator>>(std::istream &, MapRegion &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_ps/ps_text.h b/src/libcode/vx_ps/ps_text.h index 905fb11046..cf92607792 100644 --- a/src/libcode/vx_ps/ps_text.h +++ b/src/libcode/vx_ps/ps_text.h @@ -73,7 +73,7 @@ class VxpsTextNode { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void set_font_number(int); diff --git a/src/libcode/vx_ps/vx_ps.h b/src/libcode/vx_ps/vx_ps.h index 3cfeec731e..26ed654a26 100644 --- a/src/libcode/vx_ps/vx_ps.h +++ b/src/libcode/vx_ps/vx_ps.h @@ -126,7 +126,7 @@ class PSfile { DocumentOrientation Orientation; DocumentMedia Media; - ofstream * File; // the output file ... allocated + std::ofstream * File; // the output file ... allocated ConcatString OutputFilename; @@ -163,7 +163,7 @@ class PSfile { // get stuff // - // ofstream & file() const; + // std::ofstream & file() const; PSFilter & file() const; DocumentOrientation orientation () const; diff --git a/src/libcode/vx_pxm/pbm.h b/src/libcode/vx_pxm/pbm.h index e9bac50a97..330ed9afb1 100644 --- a/src/libcode/vx_pxm/pbm.h +++ b/src/libcode/vx_pxm/pbm.h @@ -81,7 +81,7 @@ class Pbm : public PxmBase { void all_white(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; diff --git a/src/libcode/vx_pxm/pcm.h b/src/libcode/vx_pxm/pcm.h index ecddb54d57..960856a235 100644 --- a/src/libcode/vx_pxm/pcm.h +++ b/src/libcode/vx_pxm/pcm.h @@ -77,7 +77,7 @@ class Pcm : public PxmBase { void reverse_video(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void all_black(); // does nothing void all_white(); // does nothing diff --git a/src/libcode/vx_pxm/pgm.h b/src/libcode/vx_pxm/pgm.h index ece18d1f6e..c8bfdea763 100644 --- a/src/libcode/vx_pxm/pgm.h +++ b/src/libcode/vx_pxm/pgm.h @@ -76,7 +76,7 @@ class Pgm : public PxmBase { void all_white(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; }; diff --git a/src/libcode/vx_pxm/ppm.h b/src/libcode/vx_pxm/ppm.h index 00eb09aa37..e5e3aa2334 100644 --- a/src/libcode/vx_pxm/ppm.h +++ b/src/libcode/vx_pxm/ppm.h @@ -75,7 +75,7 @@ class Ppm : public PxmBase { void all_white(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; // // not from base class diff --git a/src/libcode/vx_pxm/pxm_base.h b/src/libcode/vx_pxm/pxm_base.h index 33abeb3726..b0d1b06189 100644 --- a/src/libcode/vx_pxm/pxm_base.h +++ b/src/libcode/vx_pxm/pxm_base.h @@ -101,7 +101,7 @@ class PxmBase { virtual void all_white() = 0; - virtual void dump (ostream &, int depth = 0) const = 0; + virtual void dump (std::ostream &, int depth = 0) const = 0; // // non-abstract member functions diff --git a/src/libcode/vx_render/psout_filter.h b/src/libcode/vx_render/psout_filter.h index 00032e430f..6753182dfc 100644 --- a/src/libcode/vx_render/psout_filter.h +++ b/src/libcode/vx_render/psout_filter.h @@ -31,9 +31,9 @@ class PSOutputFilter : public PSFilter { PSOutputFilter(); ~PSOutputFilter(); - PSOutputFilter(ofstream &); + PSOutputFilter(std::ofstream &); - ofstream *file; + std::ofstream *file; bool ignore_columns; // default: false @@ -44,7 +44,7 @@ class PSOutputFilter : public PSFilter { virtual void eod(); - void attach(ofstream *); + void attach(std::ofstream *); void detach(); }; diff --git a/src/libcode/vx_seeps/seeps.cc b/src/libcode/vx_seeps/seeps.cc index fa8ce18715..9b53ad9dc9 100644 --- a/src/libcode/vx_seeps/seeps.cc +++ b/src/libcode/vx_seeps/seeps.cc @@ -13,6 +13,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "file_exists.h" #include "string_fxns.h" diff --git a/src/libcode/vx_seeps/seeps.h b/src/libcode/vx_seeps/seeps.h index ad6d52691a..6fd08ca12e 100644 --- a/src/libcode/vx_seeps/seeps.h +++ b/src/libcode/vx_seeps/seeps.h @@ -118,8 +118,8 @@ class SeepsClimo { bool seeps_ready; int nstn; - map seeps_score_00_map; - map seeps_score_12_map; + std::map seeps_score_00_map; + std::map seeps_score_12_map; SeepsClimoRecord *create_climo_record(int sid, float lat, float lon, float elv, float *p1, float *p2, float *t1, float *t2, diff --git a/src/libcode/vx_series_data/series_pdf.cc b/src/libcode/vx_series_data/series_pdf.cc index 446466ae22..95e0c598a2 100644 --- a/src/libcode/vx_series_data/series_pdf.cc +++ b/src/libcode/vx_series_data/series_pdf.cc @@ -8,6 +8,8 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -16,6 +18,9 @@ #include #include +#include +using namespace netCDF; + #include "series_pdf.h" //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_series_data/series_pdf.h b/src/libcode/vx_series_data/series_pdf.h index 3d178ad7b1..96c629c8d4 100644 --- a/src/libcode/vx_series_data/series_pdf.h +++ b/src/libcode/vx_series_data/series_pdf.h @@ -15,10 +15,8 @@ #include #include -using namespace std; #include -using namespace netCDF; #include "vx_util.h" #include "vx_log.h" @@ -30,7 +28,7 @@ using namespace netCDF; void init_pdf( int n, - vector& pdf); + std::vector& pdf); //////////////////////////////////////////////////////////////////////// @@ -38,21 +36,21 @@ void init_pdf( double min, double max, double delta, - vector& pdf); + std::vector& pdf); //////////////////////////////////////////////////////////////////////// void init_joint_pdf( int n_A, int n_B, - vector& pdf); + std::vector& pdf); //////////////////////////////////////////////////////////////////////// void update_pdf( double min, double delta, - vector& pdf, + std::vector& pdf, const DataPlane&, const MaskPlane&); @@ -65,7 +63,7 @@ void update_joint_pdf( double min_B, double delta_A, double delta_B, - vector& pdf, + std::vector& pdf, const DataPlane&, const DataPlane&, const MaskPlane&); @@ -75,16 +73,16 @@ void update_joint_pdf( void print_pdf( double min, double delta, - const vector& pdf); + const std::vector& pdf); //////////////////////////////////////////////////////////////////////// void write_nc_pdf( - NcFile* nc_out, + netCDF::NcFile* nc_out, const VarInfo& info, double min, double delta, - const vector& pdf); + const std::vector& pdf); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_shapedata/interest.h b/src/libcode/vx_shapedata/interest.h index 3bed46f2b5..2afe66661b 100644 --- a/src/libcode/vx_shapedata/interest.h +++ b/src/libcode/vx_shapedata/interest.h @@ -85,7 +85,7 @@ class SingleFeature { //////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const SingleFeature &); +extern std::ostream & operator<<(std::ostream &, const SingleFeature &); //////////////////////////////////////////////////////////////////////// @@ -134,7 +134,7 @@ class PairFeature { //////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const PairFeature &); +extern std::ostream & operator<<(std::ostream &, const PairFeature &); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_shapedata/mode_columns.h b/src/libcode/vx_shapedata/mode_columns.h index b37a057b5e..d8528bc361 100644 --- a/src/libcode/vx_shapedata/mode_columns.h +++ b/src/libcode/vx_shapedata/mode_columns.h @@ -13,7 +13,7 @@ //////////////////////////////////////////////////////////////////////// -static const string mode_hdr_columns [] = { +static const std::string mode_hdr_columns [] = { "VERSION", // 1 "MODEL", // 2 @@ -43,7 +43,7 @@ static const string mode_hdr_columns [] = { }; -static const string mode_obj_columns [] = { +static const std::string mode_obj_columns [] = { "OBJECT_ID", // 23 "OBJECT_CAT", // 24 diff --git a/src/libcode/vx_shapedata/mode_field_info.h b/src/libcode/vx_shapedata/mode_field_info.h index 2a4f298fbe..08ef22e072 100644 --- a/src/libcode/vx_shapedata/mode_field_info.h +++ b/src/libcode/vx_shapedata/mode_field_info.h @@ -28,7 +28,7 @@ //////////////////////////////////////////////////////////////////////// -typedef map AttrFilterMap; +typedef std::map AttrFilterMap; //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_shapedata/set.h b/src/libcode/vx_shapedata/set.h index 5aa0fecb12..c110e77dc1 100644 --- a/src/libcode/vx_shapedata/set.h +++ b/src/libcode/vx_shapedata/set.h @@ -16,6 +16,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 04-15-05 Halley Gotway +// 001 10-03-22 Prestopnik MET #2227 Remove using namespace std from header files // /////////////////////////////////////////////////////////////////////////////// @@ -89,7 +90,7 @@ extern FcstObsSet union_fcst_obs_sets(const FcstObsSet &, const FcstObsSet &); extern int fcst_obs_sets_overlap(const FcstObsSet &, const FcstObsSet &); -extern ostream & operator<<(ostream &, const FcstObsSet &); +extern std::ostream & operator<<(std::ostream &, const FcstObsSet &); /////////////////////////////////////////////////////////////////////////////// @@ -159,7 +160,7 @@ class SetCollection { /////////////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const SetCollection &); +extern std::ostream & operator<<(std::ostream &, const SetCollection &); inline void SetCollection::make_room(const int __n) { if ( __n > 0 ) extend(n_sets + __n); return; } diff --git a/src/libcode/vx_shapedata/shape.h b/src/libcode/vx_shapedata/shape.h index 7e6813c350..288106d197 100644 --- a/src/libcode/vx_shapedata/shape.h +++ b/src/libcode/vx_shapedata/shape.h @@ -17,6 +17,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 11-03-06 Halley Gotway New +// 001 22-09-28 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -25,8 +26,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include "moments.h" //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_shapedata/shapedata.h b/src/libcode/vx_shapedata/shapedata.h index f4bd1e0332..1ba59f5fa3 100644 --- a/src/libcode/vx_shapedata/shapedata.h +++ b/src/libcode/vx_shapedata/shapedata.h @@ -16,6 +16,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 11-05-31 Halley Gotway Adapated from wrfdata.h. +// 001 22-09-28 Prestopnik MET #2227 Remove namespace std from header files // /////////////////////////////////////////////////////////////////////////////// @@ -24,10 +25,6 @@ /////////////////////////////////////////////////////////////////////////////// -using namespace std; - -/////////////////////////////////////////////////////////////////////////////// - #include #include "moments.h" @@ -166,7 +163,7 @@ class ShapeData { void threshold(double t); void threshold(SingleThresh); - void threshold_attr(const map&, + void threshold_attr(const std::map&, const ShapeData *, const SingleThresh &, const Grid *, @@ -253,7 +250,7 @@ class Cell { /////////////////////////////////////////////////////////////////////////////// -extern ostream & operator<<(ostream &, const Cell &); +extern std::ostream & operator<<(std::ostream &, const Cell &); /////////////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_statistics/contable.h b/src/libcode/vx_statistics/contable.h index 28689fa58a..ded7cf3d84 100644 --- a/src/libcode/vx_statistics/contable.h +++ b/src/libcode/vx_statistics/contable.h @@ -48,7 +48,7 @@ class ContingencyTable { int rc_to_n(int r, int c) const; - vector *E; // this is really a two-dimensional array + std::vector *E; // this is really a two-dimensional array int Nrows; int Ncols; @@ -69,7 +69,7 @@ class ContingencyTable { void zero_out(); - virtual void dump(ostream & out, int depth = 0) const; + virtual void dump(std::ostream & out, int depth = 0) const; // // condition on an event diff --git a/src/libcode/vx_statistics/obs_error.h b/src/libcode/vx_statistics/obs_error.h index 27bb488ffb..3abeb3fd5f 100644 --- a/src/libcode/vx_statistics/obs_error.h +++ b/src/libcode/vx_statistics/obs_error.h @@ -34,7 +34,7 @@ class ObsErrorEntry { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // Line number of the table int line_number; @@ -111,7 +111,7 @@ class ObsErrorTable { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff diff --git a/src/libcode/vx_statistics/pair_base.h b/src/libcode/vx_statistics/pair_base.h index 984bfa690d..9acee06bcc 100644 --- a/src/libcode/vx_statistics/pair_base.h +++ b/src/libcode/vx_statistics/pair_base.h @@ -22,11 +22,11 @@ struct ob_val_t { unixtime ut; double val; - string qc; + std::string qc; }; struct station_values_t { - string sid; + std::string sid; double lat; double lon; double x; @@ -38,7 +38,7 @@ struct station_values_t { double cmn; double csd; double summary_val; - vector obs; + std::vector obs; }; //////////////////////////////////////////////////////////////////////// @@ -112,7 +112,7 @@ class PairBase { int obs_perc_value; // Percentile value for ObsSummary_Perc StringArray map_key; - map map_val; // Storage for single obs values + std::map map_val; // Storage for single obs values ////////////////////////////////////////////////////////////////// @@ -146,13 +146,13 @@ class PairBase { int has_obs_rec(const char *, double, double, double, double, double, double, int &); - ob_val_t compute_nearest(string sng_key); - ob_val_t compute_min(string sng_key); - ob_val_t compute_max(string sng_key); - ob_val_t compute_uw_mean(string sng_key); - ob_val_t compute_dw_mean(string sng_key); - ob_val_t compute_median(string sng_key); - ob_val_t compute_percentile(string sng_key, int perc); + ob_val_t compute_nearest(std::string sng_key); + ob_val_t compute_min(std::string sng_key); + ob_val_t compute_max(std::string sng_key); + ob_val_t compute_uw_mean(std::string sng_key); + ob_val_t compute_dw_mean(std::string sng_key); + ob_val_t compute_median(std::string sng_key); + ob_val_t compute_percentile(std::string sng_key, int perc); bool add_point_obs(const char *, double, double, double, double, unixtime, double, double, double, const char *, diff --git a/src/libcode/vx_statistics/pair_data_ensemble.h b/src/libcode/vx_statistics/pair_data_ensemble.h index ce4210c0a6..17501d867a 100644 --- a/src/libcode/vx_statistics/pair_data_ensemble.h +++ b/src/libcode/vx_statistics/pair_data_ensemble.h @@ -24,7 +24,6 @@ #include "vx_data2d_grib.h" #include "vx_gsl_prob.h" -using namespace std; //////////////////////////////////////////////////////////////////////// @@ -40,10 +39,10 @@ struct ens_ssvar_pt { double w; }; -typedef deque ssvar_pt_list; -typedef map ssvar_bin_map; // Indexed by bin min -typedef CRC_Array BoolArray; -typedef CRC_Array ObsErrorEntryPtrArray; +typedef std::deque ssvar_pt_list; +typedef std::map ssvar_bin_map; // Indexed by bin min +typedef CRC_Array BoolArray; +typedef CRC_Array ObsErrorEntryPtrArray; // Number of SSVAR bins to produce a warning static const int n_warn_ssvar_bins = 1000; diff --git a/src/libcode/vx_summary/summary_calc.h b/src/libcode/vx_summary/summary_calc.h index ce40206295..6948e5e87e 100644 --- a/src/libcode/vx_summary/summary_calc.h +++ b/src/libcode/vx_summary/summary_calc.h @@ -31,7 +31,7 @@ class SummaryCalc SummaryCalc(); virtual ~SummaryCalc(); - virtual string getType() const = 0; + virtual std::string getType() const = 0; virtual double calcSummary(const NumArray &num_array) const = 0; }; diff --git a/src/libcode/vx_summary/summary_obs.h b/src/libcode/vx_summary/summary_obs.h index 284b67b388..3cba669b41 100644 --- a/src/libcode/vx_summary/summary_obs.h +++ b/src/libcode/vx_summary/summary_obs.h @@ -34,21 +34,21 @@ class SummaryObs bool summarizeObs(const TimeSummaryInfo &summary_info); bool addObservationObj(const Observation &obs); - bool addObservation(const string &header_type, const string &station_id, + bool addObservation(const std::string &header_type, const std::string &station_id, const time_t valid_time, const double latitude, const double longitude, const double elevation, - const string &quality_flag, + const std::string &quality_flag, const int var_code, const double pressure_level_hpa, const double height_m, const double value, - const string &var_name = ""); - vector< Observation > getObservations(); - vector< Observation > getSummaries(); + const std::string &var_name = ""); + std::vector< Observation > getObservations(); + std::vector< Observation > getSummaries(); long countHeaders(); - long countHeaders(vector< Observation > *obs_vector); - long countHeaders(vector< Observation > &obs_vector); + long countHeaders(std::vector< Observation > *obs_vector); + long countHeaders(std::vector< Observation > &obs_vector); long countSummaryHeaders(); - time_t getValidTime(const string &time_string) const; + time_t getValidTime(const std::string &time_string) const; TimeSummaryInfo getSummaryInfo(); void setSummaryInfo(const TimeSummaryInfo &summary_info); StringArray getObsNames(); @@ -67,8 +67,8 @@ class SummaryObs TimeSummaryInfo summaryInfo; // List of observations read - vector< Observation > observations; - vector< Observation > summaries; + std::vector< Observation > observations; + std::vector< Observation > summaries; StringArray obs_names; /////////////////////// @@ -84,12 +84,12 @@ class SummaryObs // Use the configuration information to generate the list of summary // calculators needed. - vector< SummaryCalc* > getSummaryCalculators(const TimeSummaryInfo &info) const; + std::vector< SummaryCalc* > getSummaryCalculators(const TimeSummaryInfo &info) const; // Use the configuration file time summary information to figure out the // time intervals for our summaries - vector< TimeSummaryInterval > getTimeIntervals(const time_t first_data_time, + std::vector< TimeSummaryInterval > getTimeIntervals(const time_t first_data_time, const time_t last_data_time, const TimeSummaryInfo &info) const; @@ -104,8 +104,8 @@ class SummaryObs // Generate the summary header type string for the netCDF file - string getSummaryHeaderType(const string &header_type, - const string &summary_type, + std::string getSummaryHeaderType(const std::string &header_type, + const std::string &summary_type, const int summary_width_secs) const; public: @@ -123,7 +123,7 @@ class SummaryObs // Convert the number of seconds from the beginning of the day to a string - static string secsToTimeString(const int secs) + static std::string secsToTimeString(const int secs) { // Get the different fields from the number of seconds @@ -140,7 +140,7 @@ class SummaryObs snprintf(string_buffer, sizeof(string_buffer), "%02d%02d%02d", hour, minute, second); - return string(string_buffer); + return std::string(string_buffer); } // Get the first possible interval time after 0:00Z @@ -219,7 +219,7 @@ class SummaryObs return timegm(time_struct); } - static string _timeToString(const time_t unix_time) + static std::string _timeToString(const time_t unix_time) { struct tm *time_struct = gmtime(&unix_time); @@ -234,7 +234,7 @@ class SummaryObs return time_string; } - static time_t _stringToTime(const string &time_string) + static time_t _stringToTime(const std::string &time_string) { struct tm time_struct; memset(&time_struct, 0, sizeof(time_struct)); @@ -251,8 +251,8 @@ class SummaryObs }; -inline vector< Observation > SummaryObs::getObservations() { return observations; } -inline vector< Observation > SummaryObs::getSummaries() { return summaries; } +inline std::vector< Observation > SummaryObs::getObservations() { return observations; } +inline std::vector< Observation > SummaryObs::getSummaries() { return summaries; } inline StringArray SummaryObs::getObsNames() { return obs_names; } inline void SummaryObs::setSummaryInfo(const TimeSummaryInfo &summary_info) { summaryInfo = summary_info;}; inline TimeSummaryInfo SummaryObs::getSummaryInfo() { return summaryInfo;}; diff --git a/src/libcode/vx_tc_util/atcf_line_base.h b/src/libcode/vx_tc_util/atcf_line_base.h index 000b267d04..45b93e8529 100644 --- a/src/libcode/vx_tc_util/atcf_line_base.h +++ b/src/libcode/vx_tc_util/atcf_line_base.h @@ -62,10 +62,10 @@ class ATCFLineBase : public DataLine { void assign(const ATCFLineBase &); - const map * BasinMap; // not allocated - const StringArray * BestTechnique; // not allocated - const StringArray * OperTechnique; // not allocated - const ConcatString * TechSuffix; // not allocated + const std::map * BasinMap; // not allocated + const StringArray * BestTechnique; // not allocated + const StringArray * OperTechnique; // not allocated + const ConcatString * TechSuffix; // not allocated ATCFLineType Type; ConcatString Basin; @@ -81,7 +81,7 @@ class ATCFLineBase : public DataLine { ATCFLineBase & operator= (const ATCFLineBase &); bool operator==(const ATCFLineBase &); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void clear(); @@ -93,7 +93,7 @@ class ATCFLineBase : public DataLine { // set values // - void set_basin_map (const map *); + void set_basin_map (const std::map *); void set_best_technique(const StringArray *); void set_oper_technique(const StringArray *); void set_tech_suffix (const ConcatString *); @@ -130,7 +130,7 @@ class ATCFLineBase : public DataLine { //////////////////////////////////////////////////////////////////////// -inline void ATCFLineBase::set_basin_map (const map *m) +inline void ATCFLineBase::set_basin_map (const std::map *m) { BasinMap = m; } inline void ATCFLineBase::set_best_technique(const StringArray *s) { BestTechnique = s; } inline void ATCFLineBase::set_oper_technique(const StringArray *s) { OperTechnique = s; } diff --git a/src/libcode/vx_tc_util/atcf_prob_line.h b/src/libcode/vx_tc_util/atcf_prob_line.h index 9dcb426b5b..40f869ef4d 100644 --- a/src/libcode/vx_tc_util/atcf_prob_line.h +++ b/src/libcode/vx_tc_util/atcf_prob_line.h @@ -45,7 +45,7 @@ class ATCFProbLine : public ATCFLineBase { ATCFProbLine(const ATCFProbLine &); ATCFProbLine & operator= (const ATCFProbLine &); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; void clear(); diff --git a/src/libcode/vx_tc_util/atcf_track_line.h b/src/libcode/vx_tc_util/atcf_track_line.h index 1e93f4e6c6..8f46f73b3c 100644 --- a/src/libcode/vx_tc_util/atcf_track_line.h +++ b/src/libcode/vx_tc_util/atcf_track_line.h @@ -146,7 +146,7 @@ class ATCFTrackLine : public ATCFLineBase { ATCFTrackLine(const ATCFTrackLine &); ATCFTrackLine & operator= (const ATCFTrackLine &); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; int read_line(LineDataFile *); diff --git a/src/libcode/vx_tc_util/gen_shape_info.h b/src/libcode/vx_tc_util/gen_shape_info.h index 98a49e1973..f783e22019 100644 --- a/src/libcode/vx_tc_util/gen_shape_info.h +++ b/src/libcode/vx_tc_util/gen_shape_info.h @@ -110,7 +110,7 @@ class GenShapeInfoArray { void init_from_scratch(); void assign(const GenShapeInfoArray &); - vector GenShape; + std::vector GenShape; public: diff --git a/src/libcode/vx_tc_util/genesis_info.h b/src/libcode/vx_tc_util/genesis_info.h index 36e36b0d18..1a22a9ec1a 100644 --- a/src/libcode/vx_tc_util/genesis_info.h +++ b/src/libcode/vx_tc_util/genesis_info.h @@ -31,7 +31,7 @@ struct GenesisEventInfo { ConcatString Technique; - vector Category; + std::vector Category; SingleThresh VMaxThresh; SingleThresh MSLPThresh; @@ -72,7 +72,7 @@ class GenesisInfo : public TrackInfo { bool is_storm(const GenesisInfo &) const; void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; @@ -130,7 +130,7 @@ class GenesisInfoArray { void init_from_scratch(); void assign(const GenesisInfoArray &); - vector Genesis; + std::vector Genesis; public: @@ -140,7 +140,7 @@ class GenesisInfoArray { GenesisInfoArray & operator=(const GenesisInfoArray &); void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int = 0) const; diff --git a/src/libcode/vx_tc_util/pair_data_genesis.h b/src/libcode/vx_tc_util/pair_data_genesis.h index 1725273751..2d0e0e1d1b 100644 --- a/src/libcode/vx_tc_util/pair_data_genesis.h +++ b/src/libcode/vx_tc_util/pair_data_genesis.h @@ -81,13 +81,13 @@ class PairDataGenesis { TimeArray InitTime; IntArray LeadTime; - vector FcstGen; - vector BestGen; - vector GenDiff; + std::vector FcstGen; + std::vector BestGen; + std::vector GenDiff; ////////////////////////////////////////////////////////////////// - bool has_gen (const vector&, + bool has_gen (const std::vector&, const GenesisInfo *, int &) const; bool has_case(const ConcatString &, const unixtime, int &) const; diff --git a/src/libcode/vx_tc_util/prob_gen_info.h b/src/libcode/vx_tc_util/prob_gen_info.h index 0fa15defc8..af86991a91 100644 --- a/src/libcode/vx_tc_util/prob_gen_info.h +++ b/src/libcode/vx_tc_util/prob_gen_info.h @@ -48,7 +48,7 @@ class ProbGenInfo : public ProbInfoBase { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; diff --git a/src/libcode/vx_tc_util/prob_info_array.h b/src/libcode/vx_tc_util/prob_info_array.h index e0ea6230e9..cd2e8125f7 100644 --- a/src/libcode/vx_tc_util/prob_info_array.h +++ b/src/libcode/vx_tc_util/prob_info_array.h @@ -36,8 +36,8 @@ class ProbInfoArray { void init_from_scratch(); void assign(const ProbInfoArray &); - vector ProbRIRW; - vector ProbGen; + std::vector ProbRIRW; + std::vector ProbGen; public: @@ -48,7 +48,7 @@ class ProbInfoArray { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int = 0) const; diff --git a/src/libcode/vx_tc_util/prob_info_base.h b/src/libcode/vx_tc_util/prob_info_base.h index 015563e9e5..4622ad922a 100644 --- a/src/libcode/vx_tc_util/prob_info_base.h +++ b/src/libcode/vx_tc_util/prob_info_base.h @@ -69,7 +69,7 @@ class ProbInfoBase { void clear(); - virtual void dump(ostream &, int = 0) const; + virtual void dump(std::ostream &, int = 0) const; virtual ConcatString serialize() const; virtual ConcatString serialize_r(int, int = 0) const; diff --git a/src/libcode/vx_tc_util/prob_rirw_info.h b/src/libcode/vx_tc_util/prob_rirw_info.h index b1034eb00a..ba18fd5b9f 100644 --- a/src/libcode/vx_tc_util/prob_rirw_info.h +++ b/src/libcode/vx_tc_util/prob_rirw_info.h @@ -47,7 +47,7 @@ class ProbRIRWInfo : public ProbInfoBase { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; diff --git a/src/libcode/vx_tc_util/prob_rirw_pair_info.h b/src/libcode/vx_tc_util/prob_rirw_pair_info.h index 977c07c67c..b76a14a756 100644 --- a/src/libcode/vx_tc_util/prob_rirw_pair_info.h +++ b/src/libcode/vx_tc_util/prob_rirw_pair_info.h @@ -69,7 +69,7 @@ class ProbRIRWPairInfo { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString case_info() const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; @@ -146,7 +146,7 @@ class ProbRIRWPairInfoArray { void init_from_scratch(); void assign(const ProbRIRWPairInfoArray &); - vector Pairs; + std::vector Pairs; public: @@ -157,7 +157,7 @@ class ProbRIRWPairInfoArray { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int = 0) const; diff --git a/src/libcode/vx_tc_util/tc_columns.h b/src/libcode/vx_tc_util/tc_columns.h index 5241d92997..b67eeda002 100644 --- a/src/libcode/vx_tc_util/tc_columns.h +++ b/src/libcode/vx_tc_util/tc_columns.h @@ -136,8 +136,8 @@ inline int get_n_prob_rirw_cols (int n) { return(n_prob_rirw_cols + (2*n)); } // //////////////////////////////////////////////////////////////////////// -extern void open_tc_txt_file (ofstream *&, const char *); -extern void close_tc_txt_file(ofstream *&, const char *); +extern void open_tc_txt_file (std::ofstream *&, const char *); +extern void close_tc_txt_file(std::ofstream *&, const char *); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_tc_util/track_info.h b/src/libcode/vx_tc_util/track_info.h index 73b3317bf6..3159063ce2 100644 --- a/src/libcode/vx_tc_util/track_info.h +++ b/src/libcode/vx_tc_util/track_info.h @@ -86,7 +86,7 @@ class TrackInfo { void clear(); void clear_points(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; @@ -206,7 +206,7 @@ class TrackInfoArray { void init_from_scratch(); void assign(const TrackInfoArray &); - vector Track; + std::vector Track; public: @@ -217,7 +217,7 @@ class TrackInfoArray { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int = 0) const; diff --git a/src/libcode/vx_tc_util/track_pair_info.h b/src/libcode/vx_tc_util/track_pair_info.h index 6afa9b6437..b4e92739ab 100644 --- a/src/libcode/vx_tc_util/track_pair_info.h +++ b/src/libcode/vx_tc_util/track_pair_info.h @@ -87,7 +87,7 @@ class TrackPairInfo { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString case_info() const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; @@ -193,7 +193,7 @@ class TrackPairInfoArray { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int = 0) const; diff --git a/src/libcode/vx_tc_util/track_point.h b/src/libcode/vx_tc_util/track_point.h index 93908858af..cc861f547d 100644 --- a/src/libcode/vx_tc_util/track_point.h +++ b/src/libcode/vx_tc_util/track_point.h @@ -53,7 +53,7 @@ class QuadInfo { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; @@ -177,7 +177,7 @@ class TrackPoint { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; ConcatString serialize() const; ConcatString serialize_r(int, int = 0) const; diff --git a/src/libcode/vx_tc_util/vx_tc_nc_util.cc b/src/libcode/vx_tc_util/vx_tc_nc_util.cc index fb72b127d5..9f166f3d73 100644 --- a/src/libcode/vx_tc_util/vx_tc_nc_util.cc +++ b/src/libcode/vx_tc_util/vx_tc_nc_util.cc @@ -8,6 +8,11 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; + +#include +using namespace netCDF; + #include "vx_tc_nc_util.h" //////////////////////////////////////////////////////////////////////// @@ -171,7 +176,7 @@ map get_pressure_level_indices( map pressure_level_indices; map indices_from_levels - = get_pressure_level_indices(pressure_levels); + = get_pressure_level_indices(pressure_levels); for (set::iterator i = pressure_level_strings.begin(); i != pressure_level_strings.end(); ++i) { diff --git a/src/libcode/vx_tc_util/vx_tc_nc_util.h b/src/libcode/vx_tc_util/vx_tc_nc_util.h index 8f4bae8387..e90a34fb5c 100644 --- a/src/libcode/vx_tc_util/vx_tc_nc_util.h +++ b/src/libcode/vx_tc_util/vx_tc_nc_util.h @@ -14,7 +14,6 @@ //////////////////////////////////////////////////////////////////////// #include -using namespace netCDF; #include "vx_log.h" #include "vx_data2d.h" @@ -24,67 +23,67 @@ using namespace netCDF; //////////////////////////////////////////////////////////////////////// -extern void write_tc_tracks(NcFile*, - const NcDim&, const TrackInfoArray&); +extern void write_tc_tracks(netCDF::NcFile*, + const netCDF::NcDim&, const TrackInfoArray&); -extern set get_pressure_level_strings( - map >); +extern std::set get_pressure_level_strings( + std::map >); -extern set get_pressure_levels( - map >); +extern std::set get_pressure_levels( + std::map >); -extern set get_pressure_levels( - set); +extern std::set get_pressure_levels( + std::set); -extern map get_pressure_level_indices( - set); +extern std::map get_pressure_level_indices( + std::set); -extern map get_pressure_level_indices( - set, set); +extern std::map get_pressure_level_indices( + std::set, std::set); -extern void def_tc_pressure(NcFile*, - const NcDim&, set); +extern void def_tc_pressure(netCDF::NcFile*, + const netCDF::NcDim&, std::set); -extern void def_tc_range_azimuth(NcFile*, - const NcDim&, const NcDim&, const TcrmwGrid&, double); +extern void def_tc_range_azimuth(netCDF::NcFile*, + const netCDF::NcDim&, const netCDF::NcDim&, const TcrmwGrid&, double); -extern void def_tc_lat_lon_time(NcFile*, - const NcDim&, const NcDim&, const NcDim&, - NcVar&, NcVar&, NcVar&); +extern void def_tc_lat_lon_time(netCDF::NcFile*, + const netCDF::NcDim&, const netCDF::NcDim&, const netCDF::NcDim&, + netCDF::NcVar&, netCDF::NcVar&, netCDF::NcVar&); -extern void def_tc_variables(NcFile*, - map >, - map, map, - const NcDim&, const NcDim&, const NcDim&, const NcDim&, - map&); +extern void def_tc_variables(netCDF::NcFile*, + std::map >, + std::map, std::map, + const netCDF::NcDim&, const netCDF::NcDim&, const netCDF::NcDim&, const netCDF::NcDim&, + std::map&); -extern void def_tc_data(NcFile*, - const NcDim&, const NcDim&, const NcDim&, - NcVar&, VarInfo*); +extern void def_tc_data(netCDF::NcFile*, + const netCDF::NcDim&, const netCDF::NcDim&, const netCDF::NcDim&, + netCDF::NcVar&, VarInfo*); -extern void def_tc_data_3d(NcFile*, - const NcDim&, const NcDim&, const NcDim&, const NcDim&, - NcVar&, VarInfo*); +extern void def_tc_data_3d(netCDF::NcFile*, + const netCDF::NcDim&, const netCDF::NcDim&, const netCDF::NcDim&, const netCDF::NcDim&, + netCDF::NcVar&, VarInfo*); -extern void def_tc_azi_mean_data(NcFile*, - const NcDim&, const NcDim&, - NcVar&, VarInfo*); +extern void def_tc_azi_mean_data(netCDF::NcFile*, + const netCDF::NcDim&, const netCDF::NcDim&, + netCDF::NcVar&, VarInfo*); -extern void write_tc_valid_time(NcFile*, - const int&, const NcVar&, const long&); +extern void write_tc_valid_time(netCDF::NcFile*, + const int&, const netCDF::NcVar&, const long&); -extern void write_tc_data(NcFile*, const TcrmwGrid&, - const int&, const NcVar&, const double*); +extern void write_tc_data(netCDF::NcFile*, const TcrmwGrid&, + const int&, const netCDF::NcVar&, const double*); -extern void write_tc_data_rev(NcFile*, const TcrmwGrid&, - const int&, const NcVar&, const double*); +extern void write_tc_data_rev(netCDF::NcFile*, const TcrmwGrid&, + const int&, const netCDF::NcVar&, const double*); -extern void write_tc_azi_mean_data(NcFile*, const TcrmwGrid&, - const int&, const NcVar&, const double*); +extern void write_tc_azi_mean_data(netCDF::NcFile*, const TcrmwGrid&, + const int&, const netCDF::NcVar&, const double*); -extern void write_tc_pressure_level_data(NcFile*, const TcrmwGrid&, - map, const string&, - const int&, const NcVar&, const double*); +extern void write_tc_pressure_level_data(netCDF::NcFile*, const TcrmwGrid&, + std::map, const std::string&, + const int&, const netCDF::NcVar&, const double*); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_time_series/compute_swinging_door.h b/src/libcode/vx_time_series/compute_swinging_door.h index 052ce0a789..d4c9ac5283 100644 --- a/src/libcode/vx_time_series/compute_swinging_door.h +++ b/src/libcode/vx_time_series/compute_swinging_door.h @@ -37,7 +37,7 @@ class SDObservation _validTime(valid_time), _value(value) {} - SDObservation(const string &valid_time_string, + SDObservation(const std::string &valid_time_string, const double value) : _validTime(_getTime(valid_time_string)), _value(value) {} @@ -55,7 +55,7 @@ class SDObservation return _validTime; } - string getValidTimeString() const + std::string getValidTimeString() const { return _getTimeString(_validTime); } @@ -99,7 +99,7 @@ class SDObservation // Protected methods // /////////////////////// - static time_t _getTime(const string &time_string) + static time_t _getTime(const std::string &time_string) { struct tm time_struct; memset(&time_struct, 0, sizeof(time_struct)); @@ -114,7 +114,7 @@ class SDObservation return timegm(&time_struct); } - static string _getTimeString(const time_t &unix_time) + static std::string _getTimeString(const time_t &unix_time) { struct tm *time_struct = gmtime(&unix_time); @@ -126,7 +126,7 @@ class SDObservation time_struct->tm_mday, time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); - return string(time_string); + return std::string(time_string); } }; @@ -163,9 +163,9 @@ extern bool compute_swinging_door_slopes(const TimeArray &valid_times, // Return: // Returns true if successful, false otherwise. -extern bool compute_swinging_door_ramps(const vector< SDObservation > &observations, +extern bool compute_swinging_door_ramps(const std::vector< SDObservation > &observations, const double error, - vector< pair< SDObservation, SDObservation > > &ramps); + std::vector< std::pair< SDObservation, SDObservation > > &ramps); //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/core/ensemble_stat/ensemble_stat.cc b/src/tools/core/ensemble_stat/ensemble_stat.cc index 08e66db057..6123c005fe 100644 --- a/src/tools/core/ensemble_stat/ensemble_stat.cc +++ b/src/tools/core/ensemble_stat/ensemble_stat.cc @@ -69,6 +69,7 @@ // 037 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main. // 038 09/06/22 Halley Gotway MET #1908 Remove ensemble processing logic. // 039 09/29/22 Halley Gotway MET #2286 Refine GRIB1 table lookup logic. +// 040 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -84,6 +85,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "main.h" #include "ensemble_stat.h" diff --git a/src/tools/core/ensemble_stat/ensemble_stat.h b/src/tools/core/ensemble_stat/ensemble_stat.h index db1041b22e..7559c71525 100644 --- a/src/tools/core/ensemble_stat/ensemble_stat.h +++ b/src/tools/core/ensemble_stat/ensemble_stat.h @@ -13,8 +13,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -29,7 +27,6 @@ using namespace std; #include #include -using namespace netCDF; #include "ensemble_stat_conf_info.h" @@ -126,25 +123,25 @@ static int compress_level = -1; // Output NetCDF file static bool out_nc_flag = false; static ConcatString out_nc_file; -static NcFile *nc_out = (NcFile *) 0; -static NcDim lat_dim; -static NcDim lon_dim; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +static netCDF::NcDim lat_dim; +static netCDF::NcDim lon_dim; // List of output NetCDF variable names static StringArray nc_ens_var_sa; static StringArray nc_orank_var_sa; // Output STAT file -static ConcatString stat_file; -static ofstream *stat_out = (ofstream *) 0; -static AsciiTable stat_at; -static int i_stat_row; +static ConcatString stat_file; +static std::ofstream *stat_out = (std::ofstream *) 0; +static AsciiTable stat_at; +static int i_stat_row; // Optional ASCII output files -static ConcatString txt_file[n_txt]; -static ofstream *txt_out[n_txt]; -static AsciiTable txt_at[n_txt]; -static int i_txt_row[n_txt]; +static ConcatString txt_file[n_txt]; +static std::ofstream *txt_out[n_txt]; +static AsciiTable txt_at[n_txt]; +static int i_txt_row[n_txt]; //////////////////////////////////////////////////////////////////////// // diff --git a/src/tools/core/grid_stat/grid_stat.cc b/src/tools/core/grid_stat/grid_stat.cc index a7ed788b3c..3912a3866a 100644 --- a/src/tools/core/grid_stat/grid_stat.cc +++ b/src/tools/core/grid_stat/grid_stat.cc @@ -110,6 +110,7 @@ // 052 05/28/21 Halley Gotway Add MCTS HSS_EC output. // 053 12/11/21 Halley Gotway MET #1991 Fix VCNT output. // 054 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 055 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -125,6 +126,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "main.h" #include "handle_openmp.h" diff --git a/src/tools/core/grid_stat/grid_stat.h b/src/tools/core/grid_stat/grid_stat.h index 04f694fa96..555941e10c 100644 --- a/src/tools/core/grid_stat/grid_stat.h +++ b/src/tools/core/grid_stat/grid_stat.h @@ -16,8 +16,9 @@ // ---- ---- ---- ----------- // 000 11/11/08 Halley Gotway New // 001 05/03/10 Halley Gotway Add fcst/obs/diff variable name -// arrays to keep track of NetCDF variables. +// arrays to keep track of NetCDF variables. // 002 05/10/16 Halley Gotway Add grid weighting. +// 003 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -26,8 +27,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -42,7 +41,6 @@ using namespace std; #include #include -using namespace netCDF; #include "grid_stat_conf_info.h" @@ -123,26 +121,26 @@ static ConcatString out_dir; // //////////////////////////////////////////////////////////////////////// -// Output NetCDF file -static ConcatString out_nc_file; -static NcFile *nc_out = (NcFile *) 0; -static NcDim lat_dim; -static NcDim lon_dim; +// Output Netcdf file +static ConcatString out_nc_file; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +static netCDF::NcDim lat_dim; +static netCDF::NcDim lon_dim; // List of output NetCDF variable names static StringArray nc_var_sa; // Output STAT file -static ConcatString stat_file; -static ofstream *stat_out = (ofstream *) 0; -static AsciiTable stat_at; -static int i_stat_row; +static ConcatString stat_file; +static std::ofstream *stat_out = (std::ofstream *) 0; +static AsciiTable stat_at; +static int i_stat_row; // Optional ASCII output files -static ConcatString txt_file[n_txt]; -static ofstream *txt_out[n_txt]; -static AsciiTable txt_at[n_txt]; -static int i_txt_row[n_txt]; +static ConcatString txt_file[n_txt]; +static std::ofstream *txt_out[n_txt]; +static AsciiTable txt_at[n_txt]; +static int i_txt_row[n_txt]; static int compress_level = -1; diff --git a/src/tools/core/mode/mode_exec.cc b/src/tools/core/mode/mode_exec.cc index 8c93b2530a..984fc0aee9 100644 --- a/src/tools/core/mode/mode_exec.cc +++ b/src/tools/core/mode/mode_exec.cc @@ -17,6 +17,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "mode_exec.h" #include "nc_utils.h" #include "vx_regrid.h" diff --git a/src/tools/core/mode/mode_exec.h b/src/tools/core/mode/mode_exec.h index 934f674a30..718841b093 100644 --- a/src/tools/core/mode/mode_exec.h +++ b/src/tools/core/mode/mode_exec.h @@ -19,7 +19,6 @@ #include #include -using namespace netCDF; #include "vx_data2d.h" #include "vx_data2d_factory.h" @@ -132,8 +131,8 @@ class ModeExecutive { void write_obj_stats(); void write_obj_netcdf(const ModeNcOutInfo &); - void write_poly_netcdf(NcFile *); - void write_poly_netcdf(NcFile *, const ObjPolyType); + void write_poly_netcdf(netCDF::NcFile *); + void write_poly_netcdf(netCDF::NcFile *, const ObjPolyType); void write_ct_stats(); }; diff --git a/src/tools/core/pcp_combine/pcp_combine.cc b/src/tools/core/pcp_combine/pcp_combine.cc index d70047ebbb..7ba1f7d803 100644 --- a/src/tools/core/pcp_combine/pcp_combine.cc +++ b/src/tools/core/pcp_combine/pcp_combine.cc @@ -76,6 +76,7 @@ // 023 08/29/19 Halley Gotway Support multiple arguments for the // the -pcpdir option. // 024 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 025 09/29/22 Prestopnik MET #2227 Remove namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -92,6 +93,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "main.h" #include "vx_log.h" #include "vx_data2d_factory.h" diff --git a/src/tools/core/point_stat/point_stat.cc b/src/tools/core/point_stat/point_stat.cc index 0d0dbbd1b4..4a0ad2a5f2 100644 --- a/src/tools/core/point_stat/point_stat.cc +++ b/src/tools/core/point_stat/point_stat.cc @@ -100,8 +100,9 @@ // Added code for obs_qty_exc. // 049 12/11/21 Halley Gotway MET #1991 Fix VCNT output. // 050 02/11/22 Halley Gotway MET #2045 Fix HiRA output. -// 051 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main. +// 051 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main // 052 09/29/22 Halley Gotway MET #2286 Refine GRIB1 table lookup logic. +// 053 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -117,6 +118,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "main.h" #include "point_stat.h" diff --git a/src/tools/core/point_stat/point_stat.h b/src/tools/core/point_stat/point_stat.h index 0a24e9209a..1c75d7e8ea 100644 --- a/src/tools/core/point_stat/point_stat.h +++ b/src/tools/core/point_stat/point_stat.h @@ -15,6 +15,8 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 11/11/08 Halley Gotway New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files +// // //////////////////////////////////////////////////////////////////////// @@ -25,8 +27,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -40,9 +40,6 @@ using namespace std; #include #include -#include -using namespace netCDF; - #include "point_stat_conf_info.h" #include "vx_data2d_factory.h" @@ -129,16 +126,16 @@ static unixtime fcst_valid_ut = (unixtime) 0; static int fcst_lead_sec = bad_data_int; // Output STAT file -static ConcatString stat_file; -static ofstream *stat_out = (ofstream *) 0; -static AsciiTable stat_at; -static int i_stat_row; +static ConcatString stat_file; +static std::ofstream *stat_out = (std::ofstream *) 0; +static AsciiTable stat_at; +static int i_stat_row; // Optional ASCII output files -static ConcatString txt_file[n_txt]; -static ofstream *txt_out[n_txt]; -static AsciiTable txt_at[n_txt]; -static int i_txt_row[n_txt]; +static ConcatString txt_file[n_txt]; +static std::ofstream *txt_out[n_txt]; +static AsciiTable txt_at[n_txt]; +static int i_txt_row[n_txt]; //////////////////////////////////////////////////////////////////////// // diff --git a/src/tools/core/series_analysis/series_analysis.cc b/src/tools/core/series_analysis/series_analysis.cc index c0533c16bf..d62e401109 100644 --- a/src/tools/core/series_analysis/series_analysis.cc +++ b/src/tools/core/series_analysis/series_analysis.cc @@ -33,6 +33,7 @@ // 012 01/20/22 Halley Gotway MET #2003 Add PSTD BRIERCL output. // 013 05/25/22 Halley Gotway MET #2147 Add CTS HSS_EC output. // 014 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 015 10/03/22 Presotpnik MET #2227 Remove namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -49,6 +50,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "main.h" #include "series_analysis.h" diff --git a/src/tools/core/series_analysis/series_analysis.h b/src/tools/core/series_analysis/series_analysis.h index fe8e48a948..d591837294 100644 --- a/src/tools/core/series_analysis/series_analysis.h +++ b/src/tools/core/series_analysis/series_analysis.h @@ -15,6 +15,8 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 12/10/12 Halley Gotway New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files +// // //////////////////////////////////////////////////////////////////////// @@ -23,8 +25,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -39,7 +39,6 @@ using namespace std; #include #include -using namespace netCDF; #include "series_analysis_conf_info.h" @@ -89,17 +88,17 @@ static SeriesAnalysisConfInfo conf_info; //////////////////////////////////////////////////////////////////////// // Output NetCDF file -static NcFile *nc_out = (NcFile *) 0; -static NcDim lat_dim; -static NcDim lon_dim ; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +static netCDF::NcDim lat_dim; +static netCDF::NcDim lon_dim ; // Structure to store computed statistics and corresponding metadata struct NcVarData { - NcVar * var; // Pointer to NetCDF variable + netCDF::NcVar * var; // Pointer to NetCDF variable }; // Mapping of NetCDF variable name to computed statistic -map stat_data; +std::map stat_data; //////////////////////////////////////////////////////////////////////// // @@ -149,7 +148,7 @@ static int obs_lead_beg = bad_data_int; static int obs_lead_end = bad_data_int; // Mapping of statistic names to descriptions -map stat_long_name; +std::map stat_long_name; static const char stat_long_name_file[] = "MET_BASE/table_files/stat_column_description.txt"; diff --git a/src/tools/core/stat_analysis/aggr_stat_line.h b/src/tools/core/stat_analysis/aggr_stat_line.h index 86a1e771d5..43c5a437ee 100644 --- a/src/tools/core/stat_analysis/aggr_stat_line.h +++ b/src/tools/core/stat_analysis/aggr_stat_line.h @@ -29,6 +29,7 @@ // 010 04/25/18 Halley Gotway Add ECNT line type. // 011 04/01/19 Fillmore Add FCST and OBS units. // 012 01/24/20 Halley Gotway Add aggregate RPS lines. +// 013 09/28/22 Prestopnik MET #2227 Remove namespace std // //////////////////////////////////////////////////////////////////////// @@ -37,8 +38,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -93,8 +92,8 @@ struct StatHdrInfo { struct AggrSummaryInfo { StatHdrInfo hdr; - map val; - map wgt; + std::map val; + std::map wgt; }; struct AggrCTCInfo { @@ -189,7 +188,7 @@ struct ssvar_bin_cmp { struct AggrSSVARInfo { StatHdrInfo hdr; - map ssvar_bins; + std::map ssvar_bins; }; struct AggrTimeSeriesInfo { @@ -207,97 +206,97 @@ struct AggrTimeSeriesInfo { extern void aggr_summary_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_ctc_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_mctc_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_pct_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_psum_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_grad_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_wind_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_mpr_wind_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_mpr_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_isc_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_ecnt_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_rps_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_rhist_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_phist_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_relp_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_orank_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_ssvar_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_time_series_lines( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); extern void aggr_ss_index( LineDataFile &, STATAnalysisJob &, - map &, + std::map &, int &, int &); //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/core/stat_analysis/parse_stat_line.h b/src/tools/core/stat_analysis/parse_stat_line.h index ed9a6be48a..0ad26c65e9 100644 --- a/src/tools/core/stat_analysis/parse_stat_line.h +++ b/src/tools/core/stat_analysis/parse_stat_line.h @@ -25,6 +25,7 @@ // 008 10/09/17 Halley Gotway Add GRAD line type. // 009 04/25/18 Halley Gotway Add ECNT line type. // 010 01/24/20 Halley Gotway Add RPS line type. +// 011 09/28/22 Prestopnik MET #2227 Remove namespace std // //////////////////////////////////////////////////////////////////////// @@ -33,8 +34,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include diff --git a/src/tools/core/stat_analysis/skill_score_index_job.h b/src/tools/core/stat_analysis/skill_score_index_job.h index 74f2a33e0e..b00c4e93db 100644 --- a/src/tools/core/stat_analysis/skill_score_index_job.h +++ b/src/tools/core/stat_analysis/skill_score_index_job.h @@ -15,6 +15,8 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 07/28/21 Halley Gotway New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std +// // //////////////////////////////////////////////////////////////////////// @@ -23,8 +25,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -78,17 +78,17 @@ class SSIndexJobInfo { NumArray n_fcst_lines, n_ref_lines; // Input line type for each term - vector job_lt; + std::vector job_lt; // Vectors of jobs for each term - vector fcst_job; - vector ref_job; + std::vector fcst_job; + std::vector ref_job; // Vectors of partial sums and contingency tables for each term - vector fcst_sl1l2; - vector ref_sl1l2; - vector fcst_cts; - vector ref_cts; + std::vector fcst_sl1l2; + std::vector ref_sl1l2; + std::vector fcst_cts; + std::vector ref_cts; // Add jobs for each term void add_term(const STATAnalysisJob &, diff --git a/src/tools/core/stat_analysis/stat_analysis.h b/src/tools/core/stat_analysis/stat_analysis.h index 4c9f461139..ad8bd15c6f 100644 --- a/src/tools/core/stat_analysis/stat_analysis.h +++ b/src/tools/core/stat_analysis/stat_analysis.h @@ -16,6 +16,7 @@ // ---- ---- ---- ----------- // 000 11/11/08 Halley Gotway New // 001 05/03/12 Halley Gotway Switch to using vx_config library. +// 002 09/28/22 Prestopnik MET #2227 Remove namespace std // //////////////////////////////////////////////////////////////////////// @@ -26,8 +27,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -70,8 +69,8 @@ static StringArray search_dirs; static StringArray files; // Output file set with -out -static ConcatString out_file; -static ofstream *sa_out = (ofstream *) 0; +static ConcatString out_file; +static std::ofstream *sa_out = (std::ofstream *) 0; // Config file set with -config static ConcatString config_file; @@ -91,7 +90,7 @@ static ConcatString tmp_file; static ConcatString tmp_path; // Output file stream for the temporary file -static ofstream tmp_out; +static std::ofstream tmp_out; // STAT-Analysis configuration object static MetConfig conf; diff --git a/src/tools/core/stat_analysis/stat_analysis_job.h b/src/tools/core/stat_analysis/stat_analysis_job.h index 9235af7da3..a963fd1944 100644 --- a/src/tools/core/stat_analysis/stat_analysis_job.h +++ b/src/tools/core/stat_analysis/stat_analysis_job.h @@ -24,6 +24,7 @@ // 006 10/09/17 Halley Gotway Add aggregate GRAD lines. // 007 03/01/18 Halley Gotway Update summary job type. // 008 01/24/20 Halley Gotway Add aggregate RPS lines. +// 009 09/28/22 Prestopnik MET #2227 Remove namespace std // //////////////////////////////////////////////////////////////////////// @@ -32,8 +33,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -53,26 +52,26 @@ extern void set_job_from_config(MetConfig &, STATAnalysisJob &); extern void do_job(const ConcatString &, STATAnalysisJob &, int, const ConcatString &, const ConcatString &, - ofstream *); + std::ofstream *); extern void do_job_filter(const ConcatString &, LineDataFile &, - STATAnalysisJob &, int &, int &, ofstream *); + STATAnalysisJob &, int &, int &, std::ofstream *); extern void do_job_summary(const ConcatString &, LineDataFile &, - STATAnalysisJob &, int &, int &, ofstream *, gsl_rng *); + STATAnalysisJob &, int &, int &, std::ofstream *, gsl_rng *); extern void do_job_aggr(const ConcatString &, LineDataFile &, - STATAnalysisJob &, int &, int &, ofstream *); + STATAnalysisJob &, int &, int &, std::ofstream *); extern void do_job_aggr_stat(const ConcatString &, LineDataFile &, - STATAnalysisJob &, int &, int &, ofstream *, + STATAnalysisJob &, int &, int &, std::ofstream *, const ConcatString &, gsl_rng *); extern void do_job_ss_index(const ConcatString &, LineDataFile &, - STATAnalysisJob &, int &, int &, ofstream *); + STATAnalysisJob &, int &, int &, std::ofstream *); extern void do_job_ramp(const ConcatString &, LineDataFile &, - STATAnalysisJob &, int &, int &, ofstream *); + STATAnalysisJob &, int &, int &, std::ofstream *); //////////////////////////////////////////////////////////////////////// @@ -80,61 +79,61 @@ extern void write_job_aggr_hdr(STATAnalysisJob &, int, int, AsciiTable &); extern void write_job_summary(STATAnalysisJob &, - map &, AsciiTable &, + std::map &, AsciiTable &, gsl_rng *); extern void write_job_aggr_ctc(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_mctc(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_pct(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_psum(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_grad(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_wind(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_ecnt(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_rps(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_rhist(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_phist(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_relp(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_ssvar(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_orank(STATAnalysisJob &, STATLineType, - map &, AsciiTable &, + std::map &, AsciiTable &, gsl_rng *); extern void write_job_aggr_isc(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_aggr_mpr(STATAnalysisJob &, STATLineType, - map &, AsciiTable &, + std::map &, AsciiTable &, const char *, gsl_rng *); extern void write_job_aggr_mpr_wind(STATAnalysisJob &, STATLineType, - map &, AsciiTable &); + std::map &, AsciiTable &); extern void write_job_ramp(STATAnalysisJob &, - map &, + std::map &, AsciiTable &, AsciiTable &, AsciiTable &); extern void write_job_ramp_cols(const STATAnalysisJob &, AsciiTable &, @@ -146,9 +145,9 @@ extern void write_job_ss_index(STATAnalysisJob &, //////////////////////////////////////////////////////////////////////// extern void setup_table (AsciiTable &, int, int); -extern void write_table (AsciiTable &, ofstream *); -extern void write_jobstring(const ConcatString &, ofstream *); -extern void write_line (const ConcatString &, ofstream *); +extern void write_table (AsciiTable &, std::ofstream *); +extern void write_jobstring(const ConcatString &, std::ofstream *); +extern void write_line (const ConcatString &, std::ofstream *); //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/core/wavelet_stat/wavelet_stat.cc b/src/tools/core/wavelet_stat/wavelet_stat.cc index fba1cc753d..233f261384 100644 --- a/src/tools/core/wavelet_stat/wavelet_stat.cc +++ b/src/tools/core/wavelet_stat/wavelet_stat.cc @@ -38,6 +38,7 @@ // 013 04/01/19 Fillmore Add FCST and OBS units. // 014 07/09/21 Linden MET #1746 Skip thresholding. // 015 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 016 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -56,6 +57,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "wavelet_stat.h" #include "vx_statistics.h" diff --git a/src/tools/core/wavelet_stat/wavelet_stat.h b/src/tools/core/wavelet_stat/wavelet_stat.h index c27548cae6..57155d4d8b 100644 --- a/src/tools/core/wavelet_stat/wavelet_stat.h +++ b/src/tools/core/wavelet_stat/wavelet_stat.h @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 11/11/08 Halley Gotway New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -25,8 +26,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -41,7 +40,6 @@ using namespace std; #include #include -using namespace netCDF; #include "wavelet_stat_conf_info.h" @@ -95,30 +93,30 @@ static ConcatString out_dir; // Output NetCDF file static ConcatString out_nc_file; -static NcFile *nc_out = (NcFile *) 0; -static NcDim x_dim ; -static NcDim y_dim ; -static NcDim scale_dim ; -static NcDim tile_dim ; -static NcVar fcst_var ; -static NcVar obs_var ; -static NcVar diff_var ; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +static netCDF::NcDim x_dim ; +static netCDF::NcDim y_dim ; +static netCDF::NcDim scale_dim ; +static netCDF::NcDim tile_dim ; +static netCDF::NcVar fcst_var ; +static netCDF::NcVar obs_var ; +static netCDF::NcVar diff_var ; // Output PostScript file static ConcatString out_ps_file; static PSfile *ps_out = (PSfile *) 0; // Output STAT file -static ConcatString stat_file; -static ofstream *stat_out = (ofstream *) 0; -static AsciiTable stat_at; -static int i_stat_row; +static ConcatString stat_file; +static std::ofstream *stat_out = (std::ofstream *) 0; +static AsciiTable stat_at; +static int i_stat_row; // Optional ISC output file -static ConcatString isc_file; -static ofstream *isc_out = (ofstream *) 0; -static AsciiTable isc_at; -static int i_isc_row; +static ConcatString isc_file; +static std::ofstream *isc_out = (std::ofstream *) 0; +static AsciiTable isc_at; +static int i_isc_row; //////////////////////////////////////////////////////////////////////// // diff --git a/src/tools/dev_utils/gen_climo_bin.cc b/src/tools/dev_utils/gen_climo_bin.cc index 5983eba9aa..a063fd9df8 100644 --- a/src/tools/dev_utils/gen_climo_bin.cc +++ b/src/tools/dev_utils/gen_climo_bin.cc @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 001 09/29/22 Prestopnik MET #2227 Remove namespace netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -31,6 +32,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "main.h" #include "vx_util.h" #include "vx_nc_util.h" diff --git a/src/tools/dev_utils/insitu_nc_file.cc b/src/tools/dev_utils/insitu_nc_file.cc index d1bde55beb..db3955924d 100644 --- a/src/tools/dev_utils/insitu_nc_file.cc +++ b/src/tools/dev_utils/insitu_nc_file.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_math.h" #include "vx_cal.h" #include "vx_log.h" diff --git a/src/tools/dev_utils/insitu_nc_file.h b/src/tools/dev_utils/insitu_nc_file.h index f4b316d344..473dc4af5e 100644 --- a/src/tools/dev_utils/insitu_nc_file.h +++ b/src/tools/dev_utils/insitu_nc_file.h @@ -23,9 +23,6 @@ #include -#include -using namespace netCDF; - #include "vx_grid.h" #include "data_plane.h" #include "long_array.h" @@ -53,7 +50,7 @@ class InsituNcFile { void close(); - NcFile * _ncFile; // allocated + netCDF::NcFile * _ncFile; // allocated long _numRecords; long _currRecord; diff --git a/src/tools/dev_utils/met_nc_file.cc b/src/tools/dev_utils/met_nc_file.cc index 20e11cbeaf..264d222536 100644 --- a/src/tools/dev_utils/met_nc_file.cc +++ b/src/tools/dev_utils/met_nc_file.cc @@ -14,6 +14,9 @@ using namespace std; +#include +using namespace netCDF; + #include "vx_log.h" #include "vx_math.h" diff --git a/src/tools/dev_utils/met_nc_file.h b/src/tools/dev_utils/met_nc_file.h index 0b89cbdf40..81b702e2b9 100644 --- a/src/tools/dev_utils/met_nc_file.h +++ b/src/tools/dev_utils/met_nc_file.h @@ -23,9 +23,6 @@ #include #include -#include -using namespace netCDF; - #include "vx_time_series.h" //////////////////////////////////////////////////////////////////////// @@ -36,14 +33,14 @@ class MetNcFile public: - MetNcFile(const string &file_path); + MetNcFile(const std::string &file_path); virtual ~MetNcFile(); bool readFile(const int desired_grib_code, - const string &desired_station_id, - const string &desired_message_type, - vector< SDObservation > &observations); + const std::string &desired_station_id, + const std::string &desired_message_type, + std::vector< SDObservation > &observations); protected: @@ -52,34 +49,34 @@ class MetNcFile // Protected members // /////////////////////// - string _filePath; + std::string _filePath; - NcFile *_ncFile; - - NcDim *_hdrArrDim; - NcDim *_obsArrDim; - NcDim *_nhdrDim; - NcDim *_nobsDim; - NcDim *_strlDim; - - NcDim hdrArrDim; - NcDim obsArrDim; - NcDim nhdrDim; - NcDim nobsDim; - NcDim strlDim; - NcDim strllDim; - - NcVar *_hdrArrVar; - NcVar *_hdrTypeVar; - NcVar *_hdrSidVar; - NcVar *_hdrVldVar; - NcVar *_obsArrVar; + netCDF::NcFile *_ncFile; + + netCDF::NcDim *_hdrArrDim; + netCDF::NcDim *_obsArrDim; + netCDF::NcDim *_nhdrDim; + netCDF::NcDim *_nobsDim; + netCDF::NcDim *_strlDim; + + netCDF::NcDim hdrArrDim; + netCDF::NcDim obsArrDim; + netCDF::NcDim nhdrDim; + netCDF::NcDim nobsDim; + netCDF::NcDim strlDim; + netCDF::NcDim strllDim; + + netCDF::NcVar *_hdrArrVar; + netCDF::NcVar *_hdrTypeVar; + netCDF::NcVar *_hdrSidVar; + netCDF::NcVar *_hdrVldVar; + netCDF::NcVar *_obsArrVar; - NcVar hdrArrVar; - NcVar hdrTypeVar; - NcVar hdrSidVar; - NcVar hdrVldVar; - NcVar obsArrVar; + netCDF::NcVar hdrArrVar; + netCDF::NcVar hdrTypeVar; + netCDF::NcVar hdrSidVar; + netCDF::NcVar hdrVldVar; + netCDF::NcVar obsArrVar; /////////////////////// // Protected methods // diff --git a/src/tools/dev_utils/nceptab_to_flat.cc b/src/tools/dev_utils/nceptab_to_flat.cc index 5c9934e163..73c48ca14a 100644 --- a/src/tools/dev_utils/nceptab_to_flat.cc +++ b/src/tools/dev_utils/nceptab_to_flat.cc @@ -9,6 +9,9 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; + +//////////////////////////////////////////////////////////////////////// // // Takes a bunch of C source files from the wgrib code diff --git a/src/tools/dev_utils/pbtime.cc b/src/tools/dev_utils/pbtime.cc index ec3bcc4517..6d2c49a001 100644 --- a/src/tools/dev_utils/pbtime.cc +++ b/src/tools/dev_utils/pbtime.cc @@ -15,9 +15,12 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/dev_utils/reformat_county_data.cc b/src/tools/dev_utils/reformat_county_data.cc index a81f84dfa6..fb563b9ad8 100644 --- a/src/tools/dev_utils/reformat_county_data.cc +++ b/src/tools/dev_utils/reformat_county_data.cc @@ -9,6 +9,7 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include diff --git a/src/tools/dev_utils/reformat_map_data.cc b/src/tools/dev_utils/reformat_map_data.cc index ce0eb1a631..f87be38ea9 100644 --- a/src/tools/dev_utils/reformat_map_data.cc +++ b/src/tools/dev_utils/reformat_map_data.cc @@ -9,6 +9,7 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include diff --git a/src/tools/dev_utils/swinging_door.cc b/src/tools/dev_utils/swinging_door.cc index c38032dc30..49bc48657c 100644 --- a/src/tools/dev_utils/swinging_door.cc +++ b/src/tools/dev_utils/swinging_door.cc @@ -18,10 +18,13 @@ // ---- ---- ---- ----------- // 000 08-19-14 Rehak New // 001 04-27-154 Halley Gotway List and format output files -// 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 003 09-12-22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/other/ascii2nc/airnow_locations.cc b/src/tools/other/ascii2nc/airnow_locations.cc index 0435ad8281..10810c8727 100644 --- a/src/tools/other/ascii2nc/airnow_locations.cc +++ b/src/tools/other/ascii2nc/airnow_locations.cc @@ -12,7 +12,6 @@ using namespace std; - #include #include #include @@ -103,7 +102,7 @@ bool AirnowLocations::initialize(const string &fileName) // assume the full aqsid are unique compared to the non-full simple aqsid or even the station id // look for the 'full' - std::vector::const_iterator it; + vector::const_iterator it; it = find(monitoringSiteFullAqsid.begin(), monitoringSiteFullAqsid.end(), fullaqsid); if (it == monitoringSiteFullAqsid.end()) { monitoringSiteAqsid.push_back(aqsid); diff --git a/src/tools/other/ascii2nc/ascii2nc.cc b/src/tools/other/ascii2nc/ascii2nc.cc index e1be8ba119..2e4eaf960b 100644 --- a/src/tools/other/ascii2nc/ascii2nc.cc +++ b/src/tools/other/ascii2nc/ascii2nc.cc @@ -47,9 +47,12 @@ // ascii. // 019 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main // 020 08/26/22 Dave Albo Add AirNow observations. +// 021 10/03/22 Prestopnik MET #2227 Remove using namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/other/ascii2nc/file_handler.cc b/src/tools/other/ascii2nc/file_handler.cc index 9be6e86495..492398c89b 100644 --- a/src/tools/other/ascii2nc/file_handler.cc +++ b/src/tools/other/ascii2nc/file_handler.cc @@ -15,6 +15,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_math.h" #include "vx_nc_util.h" diff --git a/src/tools/other/ascii2nc/file_handler.h b/src/tools/other/ascii2nc/file_handler.h index 092fd0340a..495705b803 100644 --- a/src/tools/other/ascii2nc/file_handler.h +++ b/src/tools/other/ascii2nc/file_handler.h @@ -23,7 +23,6 @@ #include #include -using namespace netCDF; #include "mask_poly.h" #include "vx_grid.h" @@ -85,7 +84,7 @@ class FileHandler // Variables for writing output NetCDF file - NcFile *_ncFile; + netCDF::NcFile *_ncFile; MetNcPointObsOut nc_point_obs; long _nhdr; diff --git a/src/tools/other/gen_ens_prod/gen_ens_prod.cc b/src/tools/other/gen_ens_prod/gen_ens_prod.cc index 32948bf06a..f0140b840e 100644 --- a/src/tools/other/gen_ens_prod/gen_ens_prod.cc +++ b/src/tools/other/gen_ens_prod/gen_ens_prod.cc @@ -19,9 +19,12 @@ // 002 01/14/21 McCabe MET #1695 All members in one file. // 003 02/17/22 Halley Gotway MET #1918 Add normalize config option. // 004 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 005 10/03/22 Prestopnik MET #2227 Remove using namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -33,6 +36,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "gen_ens_prod.h" diff --git a/src/tools/other/gen_ens_prod/gen_ens_prod.h b/src/tools/other/gen_ens_prod/gen_ens_prod.h index 332c7594a7..cfe0120a8e 100644 --- a/src/tools/other/gen_ens_prod/gen_ens_prod.h +++ b/src/tools/other/gen_ens_prod/gen_ens_prod.h @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 09/10/21 Halley Gotway MET #1904 Initial version. +// 001 09/29/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -23,8 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -39,7 +38,6 @@ using namespace std; #include #include -using namespace netCDF; #include "gen_ens_prod_conf_info.h" @@ -83,9 +81,9 @@ static unixtime ens_valid_ut = (unixtime) 0; //////////////////////////////////////////////////////////////////////// // Output NetCDF file -static NcFile *nc_out = (NcFile *) 0; -static NcDim lat_dim; -static NcDim lon_dim; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +static netCDF::NcDim lat_dim; +static netCDF::NcDim lon_dim; // List of output NetCDF variable names static StringArray nc_ens_var_sa; diff --git a/src/tools/other/gen_ens_prod/gen_ens_prod_conf_info.h b/src/tools/other/gen_ens_prod/gen_ens_prod_conf_info.h index f92a49d153..c6199639c2 100644 --- a/src/tools/other/gen_ens_prod/gen_ens_prod_conf_info.h +++ b/src/tools/other/gen_ens_prod/gen_ens_prod_conf_info.h @@ -82,9 +82,9 @@ class GenEnsProdConfInfo { ConcatString desc; // Description ConcatString control_id; // Control ID - vector ens_input; // Vector of GenEnsProdVarInfo pointers (allocated) - vector cdf_info; // Array of climo CDF info objects - StringArray ens_member_ids; // Array of ensemble member ID strings + std::vector ens_input; // Vector of GenEnsProdVarInfo pointers (allocated) + std::vector cdf_info; // Array of climo CDF info objects + StringArray ens_member_ids; // Array of ensemble member ID strings NbrhdInfo nbrhd_prob; // Neighborhood probability definition InterpInfo nmep_smooth; // Neighborhood maximum smoothing information diff --git a/src/tools/other/gen_vx_mask/gen_vx_mask.cc b/src/tools/other/gen_vx_mask/gen_vx_mask.cc index 55572b1a2b..f65d466fd6 100644 --- a/src/tools/other/gen_vx_mask/gen_vx_mask.cc +++ b/src/tools/other/gen_vx_mask/gen_vx_mask.cc @@ -28,10 +28,13 @@ // 010 08/30/21 Halley Gotway MET #1891 Fix input and mask fields. // 011 12/13/21 Halley Gotway MET #1993 Fix -type grid. // 012 05/05/22 Halley Gotway MET #2152 Add -type poly_xy. -// 013 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 013 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 014 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -43,6 +46,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "gen_vx_mask.h" diff --git a/src/tools/other/gen_vx_mask/gen_vx_mask.h b/src/tools/other/gen_vx_mask/gen_vx_mask.h index 937b5db8c5..d87ed09c0f 100644 --- a/src/tools/other/gen_vx_mask/gen_vx_mask.h +++ b/src/tools/other/gen_vx_mask/gen_vx_mask.h @@ -20,6 +20,7 @@ // 003 06/03/21 Seth Linden Changed default mask type to MaskType_None. // 004 08/30/21 Halley Gotway MET #1891 fix input and mask fields. // 005 05/05/22 Halley Gotway MET #2152 Add -type poly_xy. +// 006 09/29/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -28,8 +29,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include "vx_util.h" #include "vx_cal.h" #include "mask_poly.h" diff --git a/src/tools/other/gis_utils/gis_dump_dbf.cc b/src/tools/other/gis_utils/gis_dump_dbf.cc index 1afd53e07f..8b9a1c6157 100644 --- a/src/tools/other/gis_utils/gis_dump_dbf.cc +++ b/src/tools/other/gis_utils/gis_dump_dbf.cc @@ -12,6 +12,7 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include diff --git a/src/tools/other/gis_utils/gis_dump_shp.cc b/src/tools/other/gis_utils/gis_dump_shp.cc index 6db3275963..37d0c06f0b 100644 --- a/src/tools/other/gis_utils/gis_dump_shp.cc +++ b/src/tools/other/gis_utils/gis_dump_shp.cc @@ -12,6 +12,7 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include @@ -89,7 +90,7 @@ cline.parse(); if ( cline.n() != 1 ) usage(); - ConcatString input_filename = (string)cline[0]; +ConcatString input_filename = (string)cline[0]; ShpFile f; diff --git a/src/tools/other/gis_utils/gis_dump_shx.cc b/src/tools/other/gis_utils/gis_dump_shx.cc index d8b37d049f..c22700d653 100644 --- a/src/tools/other/gis_utils/gis_dump_shx.cc +++ b/src/tools/other/gis_utils/gis_dump_shx.cc @@ -12,6 +12,7 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include diff --git a/src/tools/other/grid_diag/grid_diag.cc b/src/tools/other/grid_diag/grid_diag.cc index a8e2212371..96e3be2a94 100644 --- a/src/tools/other/grid_diag/grid_diag.cc +++ b/src/tools/other/grid_diag/grid_diag.cc @@ -18,10 +18,13 @@ // 001 07/28/20 Halley Gotway Updates for #1391. // 002 03/04/21 Halley Gotway Bugfix #1694. // 003 08/20/21 Halley Gotway Bugfix #1886 for integer overflow. -// 004 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 004 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 005 10/03/22 Prestopnik MET #2227 Remove using namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -33,6 +36,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "grid_diag.h" #include "series_data.h" diff --git a/src/tools/other/grid_diag/grid_diag.h b/src/tools/other/grid_diag/grid_diag.h index 1bc4d4f30d..18b18d3326 100644 --- a/src/tools/other/grid_diag/grid_diag.h +++ b/src/tools/other/grid_diag/grid_diag.h @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 10/01/19 Fillmore New +// 001 09/29/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -23,8 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -40,7 +39,6 @@ using namespace std; #include #include -using namespace netCDF; #include "grid_diag_conf_info.h" @@ -87,10 +85,10 @@ static GridDiagConfInfo conf_info; //////////////////////////////////////////////////////////////////////// // Output NetCDF file -static NcFile *nc_out = (NcFile *) 0; -vector data_var_dims; -vector hist_vars; -vector joint_hist_vars; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +vector data_var_dims; +vector hist_vars; +vector joint_hist_vars; //////////////////////////////////////////////////////////////////////// // diff --git a/src/tools/other/gsi_tools/gsi_util.h b/src/tools/other/gsi_tools/gsi_util.h index cc3f5aa3ee..f8477162cd 100644 --- a/src/tools/other/gsi_tools/gsi_util.h +++ b/src/tools/other/gsi_tools/gsi_util.h @@ -13,8 +13,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include "vx_stat_out.h" //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/other/gsi_tools/gsid2mpr.cc b/src/tools/other/gsi_tools/gsid2mpr.cc index 33b841d370..83527ea9e1 100644 --- a/src/tools/other/gsi_tools/gsid2mpr.cc +++ b/src/tools/other/gsi_tools/gsid2mpr.cc @@ -16,10 +16,13 @@ // ---- ---- ---- ----------- // 000 06/09/15 Bullock New // 001 01/26/16 Halley Gotway Add -no_check_dup option. -// 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 003 10/03/22 Prestopnik MET #2227 Remove using namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/other/gsi_tools/gsid2mpr.h b/src/tools/other/gsi_tools/gsid2mpr.h index 32b0733b9a..04001d5479 100644 --- a/src/tools/other/gsi_tools/gsid2mpr.h +++ b/src/tools/other/gsi_tools/gsid2mpr.h @@ -16,6 +16,7 @@ // ---- ---- ---- ----------- // 000 06/09/15 Bullock New // 001 01/26/16 Halley Gotway Add -no_check_dup option. +// 002 09/29/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -24,8 +25,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include "vx_util.h" diff --git a/src/tools/other/gsi_tools/gsidens2orank.cc b/src/tools/other/gsi_tools/gsidens2orank.cc index 903960793f..744ba5fff6 100644 --- a/src/tools/other/gsi_tools/gsidens2orank.cc +++ b/src/tools/other/gsi_tools/gsidens2orank.cc @@ -16,9 +16,12 @@ // ---- ---- ---- ----------- // 000 07/09/15 Halley Gotway New // 001 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 10/03/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/other/gsi_tools/gsidens2orank.h b/src/tools/other/gsi_tools/gsidens2orank.h index 0e8fb7dcdd..e68b0d9b09 100644 --- a/src/tools/other/gsi_tools/gsidens2orank.h +++ b/src/tools/other/gsi_tools/gsidens2orank.h @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 07/09/15 Halley Gotway New +// 001 09/29/22 Prestopnik MET #2227 Removing namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -23,8 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include "vx_util.h" diff --git a/src/tools/other/ioda2nc/ioda2nc.cc b/src/tools/other/ioda2nc/ioda2nc.cc index 90c6c75c34..1aaef67ba1 100644 --- a/src/tools/other/ioda2nc/ioda2nc.cc +++ b/src/tools/other/ioda2nc/ioda2nc.cc @@ -21,9 +21,12 @@ // ---- ---- ---- ----------- // 000 07-21-20 Howard Soh New // 001 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 09-29-22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -31,6 +34,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "apply_mask.h" #include "ioda2nc_conf_info.h" diff --git a/src/tools/other/lidar2nc/lidar2nc.cc b/src/tools/other/lidar2nc/lidar2nc.cc index 18adf15d73..49b649059b 100644 --- a/src/tools/other/lidar2nc/lidar2nc.cc +++ b/src/tools/other/lidar2nc/lidar2nc.cc @@ -18,6 +18,7 @@ // ---- ---- ---- ----------- // 000 03-22-17 Bullock New // 001 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 09-12-22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -27,6 +28,7 @@ static const char hdr_typ_string[] = "calipso"; //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include @@ -41,6 +43,7 @@ static const char hdr_typ_string[] = "calipso"; #include #include +using namespace netCDF; #include "hdf.h" #include "mfhdf.h" diff --git a/src/tools/other/madis2nc/madis2nc.cc b/src/tools/other/madis2nc/madis2nc.cc index fd5640210b..ecf635a539 100644 --- a/src/tools/other/madis2nc/madis2nc.cc +++ b/src/tools/other/madis2nc/madis2nc.cc @@ -33,9 +33,12 @@ // 006 07-23-18 Halley Gotway Support masks from gen_vx_mask. // 007 01-11-19 Howard Soh Added config file option. // 008 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 009 09-29-22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -47,6 +50,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "madis2nc.h" diff --git a/src/tools/other/madis2nc/madis2nc.h b/src/tools/other/madis2nc/madis2nc.h index 3317fed702..5dd20f8133 100644 --- a/src/tools/other/madis2nc/madis2nc.h +++ b/src/tools/other/madis2nc/madis2nc.h @@ -19,6 +19,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 07-21-11 Halley Gotway Adapted from contributed code. +// 001 09-29-22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -27,10 +28,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - -//////////////////////////////////////////////////////////////////////// - #include "vx_log.h" #include "mask_poly.h" #include "vx_grid.h" diff --git a/src/tools/other/madis2nc/madis2nc_conf_info.h b/src/tools/other/madis2nc/madis2nc_conf_info.h index 8e25d40694..0ced5aafef 100644 --- a/src/tools/other/madis2nc/madis2nc_conf_info.h +++ b/src/tools/other/madis2nc/madis2nc_conf_info.h @@ -27,8 +27,8 @@ class Madis2NcConfInfo { Madis2NcConfInfo(); ~Madis2NcConfInfo(); - void read_config(const string &default_filename, - const string &user_filename); + void read_config(const std::string &default_filename, + const std::string &user_filename); TimeSummaryInfo getSummaryInfo() const { diff --git a/src/tools/other/mode_graphics/cgraph_font.h b/src/tools/other/mode_graphics/cgraph_font.h index 0c2ea2cff5..f8e4f8b493 100644 --- a/src/tools/other/mode_graphics/cgraph_font.h +++ b/src/tools/other/mode_graphics/cgraph_font.h @@ -50,7 +50,7 @@ class CgFont { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; void set_by_number(int); // for builtin fonts @@ -109,7 +109,7 @@ class CgFontCollection { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; int n_fonts() const; diff --git a/src/tools/other/mode_graphics/color_stack.h b/src/tools/other/mode_graphics/color_stack.h index 9afd846a91..a583fc4efa 100644 --- a/src/tools/other/mode_graphics/color_stack.h +++ b/src/tools/other/mode_graphics/color_stack.h @@ -54,7 +54,7 @@ class ColorStack { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; void set_alloc_inc(int = 0); // 0 means default value (10) diff --git a/src/tools/other/mode_graphics/mode_nc_output_file.cc b/src/tools/other/mode_graphics/mode_nc_output_file.cc index ce45948a81..c50d28554f 100644 --- a/src/tools/other/mode_graphics/mode_nc_output_file.cc +++ b/src/tools/other/mode_graphics/mode_nc_output_file.cc @@ -19,6 +19,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "mode_nc_output_file.h" #include "nc_var_info.h" #include "nc_utils.h" diff --git a/src/tools/other/mode_graphics/mode_nc_output_file.h b/src/tools/other/mode_graphics/mode_nc_output_file.h index 5959dedd73..68a398017e 100644 --- a/src/tools/other/mode_graphics/mode_nc_output_file.h +++ b/src/tools/other/mode_graphics/mode_nc_output_file.h @@ -18,7 +18,6 @@ #include -using namespace netCDF; #include "data_plane.h" #include "vx_grid.h" @@ -50,36 +49,36 @@ class ModeNcOutputFile { ConcatString Filename; - int get_int (NcVar *, int x, int y) const; - double get_float (NcVar *, int x, int y) const; + int get_int (netCDF::NcVar *, int x, int y) const; + double get_float (netCDF::NcVar *, int x, int y) const; - int count_objects(NcVar *) const; + int count_objects(netCDF::NcVar *) const; DataPlane select_obj(ModeObjectField, int) const; - void calc_data_range(NcVar *, double & min_value, double & max_value); + void calc_data_range(netCDF::NcVar *, double & min_value, double & max_value); - NcFile * f; // allocated + netCDF::NcFile * f; // allocated Grid * _Grid; // allocated - NcVar * FcstObjId; // NOT allocated - NcVar * FcstClusId; // NOT allocated + netCDF::NcVar * FcstObjId; // NOT allocated + netCDF::NcVar * FcstClusId; // NOT allocated - NcVar * ObsObjId; // NOT allocated - NcVar * ObsClusId; // NOT allocated + netCDF::NcVar * ObsObjId; // NOT allocated + netCDF::NcVar * ObsClusId; // NOT allocated - NcVar * FcstRaw; // NOT allocated - NcVar * ObsRaw; // NOT allocated + netCDF::NcVar * FcstRaw; // NOT allocated + netCDF::NcVar * ObsRaw; // NOT allocated - NcVar _FcstObjId; // - NcVar _FcstClusId; // + netCDF::NcVar _FcstObjId; // + netCDF::NcVar _FcstClusId; // - NcVar _ObsObjId; // - NcVar _ObsClusId; // + netCDF::NcVar _ObsObjId; // + netCDF::NcVar _ObsClusId; // - NcVar _FcstRaw; // - NcVar _ObsRaw; // + netCDF::NcVar _FcstRaw; // + netCDF::NcVar _ObsRaw; // ModeNcOutputFile(const ModeNcOutputFile &); ModeNcOutputFile & operator=(const ModeNcOutputFile &); @@ -115,7 +114,7 @@ class ModeNcOutputFile { void close(); - void dump(ostream &) const; + void dump(std::ostream &) const; ConcatString filename() const; ConcatString short_filename() const; diff --git a/src/tools/other/mode_graphics/plot_mode_field.cc b/src/tools/other/mode_graphics/plot_mode_field.cc index 118fbe9b6d..ebd917c4ef 100644 --- a/src/tools/other/mode_graphics/plot_mode_field.cc +++ b/src/tools/other/mode_graphics/plot_mode_field.cc @@ -17,6 +17,7 @@ // ---- ---- ---- ----------- // 000 09-05-14 Bullock New // 001 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 09-13-22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -30,6 +31,7 @@ static const int ctable_text_width = 30; //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include diff --git a/src/tools/other/mode_time_domain/3d_conv.cc b/src/tools/other/mode_time_domain/3d_conv.cc index 5a4027eafb..bc28ed8d7e 100644 --- a/src/tools/other/mode_time_domain/3d_conv.cc +++ b/src/tools/other/mode_time_domain/3d_conv.cc @@ -28,6 +28,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_cal.h" #include "vx_util.h" #include "vx_pxm.h" diff --git a/src/tools/other/mode_time_domain/mtd.cc b/src/tools/other/mode_time_domain/mtd.cc index 7038fee0d8..5cb1c982af 100644 --- a/src/tools/other/mode_time_domain/mtd.cc +++ b/src/tools/other/mode_time_domain/mtd.cc @@ -21,6 +21,7 @@ // 003 04-25-19 Halley Gotway Add percentiles to 2D output // 004 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main // 005 08-01-22 Albo MET #1971 Differing time steps +// 006 10-03-22 Prestopnik MET #2227 Remove using namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -42,6 +43,7 @@ static const char default_prefix [] = "mtd"; //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include 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 f1e3571d17..2c4244ded4 100644 --- a/src/tools/other/mode_time_domain/mtd_file_base.cc +++ b/src/tools/other/mode_time_domain/mtd_file_base.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "mtd_file.h" #include "mtd_partition.h" #include "mtd_nc_defs.h" diff --git a/src/tools/other/mode_time_domain/mtd_file_base.h b/src/tools/other/mode_time_domain/mtd_file_base.h index 98d30f10a1..bc84dbf37b 100644 --- a/src/tools/other/mode_time_domain/mtd_file_base.h +++ b/src/tools/other/mode_time_domain/mtd_file_base.h @@ -21,7 +21,6 @@ #include #include -using namespace netCDF; #include "vx_util.h" #include "vx_cal.h" @@ -77,8 +76,8 @@ class MtdFileBase { void base_assign(const MtdFileBase &); - virtual void read (NcFile &); - virtual void write (NcFile &) const; + virtual void read (netCDF::NcFile &); + virtual void write (netCDF::NcFile &) const; Grid * G; // allocated 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 6d7cb262a4..56304c428b 100644 --- a/src/tools/other/mode_time_domain/mtd_file_float.cc +++ b/src/tools/other/mode_time_domain/mtd_file_float.cc @@ -21,6 +21,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "mtd_file.h" #include "mtd_partition.h" #include "mtd_nc_defs.h" diff --git a/src/tools/other/mode_time_domain/mtd_file_float.h b/src/tools/other/mode_time_domain/mtd_file_float.h index 20493e5965..615b9a3c93 100644 --- a/src/tools/other/mode_time_domain/mtd_file_float.h +++ b/src/tools/other/mode_time_domain/mtd_file_float.h @@ -47,8 +47,8 @@ class MtdFloatFile : public MtdFileBase { void float_assign(const MtdFloatFile &); - virtual void read (NcFile &); - virtual void write (NcFile &) const; + virtual void read (netCDF::NcFile &); + virtual void write (netCDF::NcFile &) const; float * Data; // allocated 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 931a3cb994..4bf41a4792 100644 --- a/src/tools/other/mode_time_domain/mtd_file_int.cc +++ b/src/tools/other/mode_time_domain/mtd_file_int.cc @@ -21,6 +21,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "mtd_file.h" #include "mtd_partition.h" #include "mtd_nc_defs.h" diff --git a/src/tools/other/mode_time_domain/mtd_file_int.h b/src/tools/other/mode_time_domain/mtd_file_int.h index 8611b25368..098d56d046 100644 --- a/src/tools/other/mode_time_domain/mtd_file_int.h +++ b/src/tools/other/mode_time_domain/mtd_file_int.h @@ -43,8 +43,8 @@ class MtdIntFile : public MtdFileBase { void int_assign(const MtdIntFile &); - virtual void read (NcFile &); - virtual void write (NcFile &) const; + virtual void read (netCDF::NcFile &); + virtual void write (netCDF::NcFile &) const; diff --git a/src/tools/other/mode_time_domain/mtd_nc_output.cc b/src/tools/other/mode_time_domain/mtd_nc_output.cc index 86f1f84c48..7fd50136e2 100644 --- a/src/tools/other/mode_time_domain/mtd_nc_output.cc +++ b/src/tools/other/mode_time_domain/mtd_nc_output.cc @@ -17,6 +17,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "mtd_nc_output.h" #include "write_netcdf.h" diff --git a/src/tools/other/mode_time_domain/nc_grid.cc b/src/tools/other/mode_time_domain/nc_grid.cc index 516f24756a..e31246ab4d 100644 --- a/src/tools/other/mode_time_domain/nc_grid.cc +++ b/src/tools/other/mode_time_domain/nc_grid.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "nc_utils_local.h" #include "nc_grid.h" diff --git a/src/tools/other/mode_time_domain/nc_grid.h b/src/tools/other/mode_time_domain/nc_grid.h index 47bc766d37..70b45fdef9 100644 --- a/src/tools/other/mode_time_domain/nc_grid.h +++ b/src/tools/other/mode_time_domain/nc_grid.h @@ -25,9 +25,9 @@ //////////////////////////////////////////////////////////////////////// -extern bool read_nc_grid(NcFile &, Grid &); +extern bool read_nc_grid(netCDF::NcFile &, Grid &); -extern bool write_nc_grid(NcFile &, const Grid &); +extern bool write_nc_grid(netCDF::NcFile &, const Grid &); //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/other/mode_time_domain/nc_utils_local.cc b/src/tools/other/mode_time_domain/nc_utils_local.cc index 12a056f376..87af32b3ab 100644 --- a/src/tools/other/mode_time_domain/nc_utils_local.cc +++ b/src/tools/other/mode_time_domain/nc_utils_local.cc @@ -20,6 +20,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "nc_utils.h" #include "nc_utils_local.h" #include "vx_log.h" diff --git a/src/tools/other/mode_time_domain/nc_utils_local.h b/src/tools/other/mode_time_domain/nc_utils_local.h index 9cf6d18587..528f2b566a 100644 --- a/src/tools/other/mode_time_domain/nc_utils_local.h +++ b/src/tools/other/mode_time_domain/nc_utils_local.h @@ -25,10 +25,10 @@ //////////////////////////////////////////////////////////////////////// -extern const char * string_att (const NcFile &, const char * name); -extern int string_att_as_int (const NcFile &, const char * name); -extern long long string_att_as_ll (const NcFile &, const char * name); -extern double string_att_as_double (const NcFile &, const char * name); +extern const char * string_att (const netCDF::NcFile &, const char * name); +extern int string_att_as_int (const netCDF::NcFile &, const char * name); +extern long long string_att_as_ll (const netCDF::NcFile &, const char * name); +extern double string_att_as_double (const netCDF::NcFile &, const char * name); //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/other/modis_regrid/cloudsat_swath_file.h b/src/tools/other/modis_regrid/cloudsat_swath_file.h index 2cd797b84a..11f63f33c4 100644 --- a/src/tools/other/modis_regrid/cloudsat_swath_file.h +++ b/src/tools/other/modis_regrid/cloudsat_swath_file.h @@ -52,7 +52,7 @@ class SatDimension { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff @@ -125,7 +125,7 @@ class SatAttribute { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff @@ -213,7 +213,7 @@ class SwathDataField { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff @@ -307,7 +307,7 @@ class CloudsatSwath { void clear(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff @@ -417,7 +417,7 @@ class CloudsatSwathFile { void close(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff diff --git a/src/tools/other/modis_regrid/data_plane_to_netcdf.cc b/src/tools/other/modis_regrid/data_plane_to_netcdf.cc index 67baabf37c..e084cf0d97 100644 --- a/src/tools/other/modis_regrid/data_plane_to_netcdf.cc +++ b/src/tools/other/modis_regrid/data_plane_to_netcdf.cc @@ -21,6 +21,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "data_plane_to_netcdf.h" #include "vx_log.h" // mlog #include "vx_cal.h" // bad_data_float diff --git a/src/tools/other/modis_regrid/modis_file.h b/src/tools/other/modis_regrid/modis_file.h index c50510d683..757641c9d7 100644 --- a/src/tools/other/modis_regrid/modis_file.h +++ b/src/tools/other/modis_regrid/modis_file.h @@ -91,7 +91,7 @@ class ModisFile { void close(); - void dump(ostream &, int = 0) const; + void dump(std::ostream &, int = 0) const; // // set stuff diff --git a/src/tools/other/modis_regrid/modis_regrid.cc b/src/tools/other/modis_regrid/modis_regrid.cc index 0157de39fd..6e41bcee8c 100644 --- a/src/tools/other/modis_regrid/modis_regrid.cc +++ b/src/tools/other/modis_regrid/modis_regrid.cc @@ -15,6 +15,7 @@ static const char default_units [] = "none"; //////////////////////////////////////////////////////////////////////// +using namespace std; #include #include diff --git a/src/tools/other/pb2nc/pb2nc.cc b/src/tools/other/pb2nc/pb2nc.cc index 985b027b10..e1dc57a6e9 100644 --- a/src/tools/other/pb2nc/pb2nc.cc +++ b/src/tools/other/pb2nc/pb2nc.cc @@ -54,9 +54,13 @@ // 015 02/10/18 Halley Gotway Add message_type_group_map. // 016 07/23/18 Halley Gotway Support masks defined by gen_vx_mask. // 017 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 018 09/12/22 Prestopnik MET #2227 Remove namespace std and netCDF +// from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -69,6 +73,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "pb2nc_conf_info.h" #include "data_class.h" @@ -1057,7 +1064,7 @@ void process_pbfile(int i_pb) { if(mlog.verbosity_level() >= debug_level_for_performance) { end_t = clock(); cout << (end_t-start_t)/double(CLOCKS_PER_SEC) - << " seconds\n"; + << " seconds\n"; start_t = clock(); } } @@ -2502,7 +2509,7 @@ void write_netcdf_hdr_data() { map obs_var_map = conf_info.getObsVarMap(); for(int i=0; i pqtzuv_map_tq, float *pqtzuv_merged = (float *) 0; float *next_pqtzuv, *prev_pqtzuv; float tq_pres_max, tq_pres_min, uv_pres_max, uv_pres_min; - std::map::iterator it, it_tq, it_uv; + map::iterator it, it_tq, it_uv; // Gets pressure levels for TQZ records it = pqtzuv_map_tq.begin(); @@ -3042,7 +3049,7 @@ float compute_pbl(map pqtzuv_map_tq, int pbl_level; int tq_count = pqtzuv_map_tq.size(); int uv_count = pqtzuv_map_uv.size(); - std::map::iterator it; + map::iterator it; static const char *method_name = "compute_pbl() "; hpbl = bad_data_float; @@ -3317,7 +3324,7 @@ void merge_records(float *first_pqtzuv, map pqtzuv_map_pivot, float cur_pres; float *cur_pqtzuv, *next_pqtzuv, *prev_pqtzuv; float *pqtzuv_merged; - std::map::iterator it_pivot, it_aux; + map::iterator it_pivot, it_aux; static const char *method_name = "merge_records() "; float first_pres = first_pqtzuv[0]; @@ -3389,7 +3396,7 @@ void log_tqz_and_uv(map pqtzuv_map_tq, int offset; ConcatString buf; StringArray log_array; - std::map::iterator it; + map::iterator it; for (it=pqtzuv_map_tq.begin(); it!=pqtzuv_map_tq.end(); ++it) { float *pqtzuv = it->second; @@ -3429,7 +3436,7 @@ void log_merged_tqz_uv(map pqtzuv_map_tq, const char *method_name) { ConcatString buf; StringArray log_array; - for (std::map::iterator it=pqtzuv_map_merged.begin(); + for (map::iterator it=pqtzuv_map_merged.begin(); it!=pqtzuv_map_merged.end(); ++it) { float *pqtzuv = it->second; buf.clear(); diff --git a/src/tools/other/pb2nc/pb2nc_conf_info.h b/src/tools/other/pb2nc/pb2nc_conf_info.h index 5bff649adf..401e0271f0 100644 --- a/src/tools/other/pb2nc/pb2nc_conf_info.h +++ b/src/tools/other/pb2nc/pb2nc_conf_info.h @@ -57,8 +57,8 @@ class PB2NCConfInfo { ConcatString tmp_dir; // Directory for temporary files ConcatString version; // Config file version - map obs_bufr_map; - map message_type_map; + std::map obs_bufr_map; + std::map message_type_map; StringArray surface_message_types; TimeSummaryInfo timeSummaryInfo; @@ -70,8 +70,8 @@ class PB2NCConfInfo { void clear(); - map getObsVarMap() const { return obs_bufr_map; } - map getMessageTypeMap() const { return message_type_map; } + std::map getObsVarMap() const { return obs_bufr_map; } + std::map getMessageTypeMap() const { return message_type_map; } TimeSummaryInfo getSummaryInfo() const { return timeSummaryInfo; }; void read_config(const char *, const char *); diff --git a/src/tools/other/plot_data_plane/plot_data_plane.cc b/src/tools/other/plot_data_plane/plot_data_plane.cc index b373c520f4..940a355073 100644 --- a/src/tools/other/plot_data_plane/plot_data_plane.cc +++ b/src/tools/other/plot_data_plane/plot_data_plane.cc @@ -25,10 +25,13 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 12/19/11 Holmes New -// 001 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 001 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -97,7 +100,7 @@ int met_main(int argc, char * argv[]) { double data_min, data_max; bool status = false; - std::ios::sync_with_stdio(true); + ios::sync_with_stdio(true); // // set the default color table diff --git a/src/tools/other/plot_point_obs/plot_point_obs.cc b/src/tools/other/plot_point_obs/plot_point_obs.cc index 47ccd59e44..164d4304f7 100644 --- a/src/tools/other/plot_point_obs/plot_point_obs.cc +++ b/src/tools/other/plot_point_obs/plot_point_obs.cc @@ -26,9 +26,12 @@ // 003 01/24/13 Halley Gotway Add -dotsize. // 004 11/10/20 Halley Gotway Add -config and -plot_grid. // 005 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_mai +// 006 09/29/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/other/plot_point_obs/plot_point_obs.h b/src/tools/other/plot_point_obs/plot_point_obs.h index aeef6c87b2..41c8c0f47b 100644 --- a/src/tools/other/plot_point_obs/plot_point_obs.h +++ b/src/tools/other/plot_point_obs/plot_point_obs.h @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 11/05/20 Halley Gotway New +// 001 09/29/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -23,8 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -38,8 +37,6 @@ using namespace std; #include #include -#include -using namespace netCDF; #include "plot_point_obs_conf_info.h" diff --git a/src/tools/other/plot_point_obs/plot_point_obs_conf_info.h b/src/tools/other/plot_point_obs/plot_point_obs_conf_info.h index 0791512f7c..38c6c06a2d 100644 --- a/src/tools/other/plot_point_obs/plot_point_obs_conf_info.h +++ b/src/tools/other/plot_point_obs/plot_point_obs_conf_info.h @@ -103,7 +103,7 @@ class PlotPointObsOpt { // Unique collection of locations int n_obs; - vector locations; + std::vector locations; // Flags bool store_obs_val; @@ -150,7 +150,7 @@ class PlotPointObsConfInfo { UserFunc_1Arg const_dotsize_fx; // Options for plotting point data - vector point_opts; + std::vector point_opts; ConcatString tmp_dir; // Directory for temporary files ConcatString version; // Config file version diff --git a/src/tools/other/point2grid/point2grid.cc b/src/tools/other/point2grid/point2grid.cc index 78c622e17c..496e3384e0 100644 --- a/src/tools/other/point2grid/point2grid.cc +++ b/src/tools/other/point2grid/point2grid.cc @@ -20,13 +20,19 @@ // 000 12-11-19 Howard Soh Support GOES-16 // 001 01-25-21 Halley Gotway MET #1630 Handle zero obs. // 002 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 003 10-03-23 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include +#include +using namespace netCDF; + #include "main.h" #include "vx_log.h" #include "vx_data2d_factory.h" diff --git a/src/tools/other/regrid_data_plane/regrid_data_plane.cc b/src/tools/other/regrid_data_plane/regrid_data_plane.cc index 253fe37c47..8218a7984c 100644 --- a/src/tools/other/regrid_data_plane/regrid_data_plane.cc +++ b/src/tools/other/regrid_data_plane/regrid_data_plane.cc @@ -24,9 +24,12 @@ // 004 01-28-20 Howard Soh Moved GOES-16/17 to point2grib // 005 04-09-20 Halley Gotway Add convert and censor options. // 006 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 007 09-29-22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -40,6 +43,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "vx_log.h" #include "vx_data2d_factory.h" diff --git a/src/tools/other/shift_data_plane/shift_data_plane.cc b/src/tools/other/shift_data_plane/shift_data_plane.cc index f41e0f2d5b..2600b5b20b 100644 --- a/src/tools/other/shift_data_plane/shift_data_plane.cc +++ b/src/tools/other/shift_data_plane/shift_data_plane.cc @@ -22,9 +22,13 @@ // 000 11-12-14 Halley Gotway New // 001 06-07-22 Halley Gotway MET #2173 Fix python embedding // 002 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main +// 003 09-12-22 Prestopnik MET #2227 Remove namespace std and netCDF +// from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -36,6 +40,9 @@ #include #include +#include +using namespace netCDF; + #include "GridTemplate.h" #include "vx_log.h" @@ -375,7 +382,7 @@ void usage() { << "\t-to lat lon\n" << "\t[-method type]\n" << "\t[-width n]\n" - << "\t[-shape SHAPE]\n" + << "\t[-shape SHAPE]\n" << "\t[-log file]\n" << "\t[-v level]\n" << "\t[-compress level]\n\n" @@ -406,8 +413,6 @@ void usage() { << "\t\t\"-shape\" overrides the default interpolation shape (SQUARE) " << "(optional).\n" - - << "\t\t\"-log file\" outputs log messages to the specified " << "file (optional).\n" diff --git a/src/tools/other/wwmca_tool/nc_output.cc b/src/tools/other/wwmca_tool/nc_output.cc index 5fd8431615..eab5533a57 100644 --- a/src/tools/other/wwmca_tool/nc_output.cc +++ b/src/tools/other/wwmca_tool/nc_output.cc @@ -17,6 +17,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_log.h" #include "vx_cal.h" diff --git a/src/tools/other/wwmca_tool/wwmca_plot.cc b/src/tools/other/wwmca_tool/wwmca_plot.cc index 1e742cf99a..e251493038 100644 --- a/src/tools/other/wwmca_tool/wwmca_plot.cc +++ b/src/tools/other/wwmca_tool/wwmca_plot.cc @@ -9,6 +9,7 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; static const int gray_min = 130; // these values must be between 0 and 255 inclusive static const int gray_max = 255; diff --git a/src/tools/tc_utils/rmw_analysis/rmw_analysis.cc b/src/tools/tc_utils/rmw_analysis/rmw_analysis.cc index 0ae2a6584f..1465aa706f 100644 --- a/src/tools/tc_utils/rmw_analysis/rmw_analysis.cc +++ b/src/tools/tc_utils/rmw_analysis/rmw_analysis.cc @@ -6,6 +6,8 @@ // ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* +using namespace std; + #include #include #include @@ -16,6 +18,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "rmw_analysis.h" diff --git a/src/tools/tc_utils/rmw_analysis/rmw_analysis.h b/src/tools/tc_utils/rmw_analysis/rmw_analysis.h index 541f069dc5..c4575a1534 100644 --- a/src/tools/tc_utils/rmw_analysis/rmw_analysis.h +++ b/src/tools/tc_utils/rmw_analysis/rmw_analysis.h @@ -12,9 +12,10 @@ // // Description: // -// Mod# Date Name Description -// ---- ---- ---- ----------- -// 000 08/19/19 Fillmore New +// Mod# Date Name Description +// ---- ---- ---- ----------- +// 000 08/19/19 Fillmore New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -23,8 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -39,7 +38,6 @@ using namespace std; #include #include -using namespace netCDF; #include "rmw_analysis_conf_info.h" @@ -83,23 +81,23 @@ static ConcatString out_dir; ConcatString out_file; // NetCDF file information -static NcFile* nc_in = (NcFile*) 0; -static NcFile* nc_out = (NcFile*) 0; +static netCDF::NcFile* nc_in = (netCDF::NcFile*) 0; +static netCDF::NcFile* nc_out = (netCDF::NcFile*) 0; // Grid dimension information -static NcDim range_dim; -static NcDim azimuth_dim; -static NcDim level_dim; -static NcDim track_point_dim; +static netCDF::NcDim range_dim; +static netCDF::NcDim azimuth_dim; +static netCDF::NcDim level_dim; +static netCDF::NcDim track_point_dim; -static string range_name; -static string range_units; -static string azimuth_name; -static string azimuth_units; -static string level_name; -static string level_units; +static std::string range_name; +static std::string range_units; +static std::string azimuth_name; +static std::string azimuth_units; +static std::string level_name; +static std::string level_units; -static NcVar valid_time_var; +static netCDF::NcVar valid_time_var; // Grid data static int n_range; @@ -108,27 +106,27 @@ static int n_level; static int n_track_point; static int n_track_line; -vector range_coord; -vector azimuth_coord; -vector level_coord; +std::vector range_coord; +std::vector azimuth_coord; +std::vector level_coord; -vector track_valid_time; -vector track_lat; -vector track_lon; -vector track_rmw; +std::vector track_valid_time; +std::vector track_lat; +std::vector track_lon; +std::vector track_rmw; // Variable information -static vector data_names; -static vector data_n_dims; -static vector data_long_names; -static vector data_units; +static std::vector data_names; +static std::vector data_n_dims; +static std::vector data_long_names; +static std::vector data_units; // Variable data -static vector data_counts; -static vector data_means; -static vector data_stdevs; -static vector data_mins; -static vector data_maxs; +static std::vector data_counts; +static std::vector data_means; +static std::vector data_stdevs; +static std::vector data_mins; +static std::vector data_maxs; // Track information static TrackInfoArray adeck_tracks; diff --git a/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.cc b/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.cc index 28f6d0c864..ed8860ed5f 100644 --- a/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.cc +++ b/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.cc @@ -8,6 +8,8 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.h b/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.h index ff1e1b7193..37b5db6188 100644 --- a/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.h +++ b/src/tools/tc_utils/rmw_analysis/rmw_analysis_conf_info.h @@ -13,8 +13,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include "vx_config.h" diff --git a/src/tools/tc_utils/tc_dland/tc_dland.cc b/src/tools/tc_utils/tc_dland/tc_dland.cc index 2c043a9619..dac4f15243 100644 --- a/src/tools/tc_utils/tc_dland/tc_dland.cc +++ b/src/tools/tc_utils/tc_dland/tc_dland.cc @@ -18,9 +18,13 @@ // 001 07/25/14 Halley Gotway Add -land option and update how // distances are computed. // 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 003 09/28/22 Prestopnik MET #2227 Remove namspace std and netCDF +// from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -31,6 +35,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "grib_classes.h" @@ -311,7 +318,7 @@ void process_distances() { void usage() { cout << "\n*** Model Evaluation Tools (MET" << met_version - << ") ***\n\n" + << ") ***\n\n" << "Usage: " << program_name << "\n" << "\tout_file\n" diff --git a/src/tools/tc_utils/tc_dland/tc_poly.h b/src/tools/tc_utils/tc_dland/tc_poly.h index 35c9ab9428..758f2131d9 100644 --- a/src/tools/tc_utils/tc_dland/tc_poly.h +++ b/src/tools/tc_utils/tc_dland/tc_poly.h @@ -32,7 +32,7 @@ class TCPoly { friend class TCPolyArray; - friend bool operator>>(istream &, TCPoly &); + friend bool operator>>(std::istream &, TCPoly &); private: @@ -69,7 +69,7 @@ inline ConcatString TCPoly::name() const { return(Name); } //////////////////////////////////////////////////////////////////////// -extern bool operator>>(istream &, TCPoly &); +extern bool operator>>(std::istream &, TCPoly &); //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/tc_utils/tc_gen/tc_gen.cc b/src/tools/tc_utils/tc_gen/tc_gen.cc index f28d121d12..76f1a09652 100644 --- a/src/tools/tc_utils/tc_gen/tc_gen.cc +++ b/src/tools/tc_utils/tc_gen/tc_gen.cc @@ -24,9 +24,13 @@ // 007 11/22/21 Halley Gotway MET #1810 Add -shape option // 008 05/02/22 Halley Gotway MET #2148 Fix init_hour and lead misses // 009 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 010 09/28/22 Prestopnik MET #2227 Remove using namespace std and netCDF from header files +// // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -38,6 +42,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "tc_gen.h" #include "pair_data_genesis.h" diff --git a/src/tools/tc_utils/tc_gen/tc_gen.h b/src/tools/tc_utils/tc_gen/tc_gen.h index 64cc8975c7..ad1d164729 100644 --- a/src/tools/tc_utils/tc_gen/tc_gen.h +++ b/src/tools/tc_utils/tc_gen/tc_gen.h @@ -13,8 +13,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -30,7 +28,6 @@ using namespace std; #include #include -using namespace netCDF; #include "tc_gen_conf_info.h" @@ -116,9 +113,9 @@ static ConcatString out_base; // Output NetCDF file static ConcatString out_nc_file; -static NcFile *nc_out = (NcFile *) 0; -static NcDim lat_dim; -static NcDim lon_dim; +static netCDF::NcFile *nc_out = (netCDF::NcFile *) 0; +static netCDF::NcDim lat_dim; +static netCDF::NcDim lon_dim; // List of output NetCDF variable names static StringArray nc_var_sa; diff --git a/src/tools/tc_utils/tc_pairs/tc_pairs.cc b/src/tools/tc_utils/tc_pairs/tc_pairs.cc index fd5f6d20ba..8872388932 100644 --- a/src/tools/tc_utils/tc_pairs/tc_pairs.cc +++ b/src/tools/tc_utils/tc_pairs/tc_pairs.cc @@ -33,10 +33,13 @@ // that contain all required lead times. // 011 07/27/18 Halley Gotway Support masks defined by // the gen_vx_mask tool. -// 020 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 012 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 013 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/tc_utils/tc_pairs/tc_pairs.h b/src/tools/tc_utils/tc_pairs/tc_pairs.h index 2e1d2f17ea..e49aed3c3d 100644 --- a/src/tools/tc_utils/tc_pairs/tc_pairs.h +++ b/src/tools/tc_utils/tc_pairs/tc_pairs.h @@ -16,6 +16,7 @@ // ---- ---- ---- ----------- // 000 03/14/12 Halley Gotway New // 001 03/09/17 Halley Gotway Define BEST track time step. +// 002 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -24,8 +25,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include diff --git a/src/tools/tc_utils/tc_pairs/tc_pairs_conf_info.h b/src/tools/tc_utils/tc_pairs/tc_pairs_conf_info.h index 4b7b2e364f..3fc82f2671 100644 --- a/src/tools/tc_utils/tc_pairs/tc_pairs_conf_info.h +++ b/src/tools/tc_utils/tc_pairs/tc_pairs_conf_info.h @@ -112,7 +112,7 @@ class TCPairsConfInfo { int WatchWarnOffset; // Basin Map - map BasinMap; + std::map BasinMap; // Config file version ConcatString Version; diff --git a/src/tools/tc_utils/tc_rmw/tc_rmw.cc b/src/tools/tc_utils/tc_rmw/tc_rmw.cc index 0ddfcdd710..09b60a0336 100644 --- a/src/tools/tc_utils/tc_rmw/tc_rmw.cc +++ b/src/tools/tc_utils/tc_rmw/tc_rmw.cc @@ -16,10 +16,13 @@ // ---- ---- ---- ----------- // 000 04/18/19 Fillmore New // 001 05/15/20 Halley Gotway Fix data file list option logic. -// 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 003 09/28/22 Prestopnik MET #2227 Remove namspace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -30,6 +33,9 @@ #include #include +#include +using namespace netCDF; + #include "main.h" #include "tc_rmw.h" diff --git a/src/tools/tc_utils/tc_rmw/tc_rmw.h b/src/tools/tc_utils/tc_rmw/tc_rmw.h index 1a0e6ab178..0975708a20 100644 --- a/src/tools/tc_utils/tc_rmw/tc_rmw.h +++ b/src/tools/tc_utils/tc_rmw/tc_rmw.h @@ -12,9 +12,10 @@ // // Description: // -// Mod# Date Name Description -// ---- ---- ---- ----------- -// 000 04/18/19 Fillmore New +// Mod# Date Name Description +// ---- ---- ---- ----------- +// 000 04/18/19 Fillmore New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std and netCDF from header files // //////////////////////////////////////////////////////////////////////// @@ -23,7 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; #include #include @@ -39,7 +39,6 @@ using namespace std; #include #include -using namespace netCDF; #include "tc_rmw_conf_info.h" #include "tc_rmw_wind_converter.h" @@ -98,33 +97,33 @@ static ConcatString out_prefix; // Output NetCDF file static ConcatString out_file; -static NcFile* nc_out = (NcFile*) 0; -static NcDim range_dim; -static NcDim azimuth_dim; -static NcDim pressure_dim; -static NcDim track_point_dim; -static NcVar lat_arr_var; -static NcVar lon_arr_var; -static NcVar valid_time_var; -static NcVar data_var; -static NcVar wind_r_var; -static NcVar wind_a_var; - -static vector data_vars; -static vector azi_mean_data_vars; - -static map data_3d_vars; +static netCDF::NcFile* nc_out = (netCDF::NcFile*) 0; +static netCDF::NcDim range_dim; +static netCDF::NcDim azimuth_dim; +static netCDF::NcDim pressure_dim; +static netCDF::NcDim track_point_dim; +static netCDF::NcVar lat_arr_var; +static netCDF::NcVar lon_arr_var; +static netCDF::NcVar valid_time_var; +static netCDF::NcVar data_var; +static netCDF::NcVar wind_r_var; +static netCDF::NcVar wind_a_var; + +static std::vector data_vars; +static std::vector azi_mean_data_vars; + +static std::map data_3d_vars; // List of output NetCDF variable names static StringArray nc_var_sa; -static map > variable_levels; -static map variable_long_names; -static map variable_units; +static std::map > variable_levels; +static std::map variable_long_names; +static std::map variable_units; -static set pressure_level_strings; -static set pressure_levels; -static map pressure_level_indices; +static std::set pressure_level_strings; +static std::set pressure_levels; +static std::map pressure_level_indices; //////////////////////////////////////////////////////////////////////// // diff --git a/src/tools/tc_utils/tc_rmw/tc_rmw_conf_info.cc b/src/tools/tc_utils/tc_rmw/tc_rmw_conf_info.cc index 92906015de..951c43f193 100644 --- a/src/tools/tc_utils/tc_rmw/tc_rmw_conf_info.cc +++ b/src/tools/tc_utils/tc_rmw/tc_rmw_conf_info.cc @@ -8,6 +8,8 @@ //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include diff --git a/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.cc b/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.cc index 762fc29edd..3ed71fc98f 100644 --- a/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.cc +++ b/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.cc @@ -16,9 +16,11 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 05/11/22 Albo Pulled the wind conversion into a class +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; #include "tc_rmw_wind_converter.h" #include "series_data.h" @@ -111,7 +113,7 @@ void TCRMW_WindConverter::init(const TCRMWConfInfo *conf) { //////////////////////////////////////////////////////////////////////// -void TCRMW_WindConverter::update_input(const std::string &variableName, const std::string &units) { +void TCRMW_WindConverter::update_input(const string &variableName, const string &units) { if (_computeWinds) { if (variableName == _conf->u_wind_field_name.string()) { _foundUInInput = true; diff --git a/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.h b/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.h index d07f770c3c..a400841b24 100644 --- a/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.h +++ b/src/tools/tc_utils/tc_rmw/tc_rmw_wind_converter.h @@ -97,9 +97,9 @@ class TCRMW_WindConverter { // append to the input maps for tangential and radial winds data // if configured to compute winds, but didn't find U or V, turn off // the wind computations and report an error - void append_nc_output_vars(map > &variable_levels, - map &variable_long_names, - map &variable_units); + void append_nc_output_vars(std::map > &variable_levels, + std::map &variable_long_names, + std::map &variable_units); // Check input varName against U, and if it's a match, lookup V using the // map members, and then compute tangential and radial winds if it is so diff --git a/src/tools/tc_utils/tc_stat/tc_stat.cc b/src/tools/tc_utils/tc_stat/tc_stat.cc index ae2610eba4..c536227149 100644 --- a/src/tools/tc_utils/tc_stat/tc_stat.cc +++ b/src/tools/tc_utils/tc_stat/tc_stat.cc @@ -19,10 +19,13 @@ // 002 09/28/16 Halley Gotway Add DESC output column. // 003 07/27/18 Halley Gotway Support masks defined by // the gen_vx_mask tool. -// 020 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 004 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main +// 005 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// +using namespace std; + #include #include #include @@ -307,7 +310,7 @@ void close_out_file() { void usage() { cout << "\n*** Model Evaluation Tools (MET" << met_version - << ") ***\n\n" + << ") ***\n\n" << "Usage: " << program_name << "\n" << "\t-lookin source\n" diff --git a/src/tools/tc_utils/tc_stat/tc_stat.h b/src/tools/tc_utils/tc_stat/tc_stat.h index 0e526f46ee..e037f69bb5 100644 --- a/src/tools/tc_utils/tc_stat/tc_stat.h +++ b/src/tools/tc_utils/tc_stat/tc_stat.h @@ -15,6 +15,7 @@ // Mod# Date Name Description // ---- ---- ---- ----------- // 000 04/03/12 Halley Gotway New +// 001 09/28/22 Prestopnik MET #2227 Remove namespace std from header files // //////////////////////////////////////////////////////////////////////// @@ -23,8 +24,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -82,7 +81,7 @@ static ConcatString command_line_job; //////////////////////////////////////////////////////////////////////// // Output file stream -static ofstream *tc_stat_out = (ofstream *) 0; +static std::ofstream *tc_stat_out = (std::ofstream *) 0; //////////////////////////////////////////////////////////////////////// // diff --git a/src/tools/tc_utils/tc_stat/tc_stat_job.h b/src/tools/tc_utils/tc_stat/tc_stat_job.h index 8d35120a5d..c01bcaeb2d 100644 --- a/src/tools/tc_utils/tc_stat/tc_stat_job.h +++ b/src/tools/tc_utils/tc_stat/tc_stat_job.h @@ -195,7 +195,7 @@ class TCStatJob { void clear(); - void dump(ostream &, int depth = 0) const; + void dump(std::ostream &, int depth = 0) const; ////////////////////////////////////////////////////////////////// @@ -224,8 +224,8 @@ class TCStatJob { void open_stat_file(); void close_stat_file(); - void dump_pair(const TrackPairInfo &, ofstream *); - void dump_line(const TCStatLine &, ofstream *); + void dump_pair(const TrackPairInfo &, std::ofstream *); + void dump_line(const TCStatLine &, std::ofstream *); virtual ConcatString serialize() const; @@ -285,27 +285,27 @@ class TCStatJob { bool WaterOnly; // Numeric column thresholds - map ColumnThreshMap; + std::map ColumnThreshMap; // ASCII column string matching - map ColumnStrIncMap; - map ColumnStrExcMap; + std::map ColumnStrIncMap; + std::map ColumnStrExcMap; // Numeric column thresholds - map InitThreshMap; + std::map InitThreshMap; // ASCII column string matching - map InitStrIncMap; - map InitStrExcMap; + std::map InitStrIncMap; + std::map InitStrExcMap; // Variables to the store the analysis job specification - ConcatString DumpFile; // Dump TrackPairInfo used to a file - ofstream *DumpOut; // Dump output file stream - ofstream *JobOut; // Job output file stream (not allocated) + ConcatString DumpFile; // Dump TrackPairInfo used to a file + std::ofstream *DumpOut; // Dump output file stream + std::ofstream *JobOut; // Job output file stream (not allocated) // Derived output statistics - ConcatString StatFile; // File name for output statistics - ofstream *StatOut; // Output statistics file stream + ConcatString StatFile; // File name for output statistics + std::ofstream *StatOut; // Output statistics file stream // Polyline masking regions ConcatString OutInitMaskFile; @@ -376,7 +376,7 @@ class TCStatJobFilter : public TCStatJob { void filter_tracks(TCLineCounts &); void filter_lines (TCLineCounts &); - void do_output(ostream &); + void do_output(std::ostream &); }; @@ -413,9 +413,9 @@ class TCStatJobSummary : public TCStatJob { void process_pair(TrackPairInfo &); void process_line(TCStatLine &); - void add_map(map&); + void add_map(std::map&); - void do_output(ostream &); + void do_output(std::ostream &); void compute_fsp(NumArray &, NumArray &, NumArray &); @@ -436,7 +436,7 @@ class TCStatJobSummary : public TCStatJob { SingleThresh FSPThresh; // Map column and case info to column values - map SummaryMap; + std::map SummaryMap; }; @@ -451,7 +451,7 @@ class TCStatJobRIRW : public TCStatJob { void assign(const TCStatJobRIRW &); ConcatString DumpFileCTC[4]; - ofstream *DumpOutCTC[4]; + std::ofstream *DumpOutCTC[4]; public: @@ -473,12 +473,12 @@ class TCStatJobRIRW : public TCStatJob { void process_pair(TrackPairInfo &); - void add_map(map&); + void add_map(std::map&); - void do_output (ostream &); - void do_ctc_output(ostream &); - void do_cts_output(ostream &); - void do_mpr_output(ostream &); + void do_output (std::ostream &); + void do_ctc_output(std::ostream &); + void do_cts_output(std::ostream &); + void do_mpr_output(std::ostream &); // Store the case information StringArray ByColumn; @@ -490,7 +490,7 @@ class TCStatJobRIRW : public TCStatJob { StringArray OutLineType; // Map column and case info to column values - map RIRWMap; + std::map RIRWMap; }; @@ -523,7 +523,7 @@ class TCStatJobProbRIRW : public TCStatJob { void process_pair(ProbRIRWPairInfo &); - void do_output(ostream &); + void do_output(std::ostream &); // Probability information bool ProbRIRWExact; // True for exact change, false for maximum change @@ -544,7 +544,7 @@ class TCStatJobProbRIRW : public TCStatJob { StringArray OutLineType; // Map column and case info to column values - map ProbRIRWMap; + std::map ProbRIRWMap; };