Index: /XIOS/trunk/bld.cfg
===================================================================
--- /XIOS/trunk/bld.cfg	(revision 488)
+++ /XIOS/trunk/bld.cfg	(revision 489)
@@ -31,5 +31,5 @@
 bld::target libxios.a
 #bld::target generate_fortran_interface.exe 
-bld::target xios_server.exe test_client.exe parse_xml.exe
+bld::target xios_server.exe test_client.exe parse_xml.exe test_complete.exe test_xios_interface.exe
 bld::exe_dep
 
Index: /XIOS/trunk/inputs/COMPLETE/context_surface.xml
===================================================================
--- /XIOS/trunk/inputs/COMPLETE/context_surface.xml	(revision 488)
+++ /XIOS/trunk/inputs/COMPLETE/context_surface.xml	(revision 489)
@@ -17,4 +17,5 @@
 	<variable id="my_attribute2" type="integer" > 10 </variable>
 	<variable id="my_attribute3" type="float" >6.8</variable>
+	<variable id="my_attribute4" type="double" >100.201</variable>
       </field>
       <field field_ref="field_A_srf_K" />
@@ -31,4 +32,5 @@
 	<variable id="my_attribute2" type="integer" >10</variable>
 	<variable id="my_attribute3" type="float" >6.8</variable>
+	<variable id="my_attribute4" type="double" >100.201</variable>
       </field>
       <field field_ref="field_A_srf_K" />
@@ -38,4 +40,5 @@
       <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" long_name="Average of hourly maximum over 1d" operation="average" freq_op="1h" > @field_A_srf_max </field>
       <variable id="my_global_attribute" type="string" >file_1d</variable>
+      <variable id="my_global_attribute_bool" type="boolean" >false</variable>
     </file>
   </file_definition>
Index: /XIOS/trunk/src/context_server.cpp
===================================================================
--- /XIOS/trunk/src/context_server.cpp	(revision 488)
+++ /XIOS/trunk/src/context_server.cpp	(revision 489)
@@ -38,10 +38,10 @@
     pendingEvent=true ;
   }
-  
+
   bool CContextServer::hasPendingEvent(void)
   {
     return pendingEvent ;
   }
-  
+
   bool CContextServer::eventLoop(void)
   {
@@ -58,7 +58,7 @@
     int count ;
     char * addr ;
-    MPI_Status status; 
+    MPI_Status status;
     map<int,CServerBuffer*>::iterator it;
-    
+
     for(rank=0;rank<commSize;rank++)
     {
@@ -66,10 +66,10 @@
       {
         traceOff() ;
-        MPI_Iprobe(rank,20,interComm,&flag,&status);     
+        MPI_Iprobe(rank,20,interComm,&flag,&status);
         traceOn() ;
         if (flag==true)
         {
           it=buffers.find(rank) ;
-          if (it==buffers.end()) 
+          if (it==buffers.end())
             it=(buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer))).first ;
           MPI_Get_count(&status,MPI_CHAR,&count) ;
@@ -84,5 +84,5 @@
     }
   }
-  
+
   void CContextServer::checkPendingRequest(void)
   {
@@ -94,5 +94,5 @@
     int count ;
     MPI_Status status ;
-    
+
     for(it=pendingRequest.begin();it!=pendingRequest.end();it++)
     {
@@ -108,6 +108,6 @@
       }
     }
-    
-    for(itRecv=recvRequest.begin();itRecv!=recvRequest.end();itRecv++) 
+
+    for(itRecv=recvRequest.begin();itRecv!=recvRequest.end();itRecv++)
     {
       pendingRequest.erase(*itRecv) ;
@@ -115,8 +115,8 @@
     }
   }
-  
+
   void CContextServer::processRequest(int rank, char* buff,int count)
   {
-    
+
     CBufferIn buffer(buff,count) ;
     char* startBuffer,endBuffer ;
@@ -124,5 +124,5 @@
     size_t timeLine ;
     map<size_t,CEventServer*>::iterator it ;
-       
+
     while(count>0)
     {
@@ -136,16 +136,16 @@
 
       buffer.advance(size) ;
-      count=buffer.remain() ;           
-    } 
-  
-  }
-    
+      count=buffer.remain() ;
+    }
+
+  }
+
   void CContextServer::processEvents(void)
   {
     map<size_t,CEventServer*>::iterator it ;
     CEventServer* event ;
-    
+
     it=events.find(currentTimeLine) ;
-    if (it!=events.end()) 
+    if (it!=events.end())
     {
       event=it->second ;
@@ -162,10 +162,10 @@
      }
    }
-       
+
   CContextServer::~CContextServer()
   {
     map<int,CServerBuffer*>::iterator it ;
-    for(it=buffers.begin();it!=buffers.end();++it) delete it->second ; 
-  } 
+    for(it=buffers.begin();it!=buffers.end();++it) delete it->second ;
+  }
 
 
@@ -178,5 +178,5 @@
     list<CEventServer::SSubEvent>::iterator it ;
     CContext::setCurrent(context->getId()) ;
-        
+
     if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE)
     {
@@ -198,4 +198,5 @@
     else if (event.classId==CFile::GetType()) CFile::dispatchEvent(event) ;
     else if (event.classId==CFileGroup::GetType()) CFileGroup::dispatchEvent(event) ;
+    else if (event.classId==CVariable::GetType()) CVariable::dispatchEvent(event) ;
     else
     {
Index: /XIOS/trunk/src/interface/c/icdata.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icdata.cpp	(revision 488)
+++ /XIOS/trunk/src/interface/c/icdata.cpp	(revision 489)
@@ -6,4 +6,5 @@
 #include <boost/shared_ptr.hpp>
 #include <string>
+#include <cstring>
 #include <iostream>
 
@@ -32,7 +33,7 @@
 
    // ----------------------- RedÃ©finition de types ----------------------------
-   
+
    typedef enum { NETCDF4 = 0 } XFileType;
-   
+
    typedef xios::CContext * XContextPtr;
 
@@ -40,13 +41,13 @@
    void cxios_init_server(void)
    {
-     CXios::initServerSide();      
+     CXios::initServerSide();
    }
 
    void cxios_init_client(const char * client_id , int len_client_id, MPI_Fint* f_local_comm, MPI_Fint* f_return_comm )
    {
-      std::string str; 
+      std::string str;
       MPI_Comm local_comm ;
       MPI_Comm return_comm ;
-      
+
       if (!cstr2string(client_id, len_client_id, str)) return;
 
@@ -63,7 +64,7 @@
    void cxios_context_initialize(const char * context_id , int len_context_id, MPI_Fint* f_comm)
    {
-     std::string str; 
+     std::string str;
      MPI_Comm comm ;
-     
+
      if (!cstr2string(context_id, len_context_id, str)) return;
      CTimer::get("XIOS").resume() ;
@@ -74,9 +75,9 @@
      CTimer::get("XIOS").suspend() ;
    }
- 
+
    void cxios_context_is_initialized(const char * context_id , int len_context_id, bool* initialized)
    {
-     std::string str; 
-     
+     std::string str;
+
      if (!cstr2string(context_id, len_context_id, str)) return;
      CTimer::get("XIOS").resume() ;
@@ -84,6 +85,6 @@
      *initialized=context->isInitialized() ;
      CTimer::get("XIOS").suspend() ;
-   }  
-   
+   }
+
     void cxios_context_close_definition()
    {
@@ -94,5 +95,5 @@
      CTimer::get("XIOS close definition").suspend() ;
      CTimer::get("XIOS").suspend() ;
-   }  
+   }
 
    void cxios_context_finalize()
@@ -105,5 +106,5 @@
      CTimer::get("XIOS").suspend() ;
    }
-   
+
    void cxios_finalize()
    {
@@ -119,13 +120,246 @@
      context->solveAllInheritance(false) ;
      CTimer::get("XIOS").suspend() ;
-   } 
-   
+   }
+
+   /*! \brief This group of functions retrieve variable information from the configuration file (.xml)
+    *
+    * These functions provide intermediate C interfaces to get variable information of the configuration file (e.x iodef.xml),
+    * from a Fortran one, for example the value of a variable with id = "using_server".
+    * Each function corresponds to each basic type.
+    * \param varId        [in] id of the variable that we'd like to get
+    * \param varIdSize    [in] size of the variable type (integer, float, double, string)
+    * \param dataInt      [in/out] the retrieved data
+    * \param isVarExisted [in/out] Verify whether variable with varId exists
+   */
+   void cxios_get_variable_data_k8(const char * varId, int varIdSize, double * data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS get variable data").resume();
+
+      CContext* context = CContext::getCurrent();
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        *data = CVariable::get(context->getId(),varIdStr)->getData<double>();
+      }
+
+      CTimer::get("XIOS get variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_get_variable_data_k4(const char * varId, int varIdSize, float * data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS get variable data").resume();
+
+      CContext* context = CContext::getCurrent();
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        *data = CVariable::get(context->getId(),varIdStr)->getData<float>();
+      }
+
+      CTimer::get("XIOS get variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_get_variable_data_int(const char * varId, int varIdSize, int * data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS get variable data").resume();
+
+      CContext* context = CContext::getCurrent();
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        *data = CVariable::get(context->getId(),varIdStr)->getData<int>();
+      }
+
+      CTimer::get("XIOS get variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_get_variable_data_logic(const char * varId, int varIdSize, bool * data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS get variable data").resume();
+
+      CContext* context = CContext::getCurrent();
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        *data = CVariable::get(context->getId(),varIdStr)->getData<bool>();
+      }
+
+      CTimer::get("XIOS get variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_get_variable_data_char(const char * varId, int varIdSize, char * data, int dataSizeIn, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS get variable data").resume();
+
+      CContext* context = CContext::getCurrent();
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        int dataSizeOut = CVariable::get(context->getId(),varIdStr)->getData<string>().length();
+        strncpy(data, CVariable::get(context->getId(),varIdStr)->getData<string>().c_str(), std::min(dataSizeIn, dataSizeOut));
+      }
+
+      CTimer::get("XIOS get variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   /*! \brief This group of functions write information into existing variable in the configuration file (.xml)
+    *
+    *  These functions provide intermediate C interfaces to get variable information of the configuration file (e.x iodef.xml),
+    * from a Fortran one, for example the value of a variable with id = "using_server".
+    * Each function corresponds to each basic type.
+    * \param varId        [in] id of the variable that we'd like to get
+    * \param varIdSize    [in] size of the variable type (integer, float, double, string)
+    * \param data         [in] the input data
+    * \param isVarExisted [in/out] Verify whether variable with varId exists
+   */
+   void cxios_set_variable_data_k8(const char * varId, int varIdSize, double data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS set variable data").resume();
+
+      CContext* context = CContext::getCurrent() ;
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        CVariable::get(context->getId(),varIdStr)->setData<double>(data);
+        CVariable::get(context->getId(),varIdStr)->sendValue();
+      }
+
+      CTimer::get("XIOS set variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_set_variable_data_k4(const char * varId, int varIdSize, float data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS set variable data").resume();
+
+      CContext* context = CContext::getCurrent() ;
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        CVariable::get(context->getId(),varIdStr)->setData<float>(data);
+        CVariable::get(context->getId(),varIdStr)->sendValue();
+      }
+
+      CTimer::get("XIOS set variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_set_variable_data_int(const char * varId, int varIdSize, int data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS set variable data").resume();
+
+      CContext* context = CContext::getCurrent() ;
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        CVariable::get(context->getId(),varIdStr)->setData<int>(data);
+        CVariable::get(context->getId(),varIdStr)->sendValue();
+      }
+
+
+      CTimer::get("XIOS set variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_set_variable_data_logic(const char * varId, int varIdSize, bool data, bool * isVarExisted)
+   {
+      std::string varIdStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS set variable data").resume();
+
+      CContext* context = CContext::getCurrent() ;
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        CVariable::get(context->getId(),varIdStr)->setData<bool>(data);
+        CVariable::get(context->getId(),varIdStr)->sendValue();
+      }
+
+      CTimer::get("XIOS set variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   void cxios_set_variable_data_char(const char * varId, int varIdSize, const char * data, int dataSizeIn, bool * isVarExisted)
+   {
+      std::string varIdStr, dataStr;
+      if (!cstr2string(varId, varIdSize, varIdStr)) return;
+      if (!cstr2string(data, dataSizeIn, dataStr))
+      {
+        *isVarExisted = false;
+        return;
+      }
+
+      CTimer::get("XIOS").resume();
+      CTimer::get("XIOS set variable data").resume();
+
+      CContext* context = CContext::getCurrent() ;
+      *isVarExisted = CVariable::has(context->getId(), varIdStr);
+
+      if (*isVarExisted)
+      {
+        CVariable::get(context->getId(),varIdStr)->setData<string>(dataStr);
+        CVariable::get(context->getId(),varIdStr)->sendValue();
+      }
+
+      CTimer::get("XIOS set variable data").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+   }
+
+
    // ---------------------- Ecriture des donnÃ©es ------------------------------
-   
+
    void cxios_write_data_k81(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize)
    {
       std::string fieldid_str;
-      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
-      
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
+
       CTimer::get("XIOS").resume() ;
       CTimer::get("XIOS send field").resume() ;
@@ -139,15 +373,15 @@
       CTimer::get("XIOS").suspend() ;
    }
-   
+
    void cxios_write_data_k82(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize)
    {
       std::string fieldid_str;
       if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
-      
-      CTimer::get("XIOS").resume() ;
-      CTimer::get("XIOS send field").resume() ;
-      CContext* context = CContext::getCurrent() ;
-      if (!context->hasServer) context->client->checkBuffers() ;
-      
+
+      CTimer::get("XIOS").resume() ;
+      CTimer::get("XIOS send field").resume() ;
+      CContext* context = CContext::getCurrent() ;
+      if (!context->hasServer) context->client->checkBuffers() ;
+
       CArray<double,2>data(data_k8,shape(data_Xsize,data_Ysize),neverDeleteData) ;
       CField::get(fieldid_str)->setData(data) ;
@@ -155,9 +389,9 @@
       CTimer::get("XIOS").suspend() ;
    }
-   
+
    void cxios_write_data_k83(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize, int data_Zsize)
    {
       std::string fieldid_str;
-      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
 
       CTimer::get("XIOS").resume() ;
@@ -171,9 +405,9 @@
       CTimer::get("XIOS").suspend() ;
    }
-   
+
    void cxios_write_data_k41(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize)
    {
       std::string fieldid_str;
-     if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+     if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
 
       CTimer::get("XIOS").resume() ;
@@ -189,9 +423,9 @@
       CTimer::get("XIOS").suspend() ;
    }
-   
+
    void cxios_write_data_k42(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize)
    {
       std::string fieldid_str;
-      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
 
       CTimer::get("XIOS").resume() ;
@@ -207,11 +441,11 @@
       CTimer::get("XIOS").suspend() ;
    }
-   
+
    void cxios_write_data_k43(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize, int data_Zsize)
    {
       std::string fieldid_str;
- 
-      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
- 
+
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
+
       CTimer::get("XIOS").resume() ;
       CTimer::get("XIOS send field").resume() ;
@@ -222,10 +456,10 @@
       CArray<double,3> data(data_Xsize,data_Ysize,data_Zsize) ;
       data=data_tmp ;
- 
-      CField::get(fieldid_str)->setData(data) ;
-      CTimer::get("XIOS send field").suspend() ;
-      CTimer::get("XIOS").suspend() ;
-
-    } 
+
+      CField::get(fieldid_str)->setData(data) ;
+      CTimer::get("XIOS send field").suspend() ;
+      CTimer::get("XIOS").suspend() ;
+
+    }
 
 } // extern "C"
Index: /XIOS/trunk/src/interface/fortran/idata.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/idata.F90	(revision 488)
+++ /XIOS/trunk/src/interface/fortran/idata.F90	(revision 489)
@@ -4,5 +4,5 @@
    USE, INTRINSIC :: ISO_C_BINDING
    USE ICONTEXT
-   
+
    INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
 
@@ -17,5 +17,5 @@
          INTEGER  (kind = C_INT)                    :: f_return_comm
       END SUBROUTINE cxios_init_client
-      
+
       SUBROUTINE  cxios_context_initialize(context_id,len_context_id,f_comm) BIND(C)
          USE ISO_C_BINDING
@@ -31,16 +31,16 @@
          LOGICAL  (kind = C_BOOL)                   :: initialized
       END SUBROUTINE cxios_context_is_initialized
-      
-      
+
+
        SUBROUTINE  cxios_context_close_definition() BIND(C)
          USE ISO_C_BINDING
       END SUBROUTINE cxios_context_close_definition
-     
+
 
        SUBROUTINE  cxios_context_finalize() BIND(C)
          USE ISO_C_BINDING
       END SUBROUTINE cxios_context_finalize
-     
- 
+
+
       SUBROUTINE  cxios_finalize() BIND(C)
       END SUBROUTINE cxios_finalize
@@ -49,5 +49,5 @@
       END SUBROUTINE cxios_solve_inheritance
 
- 
+
       SUBROUTINE cxios_write_data_k81(fieldid, fieldid_size, data_k8, data_Xsize) BIND(C)
          USE ISO_C_BINDING
@@ -57,5 +57,5 @@
          INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize
       END SUBROUTINE cxios_write_data_k81
-      
+
       SUBROUTINE cxios_write_data_k82(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize) BIND(C)
          USE ISO_C_BINDING
@@ -65,5 +65,5 @@
          INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize
       END SUBROUTINE cxios_write_data_k82
-      
+
       SUBROUTINE cxios_write_data_k83(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C)
          USE ISO_C_BINDING
@@ -73,5 +73,5 @@
          INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize, data_Zsize
       END SUBROUTINE cxios_write_data_k83
-      
+
       SUBROUTINE cxios_write_data_k41(fieldid, fieldid_size, data_k4, data_Xsize) BIND(C)
          USE ISO_C_BINDING
@@ -81,5 +81,5 @@
          INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize
       END SUBROUTINE cxios_write_data_k41
-      
+
       SUBROUTINE cxios_write_data_k42(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize) BIND(C)
          USE ISO_C_BINDING
@@ -89,5 +89,5 @@
          INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize
       END SUBROUTINE cxios_write_data_k42
-      
+
       SUBROUTINE cxios_write_data_k43(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize, data_Zsize) BIND(C)
          USE ISO_C_BINDING
@@ -97,8 +97,92 @@
          INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize, data_Zsize
       END SUBROUTINE cxios_write_data_k43
-      
+
+      ! Binding C and Fortran interface of get_variable (icdata.cpp)
+      SUBROUTINE cxios_get_variable_data_k8(vardid, varid_size, data_k8, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         REAL     (kind = C_DOUBLE)               :: data_k8
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_get_variable_data_k8
+
+      SUBROUTINE cxios_get_variable_data_k4(vardid, varid_size, data_k4, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         REAL     (kind = C_FLOAT)                :: data_k4
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_get_variable_data_k4
+
+      SUBROUTINE cxios_get_variable_data_int(vardid, varid_size, data_int, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         INTEGER  (kind = C_INT)                  :: data_int
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_get_variable_data_int
+
+      SUBROUTINE cxios_get_variable_data_logic(vardid, varid_size, data_logic, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         LOGICAL  (kind = 4)                      :: data_logic
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_get_variable_data_logic
+
+      SUBROUTINE cxios_get_variable_data_char(vardid, varid_size, data_char, data_size_in, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_size_in
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: data_char
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_get_variable_data_char
+
+      ! Binding C and Fortran interface of set_variable (icdata.cpp)
+      SUBROUTINE cxios_set_variable_data_k8(vardid, varid_size, data_k8, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         REAL     (kind = C_DOUBLE), VALUE        :: data_k8
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_set_variable_data_k8
+
+      SUBROUTINE cxios_set_variable_data_k4(vardid, varid_size, data_k4, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         REAL     (kind = C_FLOAT) , VALUE        :: data_k4
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_set_variable_data_k4
+
+      SUBROUTINE cxios_set_variable_data_int(vardid, varid_size, data_int, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_int
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_set_variable_data_int
+
+      SUBROUTINE cxios_set_variable_data_logic(vardid, varid_size, data_logic, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         LOGICAL  (kind = 4)       , VALUE        :: data_logic
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_set_variable_data_logic
+
+      SUBROUTINE cxios_set_variable_data_char(vardid, varid_size, data_char, data_size_in, is_var_existed) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
+         INTEGER  (kind = C_INT)   , VALUE        :: varid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_size_in
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: data_char
+         LOGICAL  (kind = C_BOOL)                 :: is_var_existed
+      END SUBROUTINE cxios_set_variable_data_char
+
    END INTERFACE
-   
-   
+
+
    CONTAINS ! Fonctions disponibles pour les utilisateurs.
 
@@ -107,22 +191,22 @@
      CALL cxios_init_server()
    END SUBROUTINE xios(init_server)
-   
+
    SUBROUTINE  xios(initialize)(client_id, local_comm, return_comm)
    IMPLICIT NONE
    INCLUDE 'mpif.h'
    CHARACTER(LEN=*),INTENT(IN) :: client_id
-   INTEGER,INTENT(IN),OPTIONAL         :: local_comm  
+   INTEGER,INTENT(IN),OPTIONAL         :: local_comm
    INTEGER,INTENT(OUT),OPTIONAL        :: return_comm
    INTEGER :: f_local_comm
    INTEGER :: f_return_comm
-   
+
       IF (PRESENT(local_comm)) THEN
-        f_local_comm=local_comm 
+        f_local_comm=local_comm
       ELSE
-        f_local_comm = MPI_COMM_NULL 
+        f_local_comm = MPI_COMM_NULL
       ENDIF
-      
+
       CALL cxios_init_client(client_id,LEN(client_id),f_local_comm,f_return_comm)
- 
+
       IF (PRESENT(return_comm)) return_comm=f_return_comm
 
@@ -134,7 +218,7 @@
    CHARACTER(LEN=*),INTENT(IN)  :: context_id
    INTEGER, INTENT(IN)          :: comm
-      
+
       CALL cxios_context_initialize(context_id,LEN(context_id),comm)
- 
+
     END SUBROUTINE  xios(context_initialize)
 
@@ -145,11 +229,11 @@
    CHARACTER(LEN=*),INTENT(IN)  :: context_id
    LOGICAL(KIND=C_BOOL) :: is_init
-         
+
       CALL cxios_context_is_initialized(context_id, LEN(context_id), is_init)
       xios(context_is_initialized) = is_init
- 
-    END FUNCTION xios(context_is_initialized)   
-
-    
+
+    END FUNCTION xios(context_is_initialized)
+
+
    SUBROUTINE  xios(finalize)
    IMPLICIT NONE
@@ -159,5 +243,5 @@
     END SUBROUTINE  xios(finalize)
 
-   
+
    SUBROUTINE xios(close_context_definition)()
    IMPLICIT NONE
@@ -165,16 +249,16 @@
    END SUBROUTINE xios(close_context_definition)
 
-   
+
    SUBROUTINE xios(context_finalize)()
    IMPLICIT NONE
       CALL cxios_context_finalize()
    END SUBROUTINE xios(context_finalize)
-   
+
    SUBROUTINE xios(solve_inheritance)()
    IMPLICIT NONE
       CALL cxios_solve_inheritance()
    END SUBROUTINE xios(solve_inheritance)
-  
-   
+
+
    SUBROUTINE xios(send_field_r8_1d)(fieldid, data1d_k8)
    IMPLICIT NONE
@@ -183,5 +267,5 @@
       CALL cxios_write_data_k81(fieldid, len(fieldid), data1d_k8, size(data1d_k8, 1))
    END SUBROUTINE xios(send_field_r8_1d)
-   
+
    SUBROUTINE  xios(send_field_r8_2d)(fieldid, data2d_k8)
    IMPLICIT NONE
@@ -190,5 +274,5 @@
       CALL cxios_write_data_k82(fieldid, len(fieldid), data2d_k8, size(data2d_k8, 1), size(data2d_k8, 2))
    END SUBROUTINE  xios(send_field_r8_2d)
-   
+
    SUBROUTINE  xios(send_field_r8_3d)(fieldid, data3d_k8)
    IMPLICIT NONE
@@ -197,5 +281,5 @@
       CALL cxios_write_data_k83(fieldid, len(fieldid), data3d_k8, size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3))
    END SUBROUTINE  xios(send_field_r8_3d)
-   
+
    SUBROUTINE xios(send_field_r4_1d)(fieldid, data1d_k4)
    IMPLICIT NONE
@@ -204,5 +288,5 @@
       CALL cxios_write_data_k41(fieldid, len(fieldid), data1d_k4, size(data1d_k4, 1))
    END SUBROUTINE xios(send_field_r4_1d)
-   
+
    SUBROUTINE xios(send_field_r4_2d)(fieldid, data2d_k4)
    IMPLICIT NONE
@@ -211,5 +295,5 @@
       CALL cxios_write_data_k42(fieldid, len(fieldid), data2d_k4, size(data2d_k4, 1), size(data2d_k4, 2))
    END SUBROUTINE xios(send_field_r4_2d)
-   
+
    SUBROUTINE xios(send_field_r4_3d)(fieldid, data3d_k4)
    IMPLICIT NONE
@@ -218,5 +302,116 @@
       CALL cxios_write_data_k43(fieldid, len(fieldid), data3d_k4, size(data3d_k4, 1), size(data3d_k4, 2), size(data3d_k4, 3))
    END SUBROUTINE xios(send_field_r4_3d)
-   
-   
+
+   ! Get variable functions
+   LOGICAL FUNCTION xios(getVar_k8)(varId, data_k8)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len = *)               , INTENT(IN) :: varId
+      REAL     (kind = 8)              , INTENT(OUT):: data_k8
+
+      CALL cxios_get_variable_data_k8(varId, len(varId), data_k8, val)
+
+      xios(getVar_k8) = val
+   END FUNCTION xios(getVar_k8)
+
+   LOGICAL FUNCTION xios(getVar_k4)(varId, data_k4)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len = *)               , INTENT(IN) :: varId
+      REAL     (kind = 4)              , INTENT(OUT):: data_k4
+
+      CALL cxios_get_variable_data_k4(varId, len(varId), data_k4, val)
+
+      xios(getVar_k4) = val
+   END FUNCTION xios(getVar_k4)
+
+   LOGICAL FUNCTION xios(getVar_int)(varId, data_int)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len = *)               , INTENT(IN) :: varId
+      INTEGER                          , INTENT(OUT):: data_int
+
+      CALL cxios_get_variable_data_int(varId, len(varId), data_int, val)
+
+      xios(getVar_int) = val
+   END FUNCTION xios(getVar_int)
+
+   LOGICAL FUNCTION xios(getVar_logic)(varId, data_logic)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len  = *)              , INTENT(IN) :: varId
+      LOGICAL  (kind = 4)              , INTENT(OUT):: data_logic
+
+      CALL cxios_get_variable_data_logic(varId, len(varId), data_logic, val)
+
+      xios(getVar_logic) = val
+   END FUNCTION xios(getVar_logic)
+
+   LOGICAL FUNCTION xios(getVar_char)(varId, data_char)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len  = *)              , INTENT(IN) :: varId
+      CHARACTER(len  = *)              , INTENT(OUT):: data_char
+
+      CALL cxios_get_variable_data_char(varId, len(varId), data_char, len(data_char), val)
+
+      xios(getVar_char) = val
+   END FUNCTION xios(getVar_char)
+
+   ! Set variable functions
+   LOGICAL FUNCTION xios(setVar_k8)(varId, data_k8)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len = *)               , INTENT(IN) :: varId
+      REAL     (kind = 8)              , INTENT(IN) :: data_k8
+
+      CALL cxios_set_variable_data_k8(varId, len(varId), data_k8, val)
+
+      xios(setVar_k8) = val
+   END FUNCTION xios(setVar_k8)
+
+   LOGICAL FUNCTION xios(setVar_k4)(varId, data_k4)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len = *)               , INTENT(IN) :: varId
+      REAL     (kind = 4)              , INTENT(IN) :: data_k4
+
+      CALL cxios_set_variable_data_k4(varId, len(varId), data_k4, val)
+
+      xios(setVar_k4) = val
+   END FUNCTION xios(setVar_k4)
+
+   LOGICAL FUNCTION xios(setVar_int)(varId, data_int)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len = *)               , INTENT(IN) :: varId
+      INTEGER                          , INTENT(IN) :: data_int
+
+      CALL cxios_set_variable_data_int(varId, len(varId), data_int, val)
+
+      xios(setVar_int) = val
+   END FUNCTION xios(setVar_int)
+
+   LOGICAL FUNCTION xios(setVar_logic)(varId, data_logic)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len  = *)              , INTENT(IN) :: varId
+      LOGICAL  (kind = 4)              , INTENT(IN) :: data_logic
+
+      CALL cxios_set_variable_data_logic(varId, len(varId), data_logic, val)
+
+      xios(setVar_logic) = val
+   END FUNCTION xios(setVar_logic)
+
+   LOGICAL FUNCTION xios(setVar_char)(varId, data_char)
+   IMPLICIT NONE
+      LOGICAL  (kind = 1)                           :: val
+      CHARACTER(len  = *)              , INTENT(IN) :: varId
+      CHARACTER(len  = *)              , INTENT(IN) :: data_char
+
+      CALL cxios_set_variable_data_char(varId, len(varId), data_char, len(data_char), val)
+
+      xios(setVar_char) = val
+   END FUNCTION xios(setVar_char)
+
 END MODULE IDATA
Index: /XIOS/trunk/src/interface/fortran/ixios.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ixios.F90	(revision 488)
+++ /XIOS/trunk/src/interface/fortran/ixios.F90	(revision 489)
@@ -10,10 +10,12 @@
                           xios(get_context_attr), xios(get_context_attr_hdl), &
                           xios(is_defined_context_attr), xios(is_defined_context_attr_hdl)
-                                               
+
 USE idata, ONLY : xios(initialize),xios(init_server), xios(finalize), xios(context_initialize),  &
                   xios(context_is_initialized), xios(close_context_definition),xios(solve_inheritance),       &
                   xios(context_finalize), xios(send_field_r8_1d), xios(send_field_r8_2d), &
                   xios(send_field_r8_3d), xios(send_field_r4_1d), xios(send_field_r4_2d), &
-                  xios(send_field_r4_3d)
+                  xios(send_field_r4_3d), xios(getVar_k8), xios(getVar_k4), xios(getVar_int), &
+                  xios(getVar_logic), xios(getVar_char), xios(setVar_k8), xios(setVar_k4), xios(setVar_int), &
+                  xios(setVar_logic), xios(setVar_char)
 
 USE idate, ONLY : txios(date),txios(time), xios(set_timestep),xios(update_calendar)
@@ -27,16 +29,16 @@
                           xios(is_defined_domain_attr), xios(is_defined_domain_attr_hdl)
 
-USE idomaingroup_attr, ONLY : xios(set_domaingroup_attr), xios(set_domaingroup_attr_hdl),  & 
-                              xios(get_domaingroup_attr), xios(get_domaingroup_attr_hdl), & 
-                              xios(is_defined_domaingroup_attr), xios(is_defined_domaingroup_attr_hdl) 
-                    
+USE idomaingroup_attr, ONLY : xios(set_domaingroup_attr), xios(set_domaingroup_attr_hdl),  &
+                              xios(get_domaingroup_attr), xios(get_domaingroup_attr_hdl), &
+                              xios(is_defined_domaingroup_attr), xios(is_defined_domaingroup_attr_hdl)
+
 USE ifield, ONLY : txios(field), txios(fieldgroup), xios(get_field_handle),  &
                    xios(get_fieldgroup_handle), xios(is_valid_field),        &
-                   xios(is_valid_fieldgroup),xios(field_is_active_id),xios(field_is_active_hdl)  
+                   xios(is_valid_fieldgroup),xios(field_is_active_id),xios(field_is_active_hdl)
 
 USE ifield_attr, ONLY : xios(set_field_attr),xios(set_field_attr_hdl),    &
                         xios(get_field_attr),xios(get_field_attr_hdl), &
                         xios(is_defined_field_attr),xios(is_defined_field_attr_hdl)
-  
+
 USE ifieldgroup_attr, ONLY : xios(set_fieldgroup_attr), xios(set_fieldgroup_attr_hdl),  &
                              xios(get_fieldgroup_attr), xios(get_fieldgroup_attr_hdl), &
@@ -50,10 +52,10 @@
                         xios(get_variable_attr),xios(get_variable_attr_hdl), &
                         xios(is_defined_variable_attr),xios(is_defined_variable_attr_hdl)
-  
+
 USE ivariablegroup_attr, ONLY : xios(set_variablegroup_attr), xios(set_variablegroup_attr_hdl),  &
                              xios(get_variablegroup_attr), xios(get_variablegroup_attr_hdl), &
                              xios(is_defined_variablegroup_attr), xios(is_defined_variablegroup_attr_hdl)
-                             
-USE ifile, ONLY : txios(file), txios(filegroup), xios(get_file_handle),    & 
+
+USE ifile, ONLY : txios(file), txios(filegroup), xios(get_file_handle),    &
                   xios(get_filegroup_handle), xios(is_valid_file), xios(is_valid_filegroup)
 
@@ -65,7 +67,7 @@
                             xios(get_filegroup_attr), xios(get_filegroup_attr_hdl), &
                             xios(is_defined_filegroup_attr), xios(is_defined_filegroup_attr_hdl)
-                  
+
 USE igrid, ONLY : txios(grid), txios(gridgroup), xios(get_grid_handle),     &
-                  xios(get_gridgroup_handle), xios(is_valid_grid), xios(is_valid_gridgroup) 
+                  xios(get_gridgroup_handle), xios(is_valid_grid), xios(is_valid_gridgroup)
 
 USE igrid_attr, ONLY : xios(set_grid_attr_hdl), xios(set_grid_attr), &
@@ -78,5 +80,5 @@
 
 USE iaxis, ONLY : txios(axis), txios(axisgroup), xios(get_axis_handle),     &
-                  xios(get_axisgroup_handle), xios(is_valid_axis), xios(is_valid_axisgroup) 
+                  xios(get_axisgroup_handle), xios(is_valid_axis), xios(is_valid_axisgroup)
 
 USE iaxis_attr, ONLY :  xios(set_axis_attr), xios(set_axis_attr_hdl), &
@@ -90,5 +92,5 @@
 USE ixml_tree, ONLY : xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain),          &
                      xios(add_fieldtofile), xios(add_variabletofile), xios(add_variabletofield),                  &
-                     xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup),         & 
+                     xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup),         &
                      xios(add_domaingroup), xios(add_fieldgrouptofile), xios(add_variablegrouptofile),            &
                      xios(add_variablegrouptofield)
@@ -127,5 +129,5 @@
                     xios(get_field_handle), xios(get_fieldgroup_handle),xios(get_variable_handle),          &
                     xios(get_variablegroup_handle)
-END INTERFACE xios(get_handle) 
+END INTERFACE xios(get_handle)
 
 INTERFACE xios(add_child)
@@ -133,5 +135,5 @@
                    xios(add_fieldtofile), xios(add_variabletofile), xios(add_variabletofield), xios(add_axisgroup),  &
                    xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup), xios(add_domaingroup),            &
-                   xios(add_fieldgrouptofile), xios(add_variablegrouptofile),xios(add_variablegrouptofield) 
+                   xios(add_fieldgrouptofile), xios(add_variablegrouptofile),xios(add_variablegrouptofield)
 END INTERFACE xios(add_child)
 
@@ -145,7 +147,15 @@
   MODULE PROCEDURE xios(field_is_active_id),xios(field_is_active_hdl)
 END INTERFACE
-  
+
+INTERFACE xios(getVar)
+  MODULE PROCEDURE xios(getVar_k8), xios(getVar_k4), xios(getVar_int), xios(getVar_logic), xios(getVar_char)
+END INTERFACE xios(getVar)
+
+INTERFACE xios(setVar)
+  MODULE PROCEDURE xios(setVar_k8), xios(setVar_k4), xios(setVar_int), xios(setVar_logic), xios(setVar_char)
+END INTERFACE xios(setVar)
+
  PUBLIC :: txios(domain), txios(domaingroup),txios(field), txios(fieldgroup),txios(file), txios(filegroup), &
-          txios(grid), txios(gridgroup), txios(axis), txios(axisgroup),txios(context), txios(date),txios(time)  
+          txios(grid), txios(gridgroup), txios(axis), txios(axisgroup),txios(context), txios(date),txios(time)
 
  PUBLIC :: xios(set_attr), xios(set_domain_attr), xios(set_domaingroup_attr), xios(set_fieldgroup_attr), &
@@ -164,12 +174,12 @@
           xios(is_defined_axisgroup_attr), xios(is_defined_context_attr)
 
- PUBLIC :: xios(get_handle) 
- PUBLIC :: xios(add_child) 
+ PUBLIC :: xios(get_handle)
+ PUBLIC :: xios(add_child)
 
  PUBLIC :: xios(is_valid_context),xios(is_valid_domain), xios(is_valid_domaingroup),xios(is_valid_field),        &
           xios(is_valid_fieldgroup), xios(is_valid_file), xios(is_valid_filegroup), xios(is_valid_grid),         &
           xios(is_valid_gridgroup), xios(is_valid_axis), xios(is_valid_axisgroup)
-          
- PUBLIC :: xios(set_current_context)  
+
+ PUBLIC :: xios(set_current_context)
  PUBLIC :: xios(set_timestep),xios(update_calendar)
  PUBLIC :: xios(initialize), xios(init_server), xios(finalize), xios(context_initialize),xios(context_is_initialized), &
@@ -177,3 +187,6 @@
            xios(field_is_active)
 
+ PUBLIC :: xios(getVar)
+ PUBLIC :: xios(setVar)
+
 END MODULE XIOS
Index: /XIOS/trunk/src/node/variable.cpp
===================================================================
--- /XIOS/trunk/src/node/variable.cpp	(revision 488)
+++ /XIOS/trunk/src/node/variable.cpp	(revision 489)
@@ -7,4 +7,6 @@
 #include "xmlioserver_spl.hpp"
 #include "type.hpp"
+#include "context.hpp"
+#include "context_client.hpp"
 #include <boost/algorithm/string.hpp>
 
@@ -48,4 +50,9 @@
    {
       return (this->content);
+   }
+
+   void CVariable::setContent(const StdString& contentStr)
+   {
+     this->content = contentStr;
    }
 
@@ -61,10 +68,10 @@
       oss << "</" << CVariable::GetName() << " >";
       return (oss.str());
-   } 
-   
+   }
+
    CVariable::EVarType CVariable::getVarType(void) const
    {
      EVarType ret ;
-     
+
      if (type.isEmpty()) ret=t_undefined ;
      else
@@ -83,5 +90,72 @@
      return ret ;
    }
-       
+
+   /*
+   *\brief Sending value of a variable with its id from client to server
+   *
+   */
+   void CVariable::sendValue()
+   {
+     CContext* context=CContext::getCurrent() ;
+     if (!context->hasServer)
+     {
+       CContextClient* client=context->client ;
+
+       CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<content ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+   }
+
+   /*
+   *\brief Receive value of a variable with its id from client to server
+   *
+   */
+   void CVariable::recvValue(CEventServer& event)
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvValue(*buffer);
+   }
+
+
+   /*
+   *\brief Receive value of a variable with its id from client to server
+   *
+   */
+   void CVariable::recvValue(CBufferIn& buffer)
+   {
+      string str ;
+      buffer>>str;
+      setContent(str);
+   }
+
+   bool CVariable::dispatchEvent(CEventServer& event)
+   {
+    if (SuperClass::dispatchEvent(event)) return true ;
+    else
+    {
+      switch(event.type)
+      {
+        case EVENT_ID_VARIABLE_VALUE :
+          recvValue(event) ;
+          return true ;
+          break ;
+
+        default :
+          ERROR("bool CVariable::dispatchEvent(CEventServer& event)",<<"Unknown Event") ;
+          return false ;
+      }
+    }
+   }
+
 /*
    void CVariable::toBinary(StdOStream & os) const
Index: /XIOS/trunk/src/node/variable.hpp
===================================================================
--- /XIOS/trunk/src/node/variable.hpp	(revision 488)
+++ /XIOS/trunk/src/node/variable.hpp	(revision 489)
@@ -15,5 +15,5 @@
       class CVariableAttributes;
       class CVariable;
-
+      class CContext;
       ///--------------------------------------------------------------
 
@@ -29,4 +29,9 @@
          , public CVariableAttributes
       {
+            enum EEventId
+            {
+             EVENT_ID_VARIABLE_VALUE
+            };
+
             /// typedef ///
             typedef CObjectTemplate<CVariable>   SuperClass;
@@ -52,6 +57,6 @@
             enum EVarType
             {  t_int, t_short_int, t_long_int, t_float, t_double, t_long_double, t_bool, t_string, t_undefined } ;
-              
-                     
+
+
             /// Autres ///
             virtual void parse(xml::CXMLNode & node);
@@ -60,15 +65,26 @@
             /// Accesseur ///
             const StdString & getContent (void) const;
-            
-            
+
+            void setContent(const StdString& content);
+
+
             template <typename T> inline T getData(void) const;
-            
+            template <typename T> inline void setData(T data);
+
             template <typename T, StdSize N>
             inline void getData(CArray<T, N>& _data_array) const;
-            
+
             EVarType getVarType(void) const ;
-            
+
+            static bool dispatchEvent(CEventServer& event) ;
+
+            //! Sending a request to set up variable data
+            void sendValue();
+
+            static void recvValue(CEventServer& event) ;
+            void recvValue(CBufferIn& buffer) ;
+
          public :
-         
+
             /// Accesseurs statiques ///
             static StdString GetName(void);
@@ -85,16 +101,16 @@
       inline bool CVariable::getData(void) const
       {
-         if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 
-         else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 
+         if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ;
+         else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ;
          else ERROR("CVariable::getdata()",
                << "Cannot convert string <" << content << "> into type required" );
          return false ;
-      } 
-      
+      }
+
       template <typename T>
       inline T CVariable::getData(void) const
       {
          T retval ;
-         std::stringstream sstr(std::stringstream::in | std::stringstream::out); 
+         std::stringstream sstr(std::stringstream::in | std::stringstream::out);
          sstr<<content ;
          sstr>>retval ;
@@ -102,6 +118,20 @@
                << "Cannot convert string <" << content << "> into type required" );
          return retval ;
-      } 
+      }
 
+      template<>
+      inline void CVariable::setData(bool data)
+      {
+        if (true == data) content.assign("true");
+        else content.assign("false");
+      }
+
+      template <typename T>
+      inline void CVariable::setData(T data)
+      {
+        std::stringstream sstr;
+        sstr<<data;
+        content = sstr.str();
+      }
 
       ///--------------------------------------------------------------
Index: /XIOS/trunk/src/test/test_xios_interface.f90
===================================================================
--- /XIOS/trunk/src/test/test_xios_interface.f90	(revision 489)
+++ /XIOS/trunk/src/test/test_xios_interface.f90	(revision 489)
@@ -0,0 +1,358 @@
+PROGRAM test_xios_interface
+
+  ! This test is based on test_complete
+  USE xios
+  USE mod_wait
+  IMPLICIT NONE
+  INCLUDE "mpif.h"
+  INTEGER :: rank
+  INTEGER :: size_loc
+  INTEGER :: ierr
+
+  CHARACTER(len=*),PARAMETER :: id="client"
+  INTEGER :: comm
+  TYPE(xios_time)      :: dtime
+  TYPE(xios_context) :: ctx_hdl
+  INTEGER,PARAMETER :: ni_glo=100
+  INTEGER,PARAMETER :: nj_glo=100
+  INTEGER,PARAMETER :: llm=5
+  DOUBLE PRECISION  :: lval(llm)=1
+  TYPE(xios_field) :: field_hdl
+  TYPE(xios_fieldgroup) :: fieldgroup_hdl
+  TYPE(xios_file) :: file_hdl
+  LOGICAL :: ok
+  CHARACTER(len=256) :: crname
+
+  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo
+  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm)
+  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A_atm(:,:,:), field_A_srf(:,:), lonvalue(:)
+  INTEGER, ALLOCATABLE :: kindex(:)
+  INTEGER :: ni,ibegin,iend,nj,jbegin,jend
+  INTEGER :: i,j,l,ts,n, nb_pt
+
+  INTEGER :: var_val_int
+  REAL :: var_val_float
+  DOUBLE PRECISION :: var_val_double
+  LOGICAL :: var_val_bool
+  CHARACTER(len=256) :: var_val_char =""
+  CHARACTER(len=256) :: var_id
+
+!!! MPI Initialization
+
+  CALL MPI_INIT(ierr)
+
+  CALL init_wait
+
+!!! XIOS Initialization (get the local communicator)
+
+  CALL xios_initialize(id,return_comm=comm)
+
+  CALL MPI_COMM_RANK(comm,rank,ierr)
+  CALL MPI_COMM_SIZE(comm,size_loc,ierr)
+
+!-------------------------------------------------------------------------------
+!
+! Define all neccessary values for test
+!
+!-------------------------------------------------------------------------------
+!###########################################################################
+! Contexte ATM
+!###########################################################################
+
+!!! Initialisation des coordonnÃ©es globales et locales pour la grille rÃ©guliÃšre
+
+  DO j=1,nj_glo
+    DO i=1,ni_glo
+      lon_glo(i,j)=(i-1)+(j-1)*ni_glo
+      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo
+      DO l=1,llm
+        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l
+      ENDDO
+    ENDDO
+  ENDDO
+  ni=ni_glo ; ibegin=1
+
+  jbegin=1
+  DO n=0,size_loc-1
+    nj=nj_glo/size_loc
+    IF (n<MOD(nj_glo,size_loc)) nj=nj+1
+    IF (n==rank) exit
+    jbegin=jbegin+nj
+  ENDDO
+
+  iend=ibegin+ni-1 ; jend=jbegin+nj-1
+
+  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A_atm(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj))
+  lon(:,:)=lon_glo(ibegin:iend,jbegin:jend)
+  lat(:,:)=lat_glo(ibegin:iend,jbegin:jend)
+  field_A_atm(1:ni,1:nj,:)=field_A_glo(ibegin:iend,jbegin:jend,:)
+
+
+!!! Context ATMOSPHERE
+
+  CALL xios_context_initialize("atmosphere",comm)
+  CALL xios_get_handle("atmosphere",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  CALL xios_set_context_attr("atmosphere",calendar_type="Gregorian")
+  CALL xios_set_context_attr("atmosphere",start_date="2000-01-01 00:00:00")
+  CALL xios_set_context_attr("atmosphere",time_origin="1999-01-01 15:00:00")
+
+  CALL xios_set_axis_attr("axis_atm",size=llm ,value=lval) ;
+
+  CALL xios_set_domain_attr("domain_atm",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj)
+  CALL xios_set_domain_attr("domain_atm",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
+  CALL xios_set_domain_attr("domain_atm",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/)))
+
+  CALL xios_set_domain_attr("domain_atm_zoom",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj)
+  CALL xios_set_domain_attr("domain_atm_zoom",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
+  CALL xios_set_domain_attr("domain_atm_zoom",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/)))
+
+!!! Activation du groupe field_definition
+  CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.)
+
+!!! CrÃ©ation d un nouveau champ
+  CALL xios_get_handle("field_definition",fieldgroup_hdl)
+  CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B_atm")
+
+!!! Heritage des attributs d un autre champ
+  CALL xios_set_attr(field_hdl,field_ref="field_A_atm",name="field_B_atm")
+
+!!! Affectation de ce nouveau champ au fichier avec un nouveau nom
+
+  CALL xios_get_handle("output_atmosphere",file_hdl)
+  CALL xios_add_child(file_hdl,field_hdl)
+  CALL xios_set_attr(field_hdl,field_ref="field_B_atm",name="field_C_atm")
+
+!!! Definition du timestep
+
+  dtime%second=3600
+  CALL xios_set_timestep(dtime)
+
+!!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalitÃ©)
+
+  ni=0 ; lonvalue(:)=0
+  CALL xios_get_domain_attr("domain_atm",ni=ni,lonvalue=lonvalue)
+
+  PRINT *,"ni",ni
+  PRINT *,"lonvalue",lonvalue ;
+
+!!! Fin de la definition du contexte
+
+  CALL xios_close_context_definition()
+
+!!! Test des valeurs des champs/fichiers
+
+  !!! Attribut defini ?
+
+  CALL xios_is_defined_field_attr("field_A_atm",enabled=ok)
+  PRINT *,"field_A_atm : attribute enabled is defined ? ",ok
+
+  !!! Recuperer la valeur d un attribut
+
+  CALL xios_get_field_attr("field_A_atm",name=crname)
+  PRINT *,"field_A_atm : attribute name is : ",TRIM(crname)
+
+  !!! Champ actif (besoin de fournir la valeur) ?
+
+    PRINT*,"field field_A_atm is active ? ",xios_field_is_active("field_A_atm")
+
+  !!! Champ defini ?
+
+    PRINT*,"field field_A_atm is valid ?",xios_is_valid_field("field_A_atm")
+
+
+!###########################################################################
+! Contexte SRF
+!###########################################################################
+
+!!! Initialisation des coordonnÃ©es globales et locales pour la grille indexee (1 point sur 2)
+
+    nb_pt=ni*nj/2
+    ALLOCATE(kindex(nb_pt),field_A_srf(nb_pt,llm))
+    DO i=1,nb_pt
+      kindex(i)=2*i-1
+    ENDDO
+    field_A_srf(1:nb_pt,:)=RESHAPE(field_A_glo(ibegin:iend:2,jbegin:jend,:),(/ nb_pt,llm /))
+
+  CALL xios_context_initialize("surface",comm)
+  CALL xios_get_handle("surface",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  CALL xios_set_context_attr("surface",calendar_type="Gregorian")
+  CALL xios_set_context_attr("surface",start_date="2000-01-01 00:00:00")
+  CALL xios_set_context_attr("surface",time_origin="1999-01-01 15:00:00")
+
+  CALL xios_set_axis_attr("axis_srf",size=llm ,value=lval) ;
+  CALL xios_set_domain_attr("domain_srf",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj)
+  CALL xios_set_domain_attr("domain_srf",data_dim=1, data_ibegin=0, data_ni=nb_pt)
+  CALL xios_set_domain_attr("domain_srf",data_n_index=nb_pt, data_i_index=kindex)
+  CALL xios_set_domain_attr("domain_srf",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/)))
+
+!!! CrÃ©ation d un nouveau champ
+
+  CALL xios_get_handle("field_definition",fieldgroup_hdl)
+  CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B_srf")
+
+!!! Heritage des attributs d un autre champ
+
+  CALL xios_set_attr(field_hdl,field_ref="field_A_srf",name="field_B_srf")
+
+!!! Affectation de ce nouveau champ au fichier avec un nouveau nom
+
+  CALL xios_get_handle("output_surface",file_hdl)
+  CALL xios_add_child(file_hdl,field_hdl)
+  CALL xios_set_attr(field_hdl,field_ref="field_B_srf",name="field_C_srf")
+
+!!! Definition du timestep
+
+  dtime%second=1800
+  CALL xios_set_timestep(dtime)
+
+!!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalitÃ©)
+
+  ni=0 ; lonvalue(:)=0
+  CALL xios_get_domain_attr("domain_srf",ni=ni,lonvalue=lonvalue)
+
+  PRINT *,"ni",ni
+  PRINT *,"lonvalue",lonvalue ;
+
+!!! Fin de la definition du contexte SRF
+
+  CALL xios_close_context_definition()
+
+
+!-------------------------------------------------------------------------------
+!
+! Get/set variable in differenct contexts
+!
+!-------------------------------------------------------------------------------
+
+ !! Be sure in the correct context
+  CALL xios_get_handle("surface",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  !! Try getting some variable values
+  var_id = "my_attribute1"
+  ok = xios_getVar(var_id, var_val_char)
+  if (ok) then
+    print*, "Value of ", var_id, " is : ", var_val_char
+  end if
+
+  var_id = "my_attribute2"
+  ok = xios_getVar(var_id, var_val_int)
+  if (ok) then
+    print*, "Value of ", var_id, " is : ", var_val_int
+  end if
+
+  var_id = "my_attribute3"
+  ok = xios_getVar(var_id, var_val_float)
+  if (ok) then
+    print*, "Value of ", var_id, " is : ", var_val_float
+  end if
+
+  var_id = "my_attribute4"
+  ok = xios_getVar(var_id, var_val_double)
+  if (ok) then
+    print*, "Value of ", var_id, " is : ", var_val_double
+  end if
+
+  var_id = "my_global_attribute_bool"
+  ok = xios_getVar(var_id, var_val_bool)
+  if (ok) then
+    print*, "Value of ", var_id, " is : ", var_val_bool
+  end if
+
+  !! Try setting some variables
+  var_id = "my_attribute1"
+  var_val_char = "ocean_att"
+  ok = xios_setVar(var_id, var_val_char)
+  if (ok) then
+    print*, "New value of ", var_id, " is : ", var_val_char
+  end if
+
+  var_id = "my_attribute2"
+  var_val_int = 50
+  ok = xios_setVar(var_id, var_val_int)
+  if (ok) then
+    print*, "New value of ", var_id, " is : ", var_val_int
+  end if
+
+  var_id = "my_attribute3"
+  var_val_float = 7.8
+  ok = xios_setVar(var_id, var_val_float)
+  if (ok) then
+    print*, "New value of ", var_id, " is : ", var_val_float
+  end if
+
+  var_id = "my_attribute4"
+  var_val_double=300.21
+  ok = xios_setVar(var_id, var_val_double)
+  if (ok) then
+    print*, "New value of ", var_id, " is : ", var_val_double
+  end if
+
+  var_id = "my_global_attribute_bool"
+  var_val_bool = .true.
+  ok = xios_setVar(var_id, var_val_bool)
+  if (ok) then
+    print*, "New value of ", var_id, " is : ", var_val_bool
+  end if
+
+!####################################################################################
+!!! Boucle temporelle
+!####################################################################################
+
+    DO ts=1,24*10
+
+      CALL xios_get_handle("atmosphere",ctx_hdl)
+      CALL xios_set_current_context(ctx_hdl)
+
+!!! Mise a jour du pas de temps
+
+      CALL xios_update_calendar(ts)
+
+!!! On donne la valeur du champ atm
+
+      CALL xios_send_field("field_A_atm",field_A_atm)
+
+!!! On change de contexte
+
+      CALL xios_get_handle("surface",ctx_hdl)
+      CALL xios_set_current_context(ctx_hdl)
+
+!!! Mise a jour du pas de temps
+
+      CALL xios_update_calendar(ts)
+
+!!! On donne la valeur du champ srf
+
+      CALL xios_send_field("field_A_srf",field_A_srf)
+
+      CALL wait_us(5000) ;
+    ENDDO
+
+!####################################################################################
+!!! Finalisation
+!####################################################################################
+
+!!! Fin des contextes
+
+    CALL xios_context_finalize()
+    CALL xios_get_handle("atmosphere",ctx_hdl)
+    CALL xios_set_current_context(ctx_hdl)
+    CALL xios_context_finalize()
+
+!!! Fin de XIOS
+
+    CALL xios_finalize()
+
+    CALL MPI_FINALIZE(ierr)
+
+  END PROGRAM test_xios_interface
+
+
+
+
+
+
