Index: /XIOS/trunk/inputs/Basic/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/Basic/iodef.xml	(revision 815)
+++ /XIOS/trunk/inputs/Basic/iodef.xml	(revision 815)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<simulation>
+  <context id="test_domain">
+    <file_definition type="one_file" par_access="collective"  output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE.">
+      <file id="output_domain">
+        <field id="field_domain_1" grid_ref="domain" operation="average" freq_op="1ts" prec="8" />
+        <field id="field_domain_2" domain_ref="domain" operation="average" freq_op="1ts" prec="8" />
+      </file>
+    </file_definition>
+
+    <grid_definition>
+      <grid id="domain">
+        <domain domain_ref="domain"/>
+      </grid>
+    </grid_definition>
+
+   <domain_definition>
+    <domain id="domain"/>
+  </domain_definition>
+  </context>
+
+  <context id="test_axis">
+    <file_definition type="one_file" par_access="collective"  output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE.">
+      <file id="output_axis">
+        <field id="field_axis" grid_ref="domain" operation="average" freq_op="1ts" prec="8" />
+      </file>
+    </file_definition>
+
+    <grid_definition>
+      <grid id="domain">
+        <axis id="x" />
+        <axis id="y" />
+      </grid>
+    </grid_definition>
+  </context>
+
+  <context id="xios">
+      <variable_definition>
+        <variable_group id="buffer">
+            <variable id="optimal_buffer_size" type="string">performance</variable>
+            <variable id="buffer_size_factor" type="double">1.0</variable>
+        </variable_group>
+
+        <variable_group id="parameters" >
+          <variable id="using_server" type="bool">false</variable>
+          <variable id="info_level" type="int">50</variable>
+          <variable id="print_file" type="bool">true</variable>
+        </variable_group>
+      </variable_definition>
+  </context>
+</simulation>
Index: /XIOS/trunk/src/node/axis.cpp
===================================================================
--- /XIOS/trunk/src/node/axis.cpp	(revision 814)
+++ /XIOS/trunk/src/node/axis.cpp	(revision 815)
@@ -351,5 +351,5 @@
      {
        sendServerAttribut(globalDim, orderPositionInGrid, distType);
-       sendValue();
+       sendValue(globalDim, orderPositionInGrid, distType);
      }
 
@@ -357,5 +357,6 @@
    }
 
-  void CAxis::sendValue()
+  void CAxis::sendValue(const std::vector<int>& globalDim, int orderPositionInGrid,
+                        CServerDistributionDescription::ServerDistributionType distType)
   {
      if (n.getValue() == n_glo.getValue())
@@ -365,10 +366,11 @@
      else
      {
-       computeConnectedServer();
+       computeConnectedServer(globalDim, orderPositionInGrid, distType);
        sendDistributedValue();
      }
   }
 
-  void CAxis::computeConnectedServer()
+  void CAxis::computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid,
+                                     CServerDistributionDescription::ServerDistributionType distType)
   {
     CContext* context = CContext::getCurrent();
@@ -418,24 +420,44 @@
     }
 
-    std::vector<int> nGlobDomain(1);
-    nGlobDomain[0] = n_glo.getValue();
-
-    size_t globalSizeIndex = 1, indexBegin, indexEnd;
-    for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i];
-    indexBegin = 0;
-    for (int i = 0; i < clientSize; ++i)
-    {
-      range = globalSizeIndex / clientSize;
-      if (i < (globalSizeIndex%clientSize)) ++range;
-      if (i == client->clientRank) break;
-      indexBegin += range;
-    }
-    indexEnd = indexBegin + range - 1;
-
-    CServerDistributionDescription serverDescription(nGlobDomain);
-    serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
-    CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
-    clientServerMap->computeServerIndexMapping(globalIndexAxis);
-    const std::map<int, std::vector<size_t> >& globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();
+    CServerDistributionDescription serverDescriptionGlobal(globalDim, nbServer);
+    int distributedDimensionOnServer = serverDescriptionGlobal.getDimensionDistributed();
+    std::map<int, std::vector<size_t> > globalIndexAxisOnServer;
+    if (distributedDimensionOnServer == orderPositionInGrid) // So we have distributed axis on client side and also on server side*
+    {
+      std::vector<int> nGlobAxis(1);
+      nGlobAxis[0] = n_glo.getValue();
+
+      size_t globalSizeIndex = 1, indexBegin, indexEnd;
+      for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i];
+      indexBegin = 0;
+      for (int i = 0; i < clientSize; ++i)
+      {
+        range = globalSizeIndex / clientSize;
+        if (i < (globalSizeIndex%clientSize)) ++range;
+        if (i == client->clientRank) break;
+        indexBegin += range;
+      }
+      indexEnd = indexBegin + range - 1;
+
+      CServerDistributionDescription serverDescription(nGlobAxis, nbServer);
+      serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd));
+      CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
+      clientServerMap->computeServerIndexMapping(globalIndexAxis);
+      globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();
+      delete clientServerMap;
+    }
+    else
+    {
+      std::vector<size_t> globalIndexServer(n_glo.getValue());
+      for (size_t idx = 0; idx < n_glo.getValue(); ++idx)
+      {
+        globalIndexServer[idx] = idx;
+      }
+
+      for (int idx = 0; idx < nbServer; ++idx)
+      {
+        globalIndexAxisOnServer[idx] = globalIndexServer;
+      }
+    }
 
     std::map<int, std::vector<size_t> >::const_iterator it = globalIndexAxisOnServer.begin(),
@@ -476,6 +498,5 @@
         connectedServerRank_.push_back(it->first);
     }
-    nbConnectedClients_ = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
-    delete clientServerMap;
+    nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
   }
 
@@ -774,10 +795,9 @@
     CContext* context = CContext::getCurrent();
     CContextClient* client = context->client;
-
-    CServerDistributionDescription serverDescription(globalDim);
-
     int nbServer = client->serverSize;
 
-    serverDescription.computeServerDistribution(nbServer, false, distType);
+    CServerDistributionDescription serverDescription(globalDim, nbServer);
+    serverDescription.computeServerDistribution();
+
     std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
     std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
Index: /XIOS/trunk/src/node/axis.hpp
===================================================================
--- /XIOS/trunk/src/node/axis.hpp	(revision 814)
+++ /XIOS/trunk/src/node/axis.hpp	(revision 815)
@@ -128,6 +128,8 @@
          void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid,
                                  CServerDistributionDescription::ServerDistributionType disType);
-         void sendValue();
-         void computeConnectedServer(void);
+         void sendValue(const std::vector<int>& globalDim, int orderPositionInGrid,
+                        CServerDistributionDescription::ServerDistributionType distType);
+         void computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid,
+                                     CServerDistributionDescription::ServerDistributionType distType);
          void sendDistributedValue();
          void sendNonDistributedValue();
Index: /XIOS/trunk/src/node/domain.cpp
===================================================================
--- /XIOS/trunk/src/node/domain.cpp	(revision 814)
+++ /XIOS/trunk/src/node/domain.cpp	(revision 815)
@@ -465,6 +465,6 @@
 	  lon_g.resize(ni_glo) ;
 	  lat_g.resize(nj_glo) ;
-	  
-	  
+
+
 	  int* ibegin_g = new int[client->clientSize] ;
 	  int* jbegin_g = new int[client->clientSize] ;
@@ -480,8 +480,8 @@
 	  v=nj ;
 	  MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ;
-	  
+
 	  MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ;
 	  MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ;
-   
+
       delete[] ibegin_g ;
       delete[] jbegin_g ;
@@ -494,5 +494,5 @@
    {
      int i,j,k;
-     
+
      const int nvertexValue = 4;
      boundsLon.resize(nvertexValue,ni*nj);
@@ -510,5 +510,5 @@
        bounds_lon_end= (lon(0) +360 + lon(ni_glo-1))/2 ;
      }
-       
+
      for(j=0;j<nj;++j)
        for(i=0;i<ni;++i)
@@ -520,5 +520,5 @@
                                                                         : (lon(ibegin + i + 1)+lon(ibegin + i))/2;
        }
-    
+
 
     boundsLat.resize(nvertexValue,nj*ni);
@@ -546,5 +546,5 @@
       }
     }
-    
+
     double latStepEnd = lat(nj_glo-1)-lat(nj_glo-2);
     if (isSouthPole) bounds_lat_end=lat(nj_glo-1);
@@ -563,6 +563,6 @@
         if ( -90 + bounds_lat_end <= 0.1*std::abs(latStepEnd)) bounds_lat_end=-90 ;
       }
-    }      
-      
+    }
+
     for(j=0;j<nj;++j)
       for(i=0;i<ni;++i)
@@ -1222,12 +1222,11 @@
   void CDomain::sendServerAttribut(void)
   {
-    CServerDistributionDescription serverDescription(nGlobDomain_);
-
     CContext* context = CContext::getCurrent();
     CContextClient* client = context->client;
     int nbServer = client->serverSize;
 
-    if (isUnstructed_) serverDescription.computeServerDistribution(nbServer,0);
-    else serverDescription.computeServerDistribution(nbServer,1);
+    CServerDistributionDescription serverDescription(nGlobDomain_, nbServer);
+    if (isUnstructed_) serverDescription.computeServerDistribution(false, 0);
+    else serverDescription.computeServerDistribution(false, 1);
 
     std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
@@ -1372,7 +1371,7 @@
     indexEnd = indexBegin + range - 1;
 
-    CServerDistributionDescription serverDescription(nGlobDomain_);
-    if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
-    else serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
+    CServerDistributionDescription serverDescription(nGlobDomain_, nbServer);
+    if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
+    else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
 
     CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
Index: /XIOS/trunk/src/node/grid.cpp
===================================================================
--- /XIOS/trunk/src/node/grid.cpp	(revision 814)
+++ /XIOS/trunk/src/node/grid.cpp	(revision 815)
@@ -419,8 +419,6 @@
 
      // Then compute distribution on server side
-     CServerDistributionDescription serverDistributionDescription(globalDim_);
-     serverDistributionDescription.computeServerGlobalIndexInRange(client->serverSize,
-                                                                   std::make_pair<size_t,size_t>(indexBegin, indexEnd),
-                                                                   positionDimensionDistributed_);
+     CServerDistributionDescription serverDistributionDescription(globalDim_, client->serverSize);
+     serverDistributionDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), positionDimensionDistributed_);
 
      // Finally, compute index mapping between client(s) and server(s)
Index: /XIOS/trunk/src/server_distribution_description.cpp
===================================================================
--- /XIOS/trunk/src/server_distribution_description.cpp	(revision 814)
+++ /XIOS/trunk/src/server_distribution_description.cpp	(revision 815)
@@ -3,5 +3,5 @@
    \author Ha NGUYEN
    \since 04 Jan 2015
-   \date 24 Jul 2015
+   \date 11 Jan 2016
 
    \brief Description of index distribution on server(s).
@@ -13,6 +13,14 @@
 namespace xios
 {
-CServerDistributionDescription::CServerDistributionDescription(const std::vector<int>& globalDimensionSize)
-  : nGlobal_(globalDimensionSize), indexBegin_(), dimensionSizes_(), globalIndex_(), vecGlobalIndex_()
+  /*!
+  \param [in] globalDimensionSize global dimension of grid
+  \param [in] nServer number of server
+  \param [in] serType type of server distribution. For now, we can distribute server by band or plan
+  */
+CServerDistributionDescription::CServerDistributionDescription(const std::vector<int>& globalDimensionSize,
+                                                               int nServer,
+                                                               ServerDistributionType serType)
+  : nGlobal_(globalDimensionSize), indexBegin_(), dimensionSizes_(), globalIndex_(),
+    vecGlobalIndex_(), serverType_(serType), nServer_(nServer), positionDimensionDistributed_(1)
 {
 }
@@ -23,16 +31,13 @@
 /*!
   Compute pre-defined global index distribution of server(s).
-  \param [in] nServer number of server
   \param [in] doComputeGlobalIndex flag to compute global index on each server. By default, false
-  \param [in] serType type of server distribution. For now, we can distribute server by band or plan
-*/
-void CServerDistributionDescription::computeServerDistribution(int nServer,
-                                                               int positionDimensionDistributed,
-                                                               bool doComputeGlobalIndex,
-                                                               ServerDistributionType serType)
-{
-  switch (serType) {
+
+*/
+void CServerDistributionDescription::computeServerDistribution(bool doComputeGlobalIndex,
+                                                               int positionDimensionDistributed)
+{
+  switch (serverType_) {
     case BAND_DISTRIBUTION:
-      computeBandDistribution(nServer, positionDimensionDistributed);
+      computeBandDistribution(nServer_, positionDimensionDistributed);
       break;
     default:
@@ -42,9 +47,9 @@
   if (doComputeGlobalIndex)
   {
-    vecGlobalIndex_.resize(nServer);
+    vecGlobalIndex_.resize(nServer_);
     int dim = nGlobal_.size();
     std::vector<int> currentIndex(dim);
 
-    for (int idxServer = 0; idxServer < nServer; ++idxServer)
+    for (int idxServer = 0; idxServer < nServer_; ++idxServer)
     {
       size_t ssize = 1, idx = 0;
@@ -92,16 +97,13 @@
   Compute global index assigned to a server with a range.E.g: if a grid has 100 points and
   there are 2 servers, the first one takes index from 0 to 49, the second has index from 50 to 99
-  \param [in] nServer number of server
+
   \param [in] indexBeginEnd begining and ending index of range
-  \param [in] serType type of server distribution. For now, we can distribute server by band or plan
-*/
-void CServerDistributionDescription::computeServerGlobalIndexInRange(int nServer,
-                                                                     const std::pair<size_t, size_t>& indexBeginEnd,
-                                                                     int positionDimensionDistributed,
-                                                                     ServerDistributionType distributionType)
-{
-  switch (distributionType) {
+*/
+void CServerDistributionDescription::computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd,
+                                                                     int positionDimensionDistributed)
+{
+  switch (serverType_) {
     case BAND_DISTRIBUTION:
-      computeBandDistribution(nServer, positionDimensionDistributed);
+      computeBandDistribution(nServer_, positionDimensionDistributed);
       break;
     default:
@@ -118,5 +120,5 @@
   std::vector<int> currentIndex(dim);
 
-  for (int idxServer = 0; idxServer < nServer; ++idxServer)
+  for (int idxServer = 0; idxServer < nServer_; ++idxServer)
   {
     size_t ssize = 1, idx = 0;
@@ -167,8 +169,10 @@
 {
   int dim = nGlobal_.size();
-  if (positionDimensionDistributed > dim)
+  positionDimensionDistributed_ = positionDimensionDistributed;
+  if (1 == dim) positionDimensionDistributed_ = 0;
+  if (positionDimensionDistributed_ > dim)
     ERROR("CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)",
           << "Position of distributed dimension is invalid" << std::endl
-          << "Position of distributed dimension is " << positionDimensionDistributed
+          << "Position of distributed dimension is " << positionDimensionDistributed_
           << "Dimension " << dim)
 
@@ -187,5 +191,5 @@
   std::vector<int> njRangeEnd(nServer,0);
 
-  int positionDistributed = (1<dim) ? positionDimensionDistributed : 0;
+  int positionDistributed = (1<dim) ? positionDimensionDistributed_ : 0;
   nGlobTemp = nGlobal_[positionDistributed];
 
@@ -259,3 +263,9 @@
   return globalIndex_;
 }
+
+int CServerDistributionDescription::getDimensionDistributed()
+{
+  return ((1<nGlobal_.size()) ? positionDimensionDistributed_ : 0);
+}
+
 } // namespace xios
Index: /XIOS/trunk/src/server_distribution_description.hpp
===================================================================
--- /XIOS/trunk/src/server_distribution_description.hpp	(revision 814)
+++ /XIOS/trunk/src/server_distribution_description.hpp	(revision 815)
@@ -3,5 +3,5 @@
    \author Ha NGUYEN
    \since 04 Jan 2015
-   \date 24 Jul 2015
+   \date 11 Jan 2016
 
    \brief Description of index distribution on server(s).
@@ -30,16 +30,13 @@
 
     /** Default constructor */
-    CServerDistributionDescription(const std::vector<int>& globalDimensionSize);
+    CServerDistributionDescription(const std::vector<int>& globalDimensionSize,
+                                   int nServer,
+                                   ServerDistributionType serType=BAND_DISTRIBUTION);
+
     /** Default destructor */
     virtual ~CServerDistributionDescription();
 
-    void computeServerDistribution(int nServer, int positionDimensionDistributed = 1,
-                                   bool doComputeGlobalIndex = false,
-                                   ServerDistributionType type = BAND_DISTRIBUTION);
-
-    void computeServerGlobalIndexInRange(int nServer,
-                                         const std::pair<size_t, size_t>& indexBeginEnd,
-                                         int positionDimensionDistributed = 1,
-                                         ServerDistributionType = BAND_DISTRIBUTION);
+    void computeServerDistribution(bool doComputeGlobalIndex = false, int positionDimensionDistributed = 1);
+    void computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd, int positionDimensionDistributed = 1);
 
     std::vector<std::vector<int> > getServerIndexBegin() const;
@@ -47,4 +44,5 @@
     const std::vector<CArray<size_t,1> >& getGlobalIndex() const;
     const boost::unordered_map<size_t,int>& getGlobalIndexRange() const;
+    int getDimensionDistributed();
 
   protected:
@@ -62,4 +60,13 @@
     //!< In case we need only global index of one server with specific rank
     boost::unordered_map<size_t,int> globalIndex_;
+
+    //!< Type of distribution on server side
+    ServerDistributionType serverType_;
+
+    //!< Number of server
+    int nServer_;
+
+    //!< Position of dimension distributed on server side (by default, the second dimension)
+    int positionDimensionDistributed_;
 };
 
Index: /XIOS/trunk/src/test/test_basic_2D.f90
===================================================================
--- /XIOS/trunk/src/test/test_basic_2D.f90	(revision 815)
+++ /XIOS/trunk/src/test/test_basic_2D.f90	(revision 815)
@@ -0,0 +1,152 @@
+PROGRAM test_basic_2D
+  USE xios
+  USE mod_wait
+  IMPLICIT NONE
+  INCLUDE "mpif.h"
+
+  TYPE(xios_duration)  :: dtime
+  TYPE(xios_context) :: ctx_hdl
+  INTEGER,PARAMETER :: ni_glo=100
+  INTEGER,PARAMETER :: nj_glo=100
+
+  INTEGER :: i,j,n,ts
+  INTEGER :: ibegin,jbegin,ni,nj,nbi,nbj,iend,jend
+  INTEGER :: ierr, rank, size
+  INTEGER :: comm
+
+  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo
+  DOUBLE PRECISION :: field_glo(ni_glo,nj_glo)
+  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_domain(:,:), field_axis(:,:)
+
+  ! Initialize MPI
+  CALL MPI_INIT(ierr)
+
+  CALL init_wait
+
+  ! Initialize XIOS
+  CALL xios_initialize('client', return_comm=comm)
+
+  CALL MPI_COMM_SIZE(comm, size, ierr)
+  CALL MPI_COMM_RANK(comm, rank, ierr)
+
+  ! Initialize all global values
+  DO j=1,nj_glo
+    DO i=1,ni_glo
+      lon_glo(i,j)=(i-1)+(j-1)*ni_glo
+      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo
+      field_glo(i,j)=(i-1)+(j-1)*ni_glo
+    ENDDO
+  ENDDO
+  ni=ni_glo ; ibegin=0
+
+  nbi = 1
+  ! Specify how we distributed domain
+  DO i=1,int(sqrt(real(size)))+1
+    IF (0 == MOD(size,i)) nbi = i
+  ENDDO
+  nbj = size/nbi
+
+  jbegin=0;
+  LOOP1: DO j=1,nbj
+    nj=nj_glo/nbj
+    if (nj<MOD(nj_glo,nbj)) nj=nj+1
+    ibegin=0
+    DO i=1,nbi
+      n=(j-1)*nbi+i-1
+      ni=ni_glo/nbi
+      if (ni<MOD(ni_glo,nbi)) ni=ni+1
+      IF (n==rank) exit LOOP1
+      IF (i/=nbi) ibegin=ibegin+ni
+    ENDDO
+    IF (j/=nbj) jbegin=jbegin+nj
+  ENDDO LOOP1
+  iend=ibegin+ni-1; jend=jbegin+nj-1
+
+!  if (rank == 0) print *, ni_glo, ni, nj_glo, nj
+  print *, ni, nj, ibegin, jbegin, iend, jend
+
+  ALLOCATE(lon(ni,nj),lat(ni,nj),field_domain(0:ni+1,-1:nj+2),field_axis(ni,nj))
+  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1)
+  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1)
+  field_domain(1:ni,1:nj)=field_glo(ibegin+1:iend+1,jbegin+1:jend+1)
+  field_axis(1:ni,1:nj)=field_glo(ibegin+1:iend+1,jbegin+1:jend+1)
+
+  ! Test 2-dimension domain
+  ! Initialize the context
+  CALL xios_context_initialize('test_domain', comm)
+  CALL xios_get_handle('test_domain', ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  CALL xios_define_calendar(type="Gregorian", &
+                            start_date=xios_date(2000, 01, 01, 00, 00, 00), &
+                            time_origin=xios_date(1999, 01, 01, 15, 00, 00))
+
+  CALL xios_set_domain_attr("domain",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj, type='curvilinear')
+  CALL xios_set_domain_attr("domain",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
+  CALL xios_set_domain_attr("domain",lonvalue_2D=lon,latvalue_2D=lat)
+
+  CALL xios_get_domain_attr("domain",lonvalue_2D=lon)
+!  PRINT *,"lonvalue",lon
+
+  dtime%second=3600
+  CALL xios_set_timestep(timestep=dtime)
+  ! Close domain context
+  CALL xios_close_context_definition()
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  ! Test 2-dimension grid composed of 2 distributed axis
+  ! Initialize the context
+  CALL xios_context_initialize('test_axis', comm)
+  CALL xios_get_handle('test_axis', ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  CALL xios_define_calendar(type="Gregorian", &
+                            start_date=xios_date(2000, 01, 01, 00, 00, 00), &
+                            time_origin=xios_date(1999, 01, 01, 15, 00, 00))
+
+  CALL xios_set_axis_attr("x", n_glo=ni_glo, n=ni, begin=ibegin, value=(/(real(i,kind=8), i=ibegin,ibegin+ni-1)/))
+  CALL xios_set_axis_attr("y", n_glo=nj_glo, n=nj, begin=jbegin, value=(/(real(i,kind=8), i=jbegin,jbegin+nj-1)/))
+
+  dtime%second=3600
+  CALL xios_set_timestep(timestep=dtime)
+
+  ! Close axis context
+  CALL xios_close_context_definition()
+
+  DO ts=1,24*10
+    ! Domain context
+    CALL xios_get_handle("test_domain",ctx_hdl)
+    CALL xios_set_current_context(ctx_hdl)
+    CALL xios_update_calendar(ts)
+    CALL xios_send_field("field_domain_1",field_domain)
+    CALL xios_send_field("field_domain_2",field_domain)
+
+    ! Switch to axis context
+    CALL xios_get_handle("test_axis",ctx_hdl)
+    CALL xios_set_current_context(ctx_hdl)
+    CALL xios_update_calendar(ts)
+    CALL xios_send_field("field_axis",field_axis)
+
+    CALL wait_us(500) ;
+  ENDDO
+
+  ! Clean-ups
+  CALL xios_get_handle("test_domain",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+  CALL xios_context_finalize()
+  CALL xios_get_handle("test_axis",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+  CALL xios_context_finalize()
+
+  DEALLOCATE(lon, lat, field_domain, field_axis)
+
+  CALL MPI_COMM_FREE(comm, ierr)
+  CALL xios_finalize()
+  CALL MPI_FINALIZE(ierr)
+
+END PROGRAM test_basic_2D
+
+
+
+
+
