simple precision tag

Issue #54 new
Iulian Grindeanu created an issue

A lot of netcdf files have data saved in simple precision; When we load in moab, we convert to double precision.
We should study what would be the implication of adding a new tag type;
The biggest issue I think it is related to the hdf5 files
We have this enum for hdf5 types:

typedef enum mhdf_TagDataType {
  mhdf_OPAQUE = 0, /**< Opaque/unknown type */
  mhdf_INTEGER,    /**< Integer type */
  mhdf_FLOAT,      /**< Floating point value */
  mhdf_BITFIELD,   /**< Bit field */
  mhdf_BOOLEAN,    /**< Boolean values stored as one byte each */
  mhdf_ENTITY_ID   /**< Global ID referencing another entity in file */
} MHDF_TagDataType;

in fact, mhdf_FLOAT corresponds to case mhdf_FLOAT:
type = H5T_NATIVE_DOUBLE; (file-desc.c...) So we should probably add mhdf_FLOAT32, for H5T_NATIVE_FLOAT? For hdf5, in H5Tpublic.h, we have these:

#define H5T_NATIVE_FLOAT        (H5OPEN H5T_NATIVE_FLOAT_g)
#define H5T_NATIVE_DOUBLE       (H5OPEN H5T_NATIVE_DOUBLE_g)

Other suggestions? Also, for internal tag types we have:

/** Specify data type for tags. */
enum DataType {
  MB_TYPE_OPAQUE  = 0, /**< byte array */
  MB_TYPE_INTEGER = 1, /**< native 'int' type */
  MB_TYPE_DOUBLE  = 2, /**< native 'double' type */
  MB_TYPE_BIT     = 3, /**< mandatory type for tags with MB_TAG_BIT storage */
  MB_TYPE_HANDLE  = 4, /**< EntityHandle */
  MB_MAX_DATA_TYPE = MB_TYPE_HANDLE
};

should we have MB_TYPE_FLOAT ? should that be after MB_TYPE_HANDLE? (enum 5?)

Comments (1)

  1. Vijay M

    I think there should be a MB_TYPE_FLOAT. This should be a basic type. I think we may need one for long double also, especially when supporting solutions with high precision.

  2. Log in to comment