Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 1655 nc_log #1656

Merged
merged 3 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions met/src/libcode/vx_data2d/var_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,19 @@ void VarInfo::set_magic(const ConcatString &nstr, const ConcatString &lstr) {
if((unsigned int) nstr.length() != strcspn(nstr.c_str(), " \t") ||
(unsigned int) lstr.length() != strcspn(lstr.c_str(), " \t")) {
mlog << Error << "\nVarInfo::set_magic() -> "
<< "embedded whitespace found in the nstr \"" << nstr
<< "\" or lstr \"" << lstr << "\".\n\n";
<< "embedded whitespace found in the name \"" << nstr
<< "\" or level \"" << lstr << "\" string.\n\n";
exit(1);
}

// Format as {name}/{level} or {name}{level}
if(lstr.nonempty() && lstr[0] != '(') {
MagicStr << cs_erase << nstr << "/" << lstr;
}
else {
MagicStr << cs_erase << nstr << lstr;
}

return;
}

Expand Down
12 changes: 0 additions & 12 deletions met/src/libcode/vx_data2d_grib/var_info_grib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,6 @@ void VarInfoGrib::set_tri(int v) {

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

void VarInfoGrib::set_magic(const ConcatString &nstr, const ConcatString &lstr) {

// Validate the magic_string
VarInfo::set_magic(nstr, lstr);

// Store the magic string
MagicStr << cs_erase << nstr << "/" << lstr;

}

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

void VarInfoGrib::add_grib_code (Dictionary &dict)
{
ConcatString field_name = dict.lookup_string(conf_key_name, false);
Expand Down
1 change: 0 additions & 1 deletion met/src/libcode/vx_data2d_grib/var_info_grib.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class VarInfoGrib : public VarInfo
// set stuff
//

void set_magic(const ConcatString &, const ConcatString &);
void set_dict(Dictionary &);
void add_grib_code(Dictionary &);

Expand Down
13 changes: 0 additions & 13 deletions met/src/libcode/vx_data2d_grib2/var_info_grib2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,6 @@ void VarInfoGrib2::set_ipdtmpl_val(const IntArray &v) {
return;
}


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

void VarInfoGrib2::set_magic(const ConcatString &nstr, const ConcatString &lstr) {

// Validate the magic_string
VarInfo::set_magic(nstr, lstr);

// Store the magic string
MagicStr << cs_erase << nstr << "/" << lstr;

}

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

void VarInfoGrib2::set_dict(Dictionary & dict) {
Expand Down
1 change: 0 additions & 1 deletion met/src/libcode/vx_data2d_grib2/var_info_grib2.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class VarInfoGrib2 : public VarInfo
// set stuff
//

void set_magic(const ConcatString &, const ConcatString &);
void set_dict(Dictionary &);

void set_record(int);
Expand Down
5 changes: 1 addition & 4 deletions met/src/libcode/vx_data2d_nc_met/var_info_nc_met.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,8 @@ void VarInfoNcMet::set_magic(const ConcatString &nstr, const ConcatString &lstr)
ConcatString tmp_str;
char *ptr = (char *) 0, *ptr2 = (char *) 0, *ptr3 = (char *) 0, *save_ptr = (char *) 0;

// Validate the magic string
VarInfo::set_magic(nstr, lstr);

// Store the magic string
MagicStr << cs_erase << nstr << lstr;
VarInfo::set_magic(nstr, lstr);

// Set the requested name and default output name
set_req_name(nstr.c_str());
Expand Down
7 changes: 2 additions & 5 deletions met/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,14 @@ void VarInfoNcPinterp::set_magic(const ConcatString &nstr, const ConcatString &l
ConcatString tmp_str;
char *ptr = (char *) 0, *ptr2 = (char *) 0, *ptr3 = (char *) 0, *save_ptr = (char *) 0;

// Validate the magic string
VarInfo::set_magic(nstr, lstr);

// Store the magic string
MagicStr << cs_erase << nstr << lstr;
VarInfo::set_magic(nstr, lstr);

// Set the requested name and default output name
set_req_name(nstr.c_str());
set_name(nstr);

// If there's no level specification, assume (0,*, *)
// If there's no level specification, assume (0,*,*)
if(strchr(lstr.c_str(), '(') == NULL) {
Level.set_req_name("0,*,*");
Level.set_name("0,*,*");
Expand Down
5 changes: 1 addition & 4 deletions met/src/libcode/vx_data2d_nccf/var_info_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,8 @@ void VarInfoNcCF::set_magic(const ConcatString &nstr, const ConcatString &lstr)
char *save_ptr = 0;
const char *method_name = "VarInfoNcCF::set_magic() -> ";

// Validate the magic string
VarInfo::set_magic(nstr, lstr);

// Store the magic string
MagicStr << cs_erase << nstr << lstr;
VarInfo::set_magic(nstr, lstr);

// Set the requested name and default output name
set_req_name(nstr.c_str());
Expand Down
15 changes: 0 additions & 15 deletions met/src/libcode/vx_data2d_python/var_info_python.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,6 @@ void VarInfoPython::set_file_type(const GrdFileType t) {
///////////////////////////////////////////////////////////////////////////////


void VarInfoPython::set_magic(const ConcatString &nstr, const ConcatString &lstr) {

// Validate the magic_string
VarInfo::set_magic(nstr, lstr);

// Store the magic string
MagicStr << cs_erase << nstr << "/" << lstr;

return;
}


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


void VarInfoPython::set_dict(Dictionary & dict) {

VarInfo::set_dict(dict);
Expand Down
1 change: 0 additions & 1 deletion met/src/libcode/vx_data2d_python/var_info_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class VarInfoPython : public VarInfo
//

void set_file_type(const GrdFileType);
void set_magic(const ConcatString &, const ConcatString &);
void set_dict(Dictionary &);

//
Expand Down