Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp	(revision 1872)
@@ -2144,5 +2144,5 @@
 
             if (field->compression_level.isEmpty())
-              field->compression_level = field->file->compression_level.isEmpty() ? 0 : field->file->compression_level;
+              field->compression_level = field->getRelFile()->compression_level.isEmpty() ? 0 : field->getRelFile()->compression_level;
             SuperClassWriter::setCompressionLevel(fieldid, field->compression_level);
 
@@ -2374,9 +2374,9 @@
         if (!field->wasWritten())
         {
-          if (appendMode && field->file->record_offset.isEmpty() && 
+          if (appendMode && field->getRelFile()->record_offset.isEmpty() && 
               field->getOperationTimeType() != func::CFunctor::once)
           {
             double factorUnit;
-            if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days)
+            if (!field->getRelFile()->time_units.isEmpty() && field->getRelFile()->time_units==CFile::time_units_attr::days)
             factorUnit=context->getCalendar()->getDayLengthInSeconds() ;
             else factorUnit=1 ;
@@ -2439,5 +2439,5 @@
           }
 
-          if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days)
+          if (!field->getRelFile()->time_units.isEmpty() && field->getRelFile()->time_units==CFile::time_units_attr::days)
           {
             double secByDay=context->getCalendar()->getDayLengthInSeconds() ;
@@ -2678,5 +2678,5 @@
 
          StdString strTimeUnits ;
-         if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) strTimeUnits="days since " ;
+         if (!field->getRelFile()->time_units.isEmpty() && field->getRelFile()->time_units==CFile::time_units_attr::days) strTimeUnits="days since " ;
          else  strTimeUnits="seconds since " ;
  
@@ -2685,5 +2685,5 @@
 
 
-         if (field->file->time_counter.isEmpty())
+         if (field->getRelFile()->time_counter.isEmpty())
          {
            if (timeCounterType==none) createTimeCounterAxis=true ;
@@ -2699,5 +2699,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::instant)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::instant)
          {
            if (field->hasTimeCentered)
@@ -2712,5 +2712,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::centered)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::centered)
          {
            if (field->hasTimeCentered)
@@ -2725,5 +2725,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::instant_exclusive)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::instant_exclusive)
          {
            if (field->hasTimeCentered)
@@ -2737,5 +2737,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::centered_exclusive)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::centered_exclusive)
          {
            if (field->hasTimeCentered)
@@ -2749,5 +2749,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::exclusive)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::exclusive)
          {
            if (field->hasTimeCentered)
@@ -2770,5 +2770,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::none)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::none)
          {
            if (field->hasTimeCentered)
@@ -2781,5 +2781,5 @@
            }
          }
-         else if (field->file->time_counter==CFile::time_counter_attr::record)
+         else if (field->getRelFile()->time_counter==CFile::time_counter_attr::record)
          {
            if (timeCounterType==none) createTimeCounterAxis=true ;
@@ -2852,6 +2852,6 @@
                 SuperClassWriter::addAttribute("axis", string("T"), &axisId);
 
-                if (field->file->time_counter.isEmpty() || 
-                   (field->file->time_counter != CFile::time_counter_attr::record))
+                if (field->getRelFile()->time_counter.isEmpty() || 
+                   (field->getRelFile()->time_counter != CFile::time_counter_attr::record))
                 {
                   CDate timeOrigin = cal->getTimeOrigin();
@@ -2865,5 +2865,5 @@
 
              // Adding time_counter_bound dimension
-             if (field->file->time_counter.isEmpty() || (field->file->time_counter != CFile::time_counter_attr::record))
+             if (field->getRelFile()->time_counter.isEmpty() || (field->getRelFile()->time_counter != CFile::time_counter_attr::record))
              {
                 if (!SuperClassWriter::varExist(axisBoundId))
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1872)
@@ -383,6 +383,6 @@
         for (int i = 0; i < data_n; ++i)
         {
-          if ((i+data_begin) >= 0 && (i+data_begin<n) && !mask(i+data_begin))
-            data_index(i) = -1;
+           if (data_index(i) >= 0 && data_index(i)<n)
+             if (!mask(data_index(i))) data_index(i) = -1;
         }
       }
@@ -1281,5 +1281,5 @@
     nonCompressedData = -1;   
     // Mask is incorporated into data_index and is not sent/received anymore
-    mask.resize(0);
+    mask.reset();
     if (hasValue)
       value.resize(nbData);
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 1872)
@@ -1091,4 +1091,5 @@
     else if (serviceType_==CServicesManager::CLIENT) for(auto file : this->enabledWriteModeFiles) file->setContextClient(client) ;
 
+    if (serviceType_==CServicesManager::CLIENT) for(auto file : this->enabledReadModeFiles) file->setContextClient(client) ;
    
     // workflow endpoint => sent to IO/SERVER
@@ -1152,5 +1153,5 @@
         field->connectToServerInput(garbageCollector) ; // connect the field to server filter
         field->computeGridIndexToFileServer() ; // compute grid index for transfer to the server context
-        field->sendFieldToFileServer() ;
+        field->sendFieldToInputFileServer() ;
       }
     }
@@ -1164,5 +1165,9 @@
 
     if (serviceType_==CServicesManager::CLIENT || serviceType_==CServicesManager::GATHERER) this->sendCloseDefinition();
-    if (serviceType_==CServicesManager::IO_SERVER || serviceType_==CServicesManager::OUT_SERVER)  createFileHeader();
+    if (serviceType_==CServicesManager::IO_SERVER || serviceType_==CServicesManager::OUT_SERVER)  
+    {
+      createFileHeader();
+    }
+
     if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles();
    
@@ -2627,6 +2632,6 @@
       vector<CFile*>::const_iterator it;
 
-      for (it=enabledFiles.begin(); it != enabledFiles.end(); it++)
-      // for (it=enabledWriteModeFiles.begin(); it != enabledWriteModeFiles.end(); it++)
+      //for (it=enabledFiles.begin(); it != enabledFiles.end(); it++)
+      for (it=enabledWriteModeFiles.begin(); it != enabledWriteModeFiles.end(); it++)
       {
          (*it)->initWrite();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 1872)
@@ -33,5 +33,4 @@
   CField::CField(void)
     : CObjectTemplate<CField>(), CFieldAttributes()
-    , file()
     , written(false)
     , nstep(0), nstepMax(0)
@@ -51,5 +50,4 @@
   CField::CField(const StdString& id)
     : CObjectTemplate<CField>(id), CFieldAttributes()
-    , file()
     , written(false)
     , nstep(0), nstepMax(0)
@@ -360,8 +358,8 @@
       info(20) << "currentDate : " << currentDate << endl ;
       info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ;
-      info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ;
-      info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ;
-
-      dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq, file->getContextClient());
+      info(20) << "fileIn_->output_freq.getValue() : " << fileIn_->output_freq.getValue() << endl ;
+      info(20) << "lastDataRequestedFromServer + fileIn_->output_freq.getValue() : " << lastDataRequestedFromServer + fileIn_->output_freq << endl ;
+
+      dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + fileIn_->output_freq, fileIn_->getContextClient());
     }
 
@@ -580,5 +578,5 @@
 
     if (wasDataAlreadyReceivedFromServer)
-      lastDataReceivedFromServer = lastDataReceivedFromServer + file->output_freq;
+      lastDataReceivedFromServer = lastDataReceivedFromServer + fileIn_->output_freq;
     else
     {
@@ -616,5 +614,5 @@
       do
       {
-        const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate();
+        const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + fileIn_->output_freq) : context->getCalendar()->getInitDate();
         isDataLate = (nextDataDue <= currentDate);
 
@@ -659,5 +657,5 @@
 
   //----------------------------------------------------------------
-
+/*
   void CField::setRelFile(CFile* _file)
   TRY
@@ -667,5 +665,5 @@
   }
   CATCH_DUMP_ATTR
-
+*/
   //----------------------------------------------------------------
 
@@ -688,5 +686,7 @@
   TRY
   {
-    return this->file;
+    if (hasFileIn()) return this->fileIn_;
+    else if (hasFileOut()) return this->fileOut_ ;
+    else return nullptr ;
   }
   CATCH
@@ -1098,12 +1098,10 @@
     CContext* context = CContext::getCurrent();
 
-    if (context->getServiceType()==CServicesManager::CLIENT || !hasOutputFile) return;
-
     if (freq_op.isEmpty()) freq_op.setValue(TimeStep);
 
     if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu);
 
-    freq_operation_srv = file->output_freq.getValue();
-    freq_write_srv     = file->output_freq.getValue();
+    freq_operation_srv = fileOut_->output_freq.getValue();
+    freq_write_srv     = fileOut_->output_freq.getValue();
 
     lastlast_Write_srv = context->getCalendar()->getInitDate();
@@ -1234,4 +1232,12 @@
     }
     
+    if (hasFileOut())
+    {
+      if (fileOut_->isServerSide())
+      {
+        this->solveServerOperation() ;
+      }
+    }
+
     buildWorkflowGraphDone_ = true ;
     workflowEnabled_ = true ;
@@ -1288,5 +1294,11 @@
   void CField::connectToServerInput(CGarbageCollector& gc)
   {
-    serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc,  grid_, false, false));
+    const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
+    const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0);
+
+    checkTimeAttributes();
+    serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid_, true, false, freq_offset, true,
+                                                                          detectMissingValues, defaultValue));
+    //serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc,  grid_, false, false));
     serverSourceFilter -> connectOutput(inputFilter,0) ;
   } 
@@ -1382,5 +1394,5 @@
       if (enableOutput && !storeFilter && !fileWriterFilter)
       {
-        if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
+        if (getRelFile() && (getRelFile()->mode.isEmpty() || getRelFile()->mode == CFile::mode_attr::write))
         {
           fileServerWriterFilter = std::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this));
@@ -1397,7 +1409,7 @@
       if (enableOutput && !storeFilter && !fileWriterFilter)
       {
-        if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
+        if (getRelFile() && (getRelFile()->mode.isEmpty() || getRelFile()->mode == CFile::mode_attr::write))
         {
-          fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, file->getContextClient()));
+          fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, getRelFile()->getContextClient()));
           instantDataFilter->connectOutput(fileWriterFilter, 0);
         }
@@ -1433,5 +1445,5 @@
         else if (!field_ref.isEmpty()) instantDataFilter = getFieldReference(gc);
         // Check if the data is to be read from a file
-        else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
+        else if (getRelFile() && !getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::read)
         {
           checkTimeAttributes();
@@ -1457,8 +1469,8 @@
         }
 
-        if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
+        if (getRelFile() && (getRelFile()->mode.isEmpty() || getRelFile()->mode == CFile::mode_attr::write))
         {
-          fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, file->getContextClient()));
-          getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0);
+          fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, getRelFile()->getContextClient()));
+          getTemporalDataFilter(gc, getRelFile()->output_freq)->connectOutput(fileWriterFilter, 0);
         }
       }
@@ -2001,5 +2013,5 @@
     if (context->getServiceType()==CServicesManager::GATHERER)
     {
-      if (file->mode.isEmpty() || (!file->mode.isEmpty() && file->mode == CFile::mode_attr::write))
+      if (getRelFile()->mode.isEmpty() || (!getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::write))
         grid_->setContextClient(contextClient);
     }
@@ -2020,6 +2032,18 @@
   {
     CContext::getCurrent()->sendContextToFileServer(client);
-    fileOut_->sendFileToFileServer(client);
+    getRelFile()->sendFileToFileServer(client);
     grid_->sendGridToFileServer(client);
+    this->sendAllAttributesToServer(client);
+    this->sendAddAllVariables(client);
+  }
+  
+  void CField::sendFieldToInputFileServer(void)
+  {
+    CContext::getCurrent()->sendContextToFileServer(client);
+    getRelFile()->sendFileToFileServer(client);
+    grid_->sendGridToFileServer(client);
+    read_access=true ; // not the best solution, but on server side, the field must be a starting point of the workflow
+                       // must be replace by a better solution when implementing filters for reading and send to client
+                       // on server side
     this->sendAllAttributesToServer(client);
     this->sendAddAllVariables(client);
@@ -2121,6 +2145,6 @@
   TRY
   {
-    bool isFieldRead  = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read;
-    bool isFieldWrite = file && ( file->mode.isEmpty() ||  file->mode == CFile::mode_attr::write);
+    bool isFieldRead  = getRelFile() && !getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::read;
+    bool isFieldWrite = getRelFile() && ( getRelFile()->mode.isEmpty() ||  getRelFile()->mode == CFile::mode_attr::write);
     if (isFieldRead && !(operation.getValue() == "instant" || operation.getValue() == "once") )     
       ERROR("void CField::checkTimeAttributes(void)",
@@ -2132,5 +2156,5 @@
       if (operation.getValue() == "instant")
       {
-        if (isFieldRead || isFieldWrite) freq_op.setValue(file->output_freq.getValue());
+        if (isFieldRead || isFieldWrite) freq_op.setValue(getRelFile()->output_freq.getValue());
         else freq_op=*freqOp ;
       }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 1872)
@@ -144,4 +144,5 @@
 
          void sendFieldToFileServer(void) ;
+         void sendFieldToInputFileServer(void) ;
 
          /// VÃ©rifications ///
@@ -248,8 +249,8 @@
 
          CGrid*  grid_=nullptr;
-         CFile*  file;
+//         CFile*  file;
          
          CFile* fileIn_ = nullptr ; //<! pointer to input related file
-         bool hasFileIn(void) { return fileIn_==nullptr ? false : true ;}
+         bool hasFileIn(void) const { return fileIn_==nullptr ? false : true ;} 
          CFile* getFileIn(void) {return fileIn_;}
          void setFileIn(CFile* fileIn) { fileIn_ = fileIn ;}
@@ -257,5 +258,5 @@
 
          CFile* fileOut_ = nullptr ; //<! pointer to output related file
-         bool hasFileOut(void) { return fileOut_==nullptr ? false : true ;}
+         bool hasFileOut(void) const { return fileOut_==nullptr ? false : true ;} 
          CFile* getFileOut(void) {return fileOut_;}
          void setFileOut(CFile* fileOut) { fileOut_ = fileOut ;}
@@ -263,5 +264,5 @@
 
          CCouplerIn* couplerIn_ = nullptr ; //<!pointer to input related coupler
-         bool hasCouplerIn(void) { return couplerIn_==nullptr ? false : true ;}
+         bool hasCouplerIn(void) const { return couplerIn_==nullptr ? false : true ;}
          CCouplerIn* getCouplerIn(void) {return couplerIn_;}
          void setCouplerIn(CCouplerIn* couplerIn) { couplerIn_ = couplerIn ;}
@@ -269,5 +270,5 @@
 
          CCouplerOut* couplerOut_ = nullptr ; //<!pointer to output related coupler
-         bool hasCouplerOut(void) { return couplerOut_==nullptr ? false : true ;}
+         bool hasCouplerOut(void) const { return couplerOut_==nullptr ? false : true ;}
          CCouplerOut* getCouplerOut(void) {return couplerOut_;}
          void setCouplerOut(CCouplerOut* couplerOut) { couplerOut_ = couplerOut ;}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp	(revision 1872)
@@ -276,6 +276,9 @@
     TRY
     {
+      CContext* context = CContext::getCurrent();
       if (checkRead) return;
-      createSubComFile();
+      //createSubComFile();
+      allZoneEmpty = false; 
+      MPI_Comm_dup(context->intraComm_, &fileComm) ;
       checkRead = true;
     }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1871)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1872)
@@ -253,5 +253,5 @@
        bool computeServerDistribution_done_=false ;
      public: 
-       CDistributionServer* getServerDistribution(void) { if (computeServerDistribution_done_) computeServerDistribution() ; return serverDistribution_ ;}
+       CDistributionServer* getServerDistribution(void) { if (!computeServerDistribution_done_) computeServerDistribution() ; return serverDistribution_ ;}
 
 
