Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/config/scalar_attribute.conf
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/config/scalar_attribute.conf	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/config/scalar_attribute.conf	(revision 2264)
@@ -9,5 +9,6 @@
 /* LOCAL and GLOBAL*/
 DECLARE_ATTRIBUTE(bool, mask, false)
-DECLARE_ATTRIBUTE(double, value)
+DECLARE_ATTRIBUTE(double, value, false)
+DECLARE_ATTRIBUTE(int, n, false)
 DECLARE_ATTRIBUTE(StdString, bounds_name)
 DECLARE_ARRAY(double, 1 , bounds)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp	(revision 2264)
@@ -2282,4 +2282,5 @@
                   std::vector<StdString> domainList = grid->getDomainList();
                   std::vector<StdString> axisList   = grid->getAxisList();
+                  std::vector<StdString> scalarList  = grid->getScalarList() ;
                   int numElement = axisDomainOrder.numElements();
                   int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1;
@@ -2318,6 +2319,7 @@
                       if (1 == axisDomainOrder.numElements())
                       {
+                        CScalar* scalar = CScalar::get(scalarList[scalarList.size()-1]);
                         start.push_back(0);
-                        count.push_back(1);
+                        count.push_back(scalar->n);
                       }
                       --idx;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4.cpp	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4.cpp	(revision 2264)
@@ -477,7 +477,8 @@
          if (sizes.size()==0) 
          {
-            array_size=1 ;
-            sstart.push_back(0);
-            scount.push_back(1);
+            
+            if ((start != NULL) && (count != NULL) && start->size()==1 && count->size()==1) // pur scalar case
+              array_size*=(*count)[0] ;
+            else array_size=1 ;
          }
          else
@@ -492,9 +493,16 @@
              sstart.push_back(record);
              scount.push_back(1);
-              if ((start == NULL) &&
-                  (count == NULL)) i++;
-              it++;
+             if ((start == NULL) && (count == NULL)) i++;
+             it++;
+             if (it==end)
+             {
+               if ((start != NULL) && (count != NULL) && start->size()==1 && count->size()==1) // pur scalar case
+               {
+                 scount[0]=(*count)[0] ;
+                 array_size *= (*count)[0];
+               }
+             }
            }
-
+           
            for (;it != end; it++)
            {
@@ -569,4 +577,5 @@
          int grpid = this->getCurrentGroup();
          int varid = this->getVariable(name);
+         
          StdSize array_size = 1;
          std::vector<StdSize> sstart, scount;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4_impl.hpp	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4_impl.hpp	(revision 2264)
@@ -19,14 +19,11 @@
     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);
+    if (this->wmpi && collective) CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE);
+    if (this->wmpi && !collective) CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT);
 
     CTimer::get("Files : get data infos").resume();
-    this->getWriteDataInfos
-    (name, record, array_size,  sstart, scount, start, count);
+    this->getWriteDataInfos(name, record, array_size,  sstart, scount, start, count);
     CTimer::get("Files : get data infos").suspend();
-
+   
     if (data.numElements() != array_size)
     {
@@ -36,6 +33,8 @@
       << " ] Invalid input data !" );
     }
-
-    this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
+    
+    if (this->wmpi && sstart.size()==0) CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); // pure scalar case
+    if (data.numElements()==0 && sstart.size()==0) {}// pure scalar case if nothing to write, write nothing (independent access) 
+    else this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
   }
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 2264)
@@ -100,4 +100,5 @@
       {
         case EVENT_ID_UPDATE_DATA :
+          // return true; // temporary
           recvUpdateData(event);
           return true;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 2264)
@@ -1427,4 +1427,5 @@
       else if (element.type==TYPE_SCALAR) posDistributed++ ;
     }
+    if (posDistributed==elements.size()) posDistributed=0 ; // grid composed only of scalar
     
     vector<CLocalView*> localViews ;
@@ -1453,5 +1454,5 @@
       {
         CScalar* scalar = (CScalar*) elements[i].ptr ;
-        scalar->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ;
+        scalar->computeRemoteElement(client, posDistributed==i ? EDistributionType::ROOT : EDistributionType::NONE) ;
         remoteViews.push_back(scalar->getRemoteElement(client)->getView(CElementView::FULL)) ;
         localViews.push_back(scalar->getLocalView(CElementView::FULL)) ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 2263)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 2264)
@@ -112,5 +112,6 @@
     if (checkAttributes_done_) return ;
     checkAttributes_done_ = true ; 
-
+    
+    if (n.isEmpty()) n=1 ;
     if (mask.isEmpty()) mask=true ;
 
@@ -342,13 +343,14 @@
       int rank = CContext::getCurrent()->getIntraCommRank() ;
       
-      CArray<size_t,1> ind(1) ;
-      ind(0)=0 ;
-      localElement_ = new CLocalElement(rank, 1, ind) ;
+      
+      CArray<size_t,1> index(n) ;
+      if (n==1) index(0)=0 ;
+      localElement_ = new CLocalElement(rank, 1, index) ;
    }
 
    void CScalar::addFullView(void)
    {
-      CArray<int,1> index(1) ;
-      for(int i=0; i<1 ; i++) index(0)=0 ;
+      CArray<int,1> index(n) ;
+      if (n==1) index(0)=0 ;
       localElement_ -> addView(CElementView::FULL, index) ;
    }
@@ -357,5 +359,5 @@
    {
       CArray<int,1> index ;
-      if (mask) 
+      if (mask && n==1)
       {
         index.resize(1) ;
@@ -386,11 +388,25 @@
     CContext* context = CContext::getCurrent();
     map<int, CArray<size_t,1>> globalIndex ;
-
-    int nbServer = client->serverSize;
     size_t nglo=1 ;
-    CArray<size_t,1> indGlo(nglo) ;
-    for(size_t i=0;i<nglo;i++) indGlo(i) = i ;
-    for (auto& rankServer : client->getRanksServerLeader()) globalIndex[rankServer].reference(indGlo.copy()) ; 
-
+
+    if (type==EDistributionType::ROOT) // Bands distribution to send to file server
+    {
+      for (auto& rankServer : client->getRanksServerLeader())
+      {
+        auto& globalInd =  globalIndex[rankServer] ;
+        if (rankServer==0) 
+        {
+          globalInd.resize(1) ;
+          globalInd(0)=0 ;
+        }
+      }
+    }
+    else if (type==EDistributionType::NONE) // domain is not distributed ie all servers get the same local domain
+    {
+      int nbServer = client->serverSize;
+      CArray<size_t,1> indGlo(nglo) ;
+      for(size_t i=0;i<nglo;i++) indGlo(i) = i ;
+      for (auto& rankServer : client->getRanksServerLeader()) globalIndex[rankServer].reference(indGlo.copy()) ; 
+    }
     remoteElement_[client] = new CDistributedElement(nglo, globalIndex) ;
     remoteElement_[client]->addFullView() ;
@@ -477,5 +493,5 @@
       // construct the local dimension and indexes
       auto& globalIndex=localElement_->getGlobalIndex() ;
-      int nk=globalIndex.numElements() ;
+      n=globalIndex.numElements() ;
       // no distribution for scalar => nk ==1 or maybe 0 ?
     }
@@ -504,5 +520,5 @@
     CContext* context = CContext::getCurrent();
     localElement_->addView(CElementView::WORKFLOW, serverMask) ;
-    mask = serverMask(0) ;
+    if (serverMask.numElements()==1) mask = serverMask(0) ;
  
     serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
