diff --git a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc index cc77b7f17a..86bef320e1 100644 --- a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc +++ b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc @@ -525,7 +525,7 @@ LongArray MetNcCFDataFile::collect_time_offsets(VarInfo &vinfo) { int time_count = time_offsets.n_elements(); if (0 < time_count) - mlog << Debug(7) << method_name << " Found " << time_count + mlog << Debug(7) << method_name << "Found " << time_count << (time_count==1 ? " time" : " times") << " between " << unix_to_yyyymmdd_hhmmss(_file->ValidTime[0]) << " and " << unix_to_yyyymmdd_hhmmss(_file->ValidTime[time_dim_size-1]) << "\n"; @@ -638,11 +638,11 @@ long MetNcCFDataFile::convert_time_to_offset(long time_value) { } if (found) - mlog << Debug(7) << method_name << " Found " + mlog << Debug(7) << method_name << "Found " << unix_to_yyyymmdd_hhmmss(time_value) << " at index " << time_offset << " from time value\n"; else if (found_value) - mlog << Debug(7) << method_name << " Found " << time_value + mlog << Debug(7) << method_name << "Found " << time_value << " at index " << time_offset << " from time value\n"; else mlog << Warning << "\n" << method_name << time_value @@ -668,6 +668,13 @@ long MetNcCFDataFile::convert_value_to_offset(double z_value, string z_dim_name) } } + // Log the dimension value to index conversion + if(z_offset != (long) bad_data_int) { + mlog << Debug(7) << method_name << "Found \"" + << z_dim_name << "\" dimension value of \"" << z_value + << "\" at dimension index " << z_offset << ".\n"; + } + if (!found && 0 < z_dim_name.length()) { NcVarInfo *var_info = find_var_info_by_dim_name(_file->Var, z_dim_name, _file->Nvars); if (var_info) { diff --git a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc index 0af90136c5..b86107078a 100644 --- a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc +++ b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc @@ -35,6 +35,7 @@ using namespace std; /////////////////////////////////////////////////////////////////////////////// static bool is_grib_code_abbr_match(const ConcatString &, int); +static void check_dim_offset(const char *); /////////////////////////////////////////////////////////////////////////////// // @@ -80,7 +81,7 @@ VarInfo *VarInfoNcCF::clone() const { VarInfoNcCF *ret = new VarInfoNcCF(*this); - return (VarInfo *)ret; + return ret; } /////////////////////////////////////////////////////////////////////////////// @@ -98,14 +99,13 @@ void VarInfoNcCF::init_from_scratch() { /////////////////////////////////////////////////////////////////////////////// void VarInfoNcCF::assign(const VarInfoNcCF &v) { - int i; // First call the parent's assign VarInfo::assign(v); // Copy clear_dimension(); - for(i=0; i " + << "Found non-integer NetCDF dimension index (" + << ptr << " != " << atoi(ptr) << ").\n" + << "Did you intend to use \"@" << ptr + << "\" to specify the value for that dimension instead?\n\n"; + } + + return; +} + +/////////////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h index 439369d95f..8fee4ead2d 100644 --- a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h +++ b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h @@ -88,7 +88,7 @@ class VarInfoNcCF : public VarInfo inline GrdFileType VarInfoNcCF::file_type() const { return FileType_NcCF; } inline const LongArray & VarInfoNcCF::dimension() const { return Dimension; } -inline int VarInfoNcCF::dimension(int i) const { return Dimension[i]; } +inline int VarInfoNcCF::dimension(int i) const { return (int) Dimension[i]; } inline int VarInfoNcCF::n_dimension() const { return Dimension.n_elements();} inline const NumArray & VarInfoNcCF::dim_value() const { return Dim_value; } inline double VarInfoNcCF::dim_value(int i) const { return Dim_value[i]; }