Index: XIOS/dev/dev_olga/src/io/onetcdf4.cpp
===================================================================
--- XIOS/dev/dev_olga/src/io/onetcdf4.cpp	(revision 983)
+++ XIOS/dev/dev_olga/src/io/onetcdf4.cpp	(revision 1158)
@@ -7,4 +7,5 @@
 #include "netCdfInterface.hpp"
 #include "netCdfException.hpp"
+#include "timer.hpp"
 
 namespace xios
@@ -55,9 +56,11 @@
          if (!append || !std::ifstream(filename.c_str()))
          {
+            CTimer::get("Files : create").resume();
             if (wmpi)
                CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);
             else
                CNetCdfInterface::create(filename, mode, this->ncidp);
-
+            CTimer::get("Files : create").suspend();
+ 
             this->appendMode = false;
          }
@@ -65,9 +68,10 @@
          {
             mode |= NC_WRITE;
+            CTimer::get("Files : open").resume();
             if (wmpi)
                CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);
             else
                CNetCdfInterface::open(filename, mode, this->ncidp);
-
+            CTimer::get("Files : open").suspend();
             this->appendMode = true;
          }
@@ -83,5 +87,7 @@
       void CONetCDF4::close()
       {
+        CTimer::get("Files : close").resume();
         CNetCdfInterface::close(this->ncidp);
+        CTimer::get("Files : close").suspend();
       }
 
@@ -247,5 +253,26 @@
       }
 
-      //---------------------------------------------------------------
+      void CONetCDF4::getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective, size_t record)
+      {
+        int grpid = this->getCurrentGroup();
+        int varid = this->getVariable(name);
+
+        std::vector<StdSize> start(2), count(2);
+        start[0] = record;
+        count[0] = 1 ;
+        start[1] = 0;
+        count[1] = 2;
+
+        timeAxisBounds.resize(2, 1);
+
+        if (this->wmpi && collective)
+          CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE);
+        if (this->wmpi && !collective)
+          CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT);
+
+        CNetCdfInterface::getVaraType(grpid, varid, &start[0], &count[0], timeAxisBounds.dataFirst());
+      }
+
+
 
       const CONetCDF4::CONetCDF4Path& CONetCDF4::getCurrentPath(void) const
@@ -503,9 +530,16 @@
       void CONetCDF4::writeData_(int grpid, int varid,
                                  const std::vector<StdSize>& sstart,
+                                 const std::vector<StdSize>& scount, char* 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);
       }
-
       //---------------------------------------------------------------
 
@@ -528,5 +562,7 @@
 
          this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL);
+
          this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
+
       }
 
@@ -554,15 +590,34 @@
 
          this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL);
-         if (using_netcdf_internal)
-         {
-           if (!isRoot)
-           {
-             sstart[0] = sstart[0] + 1;
-             scount[0] = 0;
-           }
-         }
          this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
        }
 
+      void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name,
+                                        bool collective, StdSize record, bool isRoot)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+
+         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;
+         }
+
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         if (this->wmpi && collective)
+            CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE);
+         if (this->wmpi && !collective)
+            CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT);
+
+         this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL);
+         this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
+       }
+
+
       //---------------------------------------------------------------
 
