diff --git a/met/src/libcode/vx_data2d/var_info.cc b/met/src/libcode/vx_data2d/var_info.cc index 1a4851e4e1..e72a761096 100644 --- a/met/src/libcode/vx_data2d/var_info.cc +++ b/met/src/libcode/vx_data2d/var_info.cc @@ -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; } diff --git a/met/src/libcode/vx_data2d_grib/var_info_grib.cc b/met/src/libcode/vx_data2d_grib/var_info_grib.cc index 1de21c8112..7594a1d1e6 100644 --- a/met/src/libcode/vx_data2d_grib/var_info_grib.cc +++ b/met/src/libcode/vx_data2d_grib/var_info_grib.cc @@ -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); diff --git a/met/src/libcode/vx_data2d_grib/var_info_grib.h b/met/src/libcode/vx_data2d_grib/var_info_grib.h index d8267737c2..1fd2e8eca2 100644 --- a/met/src/libcode/vx_data2d_grib/var_info_grib.h +++ b/met/src/libcode/vx_data2d_grib/var_info_grib.h @@ -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 &); diff --git a/met/src/libcode/vx_data2d_grib2/var_info_grib2.cc b/met/src/libcode/vx_data2d_grib2/var_info_grib2.cc index 99e7d7291e..b35efcd8b4 100644 --- a/met/src/libcode/vx_data2d_grib2/var_info_grib2.cc +++ b/met/src/libcode/vx_data2d_grib2/var_info_grib2.cc @@ -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) { diff --git a/met/src/libcode/vx_data2d_grib2/var_info_grib2.h b/met/src/libcode/vx_data2d_grib2/var_info_grib2.h index 17ee3c461b..27ba9c396b 100644 --- a/met/src/libcode/vx_data2d_grib2/var_info_grib2.h +++ b/met/src/libcode/vx_data2d_grib2/var_info_grib2.h @@ -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); diff --git a/met/src/libcode/vx_data2d_nc_met/var_info_nc_met.cc b/met/src/libcode/vx_data2d_nc_met/var_info_nc_met.cc index 07c26cb2ae..49f14705ec 100644 --- a/met/src/libcode/vx_data2d_nc_met/var_info_nc_met.cc +++ b/met/src/libcode/vx_data2d_nc_met/var_info_nc_met.cc @@ -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()); diff --git a/met/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc b/met/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc index 61d1e58613..02da4ac8ac 100644 --- a/met/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc +++ b/met/src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc @@ -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,*,*"); diff --git a/met/src/libcode/vx_data2d_nccf/var_info_nccf.cc b/met/src/libcode/vx_data2d_nccf/var_info_nccf.cc index aafc8a5aa7..24ed320c3c 100644 --- a/met/src/libcode/vx_data2d_nccf/var_info_nccf.cc +++ b/met/src/libcode/vx_data2d_nccf/var_info_nccf.cc @@ -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()); diff --git a/met/src/libcode/vx_data2d_python/var_info_python.cc b/met/src/libcode/vx_data2d_python/var_info_python.cc index 006f4d7ba7..81fb4e8045 100644 --- a/met/src/libcode/vx_data2d_python/var_info_python.cc +++ b/met/src/libcode/vx_data2d_python/var_info_python.cc @@ -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); diff --git a/met/src/libcode/vx_data2d_python/var_info_python.h b/met/src/libcode/vx_data2d_python/var_info_python.h index 78348445ba..9df494c98d 100644 --- a/met/src/libcode/vx_data2d_python/var_info_python.h +++ b/met/src/libcode/vx_data2d_python/var_info_python.h @@ -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 &); //