Index: /XIOS/trunk/src/io/inetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/io/inetcdf4.cpp	(revision 685)
+++ /XIOS/trunk/src/io/inetcdf4.cpp	(revision 686)
@@ -20,21 +20,9 @@
   { /* Nothing to do */ }
 
-  ///--------------------------------------------------------------
-
-  void CINetCDF4::CheckError(int status)
-  {
-    if (status != NC_NOERR)
-    {
-      StdString errormsg(nc_strerror(status)); // fuite mÃ©moire ici ?
-      ERROR("CINetCDF4::CheckError(int status)",
-            << "[ status = " << status << " ] " << errormsg);
-    }
-  }
-
   //---------------------------------------------------------------
 
   void CINetCDF4::close(void)
   {
-    CheckError(nc_close(this->ncidp));
+    CNetCdfInterface::close(this->ncidp);
   }
 
@@ -50,5 +38,5 @@
     {
       const StdString& groupid = *it;
-      CheckError(nc_inq_ncid(retvalue, const_cast<char*>(groupid.c_str()), &retvalue));
+      CNetCdfInterface::inqNcId(retvalue, groupid, retvalue);
     }
 
@@ -61,5 +49,5 @@
     int varid = 0;
     int grpid = this->getGroup(path);
-    CheckError(nc_inq_varid(grpid, varname.c_str(), &varid));
+    CNetCdfInterface::inqVarId(grpid, varname, varid);
     return varid;
   }
@@ -70,5 +58,5 @@
     int dimid = 0;
     int grpid = this->getGroup(path);
-    CheckError(nc_inq_dimid(grpid, dimname.c_str(), &dimid));
+    CNetCdfInterface::inqDimId(grpid, dimname, dimid);
     return dimid;
   }
@@ -81,6 +69,5 @@
     int grpid = this->getGroup(path);
     int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
-    CheckError(nc_inq_att(grpid, varid, attname.c_str(),
-                          &retvalue.first, &retvalue.second));
+    CNetCdfInterface::inqAtt(grpid, varid, attname, retvalue.first, retvalue.second);
     return retvalue;
   }
@@ -90,5 +77,5 @@
     int dimid = 0;
     int grpid = this->getGroup(path);
-    CheckError(nc_inq_unlimdim(grpid, &dimid));
+    CNetCdfInterface::inqUnLimDim(grpid, dimid);
     return dimid;
   }
@@ -96,14 +83,15 @@
   StdString CINetCDF4::getUnlimitedDimensionName(const CVarPath* const path)
   {
-    char full_name_in[NC_MAX_NAME +1];
     int grpid = this->getGroup(path);
     int dimid = this->getUnlimitedDimension(path);
-    CheckError(nc_inq_dimname(grpid, dimid, full_name_in));
-
-    StdString dimname(full_name_in);
+
+    StdString dimname;
+    if (dimid != -1)
+      CNetCdfInterface::inqDimName(grpid, dimid, dimname);
     return dimname;
   }
 
   //---------------------------------------------------------------
+
   StdSize CINetCDF4::getNbVertex(const StdString& name,
                                  const CVarPath* const path)
@@ -121,5 +109,5 @@
             (this->getCoordinatesIdList(name, path).back(), path);
       StdString dim = this->getDimensionsList(&bound, path).back();
-      return (this->getDimensions(&bound, path)[dim]);
+      return this->getDimensions(&bound, path)[dim];
     }
     return size_t(-1);
@@ -130,19 +118,17 @@
   std::list<StdString> CINetCDF4::getGroups(const CVarPath* const path)
   {
-    StdSize strlen = 0;
-    char full_name_in[NC_MAX_NAME +1];
     int nbgroup = 0, *groupid = NULL;
     int grpid = this->getGroup(path);
     std::list<StdString> retvalue;
 
-    CheckError(nc_inq_grps(grpid, &nbgroup, NULL));
+    CNetCdfInterface::inqGrpIds(grpid, nbgroup, NULL);
     groupid = new int[nbgroup]();
-    CheckError(nc_inq_grps(grpid, NULL, groupid));
+    CNetCdfInterface::inqGrpIds(grpid, nbgroup, groupid);
 
     for (int i = 0; i < nbgroup; i++)
     {
-      CheckError(nc_inq_grpname_full(groupid[i], &strlen, full_name_in));
-      StdString groupname(full_name_in, strlen);
-      retvalue.push_back(groupname);
+      StdString fullGrpName;
+      CNetCdfInterface::inqGrpFullName(groupid[i], fullGrpName);
+      retvalue.push_back(fullGrpName);
     }
 
@@ -153,18 +139,17 @@
   std::list<StdString> CINetCDF4::getVariables(const CVarPath* const path)
   {
-    char full_name_in[NC_MAX_NAME +1];
     int nbvar = 0, *varid = NULL;
     int grpid = this->getGroup(path);
     std::list<StdString> retvalue;
 
-    CheckError(nc_inq_varids(grpid, &nbvar, NULL));
+    CNetCdfInterface::inqVarIds(grpid, nbvar, NULL);
     varid = new int[nbvar]();
-    CheckError(nc_inq_varids(grpid, NULL, varid));
+    CNetCdfInterface::inqVarIds(grpid, nbvar, varid);
 
     for (int i = 0; i < nbvar; i++)
     {
-      CheckError(nc_inq_varname(grpid, varid[i], full_name_in));
-      StdString varname(full_name_in);
-      retvalue.push_back(varname);
+      StdString varName;
+      CNetCdfInterface::inqVarName(grpid, varid[i], varName);
+      retvalue.push_back(varName);
     }
 
@@ -175,5 +160,5 @@
   StdSize CINetCDF4::getNbOfTimestep(const CVarPath* const path)
   {
-    return (this->getDimensions(NULL, path)[this->getUnlimitedDimensionName(path)]);
+    return this->getDimensions(NULL, path)[this->getUnlimitedDimensionName(path)];
   }
 
@@ -214,5 +199,4 @@
   std::list<StdString> CINetCDF4::getDimensionsList(const StdString* const var, const CVarPath* const path)
   {
-    char full_name_in[NC_MAX_NAME +1];
     int nbdim = 0, *dimid = NULL;
     int grpid = this->getGroup(path);
@@ -222,19 +206,19 @@
     if (var != NULL)
     {
-      CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+      CNetCdfInterface::inqVarNDims(grpid, varid, nbdim);
       dimid = new int[nbdim]();
-      CheckError(nc_inq_vardimid(grpid, varid, dimid));
+      CNetCdfInterface::inqVarDimId(grpid, varid, dimid);
     }
     else
     {
-      CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+      CNetCdfInterface::inqDimIds(grpid, nbdim, NULL, 1);
       dimid = new int[nbdim]();
-      CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+      CNetCdfInterface::inqDimIds(grpid, nbdim, dimid, 1);
     }
 
     for (int i = 0; i < nbdim; i++)
     {
-      CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
-      StdString dimname(full_name_in);
+      std::string dimname;
+      CNetCdfInterface::inqDimName(grpid, dimid[i], dimname);
       retvalue.push_back(dimname);
     }
@@ -246,6 +230,4 @@
   std::map<StdString, StdSize> CINetCDF4::getDimensions(const StdString* const var, const CVarPath* const path)
   {
-    StdSize size = 0;
-    char full_name_in[NC_MAX_NAME + 1];
     int nbdim = 0, *dimid = NULL;
     int grpid = this->getGroup(path);
@@ -255,21 +237,22 @@
     if (var != NULL)
     {
-      CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+      CNetCdfInterface::inqVarNDims(grpid, varid, nbdim);
       dimid = new int[nbdim]();
-      CheckError(nc_inq_vardimid(grpid, varid, dimid));
+      CNetCdfInterface::inqVarDimId(grpid, varid, dimid);
     }
     else
     {
-      CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+      CNetCdfInterface::inqDimIds(grpid, nbdim, NULL, 1);
       dimid = new int[nbdim]();
-      CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+      CNetCdfInterface::inqDimIds(grpid, nbdim, dimid, 1);
     }
 
     for (int i = 0; i < nbdim; i++)
     {
-      CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
-      CheckError(nc_inq_dimlen (grpid, dimid[i], &size));
-
-      StdString dimname(full_name_in);
+      std::string dimname;
+      CNetCdfInterface::inqDimName(grpid, dimid[i], dimname);
+      StdSize size = 0;
+      CNetCdfInterface::inqDimLen(grpid, dimid[i], size);
+
       retvalue.insert(retvalue.end(), std::make_pair(dimname, size));
     }
@@ -279,8 +262,7 @@
   }
 
-  std::list<StdString> CINetCDF4::getAttributes(const StdString* const var, const CVarPath* const path )
+  std::list<StdString> CINetCDF4::getAttributes(const StdString* const var, const CVarPath* const path)
   {
     int nbatt = 0;
-    char full_name_in[NC_MAX_NAME +1];
     std::list<StdString> retvalue;
     int grpid = this->getGroup(path);
@@ -288,12 +270,12 @@
 
     if (var != NULL)
-      CheckError(nc_inq_varnatts(grpid, varid, &nbatt));
+      CNetCdfInterface::inqVarNAtts(grpid, varid, nbatt);
     else
-      CheckError(nc_inq_natts(grpid, &nbatt));
+      CNetCdfInterface::inqNAtts(grpid, nbatt);
 
     for (int i = 0; i < nbatt; i++)
     {
-      CheckError(nc_inq_attname(grpid, varid, i, full_name_in));
-      StdString attname(full_name_in);
+      StdString attname;
+      CNetCdfInterface::inqAttName(grpid, varid, i, attname);
       retvalue.push_back(attname);
     }
@@ -323,6 +305,5 @@
                                   const CVarPath* const path)
   {
-    return (this->hasAttribute("missing_value", &name, path) ||
-          this->hasAttribute("_FillValue", &name, path));
+    return (this->hasAttribute("missing_value", &name, path) || this->hasAttribute("_FillValue", &name, path));
   }
 
@@ -357,5 +338,5 @@
                                  const CVarPath* const path)
   {
-    return (this->hasAttribute("coordinates", &name, path));
+    return this->hasAttribute("coordinates", &name, path);
   }
 
@@ -363,5 +344,5 @@
                             const CVarPath* const path)
   {
-    return (this->hasAttribute("bounds", &name, path));
+    return this->hasAttribute("bounds", &name, path);
   }
 
@@ -373,71 +354,60 @@
   //---------------------------------------------------------------
 
-#define GET_ATTRIBUTE_VALUE(type, func_ext, type_enum)                              \
-  template <>                                                                       \
-  std::vector<type> CINetCDF4::getAttributeValue(const StdString& name,             \
-                                                 const StdString* const var,        \
-                                                 const CVarPath* const path)        \
-  {                                                                                 \
-    int grpid = this->getGroup(path);                                               \
-    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;          \
-    std::pair<nc_type , StdSize> attinfos = this->getAttribute(name, var, path);    \
-    std::vector<type> retvalue(attinfos.second);                                    \
-    if (attinfos.first != type_enum)                                                \
-      ERROR("CINetCDF4::getAttributeValue<double>(name, var, path",                 \
-            << "[ name : " << name                                                  \
-            << ", type requested :" << attinfos.first                               \
-            << ", type stored : " << type_enum << "]"                               \
-            << " Invalid type !");                                                  \
-    CheckError(nc_get_att_##func_ext(grpid, varid, name.c_str(), &(retvalue[0])));  \
-    return retvalue;                                                                \
-  }
-
-  GET_ATTRIBUTE_VALUE(double, double, NC_DOUBLE)
-  GET_ATTRIBUTE_VALUE(float,  float,  NC_FLOAT)
-  GET_ATTRIBUTE_VALUE(int,    int ,   NC_INT)
-  GET_ATTRIBUTE_VALUE(char,   text,   NC_CHAR)
-
-  template <>
+  template <class T>
+  std::vector<T> CINetCDF4::getAttributeValue(const StdString& name,
+                                              const StdString* const var,
+                                              const CVarPath* const path)
+  {
+    int grpid = this->getGroup(path);
+    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
+    std::pair<nc_type , StdSize> attinfos = this->getAttribute(name, var, path);
+    std::vector<T> retvalue(attinfos.second);
+    nc_type type = CNetCdfInterface::getNcType<T>();
+    if (attinfos.first != type)
+      ERROR("CINetCDF4::getAttributeValue<T>(name, var, path)",
+            << "[ name : " << name
+            << ", type requested :" << attinfos.first
+            << ", type stored : " << type << "]"
+            << " Invalid type !");
+    CNetCdfInterface::getAttType(grpid, varid, name.c_str(), &retvalue[0]);
+    return retvalue;
+  }
+
+  template std::vector<double> CINetCDF4::getAttributeValue(const StdString& name,
+                                                            const StdString* const var,
+                                                            const CVarPath* const path);
+  template std::vector<float> CINetCDF4::getAttributeValue(const StdString& name,
+                                                           const StdString* const var,
+                                                           const CVarPath* const path);
+  template std::vector<int> CINetCDF4::getAttributeValue(const StdString& name,
+                                                         const StdString* const var,
+                                                         const CVarPath* const path);
+  template std::vector<char> CINetCDF4::getAttributeValue(const StdString& name,
+                                                          const StdString* const var,
+                                                          const CVarPath* const path);
+
   StdString CINetCDF4::getAttributeValue(const StdString& name,
                                          const StdString* const var,
                                          const CVarPath* const path)
   {
-    std::vector<char> chart = this->getAttributeValue<std::vector<char> >(name, var, path);
-    StdString retvalue(&(chart[0]), chart.size());
-    return retvalue;
-  }
-
-  template <>
-  int CINetCDF4::getMissingValue(const StdString& name,
-                                 const CVarPath* const path)
+    std::vector<char> data = this->getAttributeValue<char>(name, var, path);
+
+    return StdString(data.begin(), data.end());
+  }
+
+  template <class T>
+  T CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path)
   {
     if (this->hasAttribute("missing_value", &name, path))
-      return (this->getAttributeValue<std::vector<int> >("missing_value", &name, path)[0]);
+      return this->getAttributeValue<T>("missing_value", &name, path)[0];
     if (this->hasAttribute("_FillValue", &name, path))
-      return (this->getAttributeValue<std::vector<int> >("_FillValue", &name, path)[0]);
+      return this->getAttributeValue<T>("_FillValue", &name, path)[0];
     return 0;
   }
 
-  template <>
-  double CINetCDF4::getMissingValue(const StdString& name,
-                                    const CVarPath* const path)
-  {
-    if (this->hasAttribute("missing_value", &name, path))
-      return (this->getAttributeValue<std::vector<double> >("missing_value", &name, path)[0]);
-    if (this->hasAttribute("_FillValue", &name, path))
-      return (this->getAttributeValue<std::vector<double> >("_FillValue", &name, path)[0]);
-    return 0;
-  }
-
-  template <>
-  float CINetCDF4::getMissingValue(const StdString& name,
-                                   const CVarPath* const path)
-  {
-    if (this->hasAttribute("missing_value", &name, path))
-      return (this->getAttributeValue<std::vector<float> >("missing_value", &name, path)[0]);
-    if (this->hasAttribute("_FillValue", &name, path))
-      return (this->getAttributeValue<std::vector<float> >("_FillValue", &name, path)[0]);
-    return 0;
-  }
+  template double CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
+  template float CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
+  template int CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
+  template char CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
 
   //---------------------------------------------------------------
@@ -464,5 +434,5 @@
     if (this->hasAttribute("coordinates", &name, path))
     {
-      return (this->getAttributeValue<StdString>("coordinates", &name, path));
+      return this->getAttributeValue("coordinates", &name, path);
     }
     else
@@ -486,5 +456,5 @@
     StdString retvalue;
     if (this->hasAttribute("bounds", &name, path))
-      return (this->getAttributeValue<StdString>("bounds", &name, path));
+      retvalue = this->getAttributeValue("bounds", &name, path);
     return retvalue;
   }
@@ -583,7 +553,5 @@
     if (!this->hasTemporalDim(path)) return false;
     std::map<StdString, StdSize> dims = this->getDimensions(&name, path);
-    if (dims.find(this->getUnlimitedDimensionName(path)) != dims.end())
-      return true;
-    return false;
+    return (dims.find(this->getUnlimitedDimensionName(path)) != dims.end());
   }
 
@@ -616,5 +584,5 @@
     if (this->isCoordinate(name, path))
     {
-      return (this->hasBounds(name, path));
+      return this->hasBounds(name, path);
     }
     else
@@ -712,9 +680,8 @@
   }
 
-  template <>
-  void CINetCDF4::getData(CArray<int, 1>& data, const StdString& var,
+  template <class T>
+  void CINetCDF4::getData(CArray<T, 1>& data, const StdString& var,
                           const CVarPath* const path, StdSize record)
   {
-
     std::vector<StdSize> start, count;
     int grpid = this->getGroup(path);
@@ -723,32 +690,16 @@
     this->getDataInfo(var, path, record, start, count, array_size);
     data.resize(array_size);
-    CheckError(nc_get_vara_int(grpid, varid, &(start[0]), &(count[0]), data.dataFirst()));
-  }
-
+    CNetCdfInterface::getVaraType(grpid, varid, &start[0], &count[0], data.dataFirst());
+  }
+
+  template <>
+  void CINetCDF4::getData(CArray<int, 1>& data, const StdString& var,
+                          const CVarPath* const path, StdSize record);
   template <>
   void CINetCDF4::getData(CArray<double, 1>& data, const StdString& var,
-                          const CVarPath* const path, StdSize record)
-  {
-    std::vector<StdSize> start, count;
-    int grpid = this->getGroup(path);
-    int varid = this->getVariable(var, path);
-    StdSize array_size = 1;
-    this->getDataInfo(var, path, record, start, count, array_size);
-    data.resize(array_size);
-    CheckError(nc_get_vara_double(grpid, varid, &(start[0]), &(count[0]), data.dataFirst()));
-  }
-
+                          const CVarPath* const path, StdSize record);
   template <>
   void CINetCDF4::getData(CArray<float, 1>& data, const StdString& var,
-                          const CVarPath* const path, StdSize record)
-  {
-    std::vector<StdSize> start, count;
-    int grpid = this->getGroup(path);
-    int varid = this->getVariable(var, path);
-    StdSize array_size = 1;
-    this->getDataInfo(var, path, record, start, count, array_size);
-    data.resize(array_size);
-    CheckError(nc_get_vara_float(grpid, varid, &(start[0]), &(count[0]), data.dataFirst()));
-  }
+                          const CVarPath* const path, StdSize record);
 
   template <>
@@ -762,5 +713,5 @@
     if (this->mpi && collective)
       CNetCdfInterface::varParAccess(ncidp, varid, NC_COLLECTIVE);
-    if (this->mpi && !collective)
+    else if (this->mpi && !collective)
       CNetCdfInterface::varParAccess(ncidp, varid, NC_INDEPENDENT);
 
@@ -777,5 +728,5 @@
     }
 
-    CheckError(nc_get_vara_double(ncidp, varid, &(sstart[0]), &(scount[0]), data.dataFirst()));
+    CNetCdfInterface::getVaraType(ncidp, varid, &sstart[0], &scount[0], data.dataFirst());
   }
 
@@ -787,7 +738,7 @@
     std::list<StdString> clist = this->getCoordinatesIdList(varname, path);
     if (this->hasCoordinates(varname, path))
-      return (*clist.begin());
+      return *clist.begin();
     else
-      return (*clist.rbegin());
+      return *clist.rbegin();
   }
 
@@ -797,7 +748,7 @@
     std::list<StdString> clist = this->getCoordinatesIdList(varname, path);
     if (this->hasCoordinates(varname, path))
-      return (*(++clist.begin()));
+      return *(++clist.begin());
     else
-      return (*(++clist.rbegin()));
+      return *(++clist.rbegin());
   }
 
@@ -808,7 +759,7 @@
     std::list<StdString> clist = this->getCoordinatesIdList(varname, path);
     if (this->hasCoordinates(varname, path))
-      return (*(++(++clist.begin())));
+      return *(++(++clist.begin()));
     else
-      return (*(++(++clist.rbegin())));
+      return *(++(++clist.rbegin()));
   }
 } // namespace xios
Index: /XIOS/trunk/src/io/inetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/io/inetcdf4.hpp	(revision 685)
+++ /XIOS/trunk/src/io/inetcdf4.hpp	(revision 686)
@@ -84,7 +84,11 @@
 
       template <class T>
-      T getAttributeValue(const StdString& name,
-                          const StdString* const var  = NULL,
-                          const CVarPath* const path = NULL);
+      std::vector<T> getAttributeValue(const StdString& name,
+                                       const StdString* const var  = NULL,
+                                       const CVarPath* const path = NULL);
+
+      StdString getAttributeValue(const StdString& name,
+                                  const StdString* const var,
+                                  const CVarPath* const path);
 
       template <class T>
@@ -149,63 +153,7 @@
 
     private:
-      /// VÃ©rification des erreurs NetCDF ///
-      static void CheckError(int status);
-
-      int ncidp; // Identifiant de fichier netcdf.
-      bool mpi; //< Whether parallel file access is used
+      int ncidp; //< Id of the NetCDF file
+      bool mpi;  //< Whether parallel file access is used
   }; // class CINetCDF4
-
-  ///--------------------------------------------------------------
-
-  template <>
-  StdString CINetCDF4::getAttributeValue(const StdString& name, const StdString* const var,
-                                         const CVarPath* const path);
-
-  template <>
-  std::vector<double> CINetCDF4::getAttributeValue(const StdString& name, const StdString* const var,
-                                                   const CVarPath* const path);
-
-  template <>
-  std::vector<float> CINetCDF4::getAttributeValue(const StdString& name, const StdString* const var,
-                                                  const CVarPath* const path);
-
-  template <>
-  std::vector<int> CINetCDF4::getAttributeValue(const StdString& name, const StdString* const var,
-                                                const CVarPath* const path);
-
-  template <>
-  std::vector<char> CINetCDF4::getAttributeValue(const StdString& name, const StdString* const var,
-                                                 const CVarPath* const path);
-
-  //---------------------------------------------------------------
-
-  template <>
-  int CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
-
-  template <>
-  double CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
-
-  template <>
-  float CINetCDF4::getMissingValue(const StdString& name, const CVarPath* const path);
-
-  //---------------------------------------------------------------
-
-  template <>
-  void CINetCDF4::getData(CArray<int, 1>& data, const StdString& var,
-                          const CVarPath* const path, StdSize record);
-
-  template <>
-  void CINetCDF4::getData(CArray<double, 1>& data, const StdString& var,
-                          const CVarPath* const path, StdSize record);
-
-  template <>
-  void CINetCDF4::getData(CArray<float, 1>& data, const StdString& var,
-                          const CVarPath* const path, StdSize record);
-
-  template <>
-  void CINetCDF4::getData(CArray<double, 1>& data, const StdString& var,
-                          bool collective, StdSize record,
-                          const std::vector<StdSize>* start /*= NULL*/,
-                          const std::vector<StdSize>* count /*= NULL*/);
 } // namespace xios
 
Index: /XIOS/trunk/src/io/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/io/nc4_data_output.cpp	(revision 685)
+++ /XIOS/trunk/src/io/nc4_data_output.cpp	(revision 686)
@@ -24,6 +24,4 @@
          StdString timeid = StdString("time_counter");
          SuperClass::type = MULTI_FILE;
-//         if (!exist)
-//            SuperClassWriter::addDimension(timeid);
       }
 
@@ -40,7 +38,4 @@
 
          SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE;
-
- //        if (!exist)
-//            SuperClassWriter::addDimension(timeid);
       }
 
Index: /XIOS/trunk/src/io/netCdfInterface.cpp
===================================================================
--- /XIOS/trunk/src/io/netCdfInterface.cpp	(revision 685)
+++ /XIOS/trunk/src/io/netCdfInterface.cpp	(revision 686)
@@ -22,12 +22,12 @@
 int CNetCdfInterface::create(const StdString& fileName, int cMode, int& ncId)
 {
-  int status = nc_create((fileName.c_str()), cMode, &ncId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-    sstr << "Error in calling function : nc_create((fileName.c_str()), cMode, &ncId) " << std::endl
-         << errormsg << std::endl
-         << "Unable to create file, given its name : " << fileName
+  int status = nc_create(fileName.c_str(), cMode, &ncId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+    sstr << "Error when calling function: nc_create(fileName.c_str(), cMode, &ncId) " << std::endl
+         << errormsg << std::endl
+         << "Unable to create file, given its name: " << fileName
          << "and its creation mode " << creationMode2String(cMode) << std::endl;
     StdString e = sstr.str();
@@ -49,12 +49,12 @@
 int CNetCdfInterface::createPar(const StdString& fileName, int cMode, MPI_Comm comm, MPI_Info info, int& ncId)
 {
-  int status = xios::nc_create_par((fileName.c_str()), cMode, comm, info, &ncId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-    sstr << "Error in calling function : nc_create_par((fileName.c_str()), cMode, comm, info, &ncId) " << std::endl
-         << errormsg << std::endl
-         << "Unable to create file on parallel filesys, given its name : " << std::endl
+  int status = xios::nc_create_par(fileName.c_str(), cMode, comm, info, &ncId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+    sstr << "Error when calling function: nc_create_par(fileName.c_str(), cMode, comm, info, &ncId) " << std::endl
+         << errormsg << std::endl
+         << "Unable to create file on parallel file system, given its name: " << std::endl
          << "and its creation mode " << creationMode2String(cMode) << std::endl;
     StdString e = sstr.str();
@@ -74,12 +74,12 @@
 int CNetCdfInterface::open(const StdString& fileName, int oMode, int& ncId)
 {
-  int status = nc_open((fileName.c_str()), oMode, &ncId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-    sstr << "Error in calling function : nc_open((fileName.c_str()), oMode, &ncId) "<< std::endl
-         << errormsg << std::endl
-         << "Unable to open file, given its name : " << fileName
+  int status = nc_open(fileName.c_str(), oMode, &ncId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+    sstr << "Error when calling function: nc_open(fileName.c_str(), oMode, &ncId) "<< std::endl
+         << errormsg << std::endl
+         << "Unable to open file, given its name: " << fileName
          << "and its open mode " << openMode2String(oMode) << std::endl;
     StdString e = sstr.str();
@@ -102,12 +102,12 @@
 int CNetCdfInterface::openPar(const StdString& fileName, int oMode, MPI_Comm comm, MPI_Info info, int& ncId)
 {
-  int status = xios::nc_open_par((fileName.c_str()), oMode, comm, info, &ncId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-    sstr << "Error in calling function " << "nc_open_par((fileName.c_str()), oMode, comm, info, &ncId) " << std::endl
-         << errormsg << std::endl
-         << "Unable to open file on parallel filesys, given its name : " << fileName
+  int status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+    sstr << "Error when calling function nc_open_par(fileName.c_str(), oMode, comm, info, &ncId) " << std::endl
+         << errormsg << std::endl
+         << "Unable to open file on parallel file system, given its name: " << fileName
          << "and its open mode " << openMode2String(oMode) << std::endl;
     StdString e = sstr.str();
@@ -130,7 +130,7 @@
     StdString errormsg(nc_strerror(status));
     StdStringStream sstr;
-    sstr << "Error in calling function " << "nc_close(ncId)" << std::endl
-         << errormsg << std::endl
-         << "Unable to close file, given its id : " << ncId << std::endl;
+    sstr << "Error when calling function nc_close(ncId)" << std::endl
+         << errormsg << std::endl
+         << "Unable to close file, given its id: " << ncId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -152,7 +152,7 @@
     StdString errormsg(nc_strerror(status));
     StdStringStream sstr;
-    sstr << "Error in calling function " << "nc_redef(ncId)" << std::endl
+    sstr << "Error when calling function nc_redef(ncId)" << std::endl
       << errormsg << std::endl
-      << "Unable to put this file into define mode given its id : " << ncId << std::endl;
+      << "Unable to put this file into define mode given its id: " << ncId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -175,7 +175,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_enddef(ncId)" << std::endl
-         << errormsg << std::endl
-         << "Unable to end define mode of this file, given its id : " << ncId << std::endl;
+    sstr << "Error when calling function nc_enddef(ncId)" << std::endl
+         << errormsg << std::endl
+         << "Unable to end define mode of this file, given its id: " << ncId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -194,13 +194,13 @@
 int CNetCdfInterface::inqNcId(int ncid, const StdString& grpName, int& grpId)
 {
-  int status = nc_inq_ncid(ncid, (grpName.c_str()), &grpId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function " << "nc_inq_ncid(ncid, (grpName.c_str()), &grpId)" << std::endl
-         << errormsg << std::endl
-         << "Unable to get id of a group (File), given its name : " << grpName << std::endl;
+  int status = nc_inq_ncid(ncid, grpName.c_str(), &grpId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_ncid(ncid, grpName.c_str(), &grpId)" << std::endl
+         << errormsg << std::endl
+         << "Unable to get id of a group (File), given its name: " << grpName << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -218,15 +218,15 @@
 \return Status code
 */
-int CNetCdfInterface::inqVarId(int ncid,const StdString& varName, int& varId)
-{
-  int status = nc_inq_varid(ncid, (varName.c_str()), &varId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function : nc_inq_varid(ncid, (varName.c_str()), &varId)" << std::endl
+int CNetCdfInterface::inqVarId(int ncid, const StdString& varName, int& varId)
+{
+  int status = nc_inq_varid(ncid, varName.c_str(), &varId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function: nc_inq_varid(ncid, varName.c_str(), &varId)" << std::endl
          << (errormsg) << std::endl
-         << "Unable to get id of variable with name : " << varName << std::endl;
+         << "Unable to get id of variable with name: " << varName << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -243,19 +243,45 @@
 \return Status code
 */
-int CNetCdfInterface::inqDimId(int ncid,const StdString& dimName, int& dimId)
-{
-  int status = nc_inq_dimid(ncid, (dimName.c_str()), &dimId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function " << "nc_inq_dimid(ncid, (dimName.c_str()), &dimId)" << std::endl
-         << errormsg << std::endl
-         << "Unable to get id of dimension, given its name : " << dimName << std::endl;
-    StdString e = sstr.str();
-    throw CNetCdfException(e);
-  }
-
+int CNetCdfInterface::inqDimId(int ncid, const StdString& dimName, int& dimId)
+{
+  int status = nc_inq_dimid(ncid, dimName.c_str(), &dimId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_dimid(ncid, dimName.c_str(), &dimId)" << std::endl
+         << errormsg << std::endl
+         << "Unable to get id of dimension, given its name: " << dimName << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+/*!
+This function queries the name of a variable given its id.
+\param [in] ncid Groupd id (or File Id)
+\param [in] varId Id of desired variable
+\param [out] varName name of desired variable
+\return Status code
+*/
+int CNetCdfInterface::inqVarName(int ncid, int varId, StdString& varName)
+{
+  char varNameBuff[NC_MAX_NAME + 1];
+  int status = nc_inq_varname(ncid, varId, varNameBuff);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_varname(ncid, varId, varNameBuff)" << std::endl
+         << errormsg << std::endl
+         << "Unable to get variable name given its id: " << varId << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+  varName = varNameBuff;
   return status;
 }
@@ -275,5 +301,5 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_inq_dimid" << std::endl
+    sstr << "Error when calling function nc_inq_dimid" << std::endl
       << errormsg << std::endl
       << "Unable to get id of unlimited dimension " << std::endl;
@@ -289,10 +315,10 @@
 \param [in] ncid Groupd id (or File Id)
 \param [in] dimId Id of desired dimension
-\param [in/out] dimName Name of desired dimension
+\param [out] dimName Name of desired dimension
 \return Status code
 */
 int CNetCdfInterface::inqDimName(int ncid, int dimId, StdString& dimName)
 {
-  char fullNameIn[NC_MAX_NAME +1];
+  char fullNameIn[NC_MAX_NAME + 1];
   int status = nc_inq_dimname(ncid, dimId, fullNameIn);
   if (NC_NOERR != status)
@@ -301,7 +327,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_inq_dimname(ncid, dimId, fullNameIn)" << std::endl
-         << errormsg << std::endl
-         << "Unable to get dimension name from its id : " << dimId << std::endl;
+    sstr << "Error when calling function nc_inq_dimname(ncid, dimId, fullNameIn)" << std::endl
+         << errormsg << std::endl
+         << "Unable to get dimension name given its id: " << dimId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -326,7 +352,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_inq_dimlen(ncid, dimId, &dimLen)" << std::endl
-         << errormsg << std::endl
-         << "Unable to get dimension length from its id: " << dimId << std::endl;
+    sstr << "Error when calling function nc_inq_dimlen(ncid, dimId, &dimLen)" << std::endl
+         << errormsg << std::endl
+         << "Unable to get dimension length given its id: " << dimId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -351,7 +377,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_inq_varndims(ncid, varId, &nDims)" << std::endl
-         << errormsg << std::endl
-         << "Unable to get the number of dimension of variable with Id : " << varId << std::endl;
+    sstr << "Error when calling function nc_inq_varndims(ncid, varId, &nDims)" << std::endl
+         << errormsg << std::endl
+         << "Unable to get the number of dimension of variable with Id: " << varId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -376,5 +402,5 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_inq_vardimid(ncid, varId, dimIds)" << std::endl
+    sstr << "Error when calling function nc_inq_vardimid(ncid, varId, dimIds)" << std::endl
          << errormsg << std::endl
          << "Unable to get list of dimension id of the variable with id " << varId << std::endl;
@@ -402,8 +428,189 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_inq_dimids(ncid, &nDims, dimIds, includeParents)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to retrieve number of dimension in the group with id : " << ncid << std::endl;
+    sstr << "Error when calling function nc_inq_dimids(ncid, &nDims, dimIds, includeParents)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to retrieve number of dimension in the group with id: " << ncid << std::endl;
     sstr << "With number of Parents " << includeParents << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+/*!
+This function queries the full name of a group given its id.
+\param [in] ncid Groupd id (or File Id)
+\param [in/out] grpFullName the full name of the group
+\return Status code
+*/
+int CNetCdfInterface::inqGrpFullName(int ncid, StdString& grpFullName)
+{
+  StdSize strlen = 0;
+  std::vector<char> buff;
+  int status = nc_inq_grpname_full(ncid, &strlen, NULL);
+  if (NC_NOERR == status)
+  {
+    buff.resize(strlen + 1);
+    status = nc_inq_grpname_full(ncid, NULL, &buff[0]);
+  }
+
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_grpname_full(ncid, &strlen, &buff[0])" << std::endl
+         << errormsg << std::endl
+         << "Unable to get the full group name given its id: " << ncid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  grpFullName.assign(buff.begin(), buff.end());
+
+  return status;
+}
+
+/*!
+This function queries the list of group ids given a location id.
+\param [in] ncid Groupd id (or File Id)
+\param [in/out] numgrps number of groups
+\param [in/out] ncids list of group ids
+\return Status code
+*/
+int CNetCdfInterface::inqGrpIds(int ncid, int& numgrps, int* ncids)
+{
+  int status = nc_inq_grps(ncid, &numgrps, ncids);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_grps(ncid, &numgrps, ncids)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to retrieve the list of groups for location id: " << ncid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+/*!
+This function queries the list of variable ids given a location id.
+\param [in] ncid Groupd id (or File Id)
+\param [in/out] nvars number of variables
+\param [in/out] varids list of variable ids
+\return Status code
+*/
+int CNetCdfInterface::inqVarIds(int ncid, int& nvars, int* varids)
+{
+  int status = nc_inq_varids(ncid, &nvars, varids);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_varids(ncid, &nvars, varids)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to retrieve the list of variables for location id: " << ncid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+/*!
+This function queries the type and the size of an attribute given its name and the id of the variable to which it is attached.
+\param [in] ncid Groupd id (or File Id)
+\param [in] varid the id of the variable to which the attribute is attached
+\param [in] name the name of the attribute
+\param [out] type the type of the attribute
+\param [out] len the size of the attribute
+\return Status code
+*/
+int CNetCdfInterface::inqAtt(int ncid, int varid, const StdString& name, nc_type& type, size_t& len)
+{
+  int status = nc_inq_att(ncid, varid, name.c_str(), &type, &len);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_att(ncid, varid, name.c_str(), &type, &len)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to query the attribute information given its name: " << name << " and its variable id:" << varid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+/*!
+This function queries the number of global attributes given a location id.
+\param [in] ncid Groupd id (or File Id)
+\param [out] ngatts the number of global attributes
+\return Status code
+*/
+int CNetCdfInterface::inqNAtts(int ncid, int& ngatts)
+{
+  int status = nc_inq_natts(ncid, &ngatts);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_natts(ncid, &ngatts)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to query the number of global attributes given the location id:" << ncid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+/*!
+This function queries the number of global attributes given a location id and a variable id.
+\param [in] ncid Groupd id (or File Id)
+\param [in] varid the id of the variable
+\param [out] natts the number of global attributes
+\return Status code
+*/
+int CNetCdfInterface::inqVarNAtts(int ncid, int varid, int& natts)
+{
+  int status = nc_inq_varnatts(ncid, varid, &natts);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_varnatts(ncid, varid, &natts)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to query the number of attributes given the location id:" << ncid << " and the variable id:" << varid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+
+//! Query the name of an attribute given a location id, a variable id and the attribute number
+int CNetCdfInterface::inqAttName(int ncid, int varid, int attnum, StdString& name)
+{
+  char attName[NC_MAX_NAME + 1];
+  int status = nc_inq_attname(ncid, varid, attnum, attName);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_inq_attname(ncid, varid, attnum, attName)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to query the name of attribute " << attnum << " given the location id:" << ncid << " and the variable id:" << varid << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -422,13 +629,13 @@
 int CNetCdfInterface::defGrp(int parentNcid, const StdString& grpName, int& grpId)
 {
-  int status = nc_def_grp(parentNcid, (grpName.c_str()), &grpId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function " << "nc_def_grp(parentNcid, (grpName.c_str()), &grpId)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to create group Id, given its name : " << grpName << std::endl;
+  int status = nc_def_grp(parentNcid, grpName.c_str(), &grpId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_def_grp(parentNcid, grpName.c_str(), &grpId)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to create group Id, given its name: " << grpName << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -447,13 +654,13 @@
 int CNetCdfInterface::defDim(int ncid, const StdString& dimName, StdSize dimLen, int& dimId)
 {
-  int status = nc_def_dim(ncid, (dimName.c_str()), dimLen, &dimId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function " << "nc_def_dim(ncid, (dimName.c_str()), dimLen, &dimId)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to create dimension with name : " << dimName
+  int status = nc_def_dim(ncid, dimName.c_str(), dimLen, &dimId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_def_dim(ncid, dimName.c_str(), dimLen, &dimId)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to create dimension with name: " << dimName
          << " and with length " << dimLen << std::endl;
     StdString e = sstr.str();
@@ -475,16 +682,16 @@
 \return Status code
 */
-int CNetCdfInterface::defVar(int ncid,const StdString& varName, nc_type xtype,
-                            int nDims, const int dimIds[], int& varId)
-{
-  int status = nc_def_var(ncid, (varName.c_str()), xtype, nDims, dimIds, &varId);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function " << " nc_def_var(ncid, (varName.c_str()), xtype, nDims, dimIds, &varId)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to add a new variable with name : " << varName
+int CNetCdfInterface::defVar(int ncid, const StdString& varName, nc_type xtype,
+                             int nDims, const int dimIds[], int& varId)
+{
+  int status = nc_def_var(ncid, varName.c_str(), xtype, nDims, dimIds, &varId);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function  nc_def_var(ncid, varName.c_str(), xtype, nDims, dimIds, &varId)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to add a new variable with name: " << varName
          << " with type " << xtype
          << " and number of dimension " << nDims << std::endl;
@@ -501,5 +708,5 @@
 \param [in] ncid Id groupd(or File Id)
 \param [in] varId Id of the variable
-\param [in] storage Type of storage (It can be : NC_CONTIGUOUS, NC_CHUNKED)
+\param [in] storage Type of storage (It can be: NC_CONTIGUOUS, NC_CHUNKED)
 \param [in/out] chunkSize array list of chunk sizes
 \return Status code
@@ -513,7 +720,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_def_var_chunking(ncid, varId, storage, chunkSize)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to set chunk size of the variable with id : " << varId
+    sstr << "Error when calling function nc_def_var_chunking(ncid, varId, storage, chunkSize)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to set chunk size of the variable with id: " << varId
       << " and storage type " << storage << std::endl;
     StdString e = sstr.str();
@@ -539,5 +746,5 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_def_var_deflate(ncid, varId, false, (compressionLevel > 0), compressionLevel)" << std::endl;
+    sstr << "Error when calling function nc_def_var_deflate(ncid, varId, false, (compressionLevel > 0), compressionLevel)" << std::endl;
     sstr << errormsg << std::endl;
     sstr << "Unable to set the compression level of the variable with id: " << varId
@@ -559,13 +766,13 @@
 {
   int old_fill_mode;
-  int status = nc_set_fill(ncid, fill ? NC_FILL : NC_NOFILL, &old_fill_mode);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error when calling function nc_set_fill(ncid, fill ? NC_FILL : NC_NOFILL, &old_fill_mode)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to set the fill mode to : " << (fill ? "NC_FILL" : "NC_NOFILL") << std::endl;
+  int status = nc_set_fill(ncid, fill ? NC_FILL: NC_NOFILL, &old_fill_mode);
+  if (NC_NOERR != status)
+  {
+    StdString errormsg(nc_strerror(status));
+    StdStringStream sstr;
+
+    sstr << "Error when calling function nc_set_fill(ncid, fill ? NC_FILL: NC_NOFILL, &old_fill_mode)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to set the fill mode to: " << (fill ? "NC_FILL": "NC_NOFILL") << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -592,7 +799,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_def_var_fill(ncid, varId, noFill, fillValue)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to set fill parameters of the variable with id : " << varId
+    sstr << "Error when calling function nc_def_var_fill(ncid, varId, noFill, fillValue)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to set fill parameters of the variable with id: " << varId
       << " and fill option " << noFill << std::endl;
     StdString e = sstr.str();
@@ -620,7 +827,7 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_var_par_access(ncid, varId, access)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to change read/write option of the variable with id : " << varId << std::endl;
+    sstr << "Error when calling function nc_var_par_access(ncid, varId, access)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to change read/write option of the variable with id: " << varId << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -643,100 +850,130 @@
     StdStringStream sstr;
 
-    sstr << "Error in calling function " << "nc_sync(ncid)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to make a synchronization of a netCDF file with id : " << ncid << std::endl;
-    StdString e = sstr.str();
-    throw CNetCdfException(e);
-  }
-
-  return status;
-}
-
-/*!
-This function makes a request to netcdf with its id, to add or change a variable attribute or gloabl attribute,
-given its name, type, number of values provided for attribute
-\param [in] ncid Id of groupd(or File Id)
-\param [in] varId Id of the variable
-\param [in] attrName Name of the attribute
-\param [in] xtypes One of the set of predefined netCDF data types
-\param [in] numVal Number of values
-\param [in] op Array of values provided for attribute
-\return Status code
-*/
-int CNetCdfInterface::putAtt(int ncid, int varId, const StdString& attrName, nc_type xtype,
-                            StdSize numVal, const void* op)
-{
-  int status = nc_put_att(ncid, varId, (attrName.c_str()), xtype, numVal, op);
-  if (NC_NOERR != status)
-  {
-    StdString errormsg(nc_strerror(status));
-    StdStringStream sstr;
-
-    sstr << "Error in calling function " << "nc_put_att(ncid, varId, (attrName.c_str()), xtype, numVal, op)" << std::endl;
-    sstr << errormsg << std::endl;
-    sstr << "Unable to set attribute " << attrName << " for a variable with id : " << varId
-         << " with number of attribute  " << numVal
-         << " with type " << xtype << std::endl;
-    StdString e = sstr.str();
-    throw CNetCdfException(e);
-  }
-
-  return status;
-}
-
- // Some specilization of putAttributeType
+    sstr << "Error when calling function nc_sync(ncid)" << std::endl;
+    sstr << errormsg << std::endl;
+    sstr << "Unable to make a synchronization of a netCDF file with id: " << ncid << std::endl;
+    StdString e = sstr.str();
+    throw CNetCdfException(e);
+  }
+
+  return status;
+}
+
+// Some specializations of getAttributeType
+template<>
+int CNetCdfInterface::ncGetAttType(int ncid, int varid, const char* attrName, double* data)
+{
+  return nc_get_att_double(ncid, varid, attrName, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetAttType(int ncid, int varid, const char* attrName, float* data)
+{
+  return nc_get_att_float(ncid, varid, attrName, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetAttType(int ncid, int varid, const char* attrName, int* data)
+{
+  return nc_get_att_int(ncid, varid, attrName, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetAttType(int ncid, int varid, const char* attrName, long* data)
+{
+  return nc_get_att_long(ncid, varid, attrName, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetAttType(int ncid, int varid, const char* attrName, short* data)
+{
+  return nc_get_att_short(ncid, varid, attrName, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetAttType(int ncid, int varid, const char* attrName, char* data)
+{
+  return nc_get_att_text(ncid, varid, attrName, data);
+}
+
+// Some specializations of putAttributeType
 template<>
 int CNetCdfInterface::ncPutAttType(int ncid, int varid, const char* attrName,
-                                 StdSize numVal, const double* op)
-{
-  return (nc_put_att_double(ncid, varid, attrName, NC_DOUBLE, numVal, op));
+                                   StdSize numVal, const double* data)
+{
+  return nc_put_att_double(ncid, varid, attrName, NC_DOUBLE, numVal, data);
 }
 
 template<>
 int CNetCdfInterface::ncPutAttType(int ncid, int varid, const char* attrName,
-                                   StdSize numVal, const float* op)
-{
-  return (nc_put_att_float(ncid, varid, attrName, NC_FLOAT, numVal, op));
+                                   StdSize numVal, const float* data)
+{
+  return nc_put_att_float(ncid, varid, attrName, NC_FLOAT, numVal, data);
 }
 
 template<>
 int CNetCdfInterface::ncPutAttType(int ncid, int varid, const char* attrName,
-                                   StdSize numVal, const int* op)
-{
-  return (nc_put_att_int(ncid, varid, attrName, NC_INT, numVal, op));
+                                   StdSize numVal, const int* data)
+{
+  return nc_put_att_int(ncid, varid, attrName, NC_INT, numVal, data);
 }
 
 template<>
 int CNetCdfInterface::ncPutAttType(int ncid, int varid, const char* attrName,
-                                   StdSize numVal, const long* op)
-{
-  return (nc_put_att_long(ncid, varid, attrName, NC_LONG, numVal, op));
+                                   StdSize numVal, const long* data)
+{
+  return nc_put_att_long(ncid, varid, attrName, NC_LONG, numVal, data);
 }
 
 template<>
 int CNetCdfInterface::ncPutAttType(int ncid, int varid, const char* attrName,
-                                   StdSize numVal, const short* op)
-{
-  return (nc_put_att_short(ncid, varid, attrName, NC_SHORT, numVal, op));
-}
-
-
-// Some specilization of putVariableType
-template<>
-int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const double* op)
-{
-  return (nc_put_vara_double(ncid, varid, start, count, op));
-}
-
-template<>
-int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const float* op)
-{
-  return (nc_put_vara_float(ncid, varid, start, count, op));
-}
-
-template<>
-int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const int* op)
-{
-  return (nc_put_vara_int(ncid, varid, start, count, op));
+                                   StdSize numVal, const short* data)
+{
+  return nc_put_att_short(ncid, varid, attrName, NC_SHORT, numVal, data);
+}
+
+template<>
+int CNetCdfInterface::ncPutAttType(int ncid, int varid, const char* attrName,
+                                   StdSize numVal, const char* data)
+{
+  return nc_put_att_text(ncid, varid, attrName, numVal, data);
+}
+
+// Some specializations of getVariableType
+template<>
+int CNetCdfInterface::ncGetVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, double* data)
+{
+  return nc_get_vara_double(ncid, varid, start, count, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, float* data)
+{
+  return nc_get_vara_float(ncid, varid, start, count, data);
+}
+
+template<>
+int CNetCdfInterface::ncGetVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, int* data)
+{
+  return nc_get_vara_int(ncid, varid, start, count, data);
+}
+
+// Some specializations of putVariableType
+template<>
+int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const double* data)
+{
+  return nc_put_vara_double(ncid, varid, start, count, data);
+}
+
+template<>
+int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const float* data)
+{
+  return nc_put_vara_float(ncid, varid, start, count, data);
+}
+
+template<>
+int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const int* data)
+{
+  return nc_put_vara_int(ncid, varid, start, count, data);
 }
 
@@ -760,11 +997,11 @@
   {
   case NC_NOWRITE:
-    modeMes = StdString("NC_NOWRITE : Opening netCDF file with read-only access with buffering and caching access");
+    modeMes = StdString("NC_NOWRITE: Opening netCDF file with read-only access with buffering and caching access");
     break;
   case NC_SHARE:
-    modeMes = StdString("NC_SHARE : Several processes can read the file concurrently");
+    modeMes = StdString("NC_SHARE: Several processes can read the file concurrently");
     break;
   case NC_WRITE:
-    modeMes = StdString("NC_WRITE : NetCDF file is readable and writable");
+    modeMes = StdString("NC_WRITE: NetCDF file is readable and writable");
     break;
   default:
@@ -781,17 +1018,17 @@
   {
   case NC_NOCLOBBER:
-    modeMes = StdString("NC_NOCLOBBER : Not overwrite an exisiting netCDF file ");
+    modeMes = StdString("NC_NOCLOBBER: Not overwrite an exisiting netCDF file ");
     break;
   case NC_SHARE:
-    modeMes = StdString("NC_SHARE : Several processes can read from and write into the file concurrently");
+    modeMes = StdString("NC_SHARE: Several processes can read from and write into the file concurrently");
     break;
   case NC_64BIT_OFFSET:
-    modeMes = StdString("NC_64BIT_OFFSET : NetCDF file is 64-bit offset");
+    modeMes = StdString("NC_64BIT_OFFSET: NetCDF file is 64-bit offset");
     break;
   case NC_NETCDF4:
-    modeMes = StdString("NC_NETCDF4 : NetCDF file is HDF5/NetCDF-4");
+    modeMes = StdString("NC_NETCDF4: NetCDF file is HDF5/NetCDF-4");
     break;
   case NC_CLASSIC_MODEL:
-    modeMes = StdString("NC_CLASSIC_MODEL : NetCDF file is classical model");
+    modeMes = StdString("NC_CLASSIC_MODEL: NetCDF file is classical model");
     break;
   default:
Index: /XIOS/trunk/src/io/netCdfInterface.hpp
===================================================================
--- /XIOS/trunk/src/io/netCdfInterface.hpp	(revision 685)
+++ /XIOS/trunk/src/io/netCdfInterface.hpp	(revision 686)
@@ -55,6 +55,9 @@
     static int inqVarId(int ncid, const StdString& varName, int& varId);
 
+    //! Query the name of a variable given its id
+    static int inqVarName(int ncid, int varId, StdString& varName);
+
     //! Query identity of a named dimension
-    static int inqDimId(int ncid,const StdString& dimName, int& dimId);
+    static int inqDimId(int ncid, const StdString& dimName, int& dimId);
 
     //! Query identity of unlimited dimension
@@ -76,13 +79,33 @@
     static int inqDimIds(int ncid, int& nDims, int* dimIds, int includeParents);
 
+    //! Query the full name of a group given its id
+    static int inqGrpFullName(int ncid, StdString& grpFullName);
+
+    //! Query the list of group ids given a location id
+    static int inqGrpIds(int ncid, int& numgrps, int* ncids);
+
+    //! Query the list of variable ids given a location id
+    static int inqVarIds(int ncid, int& nvars, int* varids);
+
+    //! Query the type and the size of an attribute given its name and the id of the variable to which it is attached.
+    static int inqAtt(int ncid, int varid, const StdString& name, nc_type& type, size_t& len);
+
+    //! Query the number of global attributes given a location id
+    static int inqNAtts(int ncid, int& ngatts);
+
+    //! Query the number of attributes given a location id and a variable id
+    static int inqVarNAtts(int ncid, int varid, int& natts);
+
+    //! Query the name of an attribute given a location id, a variable id and the attribute number
+    static int inqAttName(int ncid, int varid, int attnum, StdString& name);
 
     //! Define a group
-    static int defGrp(int parentNcid,const StdString& grpName, int& grpId);
+    static int defGrp(int parentNcid, const StdString& grpName, int& grpId);
 
     //! Define a dimension
-    static int defDim(int ncid,const StdString& dimName, StdSize dimLen, int& dimId);
+    static int defDim(int ncid, const StdString& dimName, StdSize dimLen, int& dimId);
 
     //! Define a variable
-    static int defVar(int ncid,const StdString& varName, nc_type xtype,
+    static int defVar(int ncid, const StdString& varName, nc_type xtype,
                       int nDims, const int dimIds[], int& varId);
 
@@ -103,26 +126,39 @@
     static int varParAccess(int ncid, int varid, int access);
 
-    //! Syn
+    //! Sync the file
     static int sync(int ncId);
 
-    //! Put attribute into variable
-    static int putAtt(int ncid, int varid, const StdString& attrName, nc_type xtype,
-                      StdSize numVal, const void* op);
+    //! Read an attribute
+    template<typename T>
+    static int getAttType(int ncid, int varid, const StdString& attrName, T* data);
 
+    //! Set an attribute
+    template<typename T>
+    static int putAttType(int ncid, int varid, const StdString& attrName, StdSize numVal, const T* data);
 
-    //! Put attribute into variable with specific type
+    //! Get data for a variable
     template<typename T>
-    static int putAttType(int ncid, int varid, const StdString& attrName, StdSize numVal, const T* op);
+    static int getVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, T* data);
 
-    //! Put value into a variable with a specific type
+    //! Set data for a variable
     template<typename T>
-    static int putVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const T* op);
+    static int putVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const T* data);
+
+    //! Get the NetCDF type corresponding to a specific C type
+    template<typename T>
+    static nc_type getNcType();
 
   private:
     template<typename T>
-    static int ncPutAttType(int ncid, int varid, const char* attrName, StdSize numVal, const T* op);
+    static int ncGetAttType(int ncid, int varid, const char* attrName, T* data);
 
     template<typename T>
-    static int ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const T* op);
+    static int ncPutAttType(int ncid, int varid, const char* attrName, StdSize numVal, const T* data);
+
+    template<typename T>
+    static int ncGetVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, T* data);
+
+    template<typename T>
+    static int ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const T* data);
 
   private:
Index: /XIOS/trunk/src/io/netCdfInterface_decl.cpp
===================================================================
--- /XIOS/trunk/src/io/netCdfInterface_decl.cpp	(revision 685)
+++ /XIOS/trunk/src/io/netCdfInterface_decl.cpp	(revision 686)
@@ -12,19 +12,34 @@
 namespace xios
 {
-#define  macroPutAtt(type) \
-  template int CNetCdfInterface::putAttType(int ncid, int varid, const StdString& attrName, \
-                                            StdSize numVal, const type* op);
+#define macroAtt(type) \
+  template int CNetCdfInterface::getAttType(int ncid, int varid, const StdString& attrName, type* data); \
+  template int CNetCdfInterface::putAttType(int ncid, int varid, const StdString& attrName,              \
+                                            StdSize numVal, const type* data);
 
-  macroPutAtt(double);
-  macroPutAtt(float);
-  macroPutAtt(int);
-  macroPutAtt(long);
-  macroPutAtt(short);
+  macroAtt(double)
+  macroAtt(float)
+  macroAtt(int)
+  macroAtt(long)
+  macroAtt(short)
+  macroAtt(char)
 
-#define  macroPutVar(type) \
+#define macroPutVar(type) \
+ template int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, \
+                                            const StdSize* count, type* data);         \
  template int CNetCdfInterface::putVaraType(int ncid, int varId, const StdSize* start, \
-                                            const StdSize* count, const type* op);
-  macroPutVar(double);
-  macroPutVar(float);
-  macroPutVar(int);
+                                            const StdSize* count, const type* data);
+
+  macroPutVar(double)
+  macroPutVar(float)
+  macroPutVar(int)
+
+#define macroType(type, ncType) \
+  template<> nc_type CNetCdfInterface::getNcType<type>() { return ncType; }
+
+  macroType(double, NC_DOUBLE)
+  macroType(float, NC_FLOAT)
+  macroType(int, NC_INT)
+  macroType(long, NC_LONG)
+  macroType(short, NC_SHORT)
+  macroType(char, NC_CHAR)
 }
Index: /XIOS/trunk/src/io/netCdfInterface_impl.hpp
===================================================================
--- /XIOS/trunk/src/io/netCdfInterface_impl.hpp	(revision 685)
+++ /XIOS/trunk/src/io/netCdfInterface_impl.hpp	(revision 686)
@@ -5,5 +5,5 @@
    \since 06 Oct 2014
 
-   \brief Implemention of some templated functions in netCdfInterface
+   \brief Implementation of some templated functions in netCdfInterface
  */
 
@@ -16,61 +16,106 @@
 namespace xios
 {
-   /*!
-   This function makes a request to netcdf with its id, to add or change a variable attribute or gloabl attribute,
-   given its name, type, number of values provided for attribute
-   \param [in] ncid Id of groupd(or File Id)
-   \param [in] varId Id of the variable
-   \param [in] attrName Name of the attribute
-   \param [in] numVal Number of values
-   \param [in] op Array of values provided for attribute
-   \return Error code
-   */
+  /*!
+  This function reads a variable attribute or a global attribute
+  given a location id, a variable id and the attribute name
+  \param [in] ncid Id of group (or file id)
+  \param [in] varId Id of the variable
+  \param [in] attrName Name of the attribute
+  \param [out] data Array of values
+  \return Status code
+  */
+  template<typename T>
+  int CNetCdfInterface::getAttType(int ncid, int varId, const StdString& attrName, T* data)
+  {
+    int status = ncGetAttType(ncid, varId, attrName.c_str(), data);
+    if (NC_NOERR != status)
+    {
+      StdStringStream sstr;
+      sstr << "Error when calling function ncGetAttType(ncid, varId, attrName.c_str(), data)" << std::endl;
+      sstr << nc_strerror(status) << std::endl;
+      sstr << "Unable to read attribute " << attrName << " given the location id: " << ncid << " and the variable id: " << varId << std::endl;
+      throw CNetCdfException(sstr.str());
+    }
+
+    return status;
+  }
+
+  /*!
+  This function adds or modifies a variable attribute or a global attribute
+  given a location id, a variable id and the attribute name
+  \param [in] ncid Id of group (or file id)
+  \param [in] varId Id of the variable
+  \param [in] attrName Name of the attribute
+  \param [in] numVal Number of values to set
+  \param [in] data Array of values
+  \return Status code
+  */
   template<typename T>
   int CNetCdfInterface::putAttType(int ncid, int varId, const StdString& attrName,
-                                   StdSize numVal, const T* op)
+                                   StdSize numVal, const T* data)
   {
-    int status = ncPutAttType(ncid, varId, attrName.c_str(), numVal, op);
+    int status = ncPutAttType(ncid, varId, attrName.c_str(), numVal, data);
     if (NC_NOERR != status)
-     {
-       StdString errormsg(nc_strerror(status));
-       StdStringStream sstr;
-       sstr << "Error in calling function " << "ncPutAttType(ncid, varId, attrName.c_str(), numVal, op)" << std::endl;
-       sstr << errormsg << std::endl;
-       sstr << "Unable to set attribute " << attrName << " for a variable with id : " << varId
-         << " with number of attribute  " << numVal << std::endl;
-       StdString e = sstr.str();
-       throw CNetCdfException(e);
-     }
+    {
+      StdStringStream sstr;
+      sstr << "Error when calling function ncPutAttType(ncid, varId, attrName.c_str(), numVal, data)" << std::endl;
+      sstr << nc_strerror(status) << std::endl;
+      sstr << "Unable to set attribute " << attrName << " given the location id: " << ncid << " and the variable id: " << varId
+           << " with " << numVal << " elements." << std::endl;
+      throw CNetCdfException(sstr.str());
+    }
 
-     return status;
+    return status;
   }
 
-   /*!
-   This function makes a request to netcdf with its id, to write variable values into netcdf file,
-   \param [in] ncid Id of groupd(or File Id)
-   \param [in] varId Id of the variable
-   \param [in] start Array specifying the index in the variable where the first data value will be written
-   \param [in] count Array specifying the edge lengths along each dimension of block data
-   \param [in] op Array of values provided for attribute
-   \return Error code
-   */
+  /*!
+  This function reads data for the specified variable.
+  \param [in] ncid Id of group (or file id)
+  \param [in] varId Id of the variable
+  \param [in] start Array specifying the index in the variable where the first data value will be written
+  \param [in] count Array specifying the edge lengths along each dimension of the data block
+  \param [out] data Array of values
+  \return Status code
+  */
   template<typename T>
-  int CNetCdfInterface::putVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, const T* op)
+  int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, T* data)
   {
-    int status = ncPutVaraType(ncid, varId, start, count, op);
+    int status = ncGetVaraType(ncid, varId, start, count, data);
     if (NC_NOERR != status)
-     {
-       StdString errormsg(nc_strerror(status));
-       StdStringStream sstr;
-       sstr << "Error in calling function " << "ncPutVaraType(ncid, varId, start, count, op)" << std::endl;
-       sstr << errormsg << std::endl;
-       sstr << "Unable to write value of a variable with id : " << varId << std::endl;
-       StdString e = sstr.str();
-       throw CNetCdfException(e);
-     }
+    {
+      StdStringStream sstr;
+      sstr << "Error when calling function ncGetVaraType(ncid, varId, start, count, data)" << std::endl;
+      sstr << nc_strerror(status) << std::endl;
+      sstr << "Unable to read data given the location id: " << ncid << " and the variable id: " << varId << std::endl;
+      throw CNetCdfException(sstr.str());
+    }
 
-     return status;
+    return status;
   }
 
+  /*!
+  This function writes the given data for the specified variable.
+  \param [in] ncid Id of group (or file id)
+  \param [in] varId Id of the variable
+  \param [in] start Array specifying the index in the variable where the first data value will be written
+  \param [in] count Array specifying the edge lengths along each dimension of the data block
+  \param [in] data Array of values
+  \return Status code
+  */
+  template<typename T>
+  int CNetCdfInterface::putVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, const T* data)
+  {
+    int status = ncPutVaraType(ncid, varId, start, count, data);
+    if (NC_NOERR != status)
+    {
+      StdStringStream sstr;
+      sstr << "Error when calling function ncPutVaraType(ncid, varId, start, count, data)" << std::endl;
+      sstr << nc_strerror(status) << std::endl;
+      sstr << "Unable to write data given the location id: " << ncid << " and the variable id: " << varId << std::endl;
+      throw CNetCdfException(sstr.str());
+    }
+
+    return status;
+  }
 }
 
Index: /XIOS/trunk/src/io/onetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/io/onetcdf4.cpp	(revision 685)
+++ /XIOS/trunk/src/io/onetcdf4.cpp	(revision 686)
@@ -12,10 +12,10 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CONetCDF4::CONetCDF4
-         (const StdString & filename, bool append, bool useClassicFormat, const MPI_Comm* comm, bool multifile)
-            : path()
-            , wmpi(false)
-            , useClassicFormat(useClassicFormat)
-            , recordOffset(0)
+      CONetCDF4::CONetCDF4(const StdString& filename, bool append, bool useClassicFormat,
+                           const MPI_Comm* comm, bool multifile)
+        : path()
+        , wmpi(false)
+        , useClassicFormat(useClassicFormat)
+        , recordOffset(0)
       {
          this->initialize(filename, append, useClassicFormat, comm,multifile);
@@ -27,11 +27,10 @@
       CONetCDF4::~CONetCDF4(void)
       {
-//         CheckError(nc_close(this->ncidp));
       }
 
       ///--------------------------------------------------------------
 
-      void CONetCDF4::initialize
-         (const StdString & filename, bool append, bool useClassicFormat, const MPI_Comm* comm, bool multifile)
+      void CONetCDF4::initialize(const StdString& filename, bool append, bool useClassicFormat,
+                                 const MPI_Comm* comm, bool multifile)
       {
          this->useClassicFormat = useClassicFormat;
@@ -89,5 +88,5 @@
       void CONetCDF4::close()
       {
-        (CNetCdfInterface::close(this->ncidp));
+        CNetCdfInterface::close(this->ncidp);
       }
 
@@ -96,5 +95,5 @@
       void CONetCDF4::definition_start(void)
       {
-         (CNetCdfInterface::reDef(this->ncidp));
+         CNetCdfInterface::reDef(this->ncidp);
       }
 
@@ -103,19 +102,6 @@
       void CONetCDF4::definition_end(void)
       {
-         (CNetCdfInterface::endDef(this->ncidp));
-      }
-
-      //---------------------------------------------------------------
-
-// Don't need it anymore?
-//      void CONetCDF4::CheckError(int status)
-//      {
-//         if (status != NC_NOERR)
-//         {
-//            StdString errormsg (nc_strerror(status)); // fuite mÃ©moire ici ?
-//            ERROR("CONetCDF4::CheckError(int status)",
-//                  << "[ status = " << status << " ] " << errormsg);
-//         }
-//      }
+         CNetCdfInterface::endDef(this->ncidp);
+      }
 
       //---------------------------------------------------------------
@@ -123,42 +109,41 @@
       int CONetCDF4::getCurrentGroup(void)
       {
-         return (this->getGroup(this->getCurrentPath()));
-      }
-
-      //---------------------------------------------------------------
-
-      int CONetCDF4::getGroup(const CONetCDF4Path & path)
+         return this->getGroup(this->getCurrentPath());
+      }
+
+      //---------------------------------------------------------------
+
+      int CONetCDF4::getGroup(const CONetCDF4Path& path)
       {
          int retvalue = this->ncidp;
 
-         CONetCDF4Path::const_iterator
-            it  = path.begin(), end = path.end();
-
-         for (;it != end; it++)
-         {
-            const StdString & groupid = *it;
-            (CNetCdfInterface::inqNcId(retvalue, groupid, retvalue));
-         }
-         return (retvalue);
-      }
-
-      //---------------------------------------------------------------
-
-      int CONetCDF4::getVariable(const StdString & varname)
+         CONetCDF4Path::const_iterator it = path.begin(), end = path.end();
+
+         for (; it != end; it++)
+         {
+            const StdString& groupid = *it;
+            CNetCdfInterface::inqNcId(retvalue, groupid, retvalue);
+         }
+         return retvalue;
+      }
+
+      //---------------------------------------------------------------
+
+      int CONetCDF4::getVariable(const StdString& varname)
       {
          int varid = 0;
          int grpid = this->getCurrentGroup();
-         (CNetCdfInterface::inqVarId(grpid, varname, varid));
-         return (varid);
-      }
-
-      //---------------------------------------------------------------
-
-      int CONetCDF4::getDimension(const StdString & dimname)
+         CNetCdfInterface::inqVarId(grpid, varname, varid);
+         return varid;
+      }
+
+      //---------------------------------------------------------------
+
+      int CONetCDF4::getDimension(const StdString& dimname)
       {
          int dimid = 0;
          int grpid = this->getCurrentGroup();
-         (CNetCdfInterface::inqDimId(grpid, dimname, dimid));
-         return (dimid);
+         CNetCdfInterface::inqDimId(grpid, dimname, dimid);
+         return dimid;
       }
 
@@ -169,6 +154,6 @@
          int dimid = 0;
          int grpid = this->getCurrentGroup();
-         (CNetCdfInterface::inqUnLimDim(grpid, dimid));
-         return (dimid);
+         CNetCdfInterface::inqUnLimDim(grpid, dimid);
+         return dimid;
       }
 
@@ -178,14 +163,13 @@
          int dimid = this->getUnlimitedDimension();
 
-         if (dimid == -1) return (std::string());
          StdString dimname;
-         (CNetCdfInterface::inqDimName(grpid, dimid, dimname));
-
-         return (dimname);
-      }
-
-      //---------------------------------------------------------------
-
-      std::vector<StdSize> CONetCDF4::getDimensions(const StdString & varname)
+         if (dimid != -1)
+           CNetCdfInterface::inqDimName(grpid, dimid, dimname);
+         return dimname;
+      }
+
+      //---------------------------------------------------------------
+
+      std::vector<StdSize> CONetCDF4::getDimensions(const StdString& varname)
       {
          StdSize size = 0;
@@ -195,11 +179,11 @@
          int nbdim = 0, *dimid = NULL;
 
-         (CNetCdfInterface::inqVarNDims(grpid, varid, nbdim));
+         CNetCdfInterface::inqVarNDims(grpid, varid, nbdim);
          dimid = new int[nbdim]();
-         (CNetCdfInterface::inqVarDimId(grpid, varid, dimid));
+         CNetCdfInterface::inqVarDimId(grpid, varid, dimid);
 
          for (int i = 0; i < nbdim; i++)
          {
-            (CNetCdfInterface::inqDimLen(grpid, dimid[i], size));
+            CNetCdfInterface::inqDimLen(grpid, dimid[i], size);
             if (size == NC_UNLIMITED)
                 size = UNLIMITED_DIM;
@@ -207,8 +191,8 @@
          }
          delete [] dimid;
-         return (retvalue);
-      }
-
-      std::vector<std::string> CONetCDF4::getDimensionsIdList (const std::string * _varname)
+         return retvalue;
+      }
+
+      std::vector<std::string> CONetCDF4::getDimensionsIdList(const std::string* _varname)
       {
          int nDimNull = 0;
@@ -220,13 +204,13 @@
          if (_varname != NULL)
          {
-            (CNetCdfInterface::inqVarNDims(grpid, varid, nbdim));
+            CNetCdfInterface::inqVarNDims(grpid, varid, nbdim);
             dimid = new int[nbdim]();
-            (CNetCdfInterface::inqVarDimId(grpid, varid, dimid));
+            CNetCdfInterface::inqVarDimId(grpid, varid, dimid);
          }
          else
          {
-            (CNetCdfInterface::inqDimIds(grpid, nbdim, NULL, 1));
+            CNetCdfInterface::inqDimIds(grpid, nbdim, NULL, 1);
             dimid = new int[nbdim]();
-            (CNetCdfInterface::inqDimIds(grpid, nDimNull, dimid, 1));
+            CNetCdfInterface::inqDimIds(grpid, nDimNull, dimid, 1);
          }
 
@@ -234,29 +218,28 @@
          {
             std::string dimname;
-            (CNetCdfInterface::inqDimName(grpid, dimid[i], dimname));
+            CNetCdfInterface::inqDimName(grpid, dimid[i], dimname);
             retvalue.push_back(dimname);
          }
          delete [] dimid;
 
-         return (retvalue);
-      }
-
-
-      //---------------------------------------------------------------
-
-      const CONetCDF4::CONetCDF4Path & CONetCDF4::getCurrentPath(void) const
-      { return (this->path); }
-
-      void CONetCDF4::setCurrentPath(const CONetCDF4Path & path)
+         return retvalue;
+      }
+
+      //---------------------------------------------------------------
+
+      const CONetCDF4::CONetCDF4Path& CONetCDF4::getCurrentPath(void) const
+      { return this->path; }
+
+      void CONetCDF4::setCurrentPath(const CONetCDF4Path& path)
       { this->path = path; }
 
       //---------------------------------------------------------------
 
-      int CONetCDF4::addGroup(const StdString & name)
+      int CONetCDF4::addGroup(const StdString& name)
       {
          int retvalue = 0;
          int grpid = this->getCurrentGroup();
-         (CNetCdfInterface::defGrp(grpid, name, retvalue));
-         return (retvalue);
+         CNetCdfInterface::defGrp(grpid, name, retvalue);
+         return retvalue;
       }
 
@@ -268,14 +251,14 @@
          int grpid = this->getCurrentGroup();
          if (size != UNLIMITED_DIM)
-            (CNetCdfInterface::defDim(grpid, name, size, retvalue));
+            CNetCdfInterface::defDim(grpid, name, size, retvalue);
          else
-            (CNetCdfInterface::defDim(grpid, name, NC_UNLIMITED, retvalue));
-         return (retvalue);
-      }
-
-      //---------------------------------------------------------------
-
-      int CONetCDF4::addVariable(const StdString & name, nc_type type,
-                                 const std::vector<StdString> & dim)
+            CNetCdfInterface::defDim(grpid, name, NC_UNLIMITED, retvalue);
+         return retvalue;
+      }
+
+      //---------------------------------------------------------------
+
+      int CONetCDF4::addVariable(const StdString& name, nc_type type,
+                                 const std::vector<StdString>& dim)
       {
          int varid = 0;
@@ -292,5 +275,5 @@
          for (; it != end; it++)
          {
-            const StdString & dimid = *it;
+            const StdString& dimid = *it;
             dimids.push_back(this->getDimension(dimid));
             CNetCdfInterface::inqDimLen(grpid, this->getDimension(dimid), size);
@@ -339,119 +322,103 @@
 
       template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const StdString & value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAtt(grpid, varid, name, NC_CHAR, value.size(), value.c_str()));
-         //CheckError(nc_put_att_string(grpid, varid, name.c_str(), 1, &str));
-      }
-
-      //---------------------------------------------------------------
-
-      template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const double & value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, 1, &value));
-      }
-
-       template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const CArray<double,1>& value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst()));
-      }
-      //---------------------------------------------------------------
-
-      template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const float & value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, 1, &value));
-      }
-
-       template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const CArray<float,1>& value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst()));
-      }
-
-      //---------------------------------------------------------------
-
-      template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const int & value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, 1, &value));
-      }
-
-       template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const CArray<int,1>& value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst()));
-      }
-
-      template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const short int & value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, 1, &value));
-      }
-
-       template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const CArray<short int,1>& value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst()));
-      }
-
-
-
-      template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const long int & value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, 1, &value));
-      }
-
-       template <>
-         void CONetCDF4::addAttribute
-            (const StdString & name, const CArray<long int,1>& value, const StdString * varname )
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
-         (CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst()));
-      }
-
-
-
-                //---------------------------------------------------------------
-
-      void CONetCDF4::getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size,
-                                        std::vector<StdSize> & sstart,
-                                        std::vector<StdSize> & scount,
-                                        const std::vector<StdSize> * start,
-                                        const std::vector<StdSize> * count)
+      void CONetCDF4::addAttribute(const StdString& name, const StdString& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, value.size(), value.c_str());
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const double& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, 1, &value);
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const CArray<double,1>& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst());
+      }
+      //---------------------------------------------------------------
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const float& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, 1, &value);
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const CArray<float,1>& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst());
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const int& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, 1, &value);
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const CArray<int,1>& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst());
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const short int& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, 1, &value);
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const CArray<short int,1>& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst());
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const long int& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, 1, &value);
+      }
+
+      template <>
+      void CONetCDF4::addAttribute(const StdString& name, const CArray<long int,1>& value, const StdString* varname)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CNetCdfInterface::putAttType(grpid, varid, name, value.numElements(), value.dataFirst());
+      }
+
+      //---------------------------------------------------------------
+
+      void CONetCDF4::getWriteDataInfos(const StdString& name, StdSize record, StdSize& array_size,
+                                        std::vector<StdSize>& sstart,
+                                        std::vector<StdSize>& scount,
+                                        const std::vector<StdSize>* start,
+                                        const std::vector<StdSize>* count)
       {
          std::vector<std::size_t> sizes  = this->getDimensions(name);
@@ -490,40 +457,35 @@
       }
 
-
-
-      template <>
-         void CONetCDF4::writeData_(int grpid, int varid,
-                                    const std::vector<StdSize> & sstart,
-                                    const std::vector<StdSize> & scount, const double * data)
-      {
-         (CNetCdfInterface::putVaraType(grpid, varid, &(sstart[0]), &(scount[0]), data));
-//         sync() ;
-      }
-
-      //---------------------------------------------------------------
-
-      template <>
-         void CONetCDF4::writeData_(int grpid, int varid,
-                                    const std::vector<StdSize> & sstart,
-                                    const std::vector<StdSize> & scount, const int * data)
-      {
-          (CNetCdfInterface::putVaraType(grpid, varid, &(sstart[0]), &(scount[0]), data));
-//          sync() ;
-      }
-
-      //---------------------------------------------------------------
-
-      template <>
-         void CONetCDF4::writeData_(int grpid, int varid,
-                                    const std::vector<StdSize> & sstart,
-                                    const std::vector<StdSize> & scount, const float * data)
-      {
-          (CNetCdfInterface::putVaraType(grpid, varid, &(sstart[0]), &(scount[0]), data));
-//          sync() ;
-      }
-
-      //---------------------------------------------------------------
-
-      void CONetCDF4::writeData(const CArray<int, 2>& data, const StdString & name)
+      template <>
+      void CONetCDF4::writeData_(int grpid, int varid,
+                                 const std::vector<StdSize>& sstart,
+                                 const std::vector<StdSize>& scount, const double* data)
+      {
+         CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+      void CONetCDF4::writeData_(int grpid, int varid,
+                                 const std::vector<StdSize>& sstart,
+                                 const std::vector<StdSize>& scount, const int* data)
+      {
+          CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+      void CONetCDF4::writeData_(int grpid, int varid,
+                                 const std::vector<StdSize>& sstart,
+                                 const std::vector<StdSize>& scount, const float* data)
+      {
+          CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
+      }
+
+      //---------------------------------------------------------------
+
+      void CONetCDF4::writeData(const CArray<int, 2>& data, const StdString& name)
       {
          int grpid = this->getCurrentGroup();
@@ -536,5 +498,5 @@
       }
 
-      void CONetCDF4::writeTimeAxisData(const CArray<double, 1>& data, const StdString & name,
+      void CONetCDF4::writeTimeAxisData(const CArray<double, 1>& data, const StdString& name,
                                         bool collective, StdSize record, bool isRoot)
       {
@@ -542,10 +504,10 @@
          int varid = this->getVariable(name);
 
-         map<int,size_t>::iterator it=timeAxis.find(varid) ;
-         if (it==timeAxis.end()) timeAxis[varid]=record ;
+         map<int,size_t>::iterator it=timeAxis.find(varid);
+         if (it == timeAxis.end()) timeAxis[varid] = record;
          else
          {
-           if (it->second >= record) return ;
-           else it->second =record ;
+           if (it->second >= record) return;
+           else it->second =record;
          }
 
@@ -554,10 +516,17 @@
 
          if (this->wmpi && collective)
-         (CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE));
+            CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE);
          if (this->wmpi && !collective)
-         (CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT));
+            CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT);
 
          this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL);
-         if (using_netcdf_internal)  if (!isRoot) { sstart[0]=sstart[0]+1 ; scount[0]=0 ;}
+         if (using_netcdf_internal)
+         {
+           if (!isRoot)
+           {
+             sstart[0] = sstart[0] + 1;
+             scount[0] = 0;
+           }
+         }
          this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
        }
@@ -565,13 +534,13 @@
       //---------------------------------------------------------------
 
-      bool CONetCDF4::varExist(const StdString & varname)
-      {
-         int grpid = this->getCurrentGroup();
-         return (CNetCdfInterface::isVarExisted(grpid, varname));
+      bool CONetCDF4::varExist(const StdString& varname)
+      {
+         int grpid = this->getCurrentGroup();
+         return CNetCdfInterface::isVarExisted(grpid, varname);
       }
 
       void CONetCDF4::sync(void)
       {
-         (CNetCdfInterface::sync(this->ncidp)) ;
+         CNetCdfInterface::sync(this->ncidp);
       }
       ///--------------------------------------------------------------
Index: /XIOS/trunk/src/io/onetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/io/onetcdf4.hpp	(revision 685)
+++ /XIOS/trunk/src/io/onetcdf4.hpp	(revision 686)
@@ -113,7 +113,4 @@
                                    const std::vector<StdSize> * count);
 
-            /// VÃ©rification des erreurs NetCDF ///
-            void CheckError(int status);
-
             /// PropriÃ©tÃ©s privÃ©es ///
             CONetCDF4Path path;
