[MOAB-dev] commit/MOAB: danwu: Deleted NCHelper::convert_variable(), which is no longer in use.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Jun 20 13:05:41 CDT 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/cd5aa5a93a55/
Changeset: cd5aa5a93a55
Branch: master
User: danwu
Date: 2014-06-20 20:04:57
Summary: Deleted NCHelper::convert_variable(), which is no longer in use.
Affected #: 2 files
diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index b2f99b9..93cda3b 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -551,89 +551,6 @@ ErrorCode NCHelper::read_variables_to_set(std::vector<ReadNC::VarData>& vdatas,
return rval;
}
-ErrorCode NCHelper::convert_variable(ReadNC::VarData& var_data, int tstep_num)
-{
- DebugOutput& dbgOut = _readNC->dbgOut;
-
- // Get ptr to tag space
- void* data = var_data.varDatas[tstep_num];
-
- // Get variable size
- std::size_t sz = var_data.sz;
- assert(sz > 0);
-
- // Finally, read into that space
- int success = 0;
- int* idata;
- double* ddata;
- float* fdata;
- short* sdata;
-
- switch (var_data.varDataType) {
- case NC_FLOAT:
- ddata = (double*) var_data.varDatas[tstep_num];
- fdata = (float*) var_data.varDatas[tstep_num];
- // Convert in-place
- for (int i = sz - 1; i >= 0; i--)
- ddata[i] = fdata[i];
- break;
- case NC_SHORT:
- idata = (int*) var_data.varDatas[tstep_num];
- sdata = (short*) var_data.varDatas[tstep_num];
- // Convert in-place
- for (int i = sz - 1; i >= 0; i--)
- idata[i] = sdata[i];
- break;
- default:
- success = 1;
- }
-
- if (2 <= dbgOut.get_verbosity() && !success) {
- double dmin, dmax;
- int imin, imax;
- switch (var_data.varDataType) {
- case NC_DOUBLE:
- case NC_FLOAT:
- ddata = (double*) data;
- if (sz == 0)
- break;
-
- dmin = dmax = ddata[0];
- for (unsigned int i = 1; i < sz; i++) {
- if (ddata[i] < dmin)
- dmin = ddata[i];
- if (ddata[i] > dmax)
- dmax = ddata[i];
- }
- dbgOut.tprintf(2, "Variable %s (double): min = %f, max = %f\n", var_data.varName.c_str(), dmin, dmax);
- break;
- case NC_INT:
- case NC_SHORT:
- idata = (int*) data;
- if (sz == 0)
- break;
-
- imin = imax = idata[0];
- for (unsigned int i = 1; i < sz; i++) {
- if (idata[i] < imin)
- imin = idata[i];
- if (idata[i] > imax)
- imax = idata[i];
- }
- dbgOut.tprintf(2, "Variable %s (int): min = %d, max = %d\n", var_data.varName.c_str(), imin, imax);
- break;
- case NC_NAT:
- case NC_BYTE:
- case NC_CHAR:
- break;
- default: // Default case added to remove compiler warnings
- success = 1;
- }
- }
-
- return MB_SUCCESS;
-}
-
ErrorCode NCHelper::read_coordinate(const char* var_name, int lmin, int lmax, std::vector<double>& cvals)
{
std::map<std::string, ReadNC::VarData>& varInfo = _readNC->varInfo;
diff --git a/src/io/NCHelper.hpp b/src/io/NCHelper.hpp
index 5b3b93c..afc49dc 100644
--- a/src/io/NCHelper.hpp
+++ b/src/io/NCHelper.hpp
@@ -48,9 +48,6 @@ protected:
//! Read set variables (common to scd mesh and ucd mesh)
ErrorCode read_variables_to_set(std::vector<ReadNC::VarData>& vdatas, std::vector<int>& tstep_nums);
- //! Convert variables in place
- ErrorCode convert_variable(ReadNC::VarData& var_data, int tstep_num);
-
ErrorCode read_coordinate(const char* var_name, int lmin, int lmax,
std::vector<double>& cvals);
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list