Index: XIOS/trunk/src/interface/c/icdata.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icdata.cpp	(revision 509)
+++ XIOS/trunk/src/interface/c/icdata.cpp	(revision 510)
@@ -92,5 +92,4 @@
      CTimer::get("XIOS close definition").resume() ;
      CContext* context = CContext::getCurrent() ;
-//     context->setClientServerBuffer();
      context->closeDefinition() ;
      CTimer::get("XIOS close definition").suspend() ;
Index: XIOS/trunk/src/node/context.cpp
===================================================================
--- XIOS/trunk/src/node/context.cpp	(revision 509)
+++ XIOS/trunk/src/node/context.cpp	(revision 510)
@@ -337,10 +337,18 @@
    void CContext::closeDefinition(void)
    {
-     if (hasClient && !hasServer)
+     if (hasClient)
      {
        // After xml is parsed, there are some more works with post processing
        postProcessing();
-
+//
        setClientServerBuffer();
+     }
+
+     if (hasClient && !hasServer)
+     {
+       // After xml is parsed, there are some more works with post processing
+//       postProcessing();
+
+//       setClientServerBuffer();
 
       // Send all attributes of current context to server
@@ -368,9 +376,12 @@
 
     // There are some processings that should be done after all of above. For example: check mask or index
-    if (hasClient && !hasServer)
+//    if (hasClient && !hasServer)
+    if (hasClient)
     {
       this->solveAllRefOfEnabledFields(true);
       this->buildAllExpressionOfEnabledFields();
     }
+
+
 
 //      if (hasClient)
@@ -482,7 +493,8 @@
       const vector<CFile*> allFiles=CFile::getAll() ;
 
-     if (hasClient && !hasServer)
-      for (unsigned int i = 0; i < allFiles.size(); i++)
-         allFiles[i]->solveFieldRefInheritance(apply);
+     //if (hasClient && !hasServer)
+      if (hasClient)
+        for (unsigned int i = 0; i < allFiles.size(); i++)
+          allFiles[i]->solveFieldRefInheritance(apply);
    }
 
@@ -686,6 +698,4 @@
      if (isPostProcessed) return;
 
-     this->solveCalendar();
-
      // Solve calendar for both side: client and server
       this->solveCalendar();
Index: XIOS/trunk/src/node/field.cpp
===================================================================
--- XIOS/trunk/src/node/field.cpp	(revision 509)
+++ XIOS/trunk/src/node/field.cpp	(revision 510)
@@ -401,5 +401,5 @@
      {
         areAllReferenceSolved = true;
-        if (!context->hasServer)
+        if (context->hasClient)
         {
           solveRefInheritance(true);
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 509)
+++ XIOS/trunk/src/node/grid.cpp	(revision 510)
@@ -177,4 +177,5 @@
        if (this->withAxis) retVal *= this->axis->size.getValue();
        retVal *= sizeof(double);
+       retVal *= 1.2; // Secure factor
        ret.insert(make_pair(it->first, retVal));
      }
Index: XIOS/trunk/src/test/test_xios_interface.f90
===================================================================
--- XIOS/trunk/src/test/test_xios_interface.f90	(revision 509)
+++ XIOS/trunk/src/test/test_xios_interface.f90	(revision 510)
@@ -14,6 +14,6 @@
   TYPE(xios_time)      :: dtime
   TYPE(xios_context) :: ctx_hdl
-  INTEGER,PARAMETER :: ni_glo=100
-  INTEGER,PARAMETER :: nj_glo=100
+  INTEGER,PARAMETER :: ni_glo=10
+  INTEGER,PARAMETER :: nj_glo=10
   INTEGER,PARAMETER :: llm=5
   DOUBLE PRECISION  :: lval(llm)=1
@@ -219,8 +219,4 @@
 
 !!! Fin de la definition du contexte SRF
-
-  CALL xios_close_context_definition()
-
-
 !-------------------------------------------------------------------------------
 !
@@ -228,8 +224,4 @@
 !
 !-------------------------------------------------------------------------------
-
- !! Be sure in the correct context
-  CALL xios_get_handle("surface",ctx_hdl)
-  CALL xios_set_current_context(ctx_hdl)
 
   !! Try getting some variable values
@@ -299,4 +291,7 @@
     print*, "New value of ", var_id, " is : ", var_val_bool
   end if
+!
+!!!! Fin de la definition du contexte SRF
+  CALL xios_close_context_definition()
 
 !####################################################################################
