Index: /XIOS/trunk/src/client_server_mapping.hpp
===================================================================
--- /XIOS/trunk/src/client_server_mapping.hpp	(revision 597)
+++ /XIOS/trunk/src/client_server_mapping.hpp	(revision 598)
@@ -41,7 +41,7 @@
                                            const std::vector<CArray<size_t,1>* >& globalIndexOnServer);
 
-    std::map<int,int> computeConnectedClients(int nbServer, int nbClient,
-                                              MPI_Comm& clientIntraComm,
-                                              const std::vector<int>& connectedServerRank);
+    static std::map<int,int> computeConnectedClients(int nbServer, int nbClient,
+                                                     MPI_Comm& clientIntraComm,
+                                                     const std::vector<int>& connectedServerRank);
 
     const std::map<int, std::vector<size_t> >& getGlobalIndexOnServer() const;
Index: /XIOS/trunk/src/config/file_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/file_attribute.conf	(revision 597)
+++ /XIOS/trunk/src/config/file_attribute.conf	(revision 598)
@@ -15,4 +15,5 @@
 DECLARE_ENUM2(par_access, collective, independent)
 DECLARE_ATTRIBUTE(bool,      append)
+DECLARE_ENUM2(mode, read, write)
 
 // DECLARE_ATTRIBUTE_DEF(bool, enabled, true)
Index: /XIOS/trunk/src/interface/c/iccalendar.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/iccalendar.cpp	(revision 597)
+++ /XIOS/trunk/src/interface/c/iccalendar.cpp	(revision 598)
@@ -16,4 +16,5 @@
     context->updateCalendar(step);
     context->sendUpdateCalendar(step);
+    context->checkPrefetchingOfEnabledReadModeFiles();
     CTimer::get("XIOS").suspend();
   }
Index: /XIOS/trunk/src/interface/c_attr/icfile_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 597)
+++ /XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 598)
@@ -139,4 +139,30 @@
 
 
+  void cxios_set_file_mode(file_Ptr file_hdl, const char * mode, int mode_size)
+  {
+    std::string mode_str;
+    if (!cstr2string(mode, mode_size, mode_str)) return;
+    CTimer::get("XIOS").resume();
+    file_hdl->mode.fromString(mode_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_file_mode(file_Ptr file_hdl, char * mode, int mode_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(file_hdl->mode.getInheritedStringValue(), mode, mode_size))
+      ERROR("void cxios_get_file_mode(file_Ptr file_hdl, char * mode, int mode_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_file_mode(file_Ptr file_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = file_hdl->mode.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_file_name(file_Ptr file_hdl, const char * name, int name_size)
   {
Index: /XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 597)
+++ /XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 598)
@@ -165,4 +165,30 @@
 
 
+  void cxios_set_filegroup_mode(filegroup_Ptr filegroup_hdl, const char * mode, int mode_size)
+  {
+    std::string mode_str;
+    if (!cstr2string(mode, mode_size, mode_str)) return;
+    CTimer::get("XIOS").resume();
+    filegroup_hdl->mode.fromString(mode_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_filegroup_mode(filegroup_Ptr filegroup_hdl, char * mode, int mode_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(filegroup_hdl->mode.getInheritedStringValue(), mode, mode_size))
+      ERROR("void cxios_get_filegroup_mode(filegroup_Ptr filegroup_hdl, char * mode, int mode_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_filegroup_mode(filegroup_Ptr filegroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = filegroup_hdl->mode.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_filegroup_name(filegroup_Ptr filegroup_hdl, const char * name, int name_size)
   {
Index: /XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90	(revision 597)
+++ /XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90	(revision 598)
@@ -109,4 +109,25 @@
 
 
+    SUBROUTINE cxios_set_file_mode(file_hdl, mode, mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
+      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
+    END SUBROUTINE cxios_set_file_mode
+
+    SUBROUTINE cxios_get_file_mode(file_hdl, mode, mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
+      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
+    END SUBROUTINE cxios_get_file_mode
+
+    FUNCTION cxios_is_defined_file_mode(file_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_mode
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_mode
+
+
     SUBROUTINE cxios_set_file_name(file_hdl, name, name_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90	(revision 597)
+++ /XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90	(revision 598)
@@ -130,4 +130,25 @@
 
 
+    SUBROUTINE cxios_set_filegroup_mode(filegroup_hdl, mode, mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
+      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
+    END SUBROUTINE cxios_set_filegroup_mode
+
+    SUBROUTINE cxios_get_filegroup_mode(filegroup_hdl, mode, mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
+      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
+    END SUBROUTINE cxios_get_filegroup_mode
+
+    FUNCTION cxios_is_defined_filegroup_mode(filegroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_mode
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_mode
+
+
     SUBROUTINE cxios_set_filegroup_name(filegroup_hdl, name, name_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 597)
+++ /XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 598)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_file_attr)  &
-    ( file_id, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+    ( file_id, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -25,4 +25,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix
@@ -37,5 +38,5 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(set_file_attr_hdl_)   &
-      ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -43,5 +44,5 @@
 
   SUBROUTINE xios(set_file_attr_hdl)  &
-    ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+    ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -55,4 +56,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix
@@ -66,5 +68,5 @@
 
       CALL xios(set_file_attr_hdl_)  &
-      ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -72,6 +74,7 @@
 
   SUBROUTINE xios(set_file_attr_hdl_)   &
-    ( file_hdl, append_, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  &
-    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( file_hdl, append_, description_, enabled_, format_, min_digits_, mode_, name_, name_suffix_  &
+    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
+     )
 
     IMPLICIT NONE
@@ -84,4 +87,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format_
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix_
@@ -116,4 +120,8 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        CALL cxios_set_file_mode(file_hdl%daddr, mode_, len(mode_))
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_set_file_name(file_hdl%daddr, name_, len(name_))
@@ -155,5 +163,5 @@
 
   SUBROUTINE xios(get_file_attr)  &
-    ( file_id, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+    ( file_id, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -168,4 +176,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix
@@ -180,5 +189,5 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(get_file_attr_hdl_)   &
-      ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -186,5 +195,5 @@
 
   SUBROUTINE xios(get_file_attr_hdl)  &
-    ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+    ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -198,4 +207,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix
@@ -209,5 +219,5 @@
 
       CALL xios(get_file_attr_hdl_)  &
-      ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -215,6 +225,7 @@
 
   SUBROUTINE xios(get_file_attr_hdl_)   &
-    ( file_hdl, append_, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  &
-    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( file_hdl, append_, description_, enabled_, format_, min_digits_, mode_, name_, name_suffix_  &
+    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
+     )
 
     IMPLICIT NONE
@@ -227,4 +238,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format_
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix_
@@ -259,4 +271,8 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        CALL cxios_get_file_mode(file_hdl%daddr, mode_, len(mode_))
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_get_file_name(file_hdl%daddr, name_, len(name_))
@@ -298,5 +314,5 @@
 
   SUBROUTINE xios(is_defined_file_attr)  &
-    ( file_id, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+    ( file_id, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -314,4 +330,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits
       LOGICAL(KIND=C_BOOL) :: min_digits_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
+      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -335,5 +353,5 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(is_defined_file_attr_hdl_)   &
-      ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -341,5 +359,5 @@
 
   SUBROUTINE xios(is_defined_file_attr_hdl)  &
-    ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+    ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -356,4 +374,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits
       LOGICAL(KIND=C_BOOL) :: min_digits_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
+      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -376,5 +396,5 @@
 
       CALL xios(is_defined_file_attr_hdl_)  &
-      ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  &
+      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -382,6 +402,7 @@
 
   SUBROUTINE xios(is_defined_file_attr_hdl_)   &
-    ( file_hdl, append_, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  &
-    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( file_hdl, append_, description_, enabled_, format_, min_digits_, mode_, name_, name_suffix_  &
+    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
+     )
 
     IMPLICIT NONE
@@ -397,4 +418,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits_
       LOGICAL(KIND=C_BOOL) :: min_digits__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode_
+      LOGICAL(KIND=C_BOOL) :: mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name_
       LOGICAL(KIND=C_BOOL) :: name__tmp
@@ -441,4 +464,9 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        mode__tmp = cxios_is_defined_file_mode(file_hdl%daddr)
+        mode_ = mode__tmp
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         name__tmp = cxios_is_defined_file_name(file_hdl%daddr)
Index: /XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 597)
+++ /XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 598)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_filegroup_attr)  &
-    ( filegroup_id, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+    ( filegroup_id, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
     , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -26,4 +26,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix
@@ -38,5 +39,5 @@
       CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
       CALL xios(set_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
       , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -44,5 +45,5 @@
 
   SUBROUTINE xios(set_filegroup_attr_hdl)  &
-    ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+    ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
     , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -57,4 +58,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix
@@ -68,5 +70,5 @@
 
       CALL xios(set_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
       , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -74,7 +76,7 @@
 
   SUBROUTINE xios(set_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, append_, description_, enabled_, format_, group_ref_, min_digits_, name_, name_suffix_  &
-    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
-     )
+    ( filegroup_hdl, append_, description_, enabled_, format_, group_ref_, min_digits_, mode_, name_  &
+    , name_suffix_, output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_  &
+    , type_ )
 
     IMPLICIT NONE
@@ -88,4 +90,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix_
@@ -124,4 +127,8 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        CALL cxios_set_filegroup_mode(filegroup_hdl%daddr, mode_, len(mode_))
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_set_filegroup_name(filegroup_hdl%daddr, name_, len(name_))
@@ -163,5 +170,5 @@
 
   SUBROUTINE xios(get_filegroup_attr)  &
-    ( filegroup_id, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+    ( filegroup_id, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
     , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -177,4 +184,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix
@@ -189,5 +197,5 @@
       CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
       CALL xios(get_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
       , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -195,5 +203,5 @@
 
   SUBROUTINE xios(get_filegroup_attr_hdl)  &
-    ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+    ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
     , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -208,4 +216,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix
@@ -219,5 +228,5 @@
 
       CALL xios(get_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
       , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -225,7 +234,7 @@
 
   SUBROUTINE xios(get_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, append_, description_, enabled_, format_, group_ref_, min_digits_, name_, name_suffix_  &
-    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
-     )
+    ( filegroup_hdl, append_, description_, enabled_, format_, group_ref_, min_digits_, mode_, name_  &
+    , name_suffix_, output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_  &
+    , type_ )
 
     IMPLICIT NONE
@@ -239,4 +248,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix_
@@ -275,4 +285,8 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        CALL cxios_get_filegroup_mode(filegroup_hdl%daddr, mode_, len(mode_))
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_get_filegroup_name(filegroup_hdl%daddr, name_, len(name_))
@@ -314,5 +328,5 @@
 
   SUBROUTINE xios(is_defined_filegroup_attr)  &
-    ( filegroup_id, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+    ( filegroup_id, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
     , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -332,4 +346,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits
       LOGICAL(KIND=C_BOOL) :: min_digits_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
+      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -353,5 +369,5 @@
       CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
       CALL xios(is_defined_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
       , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -359,5 +375,5 @@
 
   SUBROUTINE xios(is_defined_filegroup_attr_hdl)  &
-    ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+    ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
     , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -376,4 +392,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits
       LOGICAL(KIND=C_BOOL) :: min_digits_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
+      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -396,5 +414,5 @@
 
       CALL xios(is_defined_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, name, name_suffix  &
+      ( filegroup_hdl, append, description, enabled, format, group_ref, min_digits, mode, name, name_suffix  &
       , output_freq, output_level, par_access, split_freq, split_freq_format, sync_freq, type )
 
@@ -402,7 +420,7 @@
 
   SUBROUTINE xios(is_defined_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, append_, description_, enabled_, format_, group_ref_, min_digits_, name_, name_suffix_  &
-    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
-     )
+    ( filegroup_hdl, append_, description_, enabled_, format_, group_ref_, min_digits_, mode_, name_  &
+    , name_suffix_, output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_  &
+    , type_ )
 
     IMPLICIT NONE
@@ -420,4 +438,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits_
       LOGICAL(KIND=C_BOOL) :: min_digits__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode_
+      LOGICAL(KIND=C_BOOL) :: mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name_
       LOGICAL(KIND=C_BOOL) :: name__tmp
@@ -469,4 +489,9 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        mode__tmp = cxios_is_defined_filegroup_mode(filegroup_hdl%daddr)
+        mode_ = mode__tmp
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         name__tmp = cxios_is_defined_filegroup_name(filegroup_hdl%daddr)
Index: /XIOS/trunk/src/node/context.cpp
===================================================================
--- /XIOS/trunk/src/node/context.cpp	(revision 597)
+++ /XIOS/trunk/src/node/context.cpp	(revision 598)
@@ -253,33 +253,30 @@
    void CContext::setClientServerBuffer()
    {
-     if (hasClient)
-     {
-       size_t bufferSizeMin = 10 * sizeof(size_t) * 1024;
+     size_t bufferSizeMin = 10 * sizeof(size_t) * 1024;
 #define DECLARE_NODE(Name_, name_)    \
-       bufferSizeMin = (bufferSizeMin < sizeof(C##Name_##Definition)) ?  sizeof(C##Name_##Definition) : bufferSizeMin;
+     bufferSizeMin = (bufferSizeMin < sizeof(C##Name_##Definition)) ?  sizeof(C##Name_##Definition) : bufferSizeMin;
 #define DECLARE_NODE_PAR(Name_, name_)
 #include "node_type.conf"
-       std::map<int, StdSize> bufferSize = getDataSize();
-       if (bufferSize.empty())
+     std::map<int, StdSize> bufferSize = getDataSize();
+     if (bufferSize.empty())
+     {
+       if (client->isServerLeader())
        {
-         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)
-             bufferSize[*itRank] = bufferSizeMin;
-         }
-         else
-          return;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           bufferSize[*itRank] = bufferSizeMin;
        }
        else
-       {
-         std::map<int, StdSize>::iterator it  = bufferSize.begin(),
-                                          ite = bufferSize.end();
-         for (; it != ite; ++it)
-           it->second = (it->second < bufferSizeMin) ? bufferSizeMin : it->second;
-       }
-
-       client->setBufferSize(bufferSize);
-     }
+        return;
+     }
+     else
+     {
+       std::map<int, StdSize>::iterator it  = bufferSize.begin(),
+                                        ite = bufferSize.end();
+       for (; it != ite; ++it)
+         it->second = (it->second < bufferSizeMin) ? bufferSizeMin : it->second;
+     }
+
+     client->setBufferSize(bufferSize);
    }
 
@@ -307,9 +304,4 @@
      }
      client = new CContextClient(this,intraCommClient,interCommClient, cxtClient);
-     // Do something clever instead
-     std::map<int, StdSize> bufferSize;
-     for (int r = 0; r < client->serverSize; r++)
-       bufferSize[r] = 10 * sizeof(size_t) * 1024;
-     client->setBufferSize(bufferSize);
    }
 
@@ -363,7 +355,6 @@
        // After xml is parsed, there are some more works with post processing
        postProcessing();
-
-       setClientServerBuffer();
-     }
+     }
+     setClientServerBuffer();
 
      if (hasClient && !hasServer)
@@ -388,7 +379,4 @@
        sendRefGrid();
     }
-
-    // Now tell server that it can process all messages from client
-    if (hasClient && !hasServer) this->sendCloseDefinition();
 
     // We have a xml tree on the server side and now, it should be also processed
@@ -403,9 +391,16 @@
     }
 
+    // Now tell server that it can process all messages from client
+    if (hasClient && !hasServer) this->sendCloseDefinition();
 
     // Nettoyage de l'arborescence
     if (hasClient && !hasServer) CleanTree(); // Only on client side??
 
-    if (hasClient) sendCreateFileHeader();
+    if (hasClient)
+    {
+      sendCreateFileHeader();
+
+      startPrefetchingOfEnabledReadModeFiles();
+    }
    }
 
@@ -431,4 +426,22 @@
      {
        this->enabledFiles[i]->buildAllExpressionOfEnabledFields();
+     }
+   }
+
+   void CContext::startPrefetchingOfEnabledReadModeFiles()
+   {
+     int size = enabledReadModeFiles.size();
+     for (int i = 0; i < size; ++i)
+     {
+        enabledReadModeFiles[i]->prefetchEnabledReadModeFields();
+     }
+   }
+
+   void CContext::checkPrefetchingOfEnabledReadModeFiles()
+   {
+     int size = enabledReadModeFiles.size();
+     for (int i = 0; i < size; ++i)
+     {
+        enabledReadModeFiles[i]->prefetchEnabledReadModeFieldsIfNeeded();
      }
    }
@@ -440,4 +453,6 @@
     for (size_t i = 0; i < allFields.size(); ++i)
     {
+      if (allFields[i]->file && !allFields[i]->file->mode.isEmpty() && allFields[i]->file->mode.getValue() == CFile::mode_attr::read)
+        allFields[i]->read_access = true;
       if (!allFields[i]->read_access.isEmpty() && allFields[i]->read_access.getValue())
         fieldsWithReadAccess.push_back(allFields[i]);
@@ -501,4 +516,14 @@
          DEBUG(<<"Aucun fichier ne va Ãªtre sorti dans le contexte nommÃ© \""
                << getId() << "\" !");
+   }
+
+   void CContext::findEnabledReadModeFiles(void)
+   {
+     int size = this->enabledFiles.size();
+     for (int i = 0; i < size; ++i)
+     {
+       if (!enabledFiles[i]->mode.isEmpty() && enabledFiles[i]->mode.getValue() == CFile::mode_attr::read)
+        enabledReadModeFiles.push_back(enabledFiles[i]);
+     }
    }
 
@@ -717,4 +742,5 @@
       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
       this->findEnabledFiles();
+      this->findEnabledReadModeFiles();
 
       // Find all enabled fields of each file
@@ -734,4 +760,6 @@
    std::map<int, StdSize>& CContext::getDataSize()
    {
+     CFile::mode_attr::t_enum mode = hasClient ? CFile::mode_attr::write : CFile::mode_attr::read;
+
      // Set of grid used by enabled fields
      std::set<StdString> usedGrid;
@@ -741,38 +769,42 @@
      for (int i = 0; i < numEnabledFiles; ++i)
      {
-       std::vector<CField*> enabledFields = this->enabledFiles[i]->getEnabledFields();
-       int numEnabledFields = enabledFields.size();
-       for (int j = 0; j < numEnabledFields; ++j)
+       CFile* file = this->enabledFiles[i];
+       CFile::mode_attr::t_enum fileMode = file->mode.isEmpty() ? CFile::mode_attr::write : file->mode.getValue();
+
+       if (fileMode == mode)
        {
-//         const std::pair<StdString, StdString>& prDomAxisId = enabledFields[j]->getDomainAxisIds();
-         StdString currentGrid = enabledFields[j]->grid->getId();
-         const std::map<int, StdSize> mapSize = enabledFields[j]->getGridDataSize();
-         if (dataSize_.empty())
+         std::vector<CField*> enabledFields = file->getEnabledFields();
+         int numEnabledFields = enabledFields.size();
+         for (int j = 0; j < numEnabledFields; ++j)
          {
-           dataSize_ = mapSize;
-           usedGrid.insert(currentGrid);
-//           domainIds.insert(prDomAxisId.first);
-         }
-         else
-         {
-           std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end();
-           if (usedGrid.find(currentGrid) == usedGrid.end())
+           StdString currentGrid = enabledFields[j]->grid->getId();
+           const std::map<int, StdSize> mapSize = enabledFields[j]->getGridDataSize();
+           if (dataSize_.empty())
            {
-             for (; it != itE; ++it)
+             dataSize_ = mapSize;
+             usedGrid.insert(currentGrid);
+           }
+           else
+           {
+             std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end();
+             if (usedGrid.find(currentGrid) == usedGrid.end())
              {
-               if (0 < dataSize_.count(it->first)) dataSize_[it->first] += it->second;
-               else dataSize_.insert(make_pair(it->first, it->second));
-             }
-           } else
-           {
-             for (; it != itE; ++it)
+               for (; it != itE; ++it)
+               {
+                 if (0 < dataSize_.count(it->first)) dataSize_[it->first] += it->second;
+                 else dataSize_.insert(make_pair(it->first, it->second));
+               }
+             } else
              {
-               if (0 < dataSize_.count(it->first))
-                if (CXios::isOptPerformance) dataSize_[it->first] += it->second;
-                else
-                {
-                  if (dataSize_[it->first] < it->second) dataSize_[it->first] = it->second;
-                }
-               else dataSize_.insert(make_pair(it->first, it->second));
+               for (; it != itE; ++it)
+               {
+                 if (0 < dataSize_.count(it->first))
+                  if (CXios::isOptPerformance) dataSize_[it->first] += it->second;
+                  else
+                  {
+                    if (dataSize_[it->first] < it->second) dataSize_[it->first] = it->second;
+                  }
+                 else dataSize_.insert(make_pair(it->first, it->second));
+               }
              }
            }
Index: /XIOS/trunk/src/node/context.hpp
===================================================================
--- /XIOS/trunk/src/node/context.hpp	(revision 597)
+++ /XIOS/trunk/src/node/context.hpp	(revision 598)
@@ -105,4 +105,5 @@
          void solveAllInheritance(bool apply=true);
          void findEnabledFiles(void);
+         void findEnabledReadModeFiles(void);
          void closeAllFile(void);
          void updateCalendar(int step);
@@ -110,4 +111,6 @@
          void solveAllRefOfEnabledFields(bool sendToServer);
          void buildAllExpressionOfEnabledFields();
+         void startPrefetchingOfEnabledReadModeFiles();
+         void checkPrefetchingOfEnabledReadModeFiles();
          void findFieldsWithReadAccess(void);
          void solveAllRefOfFieldsWithReadAccess();
@@ -187,6 +190,8 @@
          boost::shared_ptr<CCalendar>   calendar;
 
-         // List of all enabled files (files on which fields are written)
+         // List of all enabled files (files on which fields are written or read)
          std::vector<CFile*> enabledFiles;
+         // List of all enabled files in read mode (files on which fields are read)
+         std::vector<CFile*> enabledReadModeFiles;
 
          // List of all fields whose instant data is accessible from the public API
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 597)
+++ /XIOS/trunk/src/node/field.cpp	(revision 598)
@@ -28,4 +28,5 @@
       , active(false) , hasOutputFile(false),hasFieldOut(false), slotUpdateDate(NULL)
       , processed(false), domAxisIds_("", ""), areAllReferenceSolved(false), areAllExpressionBuilt(false)
+      , isReadDataRequestPending(false)
       { setVirtualVariableGroup(); }
 
@@ -40,4 +41,5 @@
       , active(false), hasOutputFile(false), hasFieldOut(false), slotUpdateDate(NULL)
       , processed(false), domAxisIds_("", ""), areAllReferenceSolved(false), areAllExpressionBuilt(false)
+      , isReadDataRequestPending(false)
    { setVirtualVariableGroup(); }
 
@@ -112,7 +114,6 @@
    }
 
-   bool CField::dispatchEvent(CEventServer& event)
-  {
-
+  bool CField::dispatchEvent(CEventServer& event)
+  {
     if (SuperClass::dispatchEvent(event)) return true;
     else
@@ -125,13 +126,23 @@
           break;
 
-            case EVENT_ID_ADD_VARIABLE :
-             recvAddVariable(event);
-             return true;
-             break;
-
-           case EVENT_ID_ADD_VARIABLE_GROUP :
-             recvAddVariableGroup(event);
-             return true;
-             break;
+        case EVENT_ID_READ_DATA :
+          recvReadDataRequest(event);
+          return true;
+          break;
+
+        case EVENT_ID_READ_DATA_READY :
+          recvReadDataReady(event);
+          return true;
+          break;
+
+        case EVENT_ID_ADD_VARIABLE :
+          recvAddVariable(event);
+          return true;
+          break;
+
+        case EVENT_ID_ADD_VARIABLE_GROUP :
+          recvAddVariableGroup(event);
+          return true;
+          break;
 
         default :
@@ -263,4 +274,124 @@
       }
     }
+  }
+
+  void CField::sendReadDataRequest(void)
+  {
+    CContext* context = CContext::getCurrent();
+    CContextClient* client = context->client;
+
+    CEventClient event(getType(), EVENT_ID_READ_DATA);
+    if (client->isServerLeader())
+    {
+      CMessage msg;
+      msg << getId();
+      const std::list<int>& ranks = client->getRanksServerLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        event.push(*itRank, 1, msg);
+      client->sendEvent(event);
+    }
+    else client->sendEvent(event);
+
+    lastDataRequestedFromServer = context->getCalendar()->getCurrentDate();
+    isReadDataRequestPending = true;
+  }
+
+  /*!
+  Send request new data read from file if need be, that is the current data is out-of-date.
+  \return true if and only if some data was requested
+  */
+  bool CField::sendReadDataRequestIfNeeded(void)
+  {
+    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
+
+    bool requestData = (currentDate >= lastDataRequestedFromServer + file->output_freq.getValue());
+
+    if (requestData)
+      sendReadDataRequest();
+
+    return requestData;
+  }
+
+  void CField::recvReadDataRequest(CEventServer& event)
+  {
+    CBufferIn* buffer = event.subEvents.begin()->buffer;
+    StdString fieldId;
+    *buffer >> fieldId;
+    get(fieldId)->recvReadDataRequest();
+  }
+
+  void CField::recvReadDataRequest(void)
+  {
+    CContext* context = CContext::getCurrent();
+    CContextClient* client = context->client;
+
+    CEventClient event(getType(), EVENT_ID_READ_DATA_READY);
+    std::list<CMessage> msgs;
+
+    // TODO: Read the data from the file
+    if (data_srv.empty())
+    {
+      for (map<int, CArray<size_t, 1>* >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
+        data_srv.insert( pair<int, CArray<double,1>* >(it->first, new CArray<double,1>(it->second->numElements())));
+    }
+
+    map<int, CArray<double,1>* >::iterator it;
+    for (it = data_srv.begin(); it != data_srv.end(); it++)
+    {
+      msgs.push_back(CMessage());
+      CMessage& msg = msgs.back();
+      msg << getId() << getNStep() << *it->second;
+      event.push(it->first, grid->nbSenders[it->first], msg);
+    }
+    client->sendEvent(event);
+
+    incrementNStep();
+  }
+
+  void CField::recvReadDataReady(CEventServer& event)
+  {
+    string fieldId;
+    vector<int> ranks;
+    vector<CBufferIn*> buffers;
+
+    list<CEventServer::SSubEvent>::iterator it;
+    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
+    {
+      ranks.push_back(it->rank);
+      CBufferIn* buffer = it->buffer;
+      *buffer >> fieldId;
+      buffers.push_back(buffer);
+    }
+    get(fieldId)->recvReadDataReady(ranks, buffers);
+  }
+
+  void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers)
+  {
+    CContext* context = CContext::getCurrent();
+    StdSize record;
+    for (int i = 0; i < ranks.size(); i++)
+    {
+      int rank = ranks[i];
+      CArray<int,1>& index = *grid->storeIndex_toSrv[rank];
+      CArray<double,1> data_tmp(index.numElements());
+      *buffers[i] >> record >> data_tmp;
+
+      for (int n = 0; n < data_tmp.numElements(); n++)
+        instantData(index(n)) = data_tmp(n);
+    }
+
+    for (list< pair<CField*, int> >::iterator it = fieldDependency.begin(); it != fieldDependency.end(); ++it)
+      it->first->setSlot(it->second);
+
+    if (!hasExpression) // Should be always true ?
+    {
+      const std::vector<CField*>& refField = getAllReference();
+      std::vector<CField*>::const_iterator it = refField.begin(), end = refField.end();
+
+      for (; it != end; it++) (*it)->setDataFromExpression(instantData);
+      if (hasFieldOut) updateDataFromExpression(instantData);
+    }
+
+    isReadDataRequestPending = false;
   }
 
@@ -477,4 +608,6 @@
          const CDuration toffset = this->freq_operation - freq_offset.getValue() - context->getCalendar()->getTimeStep();
          *this->last_operation   = *this->last_operation - toffset;
+
+         lastDataRequestedFromServer.setRelCalendar(*context->getCalendar());
 
         if (operation.get() == "once") isOnceOperation = true;
Index: /XIOS/trunk/src/node/field.hpp
===================================================================
--- /XIOS/trunk/src/node/field.hpp	(revision 597)
+++ /XIOS/trunk/src/node/field.hpp	(revision 598)
@@ -54,5 +54,6 @@
          enum EEventId
          {
-           EVENT_ID_UPDATE_DATA, EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP
+           EVENT_ID_UPDATE_DATA, EVENT_ID_READ_DATA, EVENT_ID_READ_DATA_READY,
+           EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP
          } ;
 
@@ -133,4 +134,10 @@
         void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers) ;
         void writeField(void) ;
+        void sendReadDataRequest(void);
+        bool sendReadDataRequestIfNeeded(void);
+        static void recvReadDataRequest(CEventServer& event);
+        void recvReadDataRequest(void);
+        static void recvReadDataReady(CEventServer& event);
+        void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers);
         void outputField(CArray<double,3>& fieldOut) ;
         void outputField(CArray<double,2>& fieldOut) ;
@@ -172,4 +179,5 @@
          boost::shared_ptr<CDate>    last_Write, last_operation;
          boost::shared_ptr<CDate>    lastlast_Write_srv,last_Write_srv, last_operation_srv;
+         CDate lastDataRequestedFromServer;
 
          boost::shared_ptr<func::CFunctor> foperation;
@@ -198,4 +206,5 @@
          bool areAllExpressionBuilt;
          std::pair<StdString,StdString> domAxisIds_;
+         bool isReadDataRequestPending;
          DECLARE_REF_FUNC(Field,field)
 //       public:
Index: /XIOS/trunk/src/node/field_impl.hpp
===================================================================
--- /XIOS/trunk/src/node/field_impl.hpp	(revision 597)
+++ /XIOS/trunk/src/node/field_impl.hpp	(revision 598)
@@ -184,4 +184,10 @@
     if (!read_access.isEmpty() && read_access.getValue() && hasInstantData)
     {
+      CContext* context = CContext::getCurrent();
+      const CDate& currentDate = context->getCalendar()->getCurrentDate();
+
+      while (isReadDataRequestPending)
+        context->checkBuffersAndListen();
+
       grid->outputField(instantData, _data);
     }
Index: /XIOS/trunk/src/node/file.cpp
===================================================================
--- /XIOS/trunk/src/node/file.cpp	(revision 597)
+++ /XIOS/trunk/src/node/file.cpp	(revision 598)
@@ -517,4 +517,30 @@
    }
 
+   /*!
+     Prefetching the data for enabled fields read from file.
+   */
+   void CFile::prefetchEnabledReadModeFields(void)
+   {
+     if (mode.isEmpty() || mode.getValue() != mode_attr::read)
+       return;
+
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+       this->enabledFields[i]->sendReadDataRequest();
+   }
+
+   /*!
+     Prefetching the data for enabled fields read from file whose data is out-of-date.
+   */
+   void CFile::prefetchEnabledReadModeFieldsIfNeeded(void)
+   {
+     if (mode.isEmpty() || mode.getValue() != mode_attr::read)
+       return;
+
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+       this->enabledFields[i]->sendReadDataRequestIfNeeded();
+   }
+
    void CFile::solveFieldRefInheritance(bool apply)
    {
Index: /XIOS/trunk/src/node/file.hpp
===================================================================
--- /XIOS/trunk/src/node/file.hpp	(revision 597)
+++ /XIOS/trunk/src/node/file.hpp	(revision 598)
@@ -105,4 +105,6 @@
          void solveAllRefOfEnabledFields(bool sendToServer);
          void buildAllExpressionOfEnabledFields();
+         void prefetchEnabledReadModeFields();
+         void prefetchEnabledReadModeFieldsIfNeeded();
 
          // Add component into file
Index: /XIOS/trunk/src/node/grid.cpp
===================================================================
--- /XIOS/trunk/src/node/grid.cpp	(revision 597)
+++ /XIOS/trunk/src/node/grid.cpp	(revision 598)
@@ -669,13 +669,17 @@
   void CGrid::recvIndex(CEventServer& event)
   {
-    list<CEventServer::SSubEvent>::iterator it ;
+    string gridId;
+    vector<int> ranks;
+    vector<CBufferIn*> buffers;
+
+    list<CEventServer::SSubEvent>::iterator it;
     for (it=event.subEvents.begin();it!=event.subEvents.end();++it)
     {
-      int rank=it->rank;
-      CBufferIn* buffer=it->buffer;
-      string gridId ;
-      *buffer>>gridId ;
-      get(gridId)->recvIndex(rank,*buffer) ;
-    }
+      ranks.push_back(it->rank);
+      CBufferIn* buffer = it->buffer;
+      *buffer >> gridId;
+      buffers.push_back(buffer);
+    }
+    get(gridId)->recvIndex(ranks, buffers) ;
   }
 
@@ -748,89 +752,98 @@
   }
 
-  void CGrid::recvIndex(int rank, CBufferIn& buffer)
-  {
-    CContext* context = CContext::getCurrent() ;
-    CContextServer* server=context->server ;
-    buffer>>isDataDistributed_;
-    size_t dataSize = 0;
-
-    if (true == scalar_grid)
-    {
-       writtenDataSize_ = 1;
-       CArray<size_t,1> outIndex;
-       buffer>>outIndex;
-       outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex)));
-       std::vector<int> nZoomBegin(1,0), nZoomSize(1,1), nGlob(1,1), nZoomBeginGlobal(1,0);
-       serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
-                                                     nZoomBeginGlobal, nGlob);
-       return;
-    }
-
-
-     if (0 == serverDistribution_)
-     {
-       int idx = 0, numElement = axis_domain_order.numElements();
-       int ssize = numElement;
-       std::vector<int> indexMap(numElement);
-       for (int i = 0; i < numElement; ++i)
-       {
-         indexMap[i] = idx;
-         if (true == axis_domain_order(i))
-         {
+  void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers)
+  {
+    CContext* context = CContext::getCurrent();
+    CContextServer* server = context->server;
+
+    for (int n = 0; n < ranks.size(); n++)
+    {
+      int rank = ranks[n];
+      CBufferIn& buffer = *buffers[n];
+
+      buffer >> isDataDistributed_;
+      size_t dataSize = 0;
+
+      if (true == scalar_grid)
+      {
+        writtenDataSize_ = 1;
+        CArray<size_t,1> outIndex;
+        buffer >> outIndex;
+        outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex)));
+        std::vector<int> nZoomBegin(1,0), nZoomSize(1,1), nGlob(1,1), nZoomBeginGlobal(1,0);
+        serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
+                                                      nZoomBeginGlobal, nGlob);
+        return;
+      }
+
+      if (0 == serverDistribution_)
+      {
+        int idx = 0, numElement = axis_domain_order.numElements();
+        int ssize = numElement;
+        std::vector<int> indexMap(numElement);
+        for (int i = 0; i < numElement; ++i)
+        {
+          indexMap[i] = idx;
+          if (true == axis_domain_order(i))
+          {
             ++ssize;
             idx += 2;
-         }
-         else
-          ++idx;
-       }
-
-       int axisId = 0, domainId = 0;
-       std::vector<CDomain*> domainList = getDomains();
-       std::vector<CAxis*> axisList = getAxis();
-       std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize);
-       for (int i = 0; i < numElement; ++i)
-       {
-         if (axis_domain_order(i))
-         {
-            nZoomBegin[indexMap[i]]   = domainList[domainId]->zoom_ibegin_srv;
-            nZoomSize[indexMap[i]]    = domainList[domainId]->zoom_ni_srv;
+          }
+          else
+            ++idx;
+        }
+
+        int axisId = 0, domainId = 0;
+        std::vector<CDomain*> domainList = getDomains();
+        std::vector<CAxis*> axisList = getAxis();
+        std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize);
+        for (int i = 0; i < numElement; ++i)
+        {
+          if (axis_domain_order(i))
+          {
+            nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin_srv;
+            nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni_srv;
             nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->zoom_ibegin;
-            nGlob[indexMap[i]]    = domainList[domainId]->ni_glo;
-
-            nZoomBegin[indexMap[i]+1] = domainList[domainId]->zoom_jbegin_srv;
-            nZoomSize[indexMap[i]+1]  = domainList[domainId]->zoom_nj_srv;
-            nZoomBeginGlobal[indexMap[i]+1] = domainList[domainId]->zoom_jbegin;
-            nGlob[indexMap[i]+1]    = domainList[domainId]->nj_glo;
+            nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
+
+            nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin_srv;
+            nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj_srv;
+            nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin;
+            nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
             ++domainId;
-         }
-         else
-         {
+          }
+          else
+          {
             nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv;
             nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_size_srv;
             nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->zoom_begin;
-            nGlob[indexMap[i]]      = axisList[axisId]->size;
+            nGlob[indexMap[i]] = axisList[axisId]->size;
             ++axisId;
-         }
-       }
-       dataSize = 1;
-       for (int i = 0; i < nZoomSize.size(); ++i)
-        dataSize *= nZoomSize[i];
-
-       serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
-                                                     nZoomBeginGlobal, nGlob);
-     }
-
-     CArray<size_t,1> outIndex;
-     buffer>>outIndex;
-     if (isDataDistributed_)
-      serverDistribution_->computeLocalIndex(outIndex);
-     else
-     {
-       dataSize = outIndex.numElements();
-       for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i;
-     }
-     writtenDataSize_ += dataSize;
-
-     outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex)));
+          }
+        }
+        dataSize = 1;
+        for (int i = 0; i < nZoomSize.size(); ++i)
+          dataSize *= nZoomSize[i];
+
+        serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
+                                                      nZoomBeginGlobal, nGlob);
+      }
+
+      CArray<size_t,1> outIndex;
+      buffer >> outIndex;
+      if (isDataDistributed_)
+        serverDistribution_->computeLocalIndex(outIndex);
+      else
+      {
+        dataSize = outIndex.numElements();
+        for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i;
+      }
+      writtenDataSize_ += dataSize;
+
+      outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex)));
+      connectedDataSize_[rank] = outIndex.numElements();
+    }
+
+    nbSenders = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
   }
 
Index: /XIOS/trunk/src/node/grid.hpp
===================================================================
--- /XIOS/trunk/src/node/grid.hpp	(revision 597)
+++ /XIOS/trunk/src/node/grid.hpp	(revision 598)
@@ -157,5 +157,5 @@
          void outputFieldToServer(CArray<double,1>& fieldIn, int rank, CArray<double,1>& fieldOut) ;
          static void recvIndex(CEventServer& event) ;
-         void recvIndex(int rank, CBufferIn& buffer) ;
+         void recvIndex(vector<int> ranks, vector<CBufferIn*> buffers) ;
          void sendIndex(void) ;
          void sendIndexScalarGrid();
