Index: GenericIO.h
===================================================================
--- GenericIO.h	(revision 5d57155c2b8a63fdd26a994151e5a4bf08823f7c)
+++ GenericIO.h	(revision 6461f57b867b48882e8b02d0c5345cd11ae8b795)
@@ -192,4 +192,24 @@
 
 public:
+  struct LossyCompressionInfo {
+    enum LCMode {
+      LCModeNone,
+      LCModeAbs,
+      LCModeRel,
+      LCModeAbsAndRel,
+      LCModeAbsOrRel,
+      LCModePSNR
+    };
+
+    LCMode Mode;
+    double AbsErrThreshold;
+    double RelErrThreshold;
+    double PSNRThreshold;
+
+    LossyCompressionInfo()
+      : Mode(LCModeNone), AbsErrThreshold(0.0),
+        RelErrThreshold(0.0), PSNRThreshold(0.0) {}
+  };
+
   class Variable {
   private:
@@ -232,10 +252,12 @@
   public:
     template <typename T>
-    Variable(const std::string &N, T* D, unsigned Flags = 0)
+    Variable(const std::string &N, T* D, unsigned Flags = 0,
+        const LossyCompressionInfo &LCI = LossyCompressionInfo())
       : Name(N), Data((void *) D), HasExtraSpace(Flags & VarHasExtraSpace),
         IsPhysCoordX(Flags & VarIsPhysCoordX),
         IsPhysCoordY(Flags & VarIsPhysCoordY),
         IsPhysCoordZ(Flags & VarIsPhysCoordZ),
-        MaybePhysGhost(Flags & VarMaybePhysGhost) {
+        MaybePhysGhost(Flags & VarMaybePhysGhost),
+        LCI(LCI) {
       deduceTypeInfo(D);
     }
@@ -243,15 +265,18 @@
     template <typename T>
     Variable(const std::string &N, std::size_t NumElements, T* D,
-             unsigned Flags = 0)
+             unsigned Flags = 0,
+             const LossyCompressionInfo &LCI = LossyCompressionInfo())
       : Name(N), Data((void *) D), HasExtraSpace(Flags & VarHasExtraSpace),
         IsPhysCoordX(Flags & VarIsPhysCoordX),
         IsPhysCoordY(Flags & VarIsPhysCoordY),
         IsPhysCoordZ(Flags & VarIsPhysCoordZ),
-        MaybePhysGhost(Flags & VarMaybePhysGhost) {
+        MaybePhysGhost(Flags & VarMaybePhysGhost),
+        LCI(LCI) {
       deduceTypeInfoFromElement(D);
       Size = ElementSize*NumElements;
     }
 
-    Variable(const VariableInfo &VI, void *D, unsigned Flags = 0)
+    Variable(const VariableInfo &VI, void *D, unsigned Flags = 0,
+             const LossyCompressionInfo &LCI = LossyCompressionInfo())
       : Name(VI.Name), Size(VI.Size), IsFloat(VI.IsFloat),
         IsSigned(VI.IsSigned), Data(D),
@@ -261,5 +286,5 @@
         IsPhysCoordZ((Flags & VarIsPhysCoordZ) || VI.IsPhysCoordZ),
         MaybePhysGhost((Flags & VarMaybePhysGhost) || VI.MaybePhysGhost),
-        ElementSize(VI.ElementSize) {}
+        ElementSize(VI.ElementSize), LCI(LCI) {}
 
     std::string Name;
@@ -272,4 +297,6 @@
     bool MaybePhysGhost;
     std::size_t ElementSize;
+
+    LossyCompressionInfo LCI;
   };
 
@@ -341,31 +368,36 @@
   template <typename T>
   void addVariable(const std::string &Name, T *Data,
-                   unsigned Flags = 0) {
-    Vars.push_back(Variable(Name, Data, Flags));
+                   unsigned Flags = 0,
+                   const LossyCompressionInfo &LCI = LossyCompressionInfo()) {
+    Vars.push_back(Variable(Name, Data, Flags, LCI));
   }
 
   template <typename T, typename A>
   void addVariable(const std::string &Name, std::vector<T, A> &Data,
-                   unsigned Flags = 0) {
+                   unsigned Flags = 0,
+                   const LossyCompressionInfo &LCI = LossyCompressionInfo()) {
     T *D = Data.empty() ? 0 : &Data[0];
-    addVariable(Name, D, Flags);
+    addVariable(Name, D, Flags, LCI);
   }
 
   void addVariable(const VariableInfo &VI, void *Data,
-                   unsigned Flags = 0) {
-    Vars.push_back(Variable(VI, Data, Flags));
+                   unsigned Flags = 0,
+                   const LossyCompressionInfo &LCI = LossyCompressionInfo()) {
+    Vars.push_back(Variable(VI, Data, Flags, LCI));
   }
 
   template <typename T>
   void addScalarizedVariable(const std::string &Name, T *Data,
-                             std::size_t NumElements, unsigned Flags = 0) {
-    Vars.push_back(Variable(Name, NumElements, Data, Flags));
+                             std::size_t NumElements, unsigned Flags = 0,
+                             const LossyCompressionInfo &LCI = LossyCompressionInfo()) {
+    Vars.push_back(Variable(Name, NumElements, Data, Flags, LCI));
   }
 
   template <typename T, typename A>
   void addScalarizedVariable(const std::string &Name, std::vector<T, A> &Data,
-                             std::size_t NumElements, unsigned Flags = 0) {
+                             std::size_t NumElements, unsigned Flags = 0,
+                             const LossyCompressionInfo &LCI = LossyCompressionInfo()) {
     T *D = Data.empty() ? 0 : &Data[0];
-    addScalarizedVariable(Name, D, NumElements, Flags);
+    addScalarizedVariable(Name, D, NumElements, Flags, LCI);
   }
 
