Index: /XIOS/dev/dev_ym/XIOS_COUPLING/arch/arch-X64_IRENE.env
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/arch/arch-X64_IRENE.env	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/arch/arch-X64_IRENE.env	(revision 1875)
@@ -7,2 +7,4 @@
 module load blitz
 module load feature/bridge/heterogenous_mpmd
+
+module load totalview
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/bld.cfg
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/bld.cfg	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/bld.cfg	(revision 1875)
@@ -38,4 +38,6 @@
 src::xios::transformation::Functions    $PWD/src/transformation/Functions
 src::xios::type                         $PWD/src/type
+src::xios::manager                      $PWD/src/manager
+
 
 src::netcdf $PWD/extern/netcdf4
@@ -46,4 +48,5 @@
 #bld::target test_remap.exe
 bld::target xios_server.exe 
+bld::target generic_testcase.exe 
 #bld::target test_regular.exe
 #bld::target test_xios2_cmip6.exe
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/make_xios
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/make_xios	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/make_xios	(revision 1875)
@@ -11,4 +11,5 @@
 use_extern_blitz="false"
 use_memtrack="false"
+use_tv="false"
 job="1"
 netcdf_lib="netcdf4_par"
@@ -34,9 +35,10 @@
 	    echo "       [--full] : to generate dependencies and recompile from scratch"
 	    echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler"
-        echo "       [--build_path : absolute path to the build directory"
-        echo "       [--build_dir : name of the build directory"
-        echo "       [--build_suffixed : generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)"
-        echo "       [--use_extern_boost : to use external boost library"
-        echo "       [--use_extern_blitz : to use external blitz library"
+        echo "       [--build_path] : absolute path to the build directory"
+        echo "       [--build_dir ]: name of the build directory"
+        echo "       [--build_suffixed ]: generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)"
+        echo "       [--use_extern_boost] : to use external boost library"
+        echo "       [--use_extern_blitz] : to use external blitz library"
+        echo "       [--use_tv] : to use totalview data type display"
 	    echo "       [--doc] : to generate Doxygen documentation (not available yet)"
 	    echo "       [--job ntasks] : to use parallel compilation with ntasks"
@@ -59,4 +61,5 @@
          "--use_extern_boost")  use_extern_boost="true" ; shift  ;;
          "--use_extern_blitz")  use_extern_blitz="true" ; shift  ;;
+         "--use_tv")  use_tv="true" ; shift  ;;
          "--doc")   doc="true"          ; shift ;;
          "--job")   job=$2              ; shift ; shift ;;
@@ -233,4 +236,9 @@
 fi
 
+if [[ "$use_tv" == "true" ]]
+then
+   echo "src::tv_data_display $PWD/extern/tv_data_display" >> ${PWD}/bld_dir.cfg
+fi
+
 
 if [[ "$use_memtrack" == "true" ]]
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.cpp	(revision 1875)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.cpp	(revision 1875)
@@ -0,0 +1,8 @@
+#include "array_new.hpp"
+
+namespace xios
+{
+
+
+}
+
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.hpp	(revision 1875)
@@ -7,8 +7,25 @@
 #include "buffer_out.hpp"
 #include "message.hpp"
+#include "tv_data_display.h"
+#ifdef __GNUC__
+#include <typeinfo>
+#include <cxxabi.h>
+#endif
 #include <cmath>
 
 using namespace blitz;
 BZ_DECLARE_FUNCTION(round)
+
+namespace xios
+{
+  template <typename T_numtype,int N_rank>
+  class CArray ;
+
+ template <typename T_numtype,int N_rank>
+ int TV_ttf_display_type ( const CArray<T_numtype, N_rank>* array ) ;
+}
+
+template <typename T_numtype,int N_rank>
+int TV_ttf_display_type ( const xios::CArray<T_numtype, N_rank>* array ) ;
 
 namespace xios
@@ -19,5 +36,8 @@
     private:
       bool initialized;
-
+      void inc_symbol(void)
+      {
+        TV_ttf_display_type(this);
+      }
     public:
       typedef typename Array<T_numtype,N_rank>::T_default_storage T_default_storage;
@@ -27,45 +47,45 @@
         : Array<T_numtype,N_rank>(expr)
         , initialized(true)
-      {}
+      { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol(); }
 
       CArray(GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(storage)
         , initialized(false)
-      {}
+      { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       explicit CArray(int length0, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0, length1, storage)
         , initialized(true)
-      {}
+      { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0, length1, length2, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0, length1, length2, length3, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0,length1, length2, length3, length4, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4, int length5, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, int length7,
@@ -73,5 +93,5 @@
         : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6,
@@ -79,5 +99,5 @@
        : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, storage)
        , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4,
@@ -85,5 +105,5 @@
         : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, length9, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6,
@@ -91,10 +111,10 @@
        : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, length9, length10, storage)
        , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(dataFirst, shape, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, TinyVector<diffType, N_rank> stride,
@@ -102,5 +122,5 @@
         : Array<T_numtype,N_rank>(dataFirst, shape, stride, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, preexistingMemoryPolicy deletionPolicy,
@@ -108,5 +128,5 @@
         : Array<T_numtype,N_rank>(dataFirst, shape, deletionPolicy, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, TinyVector<diffType, N_rank> stride,
@@ -114,10 +134,10 @@
         : Array<T_numtype,N_rank>(dataFirst, shape, stride, deletionPolicy, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(const TinyVector<int, N_rank>& extent, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(extent, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(const TinyVector<int, N_rank>& lbounds, const TinyVector<int, N_rank>& extent,
@@ -125,35 +145,35 @@
         : Array<T_numtype,N_rank>(lbounds, extent, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(r0, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(r0, r1, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(r0, r1, r2, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, GeneralArrayStorage<N_rank> storage = T_default_storage())
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6,
@@ -161,5 +181,5 @@
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, Range r7,
@@ -167,5 +187,5 @@
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
@@ -173,5 +193,5 @@
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
@@ -179,5 +199,5 @@
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, Range r7,
@@ -185,40 +205,40 @@
         : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(const CArray<T_numtype, N_rank>& array)
         : Array<T_numtype,N_rank>(array)
         , initialized(array.initialized)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(const Array<T_numtype, N_rank>& array)
         : Array<T_numtype,N_rank>(array)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(const TinyVector<int,N_rank-1>& shape, int lastExtent, const GeneralArrayStorage<N_rank>& storage)
         : Array<T_numtype,N_rank>(shape, lastExtent, storage)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0)
         : Array<T_numtype,N_rank>(array, r0)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1)
         : Array<T_numtype,N_rank>(array, r0, r1)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2)
         : Array<T_numtype,N_rank>( array, r0, r1, r2)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3)
         : Array<T_numtype,N_rank>(array, r0, r1, r2, r3)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2,
@@ -226,5 +246,5 @@
         : Array<T_numtype,N_rank>(array, r0, r1, r2, r3,  r4)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2,
@@ -232,5 +252,5 @@
         : Array<T_numtype,N_rank>( array, r0, r1, r2, r3, r4, r5)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3,
@@ -238,5 +258,5 @@
         : Array<T_numtype,N_rank>( array, r0, r1, r2, r3, r4, r5, r6)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4,
@@ -244,5 +264,5 @@
         : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
@@ -250,5 +270,5 @@
         : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
@@ -256,5 +276,5 @@
         : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6,
@@ -262,15 +282,15 @@
         : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, const RectDomain<N_rank>& subdomain)
         : Array<T_numtype,N_rank>(array, subdomain)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       CArray(Array<T_numtype, N_rank>& array, const StridedDomain<N_rank>& subdomain)
         : Array<T_numtype,N_rank>(array, subdomain)
         , initialized(true)
-      {}
+      {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();}
 
       template<int N_rank2, typename R0, typename R1, typename R2, typename R3, typename R4, typename R5,
@@ -279,5 +299,5 @@
         : Array<T_numtype,N_rank>(array, r0,r1, r2, r3, r4, r5, r6, r7, r8, r9, r10)
         , initialized(true)
-      {}
+      { bool neverTrue ; neverTrue=false ; bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol(); }
 
       virtual ~CArray() {}
@@ -548,5 +568,46 @@
       virtual size_t size(void) const { return size(this->numElements()); }
       static size_t size(sizeType numElements) { return (N_rank + 1) * sizeof(int) + sizeof(size_t) + numElements * sizeof(T_numtype); }
-
+      
+      static int show_TV_ttf_display_type ( const CArray<T_numtype,N_rank>* array )
+      {
+        int status ;
+        if (array->isEmpty()) 
+        {
+          status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ;
+          if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;
+          else return TV_ttf_format_ok_elide ;
+        }
+        else 
+        {
+          char tname[128] ;
+          char bname[128] = "value_type" ;
+#ifdef __GNUC__
+         size_t size = sizeof(bname) ;
+         abi::__cxa_demangle(typeid(T_numtype).name(), bname, &size, &status) ;
+         if (status !=0) return TV_ttf_format_raw ;
+#endif
+          int dim = array->dimensions() ;
+          if (dim==1) snprintf (tname, sizeof(tname), "%s[%d]", bname, array->extent(0));
+          if (dim==2) snprintf (tname, sizeof(tname), "%s[%d][%d]", bname, array->extent(1), array->extent(0));
+          if (dim==3) snprintf (tname, sizeof(tname), "%s[%d][%d][%d]", bname, array->extent(2), array->extent(1), array->extent(3));
+          if (dim==4) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d]", bname, array->extent(0), array->extent(1), array->extent(2), array->extent(3));
+          if (dim==5) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d]", bname, array->extent(4), array->extent(3), array->extent(2), array->extent(1)
+                                                                                      ,array->extent(0));
+          if (dim==6) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d]", bname, array->extent(5), array->extent(4), array->extent(3), array->extent(2)
+                                                                                      ,array->extent(1),array->extent(0));
+          if (dim==7) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d][%d]", bname, array->extent(6), array->extent(5), array->extent(4), array->extent(3)
+                                                                                      ,array->extent(2),array->extent(1),array->extent(0));
+          status = TV_ttf_add_row("array_values", tname, array->dataFirst()) ;
+          if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;
+          else return TV_ttf_format_ok ;
+        }
+      }
+      
+
+      static int TV_ttf_display_type ( const CArray<T_numtype,N_rank>* array )
+      {
+        return show_TV_ttf_display_type (array) ;
+      }
+      
       virtual CBaseType* clone(void) const { return new CArray(*this); }
 
@@ -578,5 +639,33 @@
         return ret;
       }
+
   };
+
+
+#define macrotyperank(_TYPE_,_RANK_)\
+  template<> int CArray<_TYPE_,_RANK_>::TV_ttf_display_type( const CArray<_TYPE_,_RANK_>* array ) \
+  {\
+    return show_TV_ttf_display_type (array) ;\
+  }
+
+#define macrotype(_TYPE_)\
+macrotyperank(_TYPE_,1)\
+macrotyperank(_TYPE_,2)\
+macrotyperank(_TYPE_,3)\
+macrotyperank(_TYPE_,4)\
+macrotyperank(_TYPE_,5)\
+macrotyperank(_TYPE_,6)\
+macrotyperank(_TYPE_,7)
+
+macrotype(double)
+macrotype(int)
+macrotype(bool)
+macrotype(size_t)
+macrotype(float)
+macrotype(string)
+
+#undef macrotyperank
+#undef macrotype
+
 
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array.hpp	(revision 1875)
@@ -21,6 +21,5 @@
       {
         public :
-
-           using CArray<T_numtype,N_rank>::operator = ;
+            using CArray<T_numtype,N_rank>::operator = ;
 
             /// Constructeurs ///
@@ -65,4 +64,45 @@
             virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ;
             virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ;
+ 
+ static int show_TV_ttf_display_type ( const CAttributeArray<T_numtype,N_rank>* array )
+      {
+        int status ;
+        if (array->isEmpty()) 
+        {
+          status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ;
+          if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;
+          else return TV_ttf_format_ok_elide ;
+        }
+        else 
+        {
+          char tname[128] ;
+          char bname[128] = "value_type" ;
+#ifdef __GNUC__
+         size_t size = sizeof(bname) ;
+         abi::__cxa_demangle(typeid(T_numtype).name(), bname, &size, &status) ;
+         if (status !=0) return TV_ttf_format_raw ;
+#endif
+          int dim = array->dimensions() ;
+          if (dim==1) snprintf (tname, sizeof(tname), "%s[%d]", bname, array->extent(0));
+          if (dim==2) snprintf (tname, sizeof(tname), "%s[%d][%d]", bname, array->extent(1), array->extent(0));
+          if (dim==3) snprintf (tname, sizeof(tname), "%s[%d][%d][%d]", bname, array->extent(2), array->extent(1), array->extent(3));
+          if (dim==4) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d]", bname, array->extent(0), array->extent(1), array->extent(2), array->extent(3));
+          if (dim==5) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d]", bname, array->extent(4), array->extent(3), array->extent(2), array->extent(1)
+                                                                                      ,array->extent(0));
+          if (dim==6) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d]", bname, array->extent(5), array->extent(4), array->extent(3), array->extent(2)
+                                                                                      ,array->extent(1),array->extent(0));
+          if (dim==7) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d][%d]", bname, array->extent(6), array->extent(5), array->extent(4), array->extent(3)
+                                                                                      ,array->extent(2),array->extent(1),array->extent(0));
+          status = TV_ttf_add_row("array_values", tname, array->dataFirst()) ;
+          if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;
+          else return TV_ttf_format_ok ;
+        }
+      }
+      
+            
+            static int TV_ttf_display_type ( const  CAttributeArray<T_numtype,N_rank>* array )
+           {
+             return CAttributeArray<T_numtype,N_rank>::show_TV_ttf_display_type (array) ;
+           }
 
          private :
@@ -75,4 +115,30 @@
           bool _fromBuffer(CBufferIn& buffer) ;
       }; // class CAttributeEnum
+
+
+#define macrotyperank(_TYPE_,_RANK_)\
+  template<> int CAttributeArray<_TYPE_,_RANK_>::TV_ttf_display_type(const CAttributeArray<_TYPE_,_RANK_>* array ) \
+  {\
+    return CAttributeArray<_TYPE_,_RANK_>::show_TV_ttf_display_type (array) ;\
+  }
+
+#define macrotype(_TYPE_)\
+macrotyperank(_TYPE_,1)\
+macrotyperank(_TYPE_,2)\
+macrotyperank(_TYPE_,3)\
+macrotyperank(_TYPE_,4)\
+macrotyperank(_TYPE_,5)\
+macrotyperank(_TYPE_,6)\
+macrotyperank(_TYPE_,7)
+
+macrotype(double)
+macrotype(int)
+macrotype(bool)
+macrotype(size_t)
+macrotype(float)
+macrotype(string)
+
+#undef macrotyperank
+#undef macrotype
 } // namespace xios
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array_impl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array_impl.hpp	(revision 1875)
@@ -14,5 +14,5 @@
       CAttributeArray<T_numtype, N_rank>::CAttributeArray(const StdString & id)
          : CAttribute(id)
-      { /* Ne rien faire de plus */ }
+      { bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this); }
 
       template <typename T_numtype, int N_rank>
@@ -20,4 +20,5 @@
          : CAttribute(id)
       {
+         bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this);
          this->setValue(value);
       }
@@ -27,4 +28,5 @@
          : CAttribute(id)
       {
+         bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this);
          umap.insert(umap.end(), std::make_pair(id, this));
       }
@@ -35,4 +37,5 @@
          : CAttribute(id)
       {
+         bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this);
          this->setValue(value);
          umap.insert(umap.end(), std::make_pair(id, this));
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template.hpp	(revision 1875)
@@ -12,4 +12,10 @@
 #include "buffer_out.hpp"
 #include "type.hpp"
+#include "tv_data_display.h"
+
+#ifdef __GNUC__
+#include <typeinfo>
+#include <cxxabi.h>
+#endif
 
 namespace xios
@@ -20,5 +26,5 @@
     The class implements attribute of some basic types
   */
-      template <class T>
+       template <class T>
          class CAttributeTemplate : public CAttribute, public CType<T>
       {
@@ -91,4 +97,36 @@
 //            virtual void generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) ;
 
+           static int show_TV_ttf_display_type ( const CAttributeTemplate<T>* attr)
+           {
+             int status ;
+             if (attr->isEmpty()) 
+             {
+               status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ;
+               if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;
+               else return TV_ttf_format_ok_elide ;
+             }
+             else 
+             {
+               char tname[128] ;
+               char bname[128] = "ValueType" ;
+#ifdef __GNUC__
+               size_t size = sizeof(bname) ;
+               abi::__cxa_demangle(typeid(T).name(), bname, &size, &status) ;
+               if (status !=0) return TV_ttf_format_raw ;
+#endif
+               snprintf (tname, sizeof(tname), "%s", bname);
+               if (typeid(T)==typeid(string))
+                 status = TV_ttf_add_row("values", TV_ttf_type_ascii_string, ((string*)(attr->ptrValue))->c_str() );
+               else status = TV_ttf_add_row("values", tname, attr->ptrValue) ;
+               if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;
+               else return TV_ttf_format_ok_elide ;
+             }
+           }
+      
+           static int TV_ttf_display_type ( const CAttributeTemplate<T>* attr )
+           {
+             return show_TV_ttf_display_type (attr) ;
+           }
+
 
          protected :
@@ -107,6 +145,20 @@
       }; // class CAttribute
 
+#define macrotype(_TYPE_)\
+  template<> int CAttributeTemplate<_TYPE_>::TV_ttf_display_type( const CAttributeTemplate<_TYPE_>* attr ) \
+  {\
+    return show_TV_ttf_display_type (attr) ;\
+  }
+
+macrotype(double)
+macrotype(int)
+macrotype(bool)
+macrotype(string)
+//macrotype(CDate)
+//macrotype(CDuration)
+#undef macrotype
 
    template <class T>  void FromBinary(StdIStream & is, T & obj);
+
 
 } // namespace xios
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_decl.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_decl.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_decl.cpp	(revision 1875)
@@ -17,7 +17,9 @@
   macro(short)
   macro(long)
+  macro(longlong)
   macro(uint)
   macro(ushort)
   macro(ulong)
+  macro(ulonglong)
   macro(float)
   macro(double)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_impl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_impl.hpp	(revision 1875)
@@ -10,7 +10,9 @@
     template <> bool CBuffer::put<short>(const short& data) { return put_template(data) ; }  
     template <> bool CBuffer::put<long>(const long& data)  { return put_template(data) ; }  
+    template <> bool CBuffer::put<longlong>(const longlong& data)  { return put_template(data) ; }  
     template <> bool CBuffer::put<uint>(const uint& data)  { return put_template(data) ; }  
     template <> bool CBuffer::put<ushort>(const ushort& data) { return put_template(data) ; }  
     template <> bool CBuffer::put<ulong>(const ulong& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<ulonglong>(const ulonglong& data) { return put_template(data) ; }  
     template <> bool CBuffer::put<float>(const float& data) { return put_template(data) ; }  
     template <> bool CBuffer::put<double>(const double& data) { return put_template(data) ; }  
@@ -21,7 +23,9 @@
     template <> bool CBuffer::put<short>(const short* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBuffer::put<long>(const long* data, size_t n)  { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<longlong>(const longlong* data, size_t n)  { return put_template(data,n) ; }  
     template <> bool CBuffer::put<uint>(const uint* data, size_t n)  { return put_template(data,n) ; }  
     template <> bool CBuffer::put<ushort>(const ushort* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBuffer::put<ulong>(const ulong* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<ulonglong>(const ulonglong* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBuffer::put<float>(const float* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBuffer::put<double>(const double* data, size_t n) { return put_template(data,n) ; }  
@@ -33,7 +37,9 @@
     template <> bool CBuffer::put_ptr<short>(const short*& data, size_t n) { return put_ptr_template(data,n) ; }  
     template <> bool CBuffer::put_ptr<long>(const long*& data, size_t n)  { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<longlong>(const longlong*& data, size_t n)  { return put_ptr_template(data,n) ; }  
     template <> bool CBuffer::put_ptr<uint>(const uint*& data, size_t n)  { return put_ptr_template(data,n) ; }  
     template <> bool CBuffer::put_ptr<ushort>(const ushort*& data, size_t n) { return put_ptr_template(data,n) ; }  
     template <> bool CBuffer::put_ptr<ulong>(const ulong*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<ulonglong>(const ulonglong*& data, size_t n) { return put_ptr_template(data,n) ; }  
     template <> bool CBuffer::put_ptr<float>(const float*& data, size_t n) { return put_ptr_template(data,n) ; }  
     template <> bool CBuffer::put_ptr<double>(const double*& data, size_t n) { return put_ptr_template(data,n) ; }  
@@ -46,7 +52,9 @@
     template <> bool CBuffer::get<short>(short& data) { return get_template(data) ; }  
     template <> bool CBuffer::get<long>(long& data)  { return get_template(data) ; }  
+    template <> bool CBuffer::get<longlong>(longlong& data)  { return get_template(data) ; }  
     template <> bool CBuffer::get<uint>(uint& data)  { return get_template(data) ; }  
     template <> bool CBuffer::get<ushort>(ushort& data) { return get_template(data) ; }  
     template <> bool CBuffer::get<ulong>(ulong& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<ulonglong>(ulonglong& data) { return get_template(data) ; }  
     template <> bool CBuffer::get<float>(float& data) { return get_template(data) ; }  
     template <> bool CBuffer::get<double>(double& data) { return get_template(data) ; }  
@@ -57,7 +65,9 @@
     template <> bool CBuffer::get<short>(short* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBuffer::get<long>(long* data, size_t n)  { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<longlong>(longlong* data, size_t n)  { return get_template(data,n) ; }  
     template <> bool CBuffer::get<uint>(uint* data, size_t n)  { return get_template(data,n) ; }  
     template <> bool CBuffer::get<ushort>(ushort* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBuffer::get<ulong>(ulong* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<ulonglong>(ulonglong* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBuffer::get<float>(float* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBuffer::get<double>(double* data, size_t n) { return get_template(data,n) ; }  
@@ -68,7 +78,9 @@
     template <> bool CBuffer::get_ptr<short>(short*& data, size_t n) { return get_ptr_template(data,n) ; }  
     template <> bool CBuffer::get_ptr<long>(long*& data, size_t n)  { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<longlong>(longlong*& data, size_t n)  { return get_ptr_template(data,n) ; }  
     template <> bool CBuffer::get_ptr<uint>(uint*& data, size_t n)  { return get_ptr_template(data,n) ; }  
     template <> bool CBuffer::get_ptr<ushort>(ushort*& data, size_t n) { return get_ptr_template(data,n) ; }  
     template <> bool CBuffer::get_ptr<ulong>(ulong*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<ulonglong>(ulonglong*& data, size_t n) { return get_ptr_template(data,n) ; }  
     template <> bool CBuffer::get_ptr<float>(float*& data, size_t n) { return get_ptr_template(data,n) ; }  
     template <> bool CBuffer::get_ptr<double>(double*& data, size_t n) { return get_ptr_template(data,n) ; }  
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_in_decl.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_in_decl.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_in_decl.cpp	(revision 1875)
@@ -14,7 +14,9 @@
   macro(short)
   macro(long)
+  macro(longlong)
   macro(uint)
   macro(ushort)
   macro(ulong)
+  macro(ulonglong)
   macro(float)
   macro(double)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_in_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_in_impl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_in_impl.hpp	(revision 1875)
@@ -12,7 +12,9 @@
     template <> bool CBufferIn::get<short>(short& data) { return get_template(data) ; }  
     template <> bool CBufferIn::get<long>(long& data)  { return get_template(data) ; }  
+    template <> bool CBufferIn::get<longlong>(longlong& data)  { return get_template(data) ; }  
     template <> bool CBufferIn::get<uint>(uint& data)  { return get_template(data) ; }  
     template <> bool CBufferIn::get<ushort>(ushort& data) { return get_template(data) ; }  
     template <> bool CBufferIn::get<ulong>(ulong& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<ulonglong>(ulonglong& data) { return get_template(data) ; }  
     template <> bool CBufferIn::get<float>(float& data) { return get_template(data) ; }  
     template <> bool CBufferIn::get<double>(double& data) { return get_template(data) ; }  
@@ -24,7 +26,9 @@
     template <> bool CBufferIn::get<short>(short* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBufferIn::get<long>(long* data, size_t n)  { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<longlong>(longlong* data, size_t n)  { return get_template(data,n) ; }  
     template <> bool CBufferIn::get<uint>(uint* data, size_t n)  { return get_template(data,n) ; }  
     template <> bool CBufferIn::get<ushort>(ushort* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBufferIn::get<ulong>(ulong* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<ulonglong>(ulonglong* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBufferIn::get<float>(float* data, size_t n) { return get_template(data,n) ; }  
     template <> bool CBufferIn::get<double>(double* data, size_t n) { return get_template(data,n) ; }  
@@ -36,7 +40,9 @@
     template <> bool CBufferIn::advance<short>(size_t n) { return advance_template<short>(n) ; }  
     template <> bool CBufferIn::advance<long>(size_t n)  { return advance_template<long>(n) ; }  
+    template <> bool CBufferIn::advance<longlong>(size_t n)  { return advance_template<longlong>(n) ; }  
     template <> bool CBufferIn::advance<uint>(size_t n)  { return advance_template<uint>(n) ; }  
     template <> bool CBufferIn::advance<ushort>(size_t n) { return advance_template<ushort>(n) ; }  
     template <> bool CBufferIn::advance<ulong>(size_t n) { return advance_template<ulong>(n) ; }  
+    template <> bool CBufferIn::advance<ulonglong>(size_t n) { return advance_template<ulonglong>(n) ; }  
     template <> bool CBufferIn::advance<float>(size_t n) { return advance_template<float>(n) ; }  
     template <> bool CBufferIn::advance<double>(size_t n) { return advance_template<double>(n) ; }  
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_out_decl.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_out_decl.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_out_decl.cpp	(revision 1875)
@@ -15,7 +15,9 @@
   macro(short)
   macro(long)
+  macro(longlong)
   macro(uint)
   macro(ushort)
   macro(ulong)
+  macro(ulonglong)
   macro(float)
   macro(double)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_out_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_out_impl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_out_impl.hpp	(revision 1875)
@@ -11,7 +11,9 @@
     template <> bool CBufferOut::put<short>(const short& data) { return put_template(data) ; }  
     template <> bool CBufferOut::put<long>(const long& data)  { return put_template(data) ; }  
+    template <> bool CBufferOut::put<longlong>(const longlong& data)  { return put_template(data) ; }  
     template <> bool CBufferOut::put<uint>(const uint& data)  { return put_template(data) ; }  
     template <> bool CBufferOut::put<ushort>(const ushort& data) { return put_template(data) ; }  
     template <> bool CBufferOut::put<ulong>(const ulong& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<ulonglong>(const ulonglong& data) { return put_template(data) ; }  
     template <> bool CBufferOut::put<float>(const float& data) { return put_template(data) ; }  
     template <> bool CBufferOut::put<double>(const double& data) { return put_template(data) ; }  
@@ -23,7 +25,9 @@
     template <> bool CBufferOut::put<short>(const short* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBufferOut::put<long>(const long* data, size_t n)  { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<longlong>(const longlong* data, size_t n)  { return put_template(data,n) ; }  
     template <> bool CBufferOut::put<uint>(const uint* data, size_t n)  { return put_template(data,n) ; }  
     template <> bool CBufferOut::put<ushort>(const ushort* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBufferOut::put<ulong>(const ulong* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<ulonglong>(const ulonglong* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBufferOut::put<float>(const float* data, size_t n) { return put_template(data,n) ; }  
     template <> bool CBufferOut::put<double>(const double* data, size_t n) { return put_template(data,n) ; }  
@@ -36,7 +40,9 @@
     template <> bool CBufferOut::advance<short>(size_t n) { return advance_template<short>(n) ; }  
     template <> bool CBufferOut::advance<long>(size_t n)  { return advance_template<long>(n) ; }  
+    template <> bool CBufferOut::advance<longlong>(size_t n)  { return advance_template<longlong>(n) ; }  
     template <> bool CBufferOut::advance<uint>(size_t n)  { return advance_template<uint>(n) ; }  
     template <> bool CBufferOut::advance<ushort>(size_t n) { return advance_template<ushort>(n) ; }  
     template <> bool CBufferOut::advance<ulong>(size_t n) { return advance_template<ulong>(n) ; }  
+    template <> bool CBufferOut::advance<ulonglong>(size_t n) { return advance_template<ulonglong>(n) ; }  
     template <> bool CBufferOut::advance<float>(size_t n) { return advance_template<float>(n) ; }  
     template <> bool CBufferOut::advance<double>(size_t n) { return advance_template<double>(n) ; }  
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp	(revision 1875)
@@ -326,5 +326,6 @@
          // The best way to properly solve this problem will be to use the event scheduler also in attached mode
          // for now just set up a MPI barrier
-         if (!eventScheduler_ && CXios::isServer) MPI_Barrier(intraComm) ;
+//ym to be check later
+//         if (!eventScheduler_ && CXios::isServer) MPI_Barrier(intraComm) ;
 
 //         context->setProcessingEvent() ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_attribute.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_attribute.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_attribute.hpp	(revision 1875)
@@ -42,7 +42,13 @@
       public :                                                    \
          using CAttributeArray<T_num, T_rank>::operator = ;       \
-         name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \
+         bool alwaysFalse=false;\
+         name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {if (alwaysFalse) TV_ttf_display_type(this);} \
          virtual bool doSend() const { return helper(__VA_ARGS__); }   \
          bool helper(bool returnTrue=true) const { return returnTrue; }   \
+         static int TV_ttf_display_type ( const name##_attr* array )\
+         {\
+           cout<<"TV_ttf_display_type"<<endl ;\
+           return CArray<T_num,T_rank>::TV_ttf_display_type((const CArray<T_num,T_rank>*)array) ;\
+         }\
          virtual ~name##_attr(void) {}                            \
    } name;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/file_writer_filter.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/file_writer_filter.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/file_writer_filter.cpp	(revision 1875)
@@ -35,5 +35,5 @@
     }
 
-    field->sendUpdateData(dataArray, client_);
+    field->sendUpdateData(data[0]->timestamp, dataArray, client_);
   }
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp	(revision 1875)
@@ -174,5 +174,5 @@
         gridTransformation->computeAll(dataAuxInputs, packet->timestamp);
       }
-      packet->data.resize(gridTransformation->getGridDestination()->getDataSize());
+      packet->data.resize(gridTransformation->getGridDestination()->getLocalDataSize());
       if (0 != packet->data.numElements())
         (packet->data)(0) = defaultValue;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp	(revision 1875)
@@ -72,6 +72,6 @@
          void addChildGroup(V* childGroup) ; 
          static bool dispatchEvent(CEventServer& event) ;
-         void sendCreateChild(const string& id, CContextClient* client) ;
-         void sendCreateChildGroup(const string& id, CContextClient* client) ;
+         void sendCreateChild(const string& id, CContextClient* client, const string& objectId="") ;
+         void sendCreateChildGroup(const string& id, CContextClient* client, const string& objectId="") ;
          static void recvCreateChild(CEventServer& event) ;
          void recvCreateChild(CBufferIn& buffer) ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp	(revision 1875)
@@ -370,5 +370,5 @@
 
    template <class U, class V, class W>
-   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id, CContextClient* client)
+   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id, CContextClient* client, const string& objectId)
    {
 
@@ -377,5 +377,6 @@
     {
       CMessage msg ;
-      msg<<this->getId() ;
+      if (objectId.empty()) msg << this->getId();
+      else msg << objectId;
       msg<<id ;
       const std::list<int>& ranks = client->getRanksServerLeader();
@@ -388,5 +389,5 @@
 
    template <class U, class V, class W>
-   void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id, CContextClient* client)
+   void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id, CContextClient* client, const string& objectId)
    {
      CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;
@@ -394,5 +395,6 @@
      {
        CMessage msg ;
-       msg<<this->getId() ;
+       if (objectId.empty()) msg << this->getId();
+       else msg << objectId;
        msg<<id ;
        const std::list<int>& ranks = client->getRanksServerLeader();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1875)
@@ -575,4 +575,29 @@
    }
 
+   void CAxis::sendAxisToCouplerOut(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, const string& fieldId, int posInGrid)
+   {
+     if (sendAxisToFileServer_done_.count(client)!=0) return ;
+     else sendAxisToFileServer_done_.insert(client) ;
+     
+     string axisId="_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ;
+
+     if (!axis_ref.isEmpty())
+    {
+      auto axis_ref_tmp=axis_ref.getValue() ;
+      axis_ref.reset() ; // remove the reference, find an other way to do that more cleanly
+      this->sendAllAttributesToServer(client, axisId)  ; 
+      axis_ref = axis_ref_tmp ;
+    }
+    else this->sendAllAttributesToServer(client, axisId)  ; 
+  
+    this->sendAttributes(client, globalDim, orderPositionInGrid, CServerDistributionDescription::BAND_DISTRIBUTION, axisId) ;
+   }
+
+  void CAxis::makeAliasForCoupling(const string& fieldId, int posInGrid)
+  {
+    const string axisId = "_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ;
+    this->createAlias(axisId) ;
+  }
+
   /*!
     Send attributes from one client to other clients
@@ -581,8 +606,8 @@
   */
   void CAxis::sendAttributes(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
-                             CServerDistributionDescription::ServerDistributionType distType)
-  TRY
-  {
-     sendDistributionAttribute(client, globalDim, orderPositionInGrid, distType);
+                             CServerDistributionDescription::ServerDistributionType distType, const string& axisId)
+  TRY
+  {
+     sendDistributionAttribute(client, globalDim, orderPositionInGrid, distType, axisId);
 
      // if (index.numElements() == n_glo.getValue())
@@ -590,9 +615,9 @@
          || (index.numElements() != n_glo))
      {
-       sendDistributedAttributes(client);       
+       sendDistributedAttributes(client, axisId);       
      }
      else
      {
-       sendNonDistributedAttributes(client);    
+       sendNonDistributedAttributes(client, axisId);    
      }     
   }
@@ -889,7 +914,8 @@
   */
   void CAxis::sendDistributionAttribute(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
-                                        CServerDistributionDescription::ServerDistributionType distType)
-  TRY
-  {
+                                        CServerDistributionDescription::ServerDistributionType distType, const string& axisId)
+  TRY
+  {
+    string serverAxisId = axisId.empty() ? this->getId() : axisId ; 
     int nbServer = client->serverSize;
 
@@ -914,5 +940,5 @@
         msgs.push_back(CMessage());
         CMessage& msg = msgs.back();
-        msg << this->getId();
+        msg << serverAxisId;
         msg << ni << begin;
         msg << isCompressible_;                    
@@ -962,7 +988,9 @@
     In the future, if new attributes are added, they should also be processed in this function
   */
-  void CAxis::sendNonDistributedAttributes(CContextClient* client)
-  TRY
-  {
+  void CAxis::sendNonDistributedAttributes(CContextClient* client, const string& axisId)
+  TRY
+  {
+    string serverAxisId = axisId.empty() ? this->getId() : axisId ; 
+
     CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES);
     size_t nbIndex = index.numElements();
@@ -996,5 +1024,5 @@
         msgs.push_back(CMessage());
         CMessage& msg = msgs.back();
-        msg << this->getId();
+        msg << serverAxisId;
         msg << index.getValue() << dataIndex << mask.getValue();
         msg << hasValue;
@@ -1087,7 +1115,9 @@
     In future, if new attributes are added, they should also be processed in this function
   */
-  void CAxis::sendDistributedAttributes(CContextClient* client)
-  TRY
-  {
+  void CAxis::sendDistributedAttributes(CContextClient* client, const string& axisId)
+  TRY
+  {
+    string serverAxisId = axisId.empty() ? this->getId() : axisId ; 
+    
     int ind, idx;
     int nbServer = client->serverSize;
@@ -1166,5 +1196,5 @@
 
       listData.push_back(CMessage());
-      listData.back() << this->getId()
+      listData.back() << serverAxisId
                       << list_indi.back() << list_dataInd.back();
 
@@ -1431,41 +1461,4 @@
   CATCH_DUMP_ATTR
 
-/*!
-  \brief Check if a axis is completed
-  Before make any axis processing, we must be sure that all axis informations have
-  been sent, for exemple when reading a grid in a file or when grid elements are sent by an
-  other context (coupling). So all direct reference of the axis (axis_ref) must be also completed
-  \return true if axis and axis reference are completed
-  */
-  bool CAxis::checkIfCompleted(void)
-  {
-    if (hasDirectAxisReference()) if (!getDirectAxisReference()->checkIfCompleted()) return false;
-    return isCompleted_ ;
-  }
-
-  /*!
-  \brief Set a axis as completed
-   When all information about a axis have been received, the axis is tagged as completed and is
-   suitable for processing
-  */
-  void CAxis::setCompleted(void)
-  {
-    if (hasDirectAxisReference()) getDirectAxisReference()->setCompleted() ;
-    isCompleted_=true ;
-  }
-
-  /*!
-  \brief Set a axis as uncompleted
-   When informations about a axis are expected from a grid reading from file or coupling, the axis is 
-   tagged as uncompleted and is not suitable for processing
-  */
-  void CAxis::setUncompleted(void)
-  {
-    if (hasDirectAxisReference()) getDirectAxisReference()->setUncompleted() ;
-    isCompleted_=false ;
-  }
-
-
-
   /*!
    * Go through the hierarchy to find the axis from which the transformations must be inherited
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp	(revision 1875)
@@ -124,8 +124,4 @@
          bool isEqual(CAxis* axis);
 
-         bool checkIfCompleted(void) ;
-         void setCompleted(void) ;
-         void setUncompleted(void) ;
-
       public: 
         bool hasValue;        
@@ -150,13 +146,21 @@
          std::set<CContextClient*> sendAxisToFileServer_done_ ;
       
+      public:
+         void sendAxisToCouplerOut(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, const string& fieldId, int posInGrid) ;
+      private:
+         std::set<CContextClient*> sendAxisToCouplerOut_done_ ;
+    
+      public:
+         void makeAliasForCoupling(const string& fieldId, int posInGrid) ;
+
       private:
          void sendAttributes(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
-                             CServerDistributionDescription::ServerDistributionType distType);
+                             CServerDistributionDescription::ServerDistributionType distType, const string& axisId="");
          void sendDistributionAttribute(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
-                                        CServerDistributionDescription::ServerDistributionType distType);
-         
-
-         void sendNonDistributedAttributes(CContextClient* client);
-         void sendDistributedAttributes(CContextClient* client);
+                                        CServerDistributionDescription::ServerDistributionType distType, const string& axisId="");
+         
+
+         void sendNonDistributedAttributes(CContextClient* client, const string& axisId="");
+         void sendDistributedAttributes(CContextClient* client, const string& axisId="");
 
          static void recvNonDistributedAttributes(CEventServer& event);
@@ -171,12 +175,29 @@
       private:
 
-/** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */
+/** Clients that have to send a axis. There can be multiple clients in case of secondary server, otherwise only one client. */
          std::list<CContextClient*> clients;
          std::set<CContextClient*> clientsSet;
 
+      private:
          /** define if the axis is completed or not ie all attributes have been received before in case 
              of grid reading from file or coupling */ 
          bool isCompleted_=true ;  
-
+      public:     
+         /*!
+           \brief Check if a axis is completed
+           Before make any axis processing, we must be sure that all axis informations have
+           been sent, for exemple when reading a grid in a file or when grid elements are sent by an
+           other context (coupling). So all direct reference of the axis (axis_ref) must be also completed
+           \return true if axis and axis reference are completed
+          */
+         bool isCompleted(void)
+         {
+           if (hasDirectAxisReference()) if (!getDirectAxisReference()->isCompleted()) return false;
+           else return isCompleted_ ;
+         }
+         void setCompleted(void) { isCompleted_=true ; }
+         void unsetCompleted(void) { isCompleted_=false ; }
+      
+      private:
          bool isChecked;
          bool areClientAttributesChecked_;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 1875)
@@ -708,14 +708,16 @@
     }
 
-    for (auto it=couplerClient_.begin(); it!=couplerClient_.end(); ++it)
-    {
-      if (!finalized) it->second->checkBuffers();
-    }
-
-    for (auto it=couplerServer_.begin(); it!=couplerServer_.end(); ++it)
-    {
-      if (!finalized) it->second->eventLoop(enableEventsProcessing);
-    }
-
+    for (auto couplerOut : couplerOutClient_)
+      if (!finalized) couplerOut.second->checkBuffers();
+    
+    for (auto couplerIn : couplerInClient_)
+      if (!finalized) couplerIn.second->checkBuffers();
+    
+    for (auto couplerOut : couplerOutServer_)
+      if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing);
+
+    for (auto couplerIn : couplerInServer_)
+      if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing);
+    
     if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing);
   
@@ -723,47 +725,32 @@
   }
 
-  void CContext::addCouplingChanel(const std::string& context, bool out)
+  void CContext::addCouplingChanel(const std::string& fullContextId, bool out)
   {
-     vector<string> vectStr=splitRegex(context,"::") ;
-     string poolId=vectStr[0] ;
-     string serviceId=poolId ;
-     string contextId=vectStr[1] ;
-
      int contextLeader ;
-     int type = CServicesManager::CLIENT ;
-     string contextName=CXios::getContextsManager()->getServerContextName(poolId, serviceId, 0, type, contextId) ;
      
-     if (couplerClient_.find(contextName)==couplerClient_.end())
-     {
-       bool ok=CXios::getContextsManager()->getContextLeader(contextName, contextLeader, getIntraComm()) ;
+     if (out)
+     { 
+       if (couplerOutClient_.find(fullContextId)==couplerOutClient_.end()) 
+       {
+         bool ok=CXios::getContextsManager()->getContextLeader(fullContextId, contextLeader, getIntraComm()) ;
      
-       MPI_Comm interComm, interCommClient, interCommServer  ;
-       MPI_Comm intraCommClient, intraCommServer ;
-
-       if (ok) MPI_Intercomm_create(getIntraComm(), 0, CXios::getXiosComm(), contextLeader, 0, &interComm) ;
-
-       MPI_Comm_dup(intraComm_, &intraCommClient) ;
-       MPI_Comm_dup(intraComm_, &intraCommServer) ;
-       if (out)
-       {
-         MPI_Comm_dup(interComm, &interCommClient) ;
-         MPI_Comm_dup(interComm, &interCommServer) ;
-         CContextClient* client = new CContextClient(this, intraCommClient, interCommClient);
-         CContextServer* server = new CContextServer(this, intraCommServer, interCommServer);
-         client->setAssociatedServer(server) ;
-         server->setAssociatedClient(client) ;
-       }
-       else
-       {
-          MPI_Comm_dup(interComm, &interCommServer) ;
-          MPI_Comm_dup(interComm, &interCommClient) ;
-          CContextServer* server = new CContextServer(this, intraCommServer, interCommServer);
-          CContextClient* client = new CContextClient(this, intraCommClient, interCommClient);
-          client->setAssociatedServer(server) ;
-          server->setAssociatedClient(client) ;
-       }
-       MPI_Comm_free(&interComm) ;
-
-
+         MPI_Comm interComm, interCommClient, interCommServer  ;
+         MPI_Comm intraCommClient, intraCommServer ;
+
+         if (ok) MPI_Intercomm_create(getIntraComm(), 0, CXios::getXiosComm(), contextLeader, 0, &interComm) ;
+
+        MPI_Comm_dup(intraComm_, &intraCommClient) ;
+        MPI_Comm_dup(intraComm_, &intraCommServer) ;
+        MPI_Comm_dup(interComm, &interCommClient) ;
+        MPI_Comm_dup(interComm, &interCommServer) ;
+        CContextClient* client = new CContextClient(this, intraCommClient, interCommClient);
+        CContextServer* server = new CContextServer(this, intraCommServer, interCommServer);
+        client->setAssociatedServer(server) ;
+        server->setAssociatedClient(client) ;
+        MPI_Comm_free(&interComm) ;
+        couplerOutClient_[fullContextId] = client ;
+        couplerOutServer_[fullContextId] = server ;
+
+/*
       // for now, we don't now which beffer size must be used for client coupler
       // It will be evaluated later. Fix a constant size for now...
@@ -777,8 +764,37 @@
 
        client->setBufferSize(bufferSize, maxEventSize);    
-       
-       couplerClient_[contextName] = client ;
-       couplerServer_[contextName] = server ;
-     }
+*/
+      }
+    }
+    else if (couplerInClient_.find(fullContextId)==couplerInClient_.end())
+    {
+      bool ok=CXios::getContextsManager()->getContextLeader(fullContextId, contextLeader, getIntraComm()) ;
+     
+       MPI_Comm interComm, interCommClient, interCommServer  ;
+       MPI_Comm intraCommClient, intraCommServer ;
+
+       if (ok) MPI_Intercomm_create(getIntraComm(), 0, CXios::getXiosComm(), contextLeader, 0, &interComm) ;
+
+       MPI_Comm_dup(intraComm_, &intraCommClient) ;
+       MPI_Comm_dup(intraComm_, &intraCommServer) ;
+       MPI_Comm_dup(interComm, &interCommServer) ;
+       MPI_Comm_dup(interComm, &interCommClient) ;
+       CContextServer* server = new CContextServer(this, intraCommServer, interCommServer);
+       CContextClient* client = new CContextClient(this, intraCommClient, interCommClient);
+       client->setAssociatedServer(server) ;
+       server->setAssociatedClient(client) ;
+       MPI_Comm_free(&interComm) ;
+
+       map<int,size_t> bufferSize, maxEventSize ;
+       for(int i=0;i<client->getRemoteSize();i++)
+       {
+         bufferSize[i]=10000000 ;
+         maxEventSize[i]=10000000 ;
+       }
+
+       client->setBufferSize(bufferSize, maxEventSize);    
+       couplerInClient_[fullContextId] = client ;
+       couplerInServer_[fullContextId] = server ;        
+    }
   }
   
@@ -798,5 +814,19 @@
       if (serviceType_==CServicesManager::CLIENT)
       {
-        doPreTimestepOperationsForEnabledReadModeFiles(); // For now we only use server level 1 to read data
+//ym        doPreTimestepOperationsForEnabledReadModeFiles(); // For now we only use server level 1 to read data
+
+        triggerLateFields() ;
+
+        // inform couplerIn that I am finished
+        for(auto& couplerInClient : couplerInClient_) sendCouplerInContextFinalized(couplerInClient.second) ;
+
+        // wait until received message from couplerOut that they have finished
+        bool couplersInFinalized ;
+        do
+        {
+          couplersInFinalized=true ;
+          for(auto& couplerOutClient : couplerOutClient_) couplersInFinalized &= isCouplerInContextFinalized(couplerOutClient.second) ; 
+          globalEventLoop() ;
+        } while (!couplersInFinalized) ;
 
         info(100)<<"DEBUG: context "<<getId()<<" Send client finalize"<<endl ;
@@ -1055,6 +1085,6 @@
     vector<CField*>&& fileOutField = findAllEnabledFieldsInFileOut(this->enabledWriteModeFiles);
     vector<CField*>&& fileInField = findAllEnabledFieldsInFileIn(this->enabledReadModeFiles);
-    vector<CField*>&& CouplerOutField = findAllEnabledFieldsCouplerOut(this->enabledCouplerOut);
-    vector<CField*>&& CouplerInField = findAllEnabledFieldsCouplerIn(this->enabledCouplerIn);
+    vector<CField*>&& couplerOutField = findAllEnabledFieldsCouplerOut(this->enabledCouplerOut);
+    vector<CField*>&& couplerInField = findAllEnabledFieldsCouplerIn(this->enabledCouplerIn);
     findFieldsWithReadAccess();
     vector<CField*>& fieldWithReadAccess = fieldsWithReadAccess_ ;
@@ -1073,15 +1103,60 @@
     }
 
-
-
+    
+    for (auto& field : couplerInField)
+    {
+      field->unsetGridCompleted() ;
+    }
 // find all field potentially at workflow end
     vector<CField*> endWorkflowFields ;
-    endWorkflowFields.reserve(fileOutField.size()+CouplerOutField.size()+fieldWithReadAccess.size()) ;
+    endWorkflowFields.reserve(fileOutField.size()+couplerOutField.size()+fieldWithReadAccess.size()) ;
     endWorkflowFields.insert(endWorkflowFields.end(),fileOutField.begin(), fileOutField.end()) ;
-    endWorkflowFields.insert(endWorkflowFields.end(),CouplerOutField.begin(), CouplerOutField.end()) ;
+    endWorkflowFields.insert(endWorkflowFields.end(),couplerOutField.begin(), couplerOutField.end()) ;
     endWorkflowFields.insert(endWorkflowFields.end(),fieldWithReadAccess.begin(), fieldWithReadAccess.end()) ;
 
-    for(auto endWorkflowField : endWorkflowFields) endWorkflowField->buildWorkflowGraph(garbageCollector) ;
+    bool workflowGraphIsCompleted ;
+
+    bool first=true ;
+    do
+    {
+      workflowGraphIsCompleted=true; 
+      for(auto endWorkflowField : endWorkflowFields) 
+      {
+        workflowGraphIsCompleted &= endWorkflowField->buildWorkflowGraph(garbageCollector) ;
+      }
+
+      for(auto couplerIn : enabledCouplerIn) couplerIn->assignContext() ;
+      for(auto field : couplerInField) field->makeGridAliasForCoupling();
+      for(auto field : couplerInField) this->sendCouplerInReady(field->getContextClient()) ;
     
+
+      // assign context to coupler out and related fields
+      for(auto couplerOut : enabledCouplerOut) couplerOut->assignContext() ;
+      // for now supose that all coupling out endpoint are succesfull. The difficultie is client/server buffer evaluation
+      for(auto field : couplerOutField) 
+      {
+        field->computeGridIndexToFileServer() ; // same kind of index than for file server -> in future distribution may change
+      }
+      if (first) setClientServerBuffer(couplerOutField, true) ; // set buffer context
+
+      bool couplersReady ;
+      do 
+      {
+        couplersReady=true ;
+        for(auto field : couplerOutField)
+        {
+          bool ready = isCouplerInReady(field->getContextClient()) ; 
+          if (ready) field->sendFieldToCouplerOut() ;
+          couplersReady &= ready ;
+        }
+        if (!couplersReady) this->eventLoop() ;
+      } while (!couplersReady) ;
+
+      first=false ;
+      this->eventLoop() ;
+    } while (!workflowGraphIsCompleted) ;
+
+    for( auto field : couplerInField) couplerInFields_.push_back(field) ;
+
     // get all field coming potentially from model
     for (auto field : CField::getAll() ) if (field->getModelIn()) fieldModelIn.push_back(field) ;
@@ -1101,5 +1176,5 @@
         field->computeGridIndexToFileServer() ; // compute grid index for transfer to the server context
       }
-      setClientServerBuffer(fileOutField, true) ; // set context
+      setClientServerBuffer(fileOutField, true) ; // set buffer context
       for(auto field : fileOutField) field->sendFieldToFileServer() ;
     }
@@ -1146,4 +1221,16 @@
     }
 
+    
+    for(auto field : couplerInField) 
+    {
+      field->connectToCouplerIn(garbageCollector) ; // connect the field to server filter
+    }
+    
+    
+    for(auto field : couplerOutField) 
+    {
+      field->connectToCouplerOut(garbageCollector) ; // for now the same kind of filter that for file server
+    }
+
      // workflow startpoint => data from server on client side
     if (serviceType_==CServicesManager::CLIENT)
@@ -1151,5 +1238,5 @@
       for(auto field : fileInField) 
       {
-        field->connectToServerInput(garbageCollector) ; // connect the field to server filter
+        field->connectToServerInput(garbageCollector) ; // connect tFhe field to server filter
         field->computeGridIndexToFileServer() ; // compute grid index for transfer to the server context
         field->sendFieldToInputFileServer() ;
@@ -1162,7 +1249,14 @@
       // no filter for reading data from file => to be implemented
     }
-
-
-    if (serviceType_==CServicesManager::CLIENT || serviceType_==CServicesManager::GATHERER) this->sendCloseDefinition();
+    
+    // construct slave server list
+    if (serviceType_==CServicesManager::CLIENT || serviceType_==CServicesManager::GATHERER) 
+    {
+      for(auto field : fileOutField) slaveServers_.insert(field->getContextClient()) ; 
+      for(auto field : fileInField)  slaveServers_.insert(field->getContextClient()) ;  
+    }
+
+    for(auto& slaveServer : slaveServers_) sendCloseDefinition(slaveServer) ;
+
     if (serviceType_==CServicesManager::IO_SERVER || serviceType_==CServicesManager::OUT_SERVER)  
     {
@@ -1172,8 +1266,28 @@
     if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles();
    
-
-
+    // send signal to couplerIn context that definition phasis is done
+
+    for(auto& couplerInClient : couplerInClient_) sendCouplerInCloseDefinition(couplerInClient.second) ;
+
+    // wait until all couplerIn signal that closeDefition is done.
+    bool ok;
+    do
+    {
+      ok = true ;
+      for(auto& couplerOutClient : couplerOutClient_) ok &= isCouplerInCloseDefinition(couplerOutClient.second) ;
+      this->eventLoop() ; 
+    } while (!ok) ;
 
     return ;
+
+
+
+
+
+
+
+
+
+
     // For now, only read files with client and only one level server
     // if (hasClient && !hasServer) findEnabledReadModeFiles();      
@@ -1987,16 +2101,28 @@
              recvPostProcessing(event);
              return true;
-            case EVENT_ID_SEND_REGISTRY:
+           case EVENT_ID_SEND_REGISTRY:
              recvRegistry(event);
              return true;
              break;
-            case EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES:
+           case EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES:
              recvPostProcessingGlobalAttributes(event);
              return true;
              break;
-            case EVENT_ID_PROCESS_GRID_ENABLED_FIELDS:
+           case EVENT_ID_PROCESS_GRID_ENABLED_FIELDS:
              recvProcessingGridOfEnabledFields(event);
              return true;
              break;
+           case EVENT_ID_COUPLER_IN_READY:
+             recvCouplerInReady(event);
+             return true;
+             break;
+           case EVENT_ID_COUPLER_IN_CLOSE_DEFINITION:
+             recvCouplerInCloseDefinition(event);
+             return true;
+             break;
+           case EVENT_ID_COUPLER_IN_CONTEXT_FINALIZED:
+             recvCouplerInContextFinalized(event);
+             return true;
+             break;  
            default :
              ERROR("bool CContext::dispatchEvent(CEventServer& event)",
@@ -2009,4 +2135,5 @@
 
    //! Client side: Send a message to server to make it close
+   // ym obsolete
    void CContext::sendCloseDefinition(void)
    TRY
@@ -2035,4 +2162,22 @@
    }
    CATCH_DUMP_ATTR
+   
+   //  ! Client side: Send a message to server to make it close
+   void CContext::sendCloseDefinition(CContextClient* client)
+   TRY
+   {
+      if (sendCloseDefinition_done_.count(client)!=0) return ;
+      else sendCloseDefinition_done_.insert(client) ;
+
+      CEventClient event(getType(),EVENT_ID_CLOSE_DEFINITION);
+      if (client->isServerLeader())
+      {
+        CMessage msg;
+        for(auto rank : client->getRanksServerLeader()) event.push(rank,1,msg);
+        client->sendEvent(event);
+      }
+     else client->sendEvent(event);
+   }
+   CATCH_DUMP_ATTR
 
    //! Server side: Receive a message of client announcing a context close
@@ -2049,26 +2194,15 @@
    TRY
    {
-    int nbSrvPools ;
-    if (serviceType_==CServicesManager::CLIENT) nbSrvPools = 1 ;
-    else if (serviceType_==CServicesManager::GATHERER) nbSrvPools = this->clientPrimServer.size() ;
-    else nbSrvPools = 0 ;
-    CContextClient* contextClientTmp ;
-
-    for (int i = 0; i < nbSrvPools; ++i)
-    {
-       if (serviceType_==CServicesManager::CLIENT) contextClientTmp = client ;
-       else if (serviceType_==CServicesManager::GATHERER ) contextClientTmp = clientPrimServer[i] ;
-       CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR);
-
-         if (contextClientTmp->isServerLeader())
-         {
-           CMessage msg;
-           msg<<step;
-           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
-           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-             event.push(*itRank,1,msg);
-           contextClientTmp->sendEvent(event);
-         }
-         else contextClientTmp->sendEvent(event);
+     CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR);
+     for(auto client : slaveServers_) 
+     {
+       if (client->isServerLeader())
+       {
+         CMessage msg;
+         msg<<step;
+         for (auto& rank : client->getRanksServerLeader() ) event.push(rank,1,msg);
+         client->sendEvent(event);
+       }
+       else client->sendEvent(event);
      }
    }
@@ -2580,4 +2714,12 @@
    CATCH_DUMP_ATTR
 
+   void CContext::triggerLateFields(void)
+   TRY
+   {
+    for(auto& field : fileInFields_) field->triggerLateField() ;
+    for(auto& field : couplerInFields_) field->triggerLateField() ;
+   }
+   CATCH_DUMP_ATTR
+
    //! Update calendar in each time step
    void CContext::updateCalendar(int step)
@@ -2590,5 +2732,5 @@
         if (serviceType_==CServicesManager::CLIENT) // For now we only use server level 1 to read data
         {
-          doPreTimestepOperationsForEnabledReadModeFiles();
+          triggerLateFields();
         }
 
@@ -2771,4 +2913,131 @@
   }
   CATCH_DUMP_ATTR
+
+
+
+
+ //! Client side: Send a message  announcing that context can receive grid definition from coupling
+   void CContext::sendCouplerInReady(CContextClient* client)
+   TRY
+   {
+      if (sendCouplerInReady_done_.count(client)!=0) return ;
+      else sendCouplerInReady_done_.insert(client) ;
+
+      CEventClient event(getType(),EVENT_ID_COUPLER_IN_READY);
+
+      if (client->isServerLeader())
+      {
+        CMessage msg;
+        msg<<this->getId();
+        for (auto& rank : client->getRanksServerLeader()) event.push(rank,1,msg);
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+   }
+   CATCH_DUMP_ATTR
+
+   //! Server side: Receive a message announcing that context can send grid definition for context coupling
+   void CContext::recvCouplerInReady(CEventServer& event)
+   TRY
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      getCurrent()->recvCouplerInReady(*buffer);
+   }
+   CATCH
+
+   //! Server side: Receive a message announcing that context can send grid definition for context coupling
+   void CContext::recvCouplerInReady(CBufferIn& buffer)
+   TRY
+   {
+      string contextId ;
+      buffer>>contextId;
+      couplerInReady_.insert(getCouplerOutClient(contextId)) ;
+   }
+   CATCH_DUMP_ATTR
+
+
+
+
+
+ //! Client side: Send a message  announcing that a coupling context have done it closeDefinition, so data can be sent now.
+   void CContext::sendCouplerInCloseDefinition(CContextClient* client)
+   TRY
+   {
+      if (sendCouplerInCloseDefinition_done_.count(client)!=0) return ;
+      else sendCouplerInCloseDefinition_done_.insert(client) ;
+
+      CEventClient event(getType(),EVENT_ID_COUPLER_IN_CLOSE_DEFINITION);
+
+      if (client->isServerLeader())
+      {
+        CMessage msg;
+        msg<<this->getId();
+        for (auto& rank : client->getRanksServerLeader()) event.push(rank,1,msg);
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+   }
+   CATCH_DUMP_ATTR
+
+   //! Server side: Receive a message announcing that a coupling context have done it closeDefinition, so data can be sent now.
+   void CContext::recvCouplerInCloseDefinition(CEventServer& event)
+   TRY
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      getCurrent()->recvCouplerInCloseDefinition(*buffer);
+   }
+   CATCH
+
+   //! Server side: Receive a message announcing that a coupling context have done it closeDefinition, so data can be sent now.
+   void CContext::recvCouplerInCloseDefinition(CBufferIn& buffer)
+   TRY
+   {
+      string contextId ;
+      buffer>>contextId;
+      couplerInCloseDefinition_.insert(getCouplerOutClient(contextId)) ;
+   }
+   CATCH_DUMP_ATTR
+
+
+
+
+//! Client side: Send a message  announcing that a coupling context have done it contextFinalize, so it can also close it own context.
+   void CContext::sendCouplerInContextFinalized(CContextClient* client)
+   TRY
+   {
+      if (sendCouplerInContextFinalized_done_.count(client)!=0) return ;
+      else sendCouplerInContextFinalized_done_.insert(client) ;
+
+      CEventClient event(getType(),EVENT_ID_COUPLER_IN_CONTEXT_FINALIZED);
+
+      if (client->isServerLeader())
+      {
+        CMessage msg;
+        msg<<this->getId();
+        for (auto& rank : client->getRanksServerLeader()) event.push(rank,1,msg);
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+   }
+   CATCH_DUMP_ATTR
+
+   //! Server side: Receive a message announcing that a coupling context have done it contextFinalize, so it can also close it own context.
+   void CContext::recvCouplerInContextFinalized(CEventServer& event)
+   TRY
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      getCurrent()->recvCouplerInContextFinalized(*buffer);
+   }
+   CATCH
+
+   //! Server side: Receive a message announcing that a coupling context have done it contextFinalize, so it can also close it own context.
+   void CContext::recvCouplerInContextFinalized(CBufferIn& buffer)
+   TRY
+   {
+      string contextId ;
+      buffer>>contextId;
+      couplerInContextFinalized_.insert(getCouplerOutClient(contextId)) ;
+   }
+   CATCH_DUMP_ATTR
 
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp	(revision 1875)
@@ -57,4 +57,7 @@
            EVENT_ID_PROCESS_GRID_ENABLED_FIELDS,
            EVENT_ID_CONTEXT_FINALIZE_CLIENT,
+           EVENT_ID_COUPLER_IN_READY,
+           EVENT_ID_COUPLER_IN_CLOSE_DEFINITION,
+           EVENT_ID_COUPLER_IN_CONTEXT_FINALIZED,
          };
 
@@ -150,5 +153,5 @@
          void postProcessing();
          void postProcessingGlobalAttributes();         
-
+         void triggerLateFields(void) ;
          void solveAllRefOfEnabledFieldsAndTransform(void);
          void checkGridEnabledFields();
@@ -169,4 +172,9 @@
          // Send context close definition
          void sendCloseDefinition(void);
+       public:
+         void sendCloseDefinition(CContextClient* client) ;
+       private:
+         set<CContextClient*> sendCloseDefinition_done_ ;
+       public:
          // There are something to send on closing context defintion
          void sendUpdateCalendar(int step);
@@ -208,7 +216,34 @@
          static void recvFinalizeClient(CEventServer& event) ;
          void recvFinalizeClient(CBufferIn& buffer);
-         
-         void freeComms(void);                  //!< Free internally allcoated communicators
-         void releaseClientBuffers(void);       //! Deallocate buffers allocated by clientContexts
+        
+       public:
+         void sendCouplerInReady(CContextClient* client);
+       private:
+         set<CContextClient*> sendCouplerInReady_done_;
+       public:
+         static void recvCouplerInReady(CEventServer& event) ;
+         void recvCouplerInReady(CBufferIn& buffer) ; //!< coupler is ready to receive grid definition.
+         set<CContextClient*> couplerInReady_;
+         bool isCouplerInReady(CContextClient* client) { return couplerInReady_.count(client)!=0 ;}
+
+       public:
+        void sendCouplerInCloseDefinition(CContextClient* client) ;
+        set<CContextClient*> sendCouplerInCloseDefinition_done_;
+        static void recvCouplerInCloseDefinition(CEventServer& event) ;
+        void recvCouplerInCloseDefinition(CBufferIn& buffer) ; //!< coupler has finished it defintion, data can be sent     
+        set<CContextClient*> couplerInCloseDefinition_ ;
+        bool isCouplerInCloseDefinition(CContextClient* client) { return couplerInCloseDefinition_.count(client)!=0 ;}
+
+       public:
+        void sendCouplerInContextFinalized(CContextClient* client) ;
+        set<CContextClient*> sendCouplerInContextFinalized_done_;
+        static void recvCouplerInContextFinalized(CEventServer& event) ;
+        void recvCouplerInContextFinalized(CBufferIn& buffer) ; //!< coupler has finished it defintion, data can be sent     
+        set<CContextClient*> couplerInContextFinalized_ ;
+        bool isCouplerInContextFinalized(CContextClient* client) { return couplerInContextFinalized_.count(client)!=0 ;}
+
+       public:  
+        void freeComms(void);                  //!< Free internally allcoated communicators
+        void releaseClientBuffers(void);       //! Deallocate buffers allocated by clientContexts
 
          // dispatch event
@@ -281,4 +316,7 @@
          // but which are not part of a file
          std::vector<CField*> fieldsWithReadAccess_;
+         std::vector<CField*> couplerInFields_;
+         std::vector<CField*> fileInFields_;
+
 
          // Context root
@@ -295,8 +333,23 @@
          std::vector<CContextServer*> serverPrimServer;
          std::vector<CContextClient*> clientPrimServer;
-         std::map<std::string, CContextClient*> couplerClient_ ;
-         std::map<std::string, CContextServer*> couplerServer_ ;
-
-
+
+         // list of slave servers (IO server or others)
+         set<CContextClient*> slaveServers_ ;
+      private:
+         // the map containing context client associated to it string id for coupling out ;
+         std::map<std::string, CContextClient*> couplerOutClient_ ;
+         // the map containing context server associated to it string id for coupling out ;
+         std::map<std::string, CContextServer*> couplerOutServer_ ;
+         // the map containing context client associated to it string id for coupling in ;
+         std::map<std::string, CContextClient*> couplerInClient_ ;
+         // the map containing context server associated to it string id for coupling in ;
+         std::map<std::string, CContextServer*> couplerInServer_ ;
+      public:
+         CContextClient* getCouplerInClient(const string& contextId) { return couplerInClient_[contextId] ;}
+         CContextServer* getCouplerInServer(const string& contextId) { return couplerInServer_[contextId] ;}
+         CContextClient* getCouplerOutClient(const string& contextId) { return couplerOutClient_[contextId] ;}
+         CContextServer* getCouplerOutServer(const string& contextId) { return couplerOutServer_[contextId] ;}
+      
+  
          std::vector<std::string> primServerId_;
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp	(revision 1875)
@@ -51,4 +51,19 @@
    CATCH_DUMP_ATTR
 
+   const string& CCouplerIn::getCouplingContextId(void)
+   {
+     if (couplingContextId_.empty())
+     {
+       vector<string> vectStr=splitRegex(context,"::") ;
+       string poolId=vectStr[0] ;
+       string serviceId=poolId ;
+       string contextId=vectStr[1] ;
+       int contextLeader ;
+       int type = CServicesManager::CLIENT ;
+       couplingContextId_=CXios::getContextsManager()->getServerContextName(poolId, serviceId, 0, type, contextId) ;
+     }
+     return couplingContextId_ ;
+   }
+
    void CCouplerIn::createInterCommunicator(void)
    TRY
@@ -60,5 +75,5 @@
      }
      CContext* contextPtr = CContext::getCurrent();
-     contextPtr->addCouplingChanel(context, false) ;
+     contextPtr->addCouplingChanel(getCouplingContextId(), false) ;
    }
    CATCH_DUMP_ATTR
@@ -132,5 +147,12 @@
    CATCH
 
-
+  /*!
+   * assign the context associated to the coupler to the enabled fields
+   */
+   void  CCouplerIn::assignContext(void)
+   {
+     client_ = CContext::getCurrent()->getCouplerInClient(getCouplingContextId());
+     for (auto& field : getEnabledFields()) field->setContextClient(client_) ; 
+   }
 
    //----------------------------------------------------------------
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp	(revision 1875)
@@ -96,6 +96,18 @@
          void solveFieldRefInheritance(bool apply);
          void createInterCommunicator(void) ;
+         void assignContext(void) ;
+      
+      private:
+        CContextClient* client_=nullptr ;
+      public:
+         CContextClient* getContextClient(void) {return client_; }
+      
+      private:
+        string couplingContextId_ ;
+      public:
+        const string& getCouplingContextId(void) ;  
 
       private :
+
          CFieldGroup* virtualFieldGroup;
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp	(revision 1875)
@@ -54,4 +54,19 @@
    }
    CATCH_DUMP_ATTR
+
+   const string& CCouplerOut::getCouplingContextId(void)
+   {
+     if (couplingContextId_.empty())
+     {
+       vector<string> vectStr=splitRegex(context,"::") ;
+       string poolId=vectStr[0] ;
+       string serviceId=poolId ;
+       string contextId=vectStr[1] ;
+       int contextLeader ;
+       int type = CServicesManager::CLIENT ;
+       couplingContextId_=CXios::getContextsManager()->getServerContextName(poolId, serviceId, 0, type, contextId) ;
+     }
+     return couplingContextId_ ;
+   }
 
    std::vector<CField*> CCouplerOut::getEnabledFields(void)
@@ -75,4 +90,13 @@
    CATCH_DUMP_ATTR
 
+   /*!
+    * assign the context associated to the coupler to the enabled fields
+    */
+   void  CCouplerOut::assignContext(void)
+   {
+     client_ = CContext::getCurrent()->getCouplerOutClient(getCouplingContextId());
+     for (auto& field : getEnabledFields()) field->setContextClient(client_) ; 
+   }
+
       /*!
    \brief Get virtual field group
@@ -133,5 +157,5 @@
      }
      CContext* contextPtr = CContext::getCurrent();
-     contextPtr->addCouplingChanel(context, true) ;
+     contextPtr->addCouplingChanel(getCouplingContextId(), true) ;
    }
    CATCH_DUMP_ATTR
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp	(revision 1875)
@@ -96,6 +96,16 @@
         void buildFilterGraphOfEnabledFields(CGarbageCollector& gc);
         void checkGridOfEnabledFields(void) ;
-
-      private :
+        void assignContext(void) ;
+      private:
+        // the contextClient associated to the context Id attribute
+        CContextClient* client_=nullptr ;
+      public: 
+        CContextClient* getContextClient(void) {return client_; }
+      
+      private:
+        string couplingContextId_ ;
+      public:
+        const string& getCouplingContextId(void) ;  
+      private:
          CFieldGroup* virtualFieldGroup;
 
@@ -118,3 +128,3 @@
 } // namespace xios
 
-#endif // __XIOS_CCouplingIn__
+#endif // __XIOS_CCouplingIn__2
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 1875)
@@ -2101,4 +2101,33 @@
   }
 
+  void CDomain::sendDomainToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid)
+  {
+    if (sendDomainToFileServer_done_.count(client)!=0) return ;
+    else sendDomainToFileServer_done_.insert(client) ;
+    
+    const string domainId = "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId ;
+    
+    if (!domain_ref.isEmpty())
+    {
+      auto domain_ref_tmp=domain_ref.getValue() ;
+      domain_ref.reset() ; // remove the reference, find an other way to do that more cleanly
+      this->sendAllAttributesToServer(client, domainId)  ;
+      domain_ref = domain_ref_tmp ;
+    }
+    else this->sendAllAttributesToServer(client, domainId)  ;
+
+    this->sendDistributionAttributes(client, domainId);   
+    this->sendIndex(client, domainId);       
+    this->sendLonLat(client, domainId);
+    this->sendArea(client, domainId);    
+    this->sendDataIndex(client, domainId);
+  }
+
+  void CDomain::makeAliasForCoupling(const string& fieldId, int posInGrid)
+  {
+    const string domainId = "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId ;
+    this->createAlias(domainId) ;
+  }
+
   /*!
     Send all attributes from client to connected clients
@@ -2119,9 +2148,10 @@
     Send global index from client to connected client(s)
   */
-  void CDomain::sendIndex(CContextClient* client)
+  void CDomain::sendIndex(CContextClient* client, const string& domainId)
   TRY
   {
+    string serverDomainId = domainId.empty() ? this->getId() : domainId ;
+    
     int ns, n, i, j, ind, nv, idx;
-   
     int serverSize = client->serverSize;
     CEventClient eventIndex(getType(), EVENT_ID_INDEX);
@@ -2146,5 +2176,5 @@
 
       list_msgsIndex.push_back(CMessage());
-      list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix
+      list_msgsIndex.back() << serverDomainId << (int)type; // enum ne fonctionne pour les message => ToFix
       list_msgsIndex.back() << isCurvilinear;
       list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back();
@@ -2161,7 +2191,9 @@
     it calculates this distribution then sends it to the corresponding clients on the next level
   */
-  void CDomain::sendDistributionAttributes(CContextClient* client)
+  void CDomain::sendDistributionAttributes(CContextClient* client, const string& domainId)
   TRY
   {
+    string serverDomainId = domainId.empty() ? this->getId() : domainId ;
+
     int nbServer = client->serverSize;
     std::vector<int> nGlobDomain(2);
@@ -2192,5 +2224,5 @@
         msgs.push_back(CMessage());
         CMessage& msg = msgs.back();
-        msg << this->getId() ;
+        msg << serverDomainId ;
         msg << isUnstructed_;
         msg << ni_srv << ibegin_srv << nj_srv << jbegin_srv;
@@ -2209,9 +2241,10 @@
     Send area from client to connected client(s)
   */
-  void CDomain::sendArea(CContextClient* client)
+  void CDomain::sendArea(CContextClient* client, const string& domainId)
   TRY
   {
     if (!hasArea) return;
-
+    string serverDomainId = domainId.empty() ? this->getId() : domainId ;
+    
     int ns, n, i, j, ind, nv, idx;
     int serverSize = client->serverSize;
@@ -2242,5 +2275,5 @@
 
       list_msgsArea.push_back(CMessage());
-      list_msgsArea.back() << this->getId() << hasArea;
+      list_msgsArea.back() <<serverDomainId << hasArea;
       list_msgsArea.back() << list_area.back();
       eventArea.push(rank, nbSenders[serverSize][rank], list_msgsArea.back());
@@ -2255,9 +2288,10 @@
     Because longitude and latitude are optional, this function only called if latitude and longitude exist
   */
-  void CDomain::sendLonLat(CContextClient* client)
+  void CDomain::sendLonLat(CContextClient* client, const string& domainId)
   TRY
   {
     if (!hasLonLat) return;
-
+    string serverDomainId = domainId.empty() ? this->getId() : domainId ;
+    
     int ns, n, i, j, ind, nv, idx;
     int serverSize = client->serverSize;
@@ -2316,5 +2350,5 @@
       list_msgsLat.push_back(CMessage());
 
-      list_msgsLon.back() << this->getId() << hasLonLat;
+      list_msgsLon.back() << serverDomainId << hasLonLat;
       if (hasLonLat) 
         list_msgsLon.back() << list_lon.back();
@@ -2325,5 +2359,5 @@
       }
 
-      list_msgsLat.back() << this->getId() << hasLonLat;
+      list_msgsLat.back() << serverDomainId << hasLonLat;
       if (hasLonLat)
         list_msgsLat.back() << list_lat.back();
@@ -2348,7 +2382,9 @@
     The compressed index are represented with 1 and others are represented with -1
   */
-  void CDomain::sendDataIndex(CContextClient* client)
+  void CDomain::sendDataIndex(CContextClient* client, const string& domainId)
   TRY
   {
+    string serverDomainId = domainId.empty() ? this->getId() : domainId ;
+    
     int ns, n, i, j, ind, nv, idx;
     int serverSize = client->serverSize;
@@ -2406,5 +2442,5 @@
 
       list_msgsDataIndex.push_back(CMessage());
-      list_msgsDataIndex.back() << this->getId();
+      list_msgsDataIndex.back() << serverDomainId ;
       list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back();
       eventDataIndex.push(rank, nbSenders[serverSize][rank], list_msgsDataIndex.back());
@@ -2614,5 +2650,6 @@
            << "The number of sending clients is not correct."
            << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
-
+    
+    int nbLonInd = 0;
     vector<CArray<double,1> > recvLonValue(nbReceived);
     vector<CArray<double,2> > recvBoundsLonValue(nbReceived);    
@@ -2631,5 +2668,4 @@
     if (hasLonLat)
     {
-      int nbLonInd = 0;
       for (i = 0; i < nbReceived; ++i)
       {
@@ -2665,4 +2701,39 @@
         }
       }       
+    }
+
+   // setup attribute depending the type of domain
+    if (hasLonLat)
+    {
+      nbLonInd = globalLocalIndexMap_.size();
+      if (ni*nj != nbLonInd)
+        ERROR("void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers)",
+             << "The number of index received is not coherent with the given resolution"
+             << "nbLonInd=" << nbLonInd << ", ni=" << ni <<", nj"<<ni<<" ni*nj="<<ni*nj);
+
+      if (type == type_attr::rectilinear || type == type_attr::curvilinear)
+      {
+        lonvalue_2d.resize(ni,nj);
+          for(int ij=0, j=0 ; j<nj ; j++)
+            for(int i=0 ; i<ni; i++, ij++) lonvalue_2d(i,j) = lonvalue(ij) ;
+        
+        if (hasBounds)
+        {
+          bounds_lon_2d.resize(nvertex, ni, nj) ;
+          for(int ij=0, j=0 ; j<nj ; j++)
+            for(int i=0 ; i<ni; i++, ij++) 
+              for(int nv=0; nv<nvertex; nv++) bounds_lon_2d(nv,i,j) = bounds_lonvalue(nv,ij) ;
+        }
+      }
+    }
+    else if (type == type_attr::unstructured || type == type_attr::gaussian)
+    {
+      lonvalue_1d.resize(nbLonInd);
+      lonvalue_1d = lonvalue ;
+      if (hasBounds)
+      {
+        bounds_lon_1d.resize(nvertex, nbLonInd) ;
+        bounds_lon_1d = bounds_lonvalue ;
+      }
     }
   }
@@ -2717,7 +2788,7 @@
     }
 
+    int nbLatInd = 0;
     if (hasLonLat)
     {
-      int nbLatInd = 0;
       for (i = 0; i < nbReceived; ++i)
       {
@@ -2756,4 +2827,44 @@
       }       
     }
+      // setup attribute depending the type of domain
+    if (hasLonLat)
+    {
+      nbLatInd = globalLocalIndexMap_.size();
+      
+      if (ni*nj != nbLatInd)
+        ERROR("void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers)",
+             << "The number of index received is not coherent with the given resolution"
+            << "nbLonInd=" << nbLatInd << ", ni=" << ni <<", nj"<<ni<<" ni*nj="<<ni*nj);
+
+      if (type == type_attr::rectilinear || type == type_attr::curvilinear)
+      {
+        {
+          latvalue_2d.resize(ni,nj);
+          for(int ij=0, j=0 ; j<nj ; j++)
+            for(int i=0 ; i<ni; i++, ij++) latvalue_2d(i,j) = latvalue(ij) ;
+        
+          if (hasBounds)
+          {
+            bounds_lat_2d.resize(nvertex, ni, nj) ;
+            for(int ij=0, j=0 ; j<nj ; j++)
+              for(int i=0 ; i<ni; i++, ij++) 
+                for(int nv=0; nv<nvertex; nv++) bounds_lat_2d(nv,i,j) = bounds_latvalue(nv,ij) ;
+          }
+        }
+      }
+      else if (type == type_attr::unstructured || type == type_attr::gaussian)
+      {
+        if (hasLonLat)
+        {
+          latvalue_1d.resize(nbLatInd);
+          latvalue_1d = latvalue ;
+          if (hasBounds)
+          {
+            bounds_lat_1d.resize(nvertex, nbLatInd) ;
+            bounds_lon_1d = bounds_lonvalue ;
+          }
+        }
+      }
+    } 
   }
   CATCH_DUMP_ATTR
@@ -3016,40 +3127,5 @@
   }
   CATCH_DUMP_ATTR
-
-  /*!
-  \brief Check if a domain is completed
-  Before make any domain processing, we must be sure that all domain informations have
-  been sent, for exemple when reading a grid in a file or when grid elements are sent by an
-  other context (coupling). So all direct reference of the domain (domain_ref) must be also completed
-  \return true if domain and domain reference are completed
-  */
-  bool CDomain::checkIfCompleted(void)
-  {
-    if (hasDirectDomainReference()) if (!getDirectDomainReference()->checkIfCompleted()) return false;
-    return isCompleted_ ;
-  }
-
-  /*!
-  \brief Set a domain as completed
-   When all information about a domain have been received, the domain is tagged as completed and is
-   suitable for processing
-  */
-  void CDomain::setCompleted(void)
-  {
-    if (hasDirectDomainReference()) getDirectDomainReference()->setCompleted() ;
-    isCompleted_=true ;
-  }
-
-  /*!
-  \brief Set a domain as uncompleted
-   When informations about a domain are expected from a grid reading from file or coupling, the domain is 
-   tagged as uncompleted and is not suitable for processing
-  */
-  void CDomain::setUncompleted(void)
-  {
-    if (hasDirectDomainReference()) getDirectDomainReference()->setUncompleted() ;
-    isCompleted_=false ;
-  }
-  
+    
   /*!
    * Go through the hierarchy to find the domain from which the transformations must be inherited
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp	(revision 1875)
@@ -111,8 +111,24 @@
 
          static bool dispatchEvent(CEventServer& event);
-
-         bool checkIfCompleted(void) ;
-         void setCompleted(void) ;
-         void setUncompleted(void) ;
+      
+      private:
+         /** define if the domain is completed or not ie all attributes have been received before in case 
+             of grid reading from file or coupling */ 
+         bool isCompleted_=true ;  
+      public:     
+        /*!
+           \brief Check if a domain is completed
+           Before make any domain processing, we must be sure that all domain informations have
+           been sent, for exemple when reading a grid in a file or when grid elements are sent by an
+           other context (coupling). So all direct reference of the domain (domain_ref) must be also completed
+           \return true if domain and domain reference are completed
+          */
+         bool isCompleted(void)
+         {
+           if (hasDirectDomainReference()) if (!getDirectDomainReference()->isCompleted()) return false;
+           else return isCompleted_ ;
+         }
+         void setCompleted(void) { isCompleted_=true ; }
+         void unsetCompleted(void) { isCompleted_=false ; }
 
       public:
@@ -190,11 +206,20 @@
          std::set<CContextClient*> sendDomainToFileServer_done_ ;
        private:
-         
+         public:
+         void sendDomainToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid) ;
+       private:
+         std::set<CContextClient*> sendDomainToCouplerOut_done_ ;
+      
+       public:
+        void makeAliasForCoupling(const string& fieldId, int posInGrid) ;
+
+       private:
+
          void sendAttributes(); // ym obsolete -> to be removed
-         void sendIndex(CContextClient* client);
-         void sendDistributionAttributes(CContextClient* client);
-         void sendArea(CContextClient* client);
-         void sendLonLat(CContextClient* client);         
-         void sendDataIndex(CContextClient* client);
+         void sendIndex(CContextClient* client, const string& domainId="");
+         void sendDistributionAttributes(CContextClient* client, const string& domainId="");
+         void sendArea(CContextClient* client, const string& domainId="");
+         void sendLonLat(CContextClient* client, const string& domainId="");         
+         void sendDataIndex(CContextClient* client, const string& domainId="");
          void convertLonLatValue();
          void fillInRectilinearLonLat();
@@ -228,8 +253,4 @@
          bool isClientChecked; // Verify whether all attributes of domain on the client side are good
          bool isClientAfterTransformationChecked;
-         
-         /** define if the domain is completed or not ie all attributes have been received before in case 
-             of grid reading from file or coupling */ 
-         bool isCompleted_=true ;  
 
 /** global index of the domain on server side, sent by the clients. This is global index for lon, lat, mask elements (ie non masked elements)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 1875)
@@ -133,5 +133,9 @@
           return true;
           break;
-
+     
+        case EVENT_ID_GRID_COMPLETED :
+          recvGridCompleted(event);
+          return true;
+          break;
         default :
           ERROR("bool CField::dispatchEvent(CEventServer& event)", << "Unknown Event");
@@ -142,5 +146,5 @@
   CATCH
 
-  void CField::sendUpdateData(const CArray<double,1>& data, CContextClient* client)
+  void CField::sendUpdateData(Time timeStamp, const CArray<double,1>& data, CContextClient* client)
   TRY
   {
@@ -169,5 +173,5 @@
             for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n));
 
-            list_msg.back() << getId() << data_tmp;
+            list_msg.back() << getId() << timeStamp << data_tmp;
             event.push(rank, 1, list_msg.back());
           }
@@ -189,5 +193,5 @@
         for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n));
 
-        list_msg.back() << getId() << data_tmp;
+        list_msg.back() << getId() << timeStamp << data_tmp;
         event.push(rank, grid_->nbSenders_[receiverSize][rank], list_msg.back());
       }
@@ -219,9 +223,18 @@
   CATCH
 
+
   void  CField::recvUpdateData(std::map<int,CBufferIn*>& rankBuffers)
   TRY
   {
+    if (hasCouplerIn()) recvUpdateDataFromCoupler(rankBuffers) ;
+    else recvUpdateDataFromClient(rankBuffers) ;
+  }
+  CATCH
+
+  void  CField::recvUpdateDataFromClient(std::map<int,CBufferIn*>& rankBuffers)
+  TRY
+  {
     CContext* context = CContext::getCurrent();
-
+    Time timeStamp ;
     size_t sizeData = 0;
     if (0 == recvDataSrv.numElements())
@@ -249,5 +262,5 @@
         CArray<double,1> tmp;
         CArray<size_t,1>& indexTmp = it->second;
-        *(rankBuffers[it->first]) >> tmp;
+        *(rankBuffers[it->first]) >> timeStamp >> tmp;
         for (int idx = 0; idx < indexTmp.numElements(); ++idx) recv_data_tmp(indexTmp(idx)) = tmp(idx);
       }
@@ -552,4 +565,39 @@
   CATCH
 
+  
+  void CField::recvUpdateDataFromCoupler(std::map<int,CBufferIn*>& rankBuffers)
+  TRY
+  {
+    CContext* context = CContext::getCurrent();
+    Time timeStamp ;
+    if (wasDataAlreadyReceivedFromServer)
+    {  
+      lastDataReceivedFromServer = lastDataReceivedFromServer + freq_op;
+    }
+    else
+    {
+      // unlikely to input from file server where data are received at ts=0
+      // for coupling, it would be after the first freq_op, because for now we don't have
+      // restart mecanism to send the value at ts=0. It mus be changed in future
+      lastDataReceivedFromServer = context->getCalendar()->getInitDate()+freq_op;
+      wasDataAlreadyReceivedFromServer = true;
+    }
+
+    CArray<int,1>& storeClient = grid_->getStoreIndex_client();
+    CArray<double,1> recv_data_tmp(storeClient.numElements());  
+
+    auto& outLocalIndexStoreOnClient = grid_-> getOutLocalIndexStoreOnClient() ;
+    for (auto it = outLocalIndexStoreOnClient.begin(); it != outLocalIndexStoreOnClient.end(); ++it)
+    {
+      CArray<double,1> tmp;
+      CArray<size_t,1>& indexTmp = it->second;
+      *(rankBuffers[it->first]) >> timeStamp >> tmp;
+      for (int idx = 0; idx < indexTmp.numElements(); ++idx) recv_data_tmp(indexTmp(idx)) = tmp(idx);
+    }
+    
+    clientSourceFilter->streamData(lastDataReceivedFromServer, recv_data_tmp);
+    
+  }
+  CATCH_DUMP_ATTR
   /*!
     Receive read data from server
@@ -596,4 +644,42 @@
   }
   CATCH_DUMP_ATTR
+
+  void CField::checkForLateDataFromCoupler(void)
+  TRY
+  {
+    CContext* context = CContext::getCurrent();
+    const CDate& currentDate = context->getCalendar()->getCurrentDate();
+
+    CTimer timer("CField::checkForLateDataFromCoupler");
+    timer.resume();
+    traceOff() ;
+    timer.suspend();
+      
+    bool isDataLate;
+    do
+    {
+      const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + freq_op) : context->getCalendar()->getInitDate();
+      isDataLate = (nextDataDue <= currentDate);
+
+      if (isDataLate)
+      {
+        timer.resume();
+//ym          context->checkBuffersAndListen();
+//ym            context->eventLoop();
+        context->globalEventLoop();
+
+        timer.suspend();
+      }
+    } while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout);
+    
+    timer.resume();
+    traceOn() ;
+    timer.suspend() ;
+
+    if (isDataLate) ERROR("void CField::checkForLateDataFromCoupler(void)",
+                            << "Late data at timestep = " << currentDate);
+  }
+  CATCH_DUMP_ATTR
+
 
   void CField::checkForLateDataFromServer(void)
@@ -640,4 +726,21 @@
   }
   CATCH_DUMP_ATTR
+
+  void CField::triggerLateField(void)
+  TRY
+  {
+    if (hasFileIn()) 
+    {
+      checkForLateDataFromServer() ;
+      serverSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ;
+    } 
+    else if (hasCouplerIn())
+    {
+      checkForLateDataFromCoupler() ;
+      clientSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ;
+    }
+  }
+  CATCH_DUMP_ATTR
+
 
   void CField::checkIfMustAutoTrigger(void)
@@ -1140,4 +1243,5 @@
   {
     if (buildWorkflowGraphDone_) return true ;
+    
     const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
     const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0);
@@ -1152,4 +1256,8 @@
     }
 
+    // now construct grid and check if element are enabled
+    solveGridReference() ; // grid_ is now defined
+    if (!isGridCompleted()) return false;
+
     // Check if we have an expression to parse
     std::shared_ptr<COutputPin> filterExpr ;
@@ -1161,7 +1269,4 @@
     }
     
-    // now construct grid and check if element are enabled
-    solveGridReference() ; // grid_ is now defined
-    
     // prepare transformation. Need to know before if workflow of auxillary field can be built
     if (hasDirectFieldReference())
@@ -1173,7 +1278,7 @@
       for(auto grid : gridPath)
       {
-        if (!grid->checkIfCompleted()) return false ;
         grid->solveElementsRefInheritance() ;
-        grid_->completeGrid(gridSrc); // grid generation, to be checked
+        grid->completeGrid(gridSrc); // grid generation, to be checked
+        grid->checkElementsAttributes() ;
         grid->prepareTransformGrid(gridSrc) ; // prepare the grid tranformation
         for(auto fieldId : grid->getAuxInputTransformGrid()) // try to build workflow graph for auxillary field tranformation
@@ -1205,6 +1310,4 @@
     else 
     {
-      if (!grid_->checkIfCompleted()) return false ;
-      
       if (hasFileIn()) // input file, attemp to read the grid from file
       {
@@ -1221,5 +1324,10 @@
          instantDataFilter=inputFilter ;
       }  
-      else 
+      else if (hasCouplerIn())
+      {
+        grid_->checkElementsAttributes() ;
+        instantDataFilter=inputFilter ;
+      }
+      else
       {
         setModelIn() ; // no reference, the field is potentially a source field from model
@@ -1256,4 +1364,11 @@
     // insert temporal filter before sending to files
     getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(fileWriterFilter, 0);
+  } 
+
+  void CField::connectToCouplerOut(CGarbageCollector& gc)
+  {
+    // insert temporal filter before sending to files
+    fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, client));
+    instantDataFilter->connectOutput(fileWriterFilter, 0);
   } 
 
@@ -1303,4 +1418,24 @@
     serverSourceFilter -> connectOutput(inputFilter,0) ;
   } 
+
+  /*!
+   * Connect field to a source filter to receive data from coupler (on client side).
+   */
+   void CField::connectToCouplerIn(CGarbageCollector& gc)
+  {
+    CContext* context = CContext::getCurrent();
+
+    if (freq_op.isEmpty()) freq_op.setValue(TimeStep);
+    if (freq_offset.isEmpty()) freq_offset.setValue(freq_op.getValue() - TimeStep);
+
+    freq_operation_srv = freq_op ;
+    last_operation_srv = context->getCalendar()->getInitDate();
+    const CDuration toffset = freq_operation_srv - freq_offset.getValue() - context->getCalendar()->getTimeStep();
+    last_operation_srv     = last_operation_srv - toffset;
+
+    clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid_, false, false, freq_offset, true)) ;
+    clientSourceFilter -> connectOutput(inputFilter,0) ;
+  } 
+
 
   /*!
@@ -2021,12 +2156,9 @@
   CATCH_DUMP_ATTR
 
-  CContextClient* CField::getContextClient()
-  TRY
-  {
-    return client;
-  }
-  CATCH
-
-  
+  void CField::sendCloseDefinition(void)
+  {
+    CContext::getCurrent()->sendCloseDefinition(client) ;
+  }
+
   void CField::sendFieldToFileServer(void)
   {
@@ -2037,5 +2169,59 @@
     this->sendAddAllVariables(client);
   }
+
+  void CField::sendFieldToCouplerOut(void)
+  {
+    if (sendFieldToCouplerOut_done_) return ;
+    else sendFieldToCouplerOut_done_=true ;
+    grid_->sendGridToCouplerOut(client, this->getId());
+    this->sendGridCompleted();
+
+  }
   
+  void CField::makeGridAliasForCoupling(void) 
+  { 
+    grid_->makeAliasForCoupling(this->getId()); 
+  }
+
+ //! Client side: Send a message  announcing that the grid definition has been received from a coupling context
+   void CField::sendGridCompleted(void)
+   TRY
+   {
+      CEventClient event(getType(),EVENT_ID_GRID_COMPLETED);
+
+      if (client->isServerLeader())
+      {
+        CMessage msg;
+        msg<<this->getId();
+        for (auto& rank : client->getRanksServerLeader()) event.push(rank,1,msg);
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+   }
+   CATCH_DUMP_ATTR
+
+   //! Server side: Receive a message announcing that the grid definition has been received from a coupling context
+   void CField::recvGridCompleted(CEventServer& event)
+   TRY
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvGridCompleted(*buffer);
+   }
+   CATCH
+
+   //! Server side: Receive a message  message  announcing that the grid definition has been received from a coupling context
+   void CField::recvGridCompleted(CBufferIn& buffer)
+   TRY
+   {
+      setGridCompleted() ;
+   }
+   CATCH_DUMP_ATTR
+
+
+
+
+
   void CField::sendFieldToInputFileServer(void)
   {
@@ -2145,7 +2331,5 @@
   TRY
   {
-    bool isFieldRead  = getRelFile() && !getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::read;
-    bool isFieldWrite = getRelFile() && ( getRelFile()->mode.isEmpty() ||  getRelFile()->mode == CFile::mode_attr::write);
-    if (isFieldRead && !(operation.getValue() == "instant" || operation.getValue() == "once") )     
+    if (hasFileIn() && !(operation.getValue() == "instant" || operation.getValue() == "once") )     
       ERROR("void CField::checkTimeAttributes(void)",
          << "Unsupported operation for field '" << getFieldOutputName() << "'." << std::endl
@@ -2156,10 +2340,10 @@
       if (operation.getValue() == "instant")
       {
-        if (isFieldRead || isFieldWrite) freq_op.setValue(getRelFile()->output_freq.getValue());
+        if (hasFileIn() || hasFileOut()) freq_op.setValue(getRelFile()->output_freq.getValue());
         else freq_op=*freqOp ;
       }
       else freq_op.setValue(TimeStep);
     }
-    if (freq_offset.isEmpty()) freq_offset.setValue(isFieldRead ? NoneDu : (freq_op.getValue() - TimeStep));
+    if (freq_offset.isEmpty()) freq_offset.setValue(hasFileIn() ? NoneDu : (freq_op.getValue() - TimeStep));
   }
   CATCH_DUMP_ATTR
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 1875)
@@ -78,5 +78,5 @@
          {
            EVENT_ID_UPDATE_DATA, EVENT_ID_READ_DATA, EVENT_ID_READ_DATA_READY,
-           EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP
+           EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_GRID_COMPLETED
          };
 
@@ -111,7 +111,6 @@
          std::map<int, StdSize> getGridDataBufferSize(CContextClient* client, bool bufferForWriting = false);
 
-         void setContextClient(CContextClient* newContextClient);
-         CContextClient* getContextClient();
-
+       public:
+          void makeGridAliasForCoupling(void) ;
        public:
          bool isActive(bool atCurrentTimestep = false) const;
@@ -144,4 +143,12 @@
 
          void sendFieldToFileServer(void) ;
+         void sendCloseDefinition(void) ;
+      
+      public:
+         void sendFieldToCouplerOut(void) ;
+      private:
+         bool sendFieldToCouplerOut_done_=false;
+      public:
+
          void sendFieldToInputFileServer(void) ;
 
@@ -177,7 +184,10 @@
         void sendAllAttributesToServer(CContextClient* client) ; 
         void sendUpdateData(const CArray<double,1>& data);
-        void sendUpdateData(const CArray<double,1>& data, CContextClient* client);
+        void sendUpdateData(Time timestamp, const CArray<double,1>& data, CContextClient* client);
         static void recvUpdateData(CEventServer& event);
         void recvUpdateData(std::map<int,CBufferIn*>& rankBuffers);
+        void recvUpdateDataFromClient(std::map<int,CBufferIn*>& rankBuffers);
+        void recvUpdateDataFromCoupler(std::map<int,CBufferIn*>& rankBuffers);
+        
         void writeField(void);
         bool sendReadDataRequest(const CDate& tsDataRequested, CContextClient* client);
@@ -188,7 +198,12 @@
         static void recvReadDataReady(CEventServer& event);
         void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers);
+        void recvDataFromCoupler(vector<int> ranks, vector<CBufferIn*> buffers) ;
         void checkForLateDataFromServer(void);
-        void checkIfMustAutoTrigger(void);
-        void autoTriggerIfNeeded(void);
+        void checkForLateDataFromCoupler(void) ;
+
+        void checkIfMustAutoTrigger(void); // ym obsolete
+        void autoTriggerIfNeeded(void); //ym obsolete
+        void triggerLateField(void) ;
+
         void outputField(CArray<double,3>& fieldOut);
         void outputField(CArray<double,2>& fieldOut);
@@ -227,4 +242,6 @@
 
         void connectToFileServer(CGarbageCollector& gc) ;
+        void connectToCouplerOut(CGarbageCollector& gc) ;
+        void connectToCouplerIn(CGarbageCollector& gc) ;
         void connectToModelInput(CGarbageCollector& gc) ;
         void connectToFileWriter(CGarbageCollector& gc) ;
@@ -241,4 +258,18 @@
                                                  map<CContextClient*,map<int,size_t>>& maxEventSize, 
                                                  bool bufferForWriting) ;
+      private:
+          bool isGridCompleted_ = true ;
+      public:
+          bool isGridCompleted() { return isGridCompleted_ ;} 
+          void setGridCompleted(void) { isGridCompleted_= true; }
+          void unsetGridCompleted(void) { isGridCompleted_ = false ;}
+      
+      public:     
+          void sendGridCompleted(void) ;
+      private:   
+          static void recvGridCompleted(CEventServer& event);
+          void recvGridCompleted(CBufferIn& buffer);
+
+
       private:
         std::vector<CGrid*> getGridPath(void) ;
@@ -315,4 +346,9 @@
       private:
          CContextClient* client;
+      public:
+         void setContextClient(CContextClient* newContextClient);
+         CContextClient* getContextClient(void) {return client;}
+
+      private:
 
          bool areAllReferenceSolved;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 1875)
@@ -102,4 +102,11 @@
    }
    CATCH
+   
+   /*!
+    * Get the local data grid size, ie the size of the compressed grid (inside the workflow)
+    * \return The size od the compressed grid
+    */
+    StdSize  CGrid::getLocalDataSize(void) { return getClientDistribution()->getLocalDataSize();}
+
 
    /*!
@@ -326,4 +333,5 @@
    CATCH_DUMP_ATTR
 
+   //ym obsolete -> to be removed later
    void CGrid::checkMaskIndex(bool doSendingIndex)
    TRY
@@ -334,6 +342,6 @@
        if (this->isChecked && doSendingIndex && !isIndexSent) 
        { 
-         if (isScalarGrid())  sendIndexScalarGrid();
-         else  sendIndex();
+         if (isScalarGrid())  /*sendIndexScalarGrid()*/;
+         else  /*sendIndex()*/;
          this->isIndexSent = true; 
        }
@@ -1453,46 +1461,117 @@
   CATCH_DUMP_ATTR
 
-  void CGrid::sendIndexScalarGrid()
-  TRY
-  {
+  void CGrid::sendIndexScalarGrid(CContextClient* client, const string& gridId)
+  TRY
+  {
+    if (sendIndexScalarGrid_done_.count(client)!=0) return ;
+    else sendIndexScalarGrid_done_.insert(client) ;
+
     CContext* context = CContext::getCurrent();
-    storeIndex_toSrv_.clear();
-    std::list<CContextClient*>::iterator it;
-
-    for (it=clients.begin(); it!=clients.end(); ++it)
-    {
-      CContextClient* client = *it;
-      int receiverSize = client->serverSize;
-
-      CEventClient event(getType(), EVENT_ID_INDEX);
-      list<CMessage> listMsg;
-      list<CArray<size_t,1> > listOutIndex;
-
+    
+    string serverGridId = gridId.empty() ? serverGridId=this->getId() : serverGridId=gridId ;
+
+    int receiverSize = client->serverSize;
+
+    CEventClient event(getType(), EVENT_ID_INDEX);
+    list<CMessage> listMsg;
+    list<CArray<size_t,1> > listOutIndex;
+
+    if (client->isServerLeader())
+    {
+      const std::list<int>& ranks = client->getRanksServerLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+      {
+        int rank = *itRank;
+        int nb = 1;
+        storeIndex_toSrv_[client].insert(std::make_pair(rank, CArray<int,1>(nb)));
+        listOutIndex.push_back(CArray<size_t,1>(nb));
+
+        CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv_[client][rank];
+        CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
+
+        for (int k = 0; k < nb; ++k)
+        {
+          outGlobalIndexOnServer(k) = 0;
+          outLocalIndexToServer(k)  = 0;
+        }
+
+        if (context->getServiceType()==CServicesManager::CLIENT)  // -> what about for coupling probably unusefull to be check
+          storeIndex_fromSrv_.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
+
+        listMsg.push_back(CMessage());
+        listMsg.back() << serverGridId << isCompressible_ << listOutIndex.back();
+
+        event.push(rank, 1, listMsg.back());
+      }
+      client->sendEvent(event);
+    }
+    else
+    {
+      const std::list<int>& ranks = client->getRanksServerNotLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+      {
+        int rank = *itRank;
+        int nb = 1;          
+        CArray<int, 1> outLocalIndexToServer(nb);
+        for (int k = 0; k < nb; ++k)
+        {
+          outLocalIndexToServer(k)  = 0;
+        }
+
+        if (context->getServiceType()==CServicesManager::CLIENT)
+          storeIndex_fromSrv_.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
+      }
+      client->sendEvent(event);
+    }
+  }
+  CATCH_DUMP_ATTR
+
+  void CGrid::sendIndex(CContextClient* client, const string& gridId)
+  TRY
+  {
+    if (sendIndex_done_.count(client)!=0) return ;
+    else sendIndex_done_.insert(client) ;
+    CContext* context = CContext::getCurrent();
+    string serverGridId = gridId.empty() ? this->getId() : gridId ;
+
+
+
+    int receiverSize = client->serverSize;
+
+    CEventClient event(getType(), EVENT_ID_INDEX);
+    int rank;
+    list<CMessage> listMsg;
+    list<CArray<size_t,1> > listOutIndex;
+    const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = getClientDistribution()->getGlobalLocalDataSendToServer();
+    CDistributionClient::GlobalLocalDataMap::const_iterator itbIndex = globalLocalIndexSendToServer.begin(), itIndex,
+                                                            iteIndex = globalLocalIndexSendToServer.end();
+    itIndex = itbIndex;                                                              
+
+    if (!doGridHaveDataDistributed(client))
+    {
       if (client->isServerLeader())
       {
+        int indexSize = globalLocalIndexSendToServer.size();
+        CArray<size_t,1> outGlobalIndexOnServer(indexSize);
+        CArray<int,1> outLocalIndexToServer(indexSize);
+        for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
+        {
+          outGlobalIndexOnServer(idx) = itIndex->first;
+          outLocalIndexToServer(idx) = itIndex->second;
+        }
+
         const std::list<int>& ranks = client->getRanksServerLeader();
         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
         {
-          int rank = *itRank;
-          int nb = 1;
-          storeIndex_toSrv_[client].insert(std::make_pair(rank, CArray<int,1>(nb)));
-          listOutIndex.push_back(CArray<size_t,1>(nb));
-
-          CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv_[client][rank];
-          CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
-
-          for (int k = 0; k < nb; ++k)
-          {
-            outGlobalIndexOnServer(k) = 0;
-            outLocalIndexToServer(k)  = 0;
-          }
-
-          if (context->getServiceType()==CServicesManager::CLIENT)  
-            storeIndex_fromSrv_.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
+          storeIndex_toSrv_[client].insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+          if (context->getServiceType()==CServicesManager::CLIENT)  // -> what about for coupling probably unusefull to be check
+            storeIndex_fromSrv_.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+          
+          listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
 
           listMsg.push_back(CMessage());
-          listMsg.back() << getId( )<< isCompressible_ << listOutIndex.back();
-
-          event.push(rank, 1, listMsg.back());
+          listMsg.back() << serverGridId << isCompressible_ << listOutIndex.back();
+
+          event.push(*itRank, 1, listMsg.back());
         }
         client->sendEvent(event);
@@ -1500,143 +1579,69 @@
       else
       {
-        const std::list<int>& ranks = client->getRanksServerNotLeader();
-        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         int indexSize = globalLocalIndexSendToServer.size();
+         CArray<int,1> outLocalIndexToServer(indexSize);
+         for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
+         {
+           outLocalIndexToServer(idx) = itIndex->second;
+         }
+
+         const std::list<int>& ranks = client->getRanksServerNotLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         {
+           storeIndex_fromSrv_.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+         }
+         client->sendEvent(event);
+       }
+    }
+    else
+    {
+      CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itGlobalMap;
+      itGlobalMap = globalIndexOnServer_[receiverSize].begin();
+      iteGlobalMap = globalIndexOnServer_[receiverSize].end();
+
+      std::map<int,std::vector<int> >localIndexTmp;
+      std::map<int,std::vector<size_t> > globalIndexTmp;
+      for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
+      {
+        int serverRank = itGlobalMap->first;
+        int indexSize = itGlobalMap->second.size();
+        const std::vector<size_t>& indexVec = itGlobalMap->second;
+        for (int idx = 0; idx < indexSize; ++idx)
         {
-          int rank = *itRank;
-          int nb = 1;          
-          CArray<int, 1> outLocalIndexToServer(nb);
-          for (int k = 0; k < nb; ++k)
+          itIndex = globalLocalIndexSendToServer.find(indexVec[idx]);
+          if (iteIndex != itIndex)
           {
-            outLocalIndexToServer(k)  = 0;
-          }
-
-          if (context->getServiceType()==CServicesManager::CLIENT)
-            storeIndex_fromSrv_.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
-        }
-        client->sendEvent(event);
-      }
-    }
-  }
-  CATCH_DUMP_ATTR
-
-  void CGrid::sendIndex(void)
-  TRY
-  {
-    CContext* context = CContext::getCurrent();
-    storeIndex_toSrv_.clear();
-    std::list<CContextClient*>::iterator it;
-
-    for (it=clients.begin(); it!=clients.end(); ++it)
-    {
-      CContextClient* client = *it;
-      int receiverSize = client->serverSize;
-
-      CEventClient event(getType(), EVENT_ID_INDEX);
-      int rank;
-      list<CMessage> listMsg;
-      list<CArray<size_t,1> > listOutIndex;
-      const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = getClientDistribution()->getGlobalLocalDataSendToServer();
-      CDistributionClient::GlobalLocalDataMap::const_iterator itbIndex = globalLocalIndexSendToServer.begin(), itIndex,
-                                                              iteIndex = globalLocalIndexSendToServer.end();
-      itIndex = itbIndex;                                                              
-
-      if (!doGridHaveDataDistributed(client))
-      {
-        if (client->isServerLeader())
-        {
-          int indexSize = globalLocalIndexSendToServer.size();
-          CArray<size_t,1> outGlobalIndexOnServer(indexSize);
-          CArray<int,1> outLocalIndexToServer(indexSize);
-          for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
-          {
-            outGlobalIndexOnServer(idx) = itIndex->first;
-            outLocalIndexToServer(idx) = itIndex->second;
-          }
-
-          const std::list<int>& ranks = client->getRanksServerLeader();
-          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-          {
-            storeIndex_toSrv_[client].insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-            if (context->getServiceType()==CServicesManager::CLIENT)
-              storeIndex_fromSrv_.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-            
-            listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
-
-            listMsg.push_back(CMessage());
-            listMsg.back() << getId() << isCompressible_ << listOutIndex.back();
-
-            event.push(*itRank, 1, listMsg.back());
-          }
-          client->sendEvent(event);
-        }
-        else
-        {
-           int indexSize = globalLocalIndexSendToServer.size();
-           CArray<int,1> outLocalIndexToServer(indexSize);
-           for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
-           {
-             outLocalIndexToServer(idx) = itIndex->second;
-           }
-
-           const std::list<int>& ranks = client->getRanksServerNotLeader();
-           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           {
-             storeIndex_fromSrv_.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-           }
-           client->sendEvent(event);
-         }
-      }
-      else
-      {
-        CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itGlobalMap;
-        itGlobalMap = globalIndexOnServer_[receiverSize].begin();
-        iteGlobalMap = globalIndexOnServer_[receiverSize].end();
-
-        std::map<int,std::vector<int> >localIndexTmp;
-        std::map<int,std::vector<size_t> > globalIndexTmp;
-        for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-        {
-          int serverRank = itGlobalMap->first;
-          int indexSize = itGlobalMap->second.size();
-          const std::vector<size_t>& indexVec = itGlobalMap->second;
-          for (int idx = 0; idx < indexSize; ++idx)
-          {
-            itIndex = globalLocalIndexSendToServer.find(indexVec[idx]);
-            if (iteIndex != itIndex)
-            {
-              globalIndexTmp[serverRank].push_back(itIndex->first);
-              localIndexTmp[serverRank].push_back(itIndex->second);
-            }
+            globalIndexTmp[serverRank].push_back(itIndex->first);
+            localIndexTmp[serverRank].push_back(itIndex->second);
           }
         }
-
-        for (int ns = 0; ns < connectedServerRank_[receiverSize].size(); ++ns)
+      }
+
+      for (int ns = 0; ns < connectedServerRank_[receiverSize].size(); ++ns)
+      {
+        rank = connectedServerRank_[receiverSize][ns];
+        int nb = 0;
+        if (globalIndexTmp.end() != globalIndexTmp.find(rank))
+          nb = globalIndexTmp[rank].size();
+
+        storeIndex_toSrv_[client].insert(make_pair(rank, CArray<int,1>(nb)));
+        listOutIndex.push_back(CArray<size_t,1>(nb));
+
+        CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv_[client][rank];
+        CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
+
+        for (int k = 0; k < nb; ++k)
         {
-          rank = connectedServerRank_[receiverSize][ns];
-          int nb = 0;
-          if (globalIndexTmp.end() != globalIndexTmp.find(rank))
-            nb = globalIndexTmp[rank].size();
-
-          storeIndex_toSrv_[client].insert(make_pair(rank, CArray<int,1>(nb)));
-          listOutIndex.push_back(CArray<size_t,1>(nb));
-
-          CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv_[client][rank];
-          CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
-
-          for (int k = 0; k < nb; ++k)
-          {
-            outGlobalIndexOnServer(k) = globalIndexTmp[rank].at(k);
-            outLocalIndexToServer(k)  = localIndexTmp[rank].at(k);
-          }
-
-          storeIndex_fromSrv_.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
-          listMsg.push_back(CMessage());
-          listMsg.back() << getId()  << isCompressible_ << listOutIndex.back();
-
-          event.push(rank, nbSenders_[receiverSize][rank], listMsg.back());
+          outGlobalIndexOnServer(k) = globalIndexTmp[rank].at(k);
+          outLocalIndexToServer(k)  = localIndexTmp[rank].at(k);
         }
 
-        client->sendEvent(event);
-      }
+        storeIndex_fromSrv_.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
+        listMsg.push_back(CMessage());
+        listMsg.back() << serverGridId  << isCompressible_ << listOutIndex.back();
+
+        event.push(rank, nbSenders_[receiverSize][rank], listMsg.back());
+      }
+      client->sendEvent(event);
     }
   }
@@ -2235,9 +2240,44 @@
     gridPtr->sendCreateChild(this->getId(),client);
     this->sendAllAttributesToServer(client);
-    if (isScalarGrid())  sendIndexScalarGrid();
-    else  sendIndex();
+    if (isScalarGrid())  sendIndexScalarGrid(client);
+    else  sendIndex(client);
     this->sendAllDomains(client);
     this->sendAllAxis(client);
     this->sendAllScalars(client);
+  }
+
+  void CGrid::sendGridToCouplerOut(CContextClient* client, const string& fieldId)
+  {
+    if (sendGridToCouplerOut_done_.count(client)!=0) return ;
+    else sendGridToCouplerOut_done_.insert(client) ;
+    string gridId="_grid_of_"+fieldId ;
+    this->sendAllAttributesToServer(client, gridId);
+    
+    if (isScalarGrid())  sendIndexScalarGrid(client, gridId);
+    else sendIndex(client, gridId);
+
+    const auto& domVect = getDomains() ;
+    for (int pos=0; pos<domVect.size();pos++) domVect[pos]->sendDomainToCouplerOut(client, fieldId, pos);
+
+    const auto& axisVect=getAxis() ;
+    for (int pos=0; pos<axisVect.size();pos++) axisVect[pos]->sendAxisToCouplerOut(client, getGlobalDimension(), getAxisPositionInGrid()[pos], fieldId, pos);
+
+    const auto& scalVect=getScalars() ;
+    for (int pos=0; pos<scalVect.size();pos++) scalVect[pos]->sendScalarToCouplerOut(client, fieldId, pos);
+  }
+
+  void CGrid::makeAliasForCoupling(const string& fieldId)
+  {
+    string gridId="_grid_of_"+fieldId ;
+    createAlias(gridId) ;
+    
+    const auto& domVect = getDomains() ;
+    for (int pos=0; pos<domVect.size();pos++) domVect[pos]->makeAliasForCoupling(fieldId, pos);
+
+    const auto& axisVect=getAxis() ;
+    for (int pos=0; pos<axisVect.size();pos++) axisVect[pos]->makeAliasForCoupling(fieldId, pos);
+
+    const auto& scalVect=getScalars() ;
+    for (int pos=0; pos<scalVect.size();pos++) scalVect[pos]->makeAliasForCoupling(fieldId, pos);
   }
 
@@ -2365,13 +2405,45 @@
   other context (coupling)
   */
-  bool CGrid::checkIfCompleted(void)
+  bool CGrid::isCompleted(void)
   {
     setDomainList();
-    for (auto domainId : domList_) if (!CDomain::get(domainId)->checkIfCompleted()) return false ;
+    for (auto domainId : domList_) if (!CDomain::get(domainId)->isCompleted()) return false ;
     setAxisList() ;
-    for (auto axisId : axisList_) if (!CAxis::get(axisId)->checkIfCompleted()) return false ;
+    for (auto axisId : axisList_) if (!CAxis::get(axisId)->isCompleted()) return false ;
     setScalarList() ;
-    for (auto scalarId : scalarList_) if (!CScalar::get(scalarId)->checkIfCompleted()) return false ;
+    for (auto scalarId : scalarList_) if (!CScalar::get(scalarId)->isCompleted()) return false ;
     return true ;
+  }
+
+  /*!
+  \brief impose that all elements of the grid are complete
+  Before make any grid processing, we must be sure that all grid information elements have
+  been sent, for exemple when reading a grid in a file or when grid elements are sent by an
+  other context (coupling)
+  */
+  void CGrid::setCompleted(void)
+  {
+    setDomainList();
+    for (auto domainId : domList_) CDomain::get(domainId)->setCompleted() ;
+    setAxisList() ;
+    for (auto axisId : axisList_) CAxis::get(axisId)->setCompleted() ;
+    setScalarList() ;
+    for (auto scalarId : scalarList_) CScalar::get(scalarId)->setCompleted() ;
+  }
+
+/*!
+  \brief impose that all elements of the grid are incomplete
+  Before make any grid processing, we must be sure that all grid information elements have
+  been sent, for exemple when reading a grid in a file or when grid elements are sent by an
+  other context (coupling)
+  */
+  void CGrid::unsetCompleted(void)
+  {
+    setDomainList();
+    for (auto domainId : domList_) CDomain::get(domainId)->unsetCompleted() ;
+    setAxisList() ;
+    for (auto axisId : axisList_) CAxis::get(axisId)->unsetCompleted() ;
+    setScalarList() ;
+    for (auto scalarId : scalarList_) CScalar::get(scalarId)->unsetCompleted() ;
   }
 
@@ -2904,8 +2976,8 @@
       clientsSet.insert(contextClient);
     }
-    for (int i=0; i<this->getDomains().size(); i++)
-    	this->getDomains()[i]->setContextClient(contextClient);
-    for (int i=0; i<this->getAxis().size(); i++)
-    	this->getAxis()[i]->setContextClient(contextClient);
+    for (auto domain : getDomains()) domain->setContextClient(contextClient);
+    for (auto axis : getAxis()) axis->setContextClient(contextClient);
+    for (auto scalar : getScalars()) scalar->setContextClient(contextClient);
+   
   }
   CATCH_DUMP_ATTR
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1875)
@@ -90,4 +90,10 @@
 
          StdSize  getDataSize(void) ;
+
+         /**
+          * Get the local data grid size, ie the size of the compressed grid (inside the workflow)
+          * \return The size od the compressed grid
+          */
+         StdSize  getLocalDataSize(void) ;
 
          /// Entrees-sorties de champs
@@ -151,5 +157,13 @@
       private:
          std::set<CContextClient*> sendGridToFileServer_done_ ;
-      
+     
+      public:
+         void sendGridToCouplerOut(CContextClient* client, const string& fieldId) ;
+      private:
+         std::set<CContextClient*> sendGridToCouplerOut_done_ ;
+
+      public:
+         void makeAliasForCoupling(const string& fieldId) ;
+
       public:
          void sendAddDomain(const std::string& id,CContextClient* contextClient);
@@ -170,7 +184,16 @@
          static void recvIndex(CEventServer& event);
          void recvIndex(vector<int> ranks, vector<CBufferIn*> buffers, CContextServer* server);
-         void sendIndex(void);
-         void sendIndexScalarGrid();
-
+       
+       public:  
+         void sendIndex(CContextClient* client, const string& gridId="");
+       private:
+          set<CContextClient*> sendIndex_done_ ;
+       
+       public:
+         void sendIndexScalarGrid(CContextClient* client, const string& gridId="");
+       private:
+          set<CContextClient*> sendIndexScalarGrid_done_ ;
+      
+       public:
          void setContextClient(CContextClient* contextClient);
 
@@ -221,5 +244,8 @@
          bool hasTransform();
          size_t getGlobalWrittenSize(void) ;
-         bool checkIfCompleted(void) ;
+         
+         bool isCompleted(void) ;
+         void setCompleted(void) ;
+         void unsetCompleted(void) ;
 
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 1875)
@@ -68,42 +68,4 @@
 
   }
-
-  /*!
-  \brief Check if a scalar is completed
-  Before make any scalar processing, we must be sure that all scalar informations have
-  been sent, for exemple when reading a grid in a file or when grid elements are sent by an
-  other context (coupling). So all direct reference of the scalar (scalar_ref) must be also completed
-  \return true if scalar and scalar reference are completed
-  */
-  bool CScalar::checkIfCompleted(void)
-  {
-    if (hasDirectScalarReference()) if (!getDirectScalarReference()->checkIfCompleted()) return false;
-    return isCompleted_ ;
-  }
-
-  /*!
-  \brief Set a scalar as completed
-   When all information about a scalar have been received, the scalar is tagged as completed and is
-   suitable for processing
-  */
-  void CScalar::setCompleted(void)
-  {
-    if (hasDirectScalarReference()) getDirectScalarReference()->setCompleted() ;
-    isCompleted_=true ;
-  }
-
-  /*!
-  \brief Set a scalar as uncompleted
-   When informations about a scalar are expected from a grid reading from file or coupling, the scalar is 
-   tagged as uncompleted and is not suitable for processing
-  */
-  void CScalar::setUncompleted(void)
-  {
-    if (hasDirectScalarReference()) getDirectScalarReference()->setUncompleted() ;
-    isCompleted_=false ;
-  }
-
-
-
 
   /*!
@@ -187,14 +149,50 @@
         refScalar[i]->setTransformations(scalar->getAllTransformations());
   }
-
+ 
   void CScalar::sendScalarToFileServer(CContextClient* client)
   {
     if (sendScalarToFileServer_done_.count(client)!=0) return ;
     else sendScalarToFileServer_done_.insert(client) ;
-
     StdString scalarDefRoot("scalar_definition");
     CScalarGroup* scalarPtr = CScalarGroup::get(scalarDefRoot);
     this->sendAllAttributesToServer(client);
   }
+
+  void CScalar::sendScalarToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid)
+  {
+    if (sendScalarToCouplerOut_done_.count(client)!=0) return ;
+    else sendScalarToCouplerOut_done_.insert(client) ;
+
+    string scalarId="_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ;
+   
+    if (!scalar_ref.isEmpty())
+    {
+      auto scalar_ref_tmp=scalar_ref.getValue() ;
+      scalar_ref.reset() ; // remove the reference, find an other way to do that more cleanly
+      this->sendAllAttributesToServer(client, scalarId)  ;
+      scalar_ref = scalar_ref_tmp ;
+    }
+    else this->sendAllAttributesToServer(client, scalarId)  ;
+
+
+    this->sendAllAttributesToServer(client, scalarId);
+  }  
+
+  void CScalar::makeAliasForCoupling(const string& fieldId, int posInGrid)
+  {
+    const string scalarId = "_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ;
+    this->createAlias(scalarId) ;
+  }
+
+  void CScalar::setContextClient(CContextClient* contextClient)
+  TRY
+  {
+    if (clientsSet.find(contextClient)==clientsSet.end())
+    {
+      clients.push_back(contextClient) ;
+      clientsSet.insert(contextClient);
+    }
+  }
+  CATCH_DUMP_ATTR
   /*!
     Parse children nodes of a scalar in xml file.
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp	(revision 1875)
@@ -72,13 +72,17 @@
             void checkAttributesOnClient();
             virtual void parse(xml::CXMLNode & node);
-
-            bool checkIfCompleted(void) ;
-            void setCompleted(void) ;
-            void setUncompleted(void) ;
-         
+        
          public:
             void sendScalarToFileServer(CContextClient* client) ;
          private:
             std::set<CContextClient*> sendScalarToFileServer_done_ ;
+
+         public:
+            void sendScalarToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid) ;
+         private:
+            std::set<CContextClient*> sendScalarToCouplerOut_done_ ;
+         
+         public:
+            void makeAliasForCoupling(const string& fieldId, int posInGrid) ;
 
          public:
@@ -89,5 +93,11 @@
            CTransformation<CScalar>* addTransformation(ETranformationType transType, const StdString& id="");
            bool isEqual(CScalar* scalar);
-
+        private:  
+          /** Clients that have to send a scalar. There can be multiple clients in case of secondary server, otherwise only one client. */
+         std::list<CContextClient*> clients;
+         std::set<CContextClient*> clientsSet;
+        public:
+          void setContextClient(CContextClient* contextClient) ;
+        
          private:
            std::set<StdString> relFiles;
@@ -103,6 +113,25 @@
            /** define if the scalar is completed or not ie all attributes have been received before in case 
                of grid reading from file or coupling */ 
-           bool isCompleted_=true ;  
+      private:
+         /** define if the scalar is completed or not ie all attributes have been received before in case 
+             of grid reading from file or coupling */ 
+         bool isCompleted_=true ;  
+      public:     
+         /*!
+           \brief Check if a scalar is completed
+           Before make any scalar processing, we must be sure that all scalar informations have
+           been sent, for exemple when reading a grid in a file or when grid elements are sent by an
+           other context (coupling). So all direct reference of the scalar (scalar_ref) must be also completed
+           \return true if scalar and scalar reference are completed
+          */
+         bool isCompleted(void)
+         {
+           if (hasDirectScalarReference()) if (!getDirectScalarReference()->isCompleted()) return false;
+           else return isCompleted_ ;
+         }
+         void setCompleted(void) { isCompleted_=true ; }
+         void unsetCompleted(void) { isCompleted_=false ; }
 
+      private:
             DECLARE_REF_FUNC(Scalar,scalar)
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp	(revision 1875)
@@ -56,8 +56,8 @@
          static void ClearAllAttributes(void);
          std::map<int, size_t> getMinimumBufferSizeForAttributes(CContextClient* client);
-         void sendAttributToServer(const string& id, CContextClient* client);
-         void sendAttributToServer(CAttribute& attr, CContextClient* client) ;
-         void sendAllAttributesToServer(CContextClient* client);
-         void sendAddItem(const string& id, int itemType, CContextClient* client);
+         void sendAttributToServer(const string& id, CContextClient* client, const string& objectId="");
+         void sendAttributToServer(CAttribute& attr, CContextClient* client, const string& objectId="") ;
+         void sendAllAttributesToServer(CContextClient* client, const string& objectId="");
+         void sendAddItem(const string& id, int itemType, CContextClient* client, const string& objectId="");
          static void recvAttributFromClient(CEventServer& event) ;
          static bool dispatchEvent(CEventServer& event) ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp	(revision 1875)
@@ -216,5 +216,5 @@
 
    template<typename T>
-   void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client)
+   void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client, const string& objectId)
    {
      CAttributeMap& attrMap = *this;
@@ -222,10 +222,10 @@
      for (; it != itE; ++it)
      {
-       if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second), client);
+       if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second), client, objectId);
      }
    }
 
    template <class T>
-   void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client)
+   void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client, const string& objectId )
    {
       CAttributeMap & attrMap = *this;
@@ -235,5 +235,5 @@
 
   template <class T>
-  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, CContextClient* client)
+  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, CContextClient* client, const string& objectId)
   {
     CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
@@ -241,5 +241,6 @@
     {
       CMessage msg;
-      msg<<this->getId(); 
+      if (objectId.empty()) msg << this->getId();
+      else msg << objectId;
       msg << attr.getName();
       msg << attr;
@@ -254,5 +255,5 @@
 /* specialisation for context, because context Id on client is not the same on server, and no need to transfer context Id */
   template <>
-  void CObjectTemplate<CContext>::sendAttributToServer(CAttribute& attr, CContextClient* client)
+  void CObjectTemplate<CContext>::sendAttributToServer(CAttribute& attr, CContextClient* client, const string& objectId)
   {
     CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
@@ -278,5 +279,5 @@
 
   template<class T>
-  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, CContextClient* client)
+  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, CContextClient* client, const string& objectId)
   {
     typedef typename T::EEventId ItemType;
@@ -285,5 +286,6 @@
      {
        CMessage msg;
-       msg << this->getId();
+       if (objectId.empty()) msg << this->getId();
+       else msg << objectId;
        msg << id;
        const std::list<int>& ranks = client->getRanksServerLeader();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/test/generic_testcase.f90
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/test/generic_testcase.f90	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/test/generic_testcase.f90	(revision 1875)
@@ -1860,8 +1860,8 @@
         bounds_lon(3,i,j)=bounds_lon_glo(1,ibegin+i)
         bounds_lon(4,i,j)=bounds_lon_glo(2,ibegin+i)
-        bounds_lat(1,i,j)=bounds_lat_glo(1,ibegin+i)
-        bounds_lat(2,i,j)=bounds_lat_glo(1,ibegin+i)
-        bounds_lat(3,i,j)=bounds_lat_glo(2,ibegin+i)
-        bounds_lat(4,i,j)=bounds_lat_glo(2,ibegin+i)
+        bounds_lat(1,i,j)=bounds_lat_glo(1,jbegin+j)
+        bounds_lat(2,i,j)=bounds_lat_glo(1,jbegin+j)
+        bounds_lat(3,i,j)=bounds_lat_glo(2,jbegin+j)
+        bounds_lat(4,i,j)=bounds_lat_glo(2,jbegin+j)
 
         ij=(j+offset_j)*(ni+2*offset_i)+i+offset_i
@@ -1908,4 +1908,5 @@
       CALL xios_set_domain_attr(TRIM(domain_id), nj_glo=nj_glo, jbegin=jbegin, nj=nj, data_jbegin=-offset_j, data_nj=nj+2*offset_j)
       CALL xios_set_domain_attr(TRIM(domain_id), data_dim=2, lonvalue_2d=lon, latvalue_2d=lat, mask_1d=return_mask)
+      CALL xios_set_domain_attr(TRIM(domain_id), bounds_lon_2d=bounds_lon, bounds_lat_2d=bounds_lat, nvertex=4)
     ENDIF
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp	(revision 1875)
@@ -171,4 +171,11 @@
       step=(domainSrc_->lat_end-domainSrc_->lat_start)/domainSrc_->nj_glo ;
       for (int i=0; i<domainSrc_->ni_glo; ++i) lat_g(i)=domainSrc_->lat_start+i*step ;
+    }
+    else if (!domainSrc_->lonvalue.isEmpty() && !domainSrc_->latvalue.isEmpty())  // data can come possibly from coupler so only lonvalue and latvalue are defined ?
+    {
+      CArray<double,1> lon(niSrc), lat(njSrc) ;
+      for(int i=0; i< niSrc;++i) lon(i) = domainSrc_->lonvalue(i) ;
+      for(int j=0, n=0; j<njSrc; ++j, n+=niSrc) lat(j) = domainSrc_->latvalue(n) ;
+      domainSrc_->AllgatherRectilinearLonLat(lon, lat, lon_g, lat_g) ;
     }
     else ERROR("void CDomainAlgorithmInterpolate::computeRemap()",<<"Cannot compute bounds for rectilinear domain") ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/type/type_decl.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/type/type_decl.cpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/type/type_decl.cpp	(revision 1875)
@@ -33,8 +33,14 @@
   
   macro(string)
+  macro(char)
+  macro(short)
   macro(int)
+  macro(unsigned int)
+  macro(long)
+  macro(unsigned long)
+  macro(long long)
+  macro(unsigned long long)
   macro(double)
   macro(bool)
-  macro(StdSize)
   macro(CDate)
   macro(CDuration)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/type/type_util.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/type/type_util.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/type/type_util.hpp	(revision 1875)
@@ -76,5 +76,7 @@
   macro(unsigned int)
   macro(long)
+  macro(long long)
   macro(unsigned long)
+  macro(unsigned long long)
   macro(float)
   macro(double)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/xios_spl.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/xios_spl.hpp	(revision 1874)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/xios_spl.hpp	(revision 1875)
@@ -49,7 +49,9 @@
 typedef std::size_t        StdSize;
 
-typedef  unsigned short int   ushort;
-typedef  unsigned int         uint;
-typedef  unsigned long int    ulong;
+typedef  unsigned short int      ushort;
+typedef  unsigned int            uint;
+typedef  unsigned long int       ulong;
+typedef  long long int           longlong;
+typedef  unsigned long long int  ulonglong;
 
 const size_t stringArrayLen=255 ;
