Index: python/example.py
===================================================================
--- python/example.py	(revision c13d9734af5eff37fc34c7a21894f5ae895c4ee4)
+++ python/example.py	(revision 9796d0ae22439e4f941af2d8257dd2e1470d88a1)
@@ -39,4 +39,5 @@
 
 import sys
+import numpy as np
 import genericio as gio
 
@@ -44,5 +45,11 @@
 gio.gio_inspect(name)
 
-x = gio.gio_read(name, "x")
-print x
+if gio.gio_has_variable(name, "x"):
+  x = gio.gio_read(name, "x")
+  y = gio.gio_read(name, "y")
+  z = gio.gio_read(name, "z")
+  print np.column_stack((x, y, z))
+else:
+  pos = gio.gio_read(name, "pos")
+  print pos
 
Index: python/genericio.py
===================================================================
--- python/genericio.py	(revision c13d9734af5eff37fc34c7a21894f5ae895c4ee4)
+++ python/genericio.py	(revision 9796d0ae22439e4f941af2d8257dd2e1470d88a1)
@@ -53,15 +53,18 @@
 libpygio.get_variable_type.argtypes=[ct.c_char_p,ct.c_char_p]
 
+libpygio.get_variable_field_count.restype=ct.c_int
+libpygio.get_variable_field_count.argtypes=[ct.c_char_p,ct.c_char_p]
+
 libpygio.read_gio_int32.restype=None
-libpygio.read_gio_int32.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_int)]
+libpygio.read_gio_int32.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_int),ct.c_int]
 
 libpygio.read_gio_int64.restype=None
-libpygio.read_gio_int64.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_int64)]
+libpygio.read_gio_int64.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_int64),ct.c_int]
 
 libpygio.read_gio_float.restype=None
-libpygio.read_gio_float.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_float)]
+libpygio.read_gio_float.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_float),ct.c_int]
 
 libpygio.read_gio_double.restype=None
-libpygio.read_gio_double.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_double)]
+libpygio.read_gio_double.argtypes=[ct.c_char_p,ct.c_char_p,ct.POINTER(ct.c_double),ct.c_int]
 
 libpygio.inspect_gio.restype=None
@@ -71,4 +74,5 @@
     var_size = libpygio.get_elem_num(file_name)
     var_type = libpygio.get_variable_type(file_name,var_name)
+    field_count = libpygio.get_variable_field_count(file_name,var_name)
     if(var_type==10):
         print "Variable not found"
@@ -78,23 +82,28 @@
     elif(var_type==0):
         #float
-        result = np.ndarray(var_size,dtype=np.float32)
-        libpygio.read_gio_float(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_float)))
+        result = np.ndarray((var_size,field_count),dtype=np.float32)
+        libpygio.read_gio_float(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_float)),field_count)
         return result
     elif(var_type==1):
         #double
-        result = np.ndarray(var_size,dtype=np.float64)
-        libpygio.read_gio_double(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_double)))
+        result = np.ndarray((var_size,field_count),dtype=np.float64)
+        libpygio.read_gio_double(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_double)),field_count)
         return result
     elif(var_type==2):
         #int32
-        result = np.ndarray(var_size,dtype=np.int32)
-        libpygio.read_gio_int32(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int32)))
+        result = np.ndarray((var_size,field_count),dtype=np.int32)
+        libpygio.read_gio_int32(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int32)),field_count)
         return result
     elif(var_type==3):
         #int64
-        result = np.ndarray(var_size,dtype=np.int64)
-        libpygio.read_gio_int64(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int64)))
+        result = np.ndarray((var_size,field_count),dtype=np.int64)
+        libpygio.read_gio_int64(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int64)),field_count)
         return result        
-        
+
+def gio_has_variable(file_name,var_name):
+    var_size = libpygio.get_elem_num(file_name)
+    var_type = libpygio.get_variable_type(file_name,var_name)
+    return var_type!=10
+
 def gio_inspect(file_name):
     libpygio.inspect_gio(file_name)
Index: python/lib/gio.cxx
===================================================================
--- python/lib/gio.cxx	(revision bd84570ee06b44e0409f1ad472cd8c1d40af4086)
+++ python/lib/gio.cxx	(revision 9796d0ae22439e4f941af2d8257dd2e1470d88a1)
@@ -43,15 +43,15 @@
 #include <iostream>
 
-  void read_gio_float(char* file_name, char* var_name, float* data){
-    read_gio<float>(file_name,var_name,data);
+  void read_gio_float(char* file_name, char* var_name, float* data, int field_count){
+    read_gio<float>(file_name,var_name,data,field_count);
   }
-  void read_gio_double(char* file_name, char* var_name, double* data){
-    read_gio<double>(file_name,var_name,data);
+  void read_gio_double(char* file_name, char* var_name, double* data, int field_count){
+    read_gio<double>(file_name,var_name,data,field_count);
   }
-  void read_gio_int32(char* file_name, char* var_name, int* data){
-    read_gio<int>(file_name,var_name,data);
+  void read_gio_int32(char* file_name, char* var_name, int* data, int field_count){
+    read_gio<int>(file_name,var_name,data,field_count);
   }
-  void read_gio_int64(char* file_name, char* var_name, int64_t* data){
-    read_gio<int64_t>(file_name,var_name,data);
+  void read_gio_int64(char* file_name, char* var_name, int64_t* data, int field_count){
+    read_gio<int64_t>(file_name,var_name,data,field_count);
   }
   
@@ -77,11 +77,11 @@
       gio::GenericIO::VariableInfo vinfo = VI[i];
       if(vinfo.Name == var_name){
-	if(vinfo.IsFloat && vinfo.Size == 4)
+	if(vinfo.IsFloat && vinfo.ElementSize == 4)
 	  return float_type;
-	else if(vinfo.IsFloat && vinfo.Size == 8)
+	else if(vinfo.IsFloat && vinfo.ElementSize == 8)
 	  return double_type;
-	else if(!vinfo.IsFloat && vinfo.Size == 4)
+	else if(!vinfo.IsFloat && vinfo.ElementSize == 4)
 	  return int32_type;
-	else if(!vinfo.IsFloat && vinfo.Size == 8)
+	else if(!vinfo.IsFloat && vinfo.ElementSize == 8)
 	  return int64_type;
 	else
@@ -91,4 +91,20 @@
     return var_not_found;
       
+  }
+
+  int get_variable_field_count(char* file_name,char* var_name){
+   gio::GenericIO reader(file_name);
+   std::vector<gio::GenericIO::VariableInfo> VI;
+   reader.openAndReadHeader(gio::GenericIO::MismatchAllowed);
+   reader.getVariableInfo(VI);
+
+   int num =VI.size();
+    for(int i =0;i<num;++i){
+      gio::GenericIO::VariableInfo vinfo = VI[i];
+      if(vinfo.Name == var_name) {
+        return vinfo.Size/vinfo.ElementSize;
+      }
+    }
+    return 0;
   }
 
@@ -110,5 +126,9 @@
     else
       std::cout<<"[i";
-    std::cout<<" "<<vinfo.Size*8<<"] ";
+    int NumElements = vinfo.Size/vinfo.ElementSize;
+    std::cout<<" "<<vinfo.ElementSize*8;
+    if (NumElements > 1)
+      std::cout<<"x"<<NumElements;
+    std::cout<<"] ";
     std::cout<<vinfo.Name<<std::endl;
   }
Index: python/lib/gio.h
===================================================================
--- python/lib/gio.h	(revision bd84570ee06b44e0409f1ad472cd8c1d40af4086)
+++ python/lib/gio.h	(revision 9796d0ae22439e4f941af2d8257dd2e1470d88a1)
@@ -46,5 +46,5 @@
 
 template <class T>
-void read_gio(char* file_name, std::string var_name, T*& data){
+void read_gio(char* file_name, std::string var_name, T*& data, int field_count){
   gio::GenericIO reader(file_name);
   reader.openAndReadHeader(gio::GenericIO::MismatchAllowed);
@@ -57,11 +57,12 @@
       max_size = rank_size[i];
   }
-  T* rank_data = new T[max_size+reader.requestedExtraSpace()/sizeof(T)];
+  T* rank_data = new T[max_size*field_count+reader.requestedExtraSpace()/sizeof(T)];
   int64_t offset =0;
-  reader.addVariable(var_name,rank_data,true);
+  reader.addScalarizedVariable(var_name,rank_data,field_count,
+                               gio::GenericIO::VarHasExtraSpace);
   for(int i=0;i<num_ranks;++i){
     reader.readData(i,false);
-    std::copy(rank_data,rank_data+rank_size[i],data+offset);
-    offset +=rank_size[i];
+    std::copy(rank_data,rank_data+rank_size[i]*field_count,data+offset);
+    offset +=rank_size[i]*field_count;
   }
   delete [] rank_data;
@@ -70,8 +71,8 @@
 extern "C" int64_t get_elem_num(char* file_name);
 
-extern "C" void read_gio_float (char* file_name, char* var_name, float* data);
-extern "C" void read_gio_double(char* file_name, char* var_name, double* data);
-extern "C" void read_gio_int32 (char* file_name, char* var_name, int* data); 
-extern "C" void read_gio_int64 (char* file_name, char* var_name, int64_t* data);
+extern "C" void read_gio_float (char* file_name, char* var_name, float* data, int field_count);
+extern "C" void read_gio_double(char* file_name, char* var_name, double* data, int field_count);
+extern "C" void read_gio_int32 (char* file_name, char* var_name, int* data, int field_count); 
+extern "C" void read_gio_int64 (char* file_name, char* var_name, int64_t* data, int field_count);
 enum var_type{
   float_type=0,
@@ -83,3 +84,4 @@
 };
 extern "C" var_type get_variable_type(char* file_name,char* var_name);
+extern "C" int get_variable_field_count(char* file_name,char* var_name);
 extern "C" void inspect_gio(char* file_name);
