Index: XIOS/dev/branch_yushan/src/attribute_map.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/attribute_map.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/attribute_map.cpp	(revision 1037)
@@ -28,4 +28,9 @@
 
       //---------------------------------------------------------------
+
+      bool CAttributeMap::hasAttribute(const StdString& key) const
+      {
+         return (this->find(key) != this->end());
+      }
 
       void CAttributeMap::clearAttribute(const StdString& key)
Index: XIOS/dev/branch_yushan/src/attribute_map.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/attribute_map.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/attribute_map.hpp	(revision 1037)
@@ -20,5 +20,5 @@
 
             /// Tests ///
-            bool hasAttribute(const StdString & key) const;
+            inline bool hasAttribute(const StdString & key) const;
 
             /// Accesseurs ///
@@ -72,9 +72,4 @@
       };  // class CAttributeMap
 
-      inline bool CAttributeMap::hasAttribute(const StdString& key) const
-      {
-         return (this->find(key) != this->end());
-      }
-
 } // namespace xios
 
Index: XIOS/dev/branch_yushan/src/attribute_template_impl.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/attribute_template_impl.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/attribute_template_impl.hpp	(revision 1037)
@@ -71,13 +71,13 @@
          T CAttributeTemplate<T>::getValue(void) const
       {
-        return CType<T>::get() ;
-/*
-        if (SuperClass::isEmpty())
-        {
-           ERROR("T CAttributeTemplate<T>::getValue(void) const",
-                 << "[ id = " << this->getId() << "]"
-                 << " L'attribut est requis mais n'est pas dÃ©fini !");
-         }
-        return (SuperClass::getValue<T>());
+         return CType<T>::get() ;
+/*
+         if (SuperClass::isEmpty())
+         {
+            ERROR("T CAttributeTemplate<T>::getValue(void) const",
+                  << "[ id = " << this->getId() << "]"
+                  << " L'attribut est requis mais n'est pas dÃ©fini !");
+          }
+         return (SuperClass::getValue<T>());
 */
       }
Index: XIOS/dev/branch_yushan/src/buffer_client.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/buffer_client.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/buffer_client.cpp	(revision 1037)
@@ -7,4 +7,5 @@
 #include "mpi.hpp"
 #include "tracer.hpp"
+
 
 namespace xios
@@ -80,4 +81,6 @@
       traceOn();
       if (flag == true) pending = false;
+
+      //printf("\ncheckbuffer, flag = %d, pending = %d; request = %p, count = %d\n", flag, pending, &request, count);
     }
 
Index: XIOS/dev/branch_yushan/src/buffer_client.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/buffer_client.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/buffer_client.hpp	(revision 1037)
@@ -6,4 +6,7 @@
 #include "mpi.hpp"
 #include "cxios.hpp"
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/client.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/client.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/client.cpp	(revision 1037)
@@ -30,4 +30,6 @@
       if (initialized) is_MPI_Initialized=true ;
       else is_MPI_Initialized=false ;
+      
+      //return;
 
 // don't use OASIS
@@ -87,4 +89,5 @@
 
           MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ;
+        
 
           if (CXios::usingServer)
@@ -97,5 +100,5 @@
             MPI_Comm_rank(intraComm,&intraCommRank) ;
             info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize
-                 <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ;
+                 <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader<<endl ;
             MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ;
           }
@@ -148,4 +151,5 @@
 
       MPI_Comm_dup(intraComm,&returnComm) ;
+
     }
 
@@ -160,4 +164,7 @@
       if (!CXios::isServer)
       {
+      
+        
+        
         int size,rank,globalRank ;
         size_t message_size ;
@@ -165,4 +172,5 @@
         MPI_Comm contextInterComm ;
 
+        
         MPI_Comm_size(contextComm,&size) ;
         MPI_Comm_rank(contextComm,&rank) ;
@@ -173,22 +181,33 @@
         CMessage msg ;
         msg<<idServer<<size<<globalRank ;
-//        msg<<id<<size<<globalRank ;
+
 
         int messageSize=msg.size() ;
-        char * buff = new char[messageSize] ;
-        CBufferOut buffer((void*)buff,messageSize) ;
+        void * buff = new char[messageSize] ;
+        CBufferOut buffer(buff,messageSize) ;
         buffer<<msg ;
-
-        MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ;
+        
+        
+
+        MPI_Send(buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ;
         delete [] buff ;
+        
+        printf("====== Client: begin context_init \n");
+      
 
         MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ;
         info(10)<<"Register new Context : "<<id<<endl ;
+        
+        cout<<"Register new Context : "<<id<<endl ;
+              
 
         MPI_Comm inter ;
         MPI_Intercomm_merge(contextInterComm,0,&inter) ;
         MPI_Barrier(inter) ;
-
+        
+        
         context->initClient(contextComm,contextInterComm) ;
+        
+        printf("====== Client: context_init OK\n");
 
         contextInterComms.push_back(contextInterComm);
@@ -220,4 +239,6 @@
 
       MPI_Comm_rank(intraComm,&rank) ;
+      
+      printf("CClient::finalize called isServer = %d\n", CXios::isServer);
  
       if (!CXios::isServer)
@@ -227,4 +248,5 @@
         {
           MPI_Send(&msg,1,MPI_INT,0,0,interComm) ;
+          printf(" CClient : send finalize sign to server 0\n");
         }
       }
@@ -241,5 +263,5 @@
       {
         if (CXios::usingOasis) oasis_finalize();
-        else MPI_Finalize() ;
+        else {MPI_Finalize() ; printf("CClient::finalize called MPI_finalize\n");}
       }
       
Index: XIOS/dev/branch_yushan/src/client.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/client.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/client.hpp	(revision 1037)
@@ -4,4 +4,8 @@
 #include "xios_spl.hpp"
 #include "mpi.hpp"
+#ifdef _usingEP
+//#include "ep_declaration.hpp"
+#endif
+
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/client_client_dht_template_impl.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/client_client_dht_template_impl.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/client_client_dht_template_impl.hpp	(revision 1037)
@@ -10,4 +10,8 @@
 #include "utils.hpp"
 #include "mpi_tag.hpp"
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
+
 
 namespace xios
@@ -37,14 +41,19 @@
   : H(clientIntraComm), index2InfoMapping_(), indexToInfoMappingLevel_(), nbClient_(0)
 {
+  
   MPI_Comm_size(clientIntraComm, &nbClient_);
   this->computeMPICommLevel();
-  int nbLvl = this->getNbLevel();
+  int nbLvl = this->getNbLevel();  
   sendRank_.resize(nbLvl);
   recvRank_.resize(nbLvl);
   Index2VectorInfoTypeMap indexToVecInfoMap;
-  indexToVecInfoMap.rehash(std::ceil(indexInfoMap.size()/indexToVecInfoMap.max_load_factor()));
-  typename Index2InfoTypeMap::const_iterator it = indexInfoMap.begin(), ite = indexInfoMap.end();
-  for (; it != ite; ++it) indexToVecInfoMap[it->first].push_back(it->second);
-  computeDistributedIndex(indexToVecInfoMap, clientIntraComm, nbLvl-1);
+  indexToVecInfoMap.rehash(std::ceil(indexInfoMap.size()/indexToVecInfoMap.max_load_factor())); 
+  typename Index2InfoTypeMap::const_iterator it = indexInfoMap.begin(), ite = indexInfoMap.end(); 
+  for (; it != ite; ++it)
+  {
+    indexToVecInfoMap[it->first].push_back(it->second);
+  } 
+  
+  computeDistributedIndex(indexToVecInfoMap, clientIntraComm, nbLvl-1); 
 }
 
@@ -179,5 +188,7 @@
   {
     if (0 != recvNbIndexClientCount[idx])
+    {
       recvIndexFromClients(recvRankClient[idx], recvIndexBuff+currentIndex, recvNbIndexClientCount[idx], commLevel, request);
+    }
     currentIndex += recvNbIndexClientCount[idx];
   }
@@ -189,5 +200,11 @@
 
   std::vector<MPI_Status> status(request.size());
+
+  //printf("1(%d): calling wait all for %lu requests\n", clientRank, request.size());
+
   MPI_Waitall(request.size(), &request[0], &status[0]);
+
+
+  //printf("               1(%d): calling wait all for %lu requests OK\n", clientRank, request.size());
 
   CArray<size_t,1>* tmpGlobalIndex;
@@ -294,5 +311,8 @@
 
   std::vector<MPI_Status> statusOnReturn(requestOnReturn.size());
+  //printf("2(%d): calling wait all for %lu requests\n", clientRank, requestOnReturn.size());
   MPI_Waitall(requestOnReturn.size(), &requestOnReturn[0], &statusOnReturn[0]);
+
+  //printf("            2(%d): calling wait all for %lu requests OK\n", clientRank, requestOnReturn.size());
 
   Index2VectorInfoTypeMap indexToInfoMapping;
@@ -363,4 +383,5 @@
                                                             int level)
 {
+  //printf("in computeDistributedIndex(const Index2VectorInfoTypeMap& indexInfoMap, const MPI_Comm& commLevel, int level)\n");
   int clientRank;
   MPI_Comm_rank(commLevel,&clientRank);
@@ -418,4 +439,6 @@
   }
 
+  //printf("check 4 OK. clientRank = %d\n", clientRank);
+
   // Calculate from how many clients each client receive message.
   // Calculate size of buffer for receiving message
@@ -423,4 +446,5 @@
   sendRecvRank(level, sendBuff, sendNbIndexBuff,
                recvRankClient, recvNbIndexClientCount);
+  //printf("sendRecvRank OK\n");
 
   int recvNbIndexCount = 0;
@@ -435,4 +459,6 @@
     recvInfoBuff = new unsigned char[recvNbIndexCount*ProcessDHTElement<InfoType>::typeSize()];
   }
+
+  //printf("check 5 OK. clientRank = %d\n", clientRank);
 
   // If a client holds information about index and the corresponding which don't belong to it,
@@ -447,22 +473,37 @@
     {
       recvIndexFromClients(recvRankClient[idx], recvIndexBuff+currentIndex, recvNbIndexClientCount[idx], commLevel, request);
+
       recvInfoFromClients(recvRankClient[idx],
                           recvInfoBuff+currentIndex*ProcessDHTElement<InfoType>::typeSize(),
                           recvNbIndexClientCount[idx]*ProcessDHTElement<InfoType>::typeSize(),
                           commLevel, request);
+
     }
     currentIndex += recvNbIndexClientCount[idx];
   }
+
+  //printf("check 6 OK. clientRank = %d\n", clientRank);
 
   boost::unordered_map<int, size_t* >::iterator itbIndex = client2ClientIndex.begin(), itIndex,
                                                 iteIndex = client2ClientIndex.end();
   for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex)
+  {
     sendIndexToClients(itIndex->first, itIndex->second, sendNbIndexBuff[itIndex->first-groupRankBegin], commLevel, request);
+
+  }
+
+  //printf("check 7 OK. clientRank = %d\n", clientRank);
+
   boost::unordered_map<int, unsigned char*>::iterator itbInfo = client2ClientInfo.begin(), itInfo,
                                                       iteInfo = client2ClientInfo.end();
   for (itInfo = itbInfo; itInfo != iteInfo; ++itInfo)
+  {
     sendInfoToClients(itInfo->first, itInfo->second, sendNbInfo[itInfo->first-groupRankBegin], commLevel, request);
 
+  }
+
+  //printf("check 8 OK. clientRank = %d\n", clientRank);
   std::vector<MPI_Status> status(request.size());
+
   MPI_Waitall(request.size(), &request[0], &status[0]);
 
@@ -480,8 +521,12 @@
     {
       ProcessDHTElement<InfoType>::unpackElement(infoValue, infoBuff, infoIndex);
+      unsigned long pp = *(recvIndexBuff+currentIndex+i);
+      
       indexToInfoMapping[*(recvIndexBuff+currentIndex+i)].push_back(infoValue);
     }
     currentIndex += count;
   }
+
+  //printf("check 9 OK. clientRank = %d\n", clientRank);
 
   if (0 != recvNbIndexCount)
@@ -498,4 +543,5 @@
       delete [] it->second;
 
+  //printf("check 10 OK. clientRank = %d\n", clientRank);
   // Ok, now do something recursive
   if (0 < level)
@@ -523,4 +569,5 @@
   MPI_Request request;
   requestSendIndex.push_back(request);
+
   MPI_Isend(indices, indiceSize, MPI_UNSIGNED_LONG,
             clientDestRank, MPI_DHT_INDEX, clientIntraComm, &(requestSendIndex.back()));
@@ -541,4 +588,5 @@
   MPI_Request request;
   requestRecvIndex.push_back(request);
+
   MPI_Irecv(indices, indiceSize, MPI_UNSIGNED_LONG,
             clientSrcRank, MPI_DHT_INDEX, clientIntraComm, &(requestRecvIndex.back()));
@@ -560,5 +608,5 @@
   MPI_Request request;
   requestSendInfo.push_back(request);
-
+  //printf("MPI_IsendInfo(info, infoSize, MPI_CHAR,... char count = %d, dest = %d, buf_size = %d\n", infoSize, clientDestRank, sizeof(*info) );
   MPI_Isend(info, infoSize, MPI_CHAR,
             clientDestRank, MPI_DHT_INFO, clientIntraComm, &(requestSendInfo.back()));
@@ -668,6 +716,10 @@
     ++nRequest;
   }
-
+  
+  int clientRank;
+  MPI_Comm_rank(this->internalComm_,&clientRank);
+  //printf("4(%d): calling wait all for %lu requests\n", clientRank, sendNbRank.size()+recvNbRank.size());
   MPI_Waitall(sendNbRank.size()+recvNbRank.size(), &request[0], &requestStatus[0]);
+  //printf("        4(%d): calling wait all for %lu requests OK\n", clientRank, sendNbRank.size()+recvNbRank.size());
 }
 
@@ -686,4 +738,7 @@
                                                  std::vector<int>& recvNbRank, std::vector<int>& recvNbElements)
 {
+  int myRank;
+  MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+  //printf("myRank = %d, in sendRecvRank(int level, const std::vector<int>& sendNbRank, const std::vector<int>& sendNbElements, std::vector<int>& recvNbRank, std::vector<int>& recvNbElements)\n", myRank);
   int groupBegin = this->getGroupBegin()[level];
 
@@ -702,8 +757,12 @@
   for (int idx = 0; idx < recvBuffSize; ++idx)
   {
+    //printf("myRank = %d starts irecv with src = %d, tag = %d, idx = %d\n", myRank, recvRank[idx], MPI_DHT_INDEX_0, idx);
     MPI_Irecv(&recvBuff[0]+2*idx, 2, MPI_INT,
               recvRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]);
+    //printf("myRank = %d MPI_Irecv OK, idx = %d, nRequest = %d\n", myRank, idx, nRequest);
     ++nRequest;
   }
+
+  //printf("myRank = %d, check 1 OK\n", myRank);
 
   for (int idx = 0; idx < sendBuffSize; ++idx)
@@ -716,10 +775,23 @@
   for (int idx = 0; idx < sendBuffSize; ++idx)
   {
+    //printf("myRank = %d starts isend with dest = %d, tag = %d, idx = %d\n", myRank, sendRank[idx], MPI_DHT_INDEX_0, idx);
     MPI_Isend(&sendBuff[idx*2], 2, MPI_INT,
               sendRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]);
+    //printf("myRank = %d MPI_Isend OK, idx = %d, nRequest = %d\n", myRank, idx, nRequest);
     ++nRequest;
   }
 
+  MPI_Barrier(this->internalComm_);
+
+  //printf("myRank = %d, check 2 OK\n", myRank);
+
+  int clientRank;
+  MPI_Comm_rank(this->internalComm_,&clientRank);
+
+  //printf("5(%d): calling wait all for %lu requests\n", myRank, sendBuffSize+recvBuffSize);
   MPI_Waitall(sendBuffSize+recvBuffSize, &request[0], &requestStatus[0]);
+  //printf("            5(%d): calling wait all for %lu requests OK\n", myRank, sendBuffSize+recvBuffSize);
+  //printf("check 3 OK\n");
+
   int nbRecvRank = 0, nbRecvElements = 0;
   recvNbRank.clear();
@@ -733,5 +805,6 @@
     }
   }
-}
-
-}
+  //printf("check 4 OK\n");
+}
+
+}
Index: XIOS/dev/branch_yushan/src/client_server_mapping.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/client_server_mapping.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/client_server_mapping.hpp	(revision 1037)
@@ -14,4 +14,8 @@
 #include "mpi.hpp"
 #include <boost/unordered_map.hpp>
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
+
 
 namespace xios {
Index: XIOS/dev/branch_yushan/src/config/field_attribute.conf
===================================================================
--- XIOS/dev/branch_yushan/src/config/field_attribute.conf	(revision 1036)
+++ XIOS/dev/branch_yushan/src/config/field_attribute.conf	(revision 1037)
@@ -11,5 +11,4 @@
 DECLARE_ATTRIBUTE(int,       level)
 DECLARE_ATTRIBUTE(int,       prec)
-DECLARE_ATTRIBUTE(StdString, expr)
 
 DECLARE_ATTRIBUTE(bool,      enabled)
@@ -34,5 +33,2 @@
 DECLARE_ATTRIBUTE(bool,      ts_enabled)
 DECLARE_ATTRIBUTE(CDuration, ts_split_freq)
-
-DECLARE_ATTRIBUTE(StdString, cell_methods)
-DECLARE_ENUM4(cell_methods_mode,  overwrite, prefix, suffix, none)
Index: XIOS/dev/branch_yushan/src/config/interpolate_domain_attribute.conf
===================================================================
--- XIOS/dev/branch_yushan/src/config/interpolate_domain_attribute.conf	(revision 1036)
+++ XIOS/dev/branch_yushan/src/config/interpolate_domain_attribute.conf	(revision 1037)
@@ -1,8 +1,7 @@
 /* GLOBAL */
+DECLARE_ATTRIBUTE(StdString, file)
 DECLARE_ATTRIBUTE(int, order)
 DECLARE_ATTRIBUTE(bool, renormalize)
 
 /* Write interpolation weights into file */
-DECLARE_ENUM3(mode,compute,read,read_or_compute)
-DECLARE_ATTRIBUTE(StdString, weight_filename)
-DECLARE_ATTRIBUTE(bool, write_weight)
+DECLARE_ENUM2(mode,write,read)
Index: XIOS/dev/branch_yushan/src/context_client.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/context_client.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/context_client.cpp	(revision 1037)
@@ -50,6 +50,4 @@
         for (int i = 0; i < serverByClient; i++)
           ranksServerLeader.push_back(rankStart + i);
-
-        ranksServerNotLeader.resize(0);
       }
       else
@@ -62,6 +60,4 @@
           if (clientRank % (clientByServer + 1) == 0)
             ranksServerLeader.push_back(clientRank / (clientByServer + 1));
-          else
-            ranksServerNotLeader.push_back(clientRank / (clientByServer + 1));
         }
         else
@@ -70,7 +66,5 @@
           if (rank % clientByServer == 0)
             ranksServerLeader.push_back(remain + rank / clientByServer);
-          else
-            ranksServerNotLeader.push_back(remain + rank / clientByServer);
-        }        
+        }
       }
 
@@ -85,68 +79,22 @@
     {
       list<int> ranks = event.getRanks();
-
       if (!event.isEmpty())
       {
         list<int> sizes = event.getSizes();
 
-        // We force the getBuffers call to be non-blocking on the servers
-        list<CBufferOut*> buffList;
-        bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient);
-
-        if (couldBuffer)
-        {
-          event.send(timeLine, sizes, buffList);
-
-          checkBuffers(ranks);
-
-          if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode
-          {
-            waitEvent(ranks);
-            CContext::setCurrent(context->getId());
-          }
-        }
-        else
-        {
-          tmpBufferedEvent.ranks = ranks;
-          tmpBufferedEvent.sizes = sizes;
-
-          for (list<int>::const_iterator it = sizes.begin(); it != sizes.end(); it++)
-            tmpBufferedEvent.buffers.push_back(new CBufferOut(*it));
-
-          event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers);
-        }
+        list<CBufferOut*> buffList = getBuffers(ranks, sizes);
+
+        event.send(timeLine, sizes, buffList);
+
+        checkBuffers(ranks);
+      }
+
+      if (isAttachedModeEnabled())
+      {
+        waitEvent(ranks);
+        CContext::setCurrent(context->getId());
       }
 
       timeLine++;
-    }
-
-    /*!
-     * Send the temporarily buffered event (if any).
-     *
-     * \return true if a temporarily buffered event could be sent, false otherwise 
-     */
-    bool CContextClient::sendTemporarilyBufferedEvent()
-    {
-      bool couldSendTmpBufferedEvent = false;
-
-      if (hasTemporarilyBufferedEvent())
-      {
-        list<CBufferOut*> buffList;
-        if (getBuffers(tmpBufferedEvent.ranks, tmpBufferedEvent.sizes, buffList, true)) // Non-blocking call
-        {
-          list<CBufferOut*>::iterator it, itBuffer;
-
-          for (it = tmpBufferedEvent.buffers.begin(), itBuffer = buffList.begin(); it != tmpBufferedEvent.buffers.end(); it++, itBuffer++)
-            (*itBuffer)->put((char*)(*it)->start(), (*it)->count());
-
-          checkBuffers(tmpBufferedEvent.ranks);
-
-          tmpBufferedEvent.clear();
-
-          couldSendTmpBufferedEvent = true;
-        }
-      }
-
-      return couldSendTmpBufferedEvent;
     }
 
@@ -159,32 +107,30 @@
     {
       parentServer->server->setPendingEvent();
+      size_t pendingmapSize;
       while (checkBuffers(ranks))
       {
-        parentServer->server->listen();
-        parentServer->server->checkPendingRequest();
+        parentServer->server->listen(); 
+        parentServer->server->checkPendingRequest(); 
       }
 
       while (parentServer->server->hasPendingEvent())
       {
-       parentServer->server->eventLoop();
+       parentServer->server->eventLoop(); //printf("parentServer->server->eventLoop()\n");
       }
     }
 
     /*!
-     * Get buffers for each connection to the servers. This function blocks until there is enough room in the buffers unless
-     * it is explicitly requested to be non-blocking.
-     *
-     * \param [in] serverList list of rank of connected server
-     * \param [in] sizeList size of message corresponding to each connection
-     * \param [out] retBuffers list of buffers that can be used to store an event
-     * \param [in] nonBlocking whether this function should be non-blocking
-     * \return whether the already allocated buffers could be used
+    Setup buffer for each connection to server and verify their state to put content into them
+    \param [in] serverList list of rank of connected server
+    \param [in] sizeList size of message corresponding to each connection
+    \return List of buffer input which event can be placed
     */
-    bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking /*= false*/)
+    list<CBufferOut*> CContextClient::getBuffers(list<int>& serverList, list<int>& sizeList)
     {
-      list<int>::const_iterator itServer, itSize;
+      list<int>::iterator itServer, itSize;
       list<CClientBuffer*> bufferList;
-      map<int,CClientBuffer*>::const_iterator it;
+      map<int,CClientBuffer*>::iterator it;
       list<CClientBuffer*>::iterator itBuffer;
+      list<CBufferOut*>  retBuffer;
       bool areBuffersFree;
 
@@ -212,14 +158,12 @@
           context->server->listen();
         }
-      } while (!areBuffersFree && !nonBlocking);
+      } while (!areBuffersFree);
       CTimer::get("Blocking time").suspend();
 
-      if (areBuffersFree)
-      {
-        for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++)
-          retBuffers.push_back((*itBuffer)->getBuffer(*itSize));
-      }
-
-      return areBuffersFree;
+      for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++)
+      {
+        retBuffer.push_back((*itBuffer)->getBuffer(*itSize));
+      }
+      return retBuffer;
    }
 
@@ -291,6 +235,10 @@
        if (ratio < minBufferSizeEventSizeRatio) minBufferSizeEventSizeRatio = ratio;
      }
+     #ifdef _usingMPI
      MPI_Allreduce(MPI_IN_PLACE, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm);
-
+     #elif _usingEP
+     MPI_Allreduce(&minBufferSizeEventSizeRatio, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm);
+     #endif
+     
      if (minBufferSizeEventSizeRatio < 1.0)
        ERROR("void CContextClient::setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize)",
@@ -301,22 +249,4 @@
                           + 1;                                   // the other local buffer might contain only one event
    }
-
-  /*!
-  Get leading server in the group of connected server
-  \return ranks of leading servers
-  */
-  const std::list<int>& CContextClient::getRanksServerNotLeader(void) const
-  {
-    return ranksServerNotLeader;
-  }
-
-  /*!
-  Check if client connects to leading server
-  \return connected(true), not connected (false)
-  */
-  bool CContextClient::isServerNotLeader(void) const
-  {
-    return !ranksServerNotLeader.empty();
-  }
 
   /*!
@@ -354,13 +284,5 @@
    {
      map<int,CClientBuffer*>::iterator itBuff;
-     bool stop = false;
-
-     CTimer::get("Blocking time").resume();
-     while (hasTemporarilyBufferedEvent())
-     {
-       checkBuffers();
-       sendTemporarilyBufferedEvent();
-     }
-     CTimer::get("Blocking time").suspend();
+     bool stop = true;
 
      CEventClient event(CContext::GetType(), CContext::EVENT_ID_CONTEXT_FINALIZE);
@@ -376,12 +298,9 @@
 
      CTimer::get("Blocking time").resume();
-     while (!stop)
+     while (stop)
      {
        checkBuffers();
-       if (hasTemporarilyBufferedEvent())
-         sendTemporarilyBufferedEvent();
-
-       stop = true;
-       for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest();
+       stop = false;
+       for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop |= itBuff->second->hasPendingRequest();
      }
      CTimer::get("Blocking time").suspend();
Index: XIOS/dev/branch_yushan/src/context_client.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/context_client.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/context_client.hpp	(revision 1037)
@@ -10,4 +10,8 @@
 #include "mpi.hpp"
 #include "registry.hpp"
+#ifdef _usingEP
+//#include "ep_declaration.hpp"
+#endif
+
 
 namespace xios
@@ -31,9 +35,8 @@
       // Send event to server
       void sendEvent(CEventClient& event);
-      bool sendTemporarilyBufferedEvent();
       void waitEvent(list<int>& ranks);
 
-      // Functions to set/get buffers
-      bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false);
+      // Functions relates to set/get buffers
+      list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList);
       void newBuffer(int rank);
       bool checkBuffers(list<int>& ranks);
@@ -42,11 +45,7 @@
 
       bool isServerLeader(void) const;
-      bool isServerNotLeader(void) const;
       const std::list<int>& getRanksServerLeader(void) const;
-      const std::list<int>& getRanksServerNotLeader(void) const;
 
       bool isAttachedModeEnabled() const;
-
-      bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); };
 
       // Close and finalize context client
@@ -79,20 +78,4 @@
       StdSize maxBufferedEvents;
 
-      struct {
-        std::list<int> ranks, sizes;
-        std::list<CBufferOut*> buffers;
-
-        bool isEmpty() const { return ranks.empty(); };
-        void clear() {
-          ranks.clear();
-          sizes.clear();
-
-          for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++)
-            delete *it;
-
-          buffers.clear();
-        };
-      } tmpBufferedEvent; //! Event temporarily buffered (used only on the server)
-
       //! Context for server (Only used in attached mode)
       CContext* parentServer;
@@ -100,7 +83,4 @@
       //! List of server ranks for which the client is leader
       std::list<int> ranksServerLeader;
-
-      //! List of server ranks for which the client is not leader
-      std::list<int> ranksServerNotLeader;
 
     public: // Some function should be removed in the future
Index: XIOS/dev/branch_yushan/src/context_server.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/context_server.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/context_server.cpp	(revision 1037)
@@ -57,10 +57,9 @@
   }
 
-  bool CContextServer::eventLoop(bool enableEventsProcessing /*= true*/)
+  bool CContextServer::eventLoop(void)
   {
     listen();
     checkPendingRequest();
-    if (enableEventsProcessing)
-      processEvents();
+    processEvents();
     return finished;
   }
@@ -77,4 +76,5 @@
     for(rank=0;rank<commSize;rank++)
     {
+      //printf("in CContextServer::listen, rank = %d, commSize = %d, pendingRequest.find(rank) = %d\n", rank, commSize, pendingRequest.find(rank));
       if (pendingRequest.find(rank)==pendingRequest.end())
       {
@@ -85,4 +85,5 @@
         {
           it=buffers.find(rank);
+          
           if (it==buffers.end()) // Receive the buffer size and allocate the buffer
           {
@@ -91,7 +92,9 @@
             mapBufferSize_.insert(std::make_pair(rank, buffSize));
             it=(buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer(buffSize)))).first;
+            //printf("find message, is buffer end, receiving, buffSize = %d, rank = %d, commSize = %d\n", buffSize, rank, commSize);
           }
           else
           {
+            
             MPI_Get_count(&status,MPI_CHAR,&count);
             if (it->second->isBufferFree(count))
@@ -100,4 +103,5 @@
               MPI_Irecv(addr,count,MPI_CHAR,rank,20,interComm,&pendingRequest[rank]);
               bufferRequest[rank]=addr;
+              //printf("find message, i-receiving to buffer %p, rank = %d, commSize = %d\n", addr, rank, commSize);
             }
           }
@@ -116,4 +120,6 @@
     int count;
     MPI_Status status;
+
+    //printf("enter checkPendingRequest\n");
 
     for(it=pendingRequest.begin();it!=pendingRequest.end();it++)
@@ -185,5 +191,5 @@
          // The best way to properly solve this problem will be to use the event scheduler also in attached mode
          // for now just set up a MPI barrier
-         if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ;
+         if (!CServer::eventScheduler) MPI_Barrier(intraComm) ;
 
          CTimer::get("Process events").resume();
Index: XIOS/dev/branch_yushan/src/context_server.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/context_server.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/context_server.hpp	(revision 1037)
@@ -15,5 +15,5 @@
 
     CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
-    bool eventLoop(bool enableEventsProcessing = true);
+    bool eventLoop(void) ;
     void listen(void) ;
     void checkPendingRequest(void) ;
Index: XIOS/dev/branch_yushan/src/cxios.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/cxios.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/cxios.cpp	(revision 1037)
@@ -30,9 +30,10 @@
   bool CXios::isOptPerformance = true;
   CRegistry* CXios::globalRegistry = 0;
-  double CXios::recvFieldTimeout = 10.0;
 
   //! Parse configuration file and create some objects from it
   void CXios::initialize()
   {
+    
+    
     set_new_handler(noMemory);
     parseFile(rootFile);
@@ -64,9 +65,27 @@
     bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor);
     minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double));
-    recvFieldTimeout = getin<double>("recv_field_timeout", 10.0);
-    if (recvFieldTimeout < 0.0)
-      ERROR("CXios::parseXiosConfig()", "recv_field_timeout cannot be negative.");
-
-    globalComm=MPI_COMM_WORLD ;
+
+    int num_ep;
+    if(isClient) 
+    { 
+      num_ep = 1;
+    }
+    
+    if(isServer) 
+    { 
+      num_ep = 1; 
+    }
+    
+    MPI_Info info;
+    MPI_Comm *ep_comm;
+    MPI_Comm_create_endpoints(MPI_COMM_WORLD, num_ep, info, ep_comm); 
+      
+    globalComm = ep_comm[0];
+    
+    int tmp_size;
+    MPI_Comm_size(globalComm, &tmp_size);
+    printf("globalcomm size = %d\n", tmp_size);
+
+    
   }
 
@@ -79,8 +98,9 @@
   void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)
   {
+    isClient = true;
+    
     initialize() ;
 
-    isClient = true;
-
+   
     CClient::initialize(codeId,localComm,returnComm) ;
     if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ;
@@ -89,5 +109,6 @@
     // and the clients are also servers
     isServer = !usingServer;
-
+    
+    
     if (printLogs2Files)
     {
@@ -100,4 +121,6 @@
       CClient::openErrorStream();
     }
+    
+   
   }
 
@@ -123,4 +146,15 @@
   void CXios::initServer()
   {
+    int initialized;
+    MPI_Initialized(&initialized);
+    if (initialized) CServer::is_MPI_Initialized=true ;
+    else CServer::is_MPI_Initialized=false ;
+      
+ 
+    if(!CServer::is_MPI_Initialized)
+    {
+      MPI_Init(NULL, NULL);
+    }
+      
     set_new_handler(noMemory);
     std::set<StdString> parseList;
@@ -133,12 +167,16 @@
   void CXios::initServerSide(void)
   {
-    initServer();
+    
     isClient = false;
     isServer = true;
-
+    
+    initServer();
+    
+    
     // Initialize all aspects MPI
     CServer::initialize();
     if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ;
     
+      
     if (printLogs2Files)
     {
@@ -151,7 +189,9 @@
       CServer::openErrorStream();
     }
-
+    
     // Enter the loop to listen message from Client
     CServer::eventLoop();
+    
+    printf("server eventloop OK\n");
 
     // Finalize
@@ -162,5 +202,11 @@
        delete globalRegistry ;
      }
+     
+     printf("server globalRegistry OK\n");
+     
     CServer::finalize();
+    
+    printf("server finalize OK\n");
+    
     CServer::closeInfoStream();
   }
Index: XIOS/dev/branch_yushan/src/cxios.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/cxios.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/cxios.hpp	(revision 1037)
@@ -5,4 +5,8 @@
 #include "mpi.hpp"
 #include "registry.hpp"
+#ifdef _usingEP
+//#include "ep_declaration.hpp"
+#endif
+
 
 namespace xios
@@ -45,5 +49,4 @@
      static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible)
      static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers
-     static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field
 
     public:
Index: XIOS/dev/branch_yushan/src/declare_ref_func.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/declare_ref_func.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/declare_ref_func.hpp	(revision 1037)
@@ -51,6 +51,4 @@
     SuperClassAttribute::setAttributes(refer_ptr, apply);              \
   }                                                                    \
-  if (this->hasAttribute("name") && this->name.isEmpty()) \
-    this->name.setValue(this->get##type##OutputName());                \
 }                                                                      \
                                                                        \
@@ -104,10 +102,6 @@
       tmp_ptr = refer_ptr;                                             \
       refer_ptr = tmp_ptr->getDirect##type##Reference();               \
-      if (refer_ptr->hasAutoGeneratedId() &&                           \
-          refer_ptr->hasDirect##type##Reference())                     \
+      if (refer_ptr->hasDirect##type##Reference())                     \
         nameRef = refer_ptr->name_##_ref;                              \
-      else {                                                           \
-        nameRef = refer_ptr->getId(); break;                           \
-      }                                                                \
       if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr))        \
       {                                                                \
Index: XIOS/dev/branch_yushan/src/dht_auto_indexing.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/dht_auto_indexing.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/dht_auto_indexing.cpp	(revision 1037)
@@ -79,6 +79,5 @@
     for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx)
     {
-//      (itIdx->second)[0] = beginIndexOnProc_ + idx;
-      (itIdx->second)[1] = beginIndexOnProc_ + idx;
+      (itIdx->second)[0] = beginIndexOnProc_ + idx;
       globalIndex_[idx] = beginIndexOnProc_ + idx;
       ++idx ;
Index: XIOS/dev/branch_yushan/src/dht_auto_indexing.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/dht_auto_indexing.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/dht_auto_indexing.hpp	(revision 1037)
@@ -12,4 +12,7 @@
 
 #include "client_client_dht_template.hpp"
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/event_scheduler.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/event_scheduler.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/event_scheduler.cpp	(revision 1037)
@@ -2,4 +2,5 @@
 #include "xios_spl.hpp"
 #include "mpi.hpp"
+
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/event_scheduler.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/event_scheduler.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/event_scheduler.hpp	(revision 1037)
@@ -4,4 +4,8 @@
 #include "xios_spl.hpp"
 #include "mpi.hpp"
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
+
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/filter/file_writer_filter.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/file_writer_filter.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/file_writer_filter.cpp	(revision 1037)
@@ -2,5 +2,4 @@
 #include "exception.hpp"
 #include "field.hpp"
-#include "utils.hpp"
 
 namespace xios
@@ -17,18 +16,4 @@
   void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data)
   {
-    bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() && 
-                               !field->default_value.isEmpty() && 
-                               field->detect_missing_value == true);
-    if (ignoreMissingValue)
-    {
-      double missingValue = field->default_value;
-      size_t nbData = data[0]->data.numElements();
-      for (size_t idx = 0; idx < nbData; ++idx)
-      {
-        if (NumTraits<double>::isnan(data[0]->data(idx)))
-          data[0]->data(idx) = missingValue;
-      }
-    }    
-
     field->sendUpdateData(data[0]->data);
   }
Index: XIOS/dev/branch_yushan/src/filter/filter.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/filter.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/filter.cpp	(revision 1037)
@@ -5,5 +5,5 @@
   CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine)
     : CInputPin(gc, inputSlotsCount)
-    , COutputPin(gc)
+    , COutputPin()
     , engine(engine)
     , inputSlotCount(inputSlotCount)
@@ -14,29 +14,5 @@
     CDataPacketPtr outputPacket = engine->apply(data);
     if (outputPacket)
-      onOutputReady(outputPacket);
-  }
-
-  void CFilter::setInputTrigger(size_t inputSlot, COutputPin* trigger)
-  {
-    // Was the filter already triggerable? If not, we need to inform
-    // all downstream filters.
-    bool wasTriggerable = canBeTriggered();
-
-    CInputPin::setInputTrigger(inputSlot, trigger);
-
-    if (!wasTriggerable)
-      setOutputTriggers();
-  }
-
-  void CFilter::trigger(Time timestamp)
-  {
-    CInputPin::trigger(timestamp);
-
-    COutputPin::trigger(timestamp);
-  }
-
-  bool CFilter::canBeTriggered() const
-  {
-    return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered());
+      deliverOuput(outputPacket);
   }
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/filter.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/filter.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/filter.hpp	(revision 1037)
@@ -26,26 +26,4 @@
       CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine);
 
-      /*!
-       * Sets the trigger for a specific input slot.
-       *
-       * \param inputSlot the input slot number
-       * \param trigger the corresponding trigger
-       */
-      void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger);
-
-      /*!
-       * Triggers the filter for the specified timestamp.
-       *
-       * \param timestamp the timestamp for which we are triggering the filter
-       */
-      void virtual trigger(Time timestamp);
-
-      /*!
-       * Tests if the filter can be triggered.
-       *
-       * \return true if the filter can be triggered
-       */
-      bool virtual canBeTriggered() const;
-
     protected:
       IFilterEngine* engine; //!< The filter engine, might be the filter itself
Index: XIOS/dev/branch_yushan/src/filter/garbage_collector.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/garbage_collector.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/garbage_collector.cpp	(revision 1037)
@@ -3,28 +3,28 @@
 namespace xios
 {
-  void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp)
+  void CGarbageCollector::registerFilter(CInputPin* inputPin, Time timestamp)
   {
-    registeredObjects[timestamp].insert(Object);
+    registeredFilters[timestamp].insert(inputPin);
   }
 
-  void CGarbageCollector::unregisterObject(InvalidableObject* Object, Time timestamp)
+  void CGarbageCollector::unregisterFilter(CInputPin* inputPin, Time timestamp)
   {
-    std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.find(timestamp);
-    if (it != registeredObjects.end())
-      it->second.erase(Object);
+    std::map<Time, std::set<CInputPin*> >::iterator it = registeredFilters.find(timestamp);
+    if (it != registeredFilters.end())
+      it->second.erase(inputPin);
   }
 
   void CGarbageCollector::invalidate(Time timestamp)
   {
-    std::map<Time, std::set<InvalidableObject*> >::iterator it    = registeredObjects.begin(),
-                                                            itEnd = registeredObjects.lower_bound(timestamp);
+    std::map<Time, std::set<CInputPin*> >::iterator it    = registeredFilters.begin(),
+                                                    itEnd = registeredFilters.lower_bound(timestamp);
     for (; it != itEnd; ++it)
     {
-      std::set<InvalidableObject*>::iterator itObject    = it->second.begin(),
-                                             itObjectEnd = it->second.end();
-      for (; itObject != itObjectEnd; ++itObject)
-        (*itObject)->invalidate(timestamp);
+      std::set<CInputPin*>::iterator itFilter    = it->second.begin(),
+                                     itFilterEnd = it->second.end();
+      for (; itFilter != itFilterEnd; ++itFilter)
+        (*itFilter)->invalidate(timestamp);
     }
-    registeredObjects.erase(registeredObjects.begin(), itEnd);
+    registeredFilters.erase(registeredFilters.begin(), itEnd);
   }
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/garbage_collector.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/garbage_collector.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/garbage_collector.hpp	(revision 1037)
@@ -5,21 +5,8 @@
 #include <set>
 
-#include "date.hpp"
+#include "input_pin.hpp"
 
 namespace xios
 {
-  /*!
-   * Interface shared by all objects that might need to invalidate packets.
-   */
-  struct InvalidableObject
-  {
-    /*!
-     * Removes all pending packets which are older than the specified timestamp.
-     *
-     * \param timestamp the timestamp used for invalidation
-     */
-    void virtual invalidate(Time timestamp) = 0;
-  }; // struct InvalidableObject
-
   /*!
    * A basic garbage collector which ensures no old packets linger in the filter graph.
@@ -35,21 +22,21 @@
 
       /*!
-       * Registers an object for a specified timestamp.
+       * Registers a filter for a specified timestamp.
        *
-       * \param object the object to register
-       * \param timestamp the timestamp for which the object is registered
+       * \param inputPin the input pin of the filter to register
+       * \param timestamp the timestamp for which the filter is registered
        */
-      void registerObject(InvalidableObject* object, Time timestamp);
+      void registerFilter(CInputPin* inputPin, Time timestamp);
 
       /*!
-       * Removes a object previously registered for a specified timestamp.
+       * Removes a filter previously registered for a specified timestamp.
        *
-       * \param object the object to unregister
-       * \param timestamp the timestamp for which the object is unregistered
+       * \param inputPin the input pin of the filter to unregister
+       * \param timestamp the timestamp for which the filter is unregistered
        */
-      void unregisterObject(InvalidableObject* object, Time timestamp);
+      void unregisterFilter(CInputPin* inputPin, Time timestamp);
 
       /*!
-       * Ensures all registered objects invalidate packets older than the specified timestamp.
+       * Ensures all registered filters invalidate packets older than the specified timestamp.
        *
        * \param timestamp the timestamp used for invalidation
@@ -61,5 +48,5 @@
       CGarbageCollector& operator=(const CGarbageCollector&);
 
-      std::map<Time, std::set<InvalidableObject*> > registeredObjects; //!< Currently registered objects
+      std::map<Time, std::set<CInputPin*> > registeredFilters; //!< Currently registered filters
   }; // class CGarbageCollector
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/input_pin.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/input_pin.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/input_pin.cpp	(revision 1037)
@@ -1,4 +1,3 @@
 #include "input_pin.hpp"
-#include "output_pin.hpp"
 #include "garbage_collector.hpp"
 #include "exception.hpp"
@@ -9,6 +8,4 @@
     : gc(gc)
     , slotsCount(slotsCount)
-    , triggers(slotsCount)
-    , hasTriggers(false)
   { /* Nothing to do */ }
 
@@ -26,6 +23,7 @@
     {
       it = inputs.insert(std::make_pair(packet->timestamp, InputBuffer(slotsCount))).first;
-      gc.registerObject(this, packet->timestamp);
+      gc.registerFilter(this, packet->timestamp);
     }
+
     it->second.slotsFilled++;
     it->second.packets[inputSlot] = packet;
@@ -34,41 +32,8 @@
     {
       // Unregister before calling onInputReady in case the filter registers again
-      gc.unregisterObject(this, packet->timestamp);
+      gc.unregisterFilter(this, packet->timestamp);
       onInputReady(it->second.packets);
       inputs.erase(it);
     }
-  }
-
-  void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)
-  {
-    if (inputSlot >= slotsCount)
-      ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)",
-            "The input slot " << inputSlot << " does not exist.");
-    if (triggers[inputSlot])
-      ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)",
-            "The trigger for input slot " << inputSlot << " has already been set.");
-
-    triggers[inputSlot] = trigger;
-    hasTriggers = true;
-  }
-
-  void CInputPin::trigger(Time timestamp)
-  {
-    if (hasTriggers) // Don't use canBeTriggered here, this function is virtual and can be overriden
-    {
-      std::map<Time, InputBuffer>::iterator it = inputs.find(timestamp);
-      bool nothingReceived = (it == inputs.end());
-
-      for (size_t s = 0; s < slotsCount; s++)
-      {
-        if (triggers[s] && (nothingReceived || !it->second.packets[s]))
-          triggers[s]->trigger(timestamp);
-      }
-    }
-  }
-
-  bool CInputPin::canBeTriggered() const
-  {
-    return hasTriggers;
   }
 
Index: XIOS/dev/branch_yushan/src/filter/input_pin.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/input_pin.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/input_pin.hpp	(revision 1037)
@@ -5,15 +5,14 @@
 #include <map>
 
-#include "garbage_collector.hpp"
 #include "data_packet.hpp"
 
 namespace xios
 {
-  class COutputPin;
+  class CGarbageCollector;
 
   /*!
    * An input pin handles the data packets received by a filter.
    */
-  class CInputPin : public InvalidableObject
+  class CInputPin
   {
     public:
@@ -28,12 +27,4 @@
 
       /*!
-       * Sets the trigger for a specific input slot.
-       *
-       * \param inputSlot the input slot number
-       * \param trigger the corresponding trigger
-       */
-      void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger);
-
-      /*!
        * Receives a data packet from an upstream filter on
        * the specified input slot.
@@ -46,18 +37,4 @@
 
       /*!
-       * Triggers the input of any buffered packet for the specified timestamp.
-       *
-       * \param timestamp the timestamp for which we are triggering the input
-       */
-      void virtual trigger(Time timestamp);
-
-      /*!
-       * Tests if the pin can be triggered.
-       *
-       * \return true if the pin can be triggered
-       */
-      bool virtual canBeTriggered() const;
-
-      /*!
        * Removes all pending packets which are older than the specified timestamp.
        *
@@ -67,4 +44,6 @@
 
     protected:
+      CGarbageCollector& gc; //!< The garbage collector associated to the input pin
+
       /*!
        * Function triggered when all slots have been filled for a specific timestamp.
@@ -96,16 +75,8 @@
       };
 
-      CGarbageCollector& gc; //!< The garbage collector associated to the input pin
-
       size_t slotsCount; //!< The number of slots
 
       //! Input buffer, store the packets until all slots are full for a timestep
       std::map<Time, InputBuffer> inputs;
-
-      //! Store the triggers corresponding to the input slots
-      std::vector<COutputPin*> triggers;
-
-      //! Whether some triggers have been set
-      bool hasTriggers;
   }; // class CInputPin
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/output_pin.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/output_pin.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/output_pin.cpp	(revision 1037)
@@ -4,9 +4,4 @@
 namespace xios
 {
-  COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/)
-    : gc(gc)
-    , manualTrigger(manualTrigger)
-  { /* Nothing to do */ }
-
   void COutputPin::connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot)
   {
@@ -16,22 +11,4 @@
 
     outputs.push_back(std::make_pair(inputPin, inputSlot));
-
-    if (canBeTriggered())
-      inputPin->setInputTrigger(inputSlot, this);
-  }
-
-  void COutputPin::onOutputReady(CDataPacketPtr packet)
-  {
-    if (!packet)
-      ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)",
-            "The packet cannot be null.");
-
-    if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden
-    {
-      outputPackets[packet->timestamp] = packet;
-      gc.registerObject(this, packet->timestamp);
-    }
-    else
-      deliverOuput(packet);
   }
 
@@ -44,36 +21,7 @@
     std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd;
     for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it)
+    {
       it->first->setInput(it->second, packet);
-  }
-
-  void COutputPin::trigger(Time timestamp)
-  {
-    if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden
-    {
-      std::map<Time, CDataPacketPtr>::iterator it = outputPackets.find(timestamp);
-      if (it != outputPackets.end())
-      {
-        gc.unregisterObject(this, timestamp);
-        deliverOuput(it->second);
-        outputPackets.erase(it);
-      }
     }
   }
-
-  bool COutputPin::canBeTriggered() const
-  {
-    return manualTrigger;
-  }
-
-  void COutputPin::setOutputTriggers()
-  {
-    std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd;
-    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it)
-      it->first->setInputTrigger(it->second, this);
-  }
-
-  void COutputPin::invalidate(Time timestamp)
-  {
-    outputPackets.erase(outputPackets.begin(), outputPackets.lower_bound(timestamp));
-  }
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/output_pin.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/output_pin.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/output_pin.hpp	(revision 1037)
@@ -2,5 +2,4 @@
 #define __XIOS_COutputPin__
 
-#include "garbage_collector.hpp"
 #include "input_pin.hpp"
 
@@ -10,16 +9,7 @@
    * An output pin handles the connections with downstream filters.
    */
-  class COutputPin : public InvalidableObject
+  class COutputPin
   {
     public:
-      /*!
-       * Constructs an ouput pin with manual or automatic trigger
-       * and an associated garbage collector.
-       *
-       * \param gc the garbage collector associated with this ouput pin
-       * \param slotsCount the number of slots
-       */
-      COutputPin(CGarbageCollector& gc, bool manualTrigger = false);
-
       /*!
        * Connects to a specific slot of the input pin of a downstream filter.
@@ -31,39 +21,5 @@
       void connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot);
 
-      /*!
-       * Triggers the output of any buffered packet for the specified timestamp.
-       *
-       * \param timestamp the timestamp for which we are triggering the output
-       */
-      void virtual trigger(Time timestamp);
-
-      /*!
-       * Tests if the pin can be triggered.
-       *
-       * \return true if the pin can be triggered
-       */
-      bool virtual canBeTriggered() const;
-
-      /*!
-       * Removes all pending packets which are older than the specified timestamp.
-       *
-       * \param timestamp the timestamp used for invalidation
-       */
-      void virtual invalidate(Time timestamp);
-
     protected:
-      /*!
-       * Function triggered when a packet is ready to be delivered.
-       *
-       * \param packet the packet ready for output
-       */
-      void onOutputReady(CDataPacketPtr packet);
-
-      /*!
-       * Informs the downstream pins that this output pin should be triggered.
-       */
-      void setOutputTriggers();
-
-    private:
       /*!
        * Delivers an output packet to the downstreams filter.
@@ -73,14 +29,7 @@
       void deliverOuput(CDataPacketPtr packet);
 
-      CGarbageCollector& gc; //!< The garbage collector associated to the output pin
-
-      //!< Whether the ouput should be triggered manually
-      bool manualTrigger;
-
+    private:
       //!< The list of connected filters and the corresponding slot numbers
       std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> > outputs;
-
-      //! Output buffer, store the packets until the output is triggered
-      std::map<Time, CDataPacketPtr> outputPackets;
   }; // class COutputPin
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/source_filter.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/source_filter.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/source_filter.cpp	(revision 1037)
@@ -3,16 +3,10 @@
 #include "exception.hpp"
 #include "calendar_util.hpp"
-#include <limits> 
 
 namespace xios
 {
-  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid,
-                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/,
-                               bool hasMissingValue /*= false*/,
-                               double defaultValue /*= 0.0*/)
-    : COutputPin(gc, manualTrigger)
-    , grid(grid)
+  CSourceFilter::CSourceFilter(CGrid* grid, const CDuration offset /*= NoneDu*/)
+    : grid(grid)
     , offset(offset)
-    , hasMissingValue(hasMissingValue), defaultValue(defaultValue)
   {
     if (!grid)
@@ -32,19 +26,8 @@
 
     packet->data.resize(grid->storeIndex_client.numElements());
+
     grid->inputField(data, packet->data);
 
-    // Convert missing values to NaN
-    if (hasMissingValue)
-    {
-      double nanValue = std::numeric_limits<double>::quiet_NaN();
-      size_t nbData = packet->data.numElements();
-      for (size_t idx = 0; idx < nbData; ++idx)
-      {
-        if (defaultValue == packet->data(idx))
-          packet->data(idx) = nanValue;
-      }
-    }
-
-    onOutputReady(packet);
+    deliverOuput(packet);
   }
 
@@ -66,9 +49,8 @@
     packet->status = CDataPacket::NO_ERROR;
 
-    // if (data.size() != grid->storeIndex_toSrv.size())
-    if (data.size() != grid->storeIndex_fromSrv.size())
+    if (data.size() != grid->storeIndex_toSrv.size())
       ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)",
             << "Incoherent data received from servers,"
-            << " expected " << grid->storeIndex_fromSrv.size() << " chunks but " << data.size() << " were given.");
+            << " expected " << grid->storeIndex_toSrv.size() << " chunks but " << data.size() << " were given.");
 
     packet->data.resize(grid->storeIndex_client.numElements());
@@ -76,11 +58,11 @@
     for (it = data.begin(); it != itEnd; it++)
     {
-      // CArray<int,1>& index = grid->storeIndex_toSrv[it->first];
-      CArray<int,1>& index = grid->storeIndex_fromSrv[it->first];
+      CArray<int,1>& index = grid->storeIndex_toSrv[it->first];
+
       for (int n = 0; n < index.numElements(); n++)
         packet->data(index(n)) = it->second(n);
     }
 
-    onOutputReady(packet);
+    deliverOuput(packet);
   }
 
@@ -91,5 +73,5 @@
     packet->timestamp = date;
     packet->status = CDataPacket::END_OF_STREAM;
-    onOutputReady(packet);
+    deliverOuput(packet);
   }
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/source_filter.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/source_filter.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/source_filter.hpp	(revision 1037)
@@ -19,15 +19,8 @@
        * Constructs a source filter accepting data attached to the specified grid.
        *
-       * \param gc the garbage collector associated with this filter
        * \param grid the grid to which the data is attached
        * \param offset the offset applied to the timestamp of all packets
-       * \param manualTrigger whether the output should be triggered manually
-       * \param hasMissingValue whether data has missing value
-       * \param defaultValue missing value to detect
        */
-      CSourceFilter(CGarbageCollector& gc, CGrid* grid,
-                    const CDuration offset = NoneDu, bool manualTrigger = false,
-                    bool hasMissingValue = false,
-                    double defaultValue = 0.0);
+      CSourceFilter(CGrid* grid, const CDuration offset = NoneDu);
 
       /*!
@@ -62,6 +55,4 @@
       CGrid* grid; //!< The grid attached to the data the filter can accept
       const CDuration offset; //!< The offset applied to the timestamp of all packets
-      bool hasMissingValue;
-      double defaultValue;
   }; // class CSourceFilter
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.cpp	(revision 1037)
@@ -11,5 +11,5 @@
 
   std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> >
-  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue)
+  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue)
   {
     if (!srcGrid || !destGrid)
@@ -26,5 +26,4 @@
       const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs();
       size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size());
-      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : missingValue;
       boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount));
 
@@ -54,5 +53,5 @@
     CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue);
     if (outputPacket)
-      onOutputReady(outputPacket);
+      deliverOuput(outputPacket);
   }
 
@@ -104,6 +103,5 @@
       }
       packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements());
-      if (0 != packet->data.numElements())
-        (packet->data)(0) = defaultValue;
+      packet->data = defaultValue;
       apply(data[0]->data, packet->data);
     }
@@ -220,7 +218,7 @@
     if (dataCurrentDest.numElements() != dataDest.numElements())
     ERROR("CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)",
-          "Incoherent between the received size and expected size. " << std::endl 
-          << "Expected size: " << dataDest.numElements() << std::endl 
-          << "Received size: " << dataCurrentDest.numElements());
+          "Incoherent between the received size and expected size" <<
+          "Expected size: " << dataDest.numElements() <<
+          "Received size: " << dataCurrentDest.numElements());
 
     dataDest = dataCurrentDest;
Index: XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.hpp	(revision 1037)
@@ -32,10 +32,8 @@
        * \param srcGrid the source grid
        * \param destGrid the destination grid
-       * \param hasMissingValue whether field source has missing value
-       * \param defaultValue default value
        * \return the first and the last filters of the filter graph
        */
       static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> >
-      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue);
+      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue);
 
     protected:
Index: XIOS/dev/branch_yushan/src/filter/store_filter.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/store_filter.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/store_filter.cpp	(revision 1037)
@@ -8,5 +8,4 @@
   CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid)
     : CInputPin(gc, 1)
-    , gc(gc)
     , context(context)
     , grid(grid)
@@ -24,11 +23,8 @@
     CTimer timer("CStoreFilter::getPacket");
     CConstDataPacketPtr packet;
-    const double timeout = CXios::recvFieldTimeout;
+    const double timeout = 10; // 10 seconds timeout
 
     do
     {
-      if (canBeTriggered())
-        trigger(timestamp);
-
       timer.resume();
 
@@ -43,12 +39,7 @@
 
     if (!packet)
-    {
-      std::map<Time, CDataPacketPtr>::const_iterator it ;
-      info(0)<<"Impossible to get the packet with timestamp = " << timestamp<<std::endl<<"Available timestamp are : "<<std::endl ;
-      for(it=packets.begin();it!=packets.end();++it) info(0)<<it->first<<"  ";
-      info(0)<<std::endl ;
       ERROR("CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) const",
             << "Impossible to get the packet with timestamp = " << timestamp);
-    }
+
     return packet;
   }
@@ -78,5 +69,5 @@
     // The packet is always destroyed by the garbage collector
     // so we register but never unregister
-    gc.registerObject(this, data[0]->timestamp);
+    gc.registerFilter(this, data[0]->timestamp);
   }
 
Index: XIOS/dev/branch_yushan/src/filter/store_filter.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/store_filter.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/store_filter.hpp	(revision 1037)
@@ -65,5 +65,4 @@
 
     private:
-      CGarbageCollector& gc; //!< The garbage collector associated to the filter
       CContext* context; //!< The context to which the data belongs
       CGrid* grid; //!< The grid attached to the data the filter can accept
Index: XIOS/dev/branch_yushan/src/filter/temporal_filter.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/filter/temporal_filter.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/filter/temporal_filter.cpp	(revision 1037)
@@ -15,6 +15,4 @@
     , isFirstOperation(true)
   {
-    double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue;
-    
 #define DECLARE_FUNCTOR(MType, mtype) \
     if (opId.compare(#mtype) == 0) \
@@ -22,5 +20,5 @@
       if (ignoreMissingValue) \
       { \
-        functor.reset(new func::C##MType(tmpData, defaultValue)); \
+        functor.reset(new func::C##MType(tmpData, missingValue)); \
       } \
       else \
Index: XIOS/dev/branch_yushan/src/functor/accumulate.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/functor/accumulate.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/functor/accumulate.cpp	(revision 1037)
@@ -1,5 +1,4 @@
 #include "accumulate.hpp"
 #include "array_new.hpp"
-#include "utils.hpp"
 
 namespace xios
@@ -34,7 +33,7 @@
             double* out=_doutput.dataFirst();
             for (i=0; i<n; ++i,++in,++out) 
-              if (!NumTraits<double>::isnan(*in))
+              if (*in!=missingValue)
               {
-                if(!NumTraits<double>::isnan(*out)) *out  += *in;
+                if(*out!=missingValue) *out  += *in;
                 else *out=*in ;
               }
Index: XIOS/dev/branch_yushan/src/functor/average.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/functor/average.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/functor/average.cpp	(revision 1037)
@@ -1,5 +1,4 @@
 #include "average.hpp"
 #include "array_new.hpp"
-#include "utils.hpp"
 
 namespace xios
@@ -43,5 +42,5 @@
             int* nc=nbcalls.dataFirst() ;
             for (i=0; i<n; ++i,++nc,++in) 
-              if (!NumTraits<double>::isnan(*in)) (*nc) ++;
+              if (*in!=missingValue) (*nc) ++;
           }
         }
@@ -55,5 +54,5 @@
             int* nc=nbcalls.dataFirst() ;
             for (i=0; i<n; ++i,++in,++out,++nc) 
-              if (!NumTraits<double>::isnan(*in)) 
+              if (*in!=missingValue) 
               {
                 if (*nc != 0) (*out)  += *in;
Index: XIOS/dev/branch_yushan/src/functor/maximum.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/functor/maximum.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/functor/maximum.cpp	(revision 1037)
@@ -1,5 +1,6 @@
 #include "maximum.hpp"
 #include "array_new.hpp"
-#include "utils.hpp"
+
+
 
 namespace xios
@@ -34,7 +35,7 @@
            { 
              for (; it1 != end1; it1++, it++) 
-               if (!NumTraits<double>::isnan(*it1))
+               if (*it1 != missingValue)
                {
-                 if (!NumTraits<double>::isnan(*it)) *it = std::max(*it1, *it);
+                 if ( *it != missingValue) *it = std::max(*it1, *it);
                  else *it=*it1 ;  
                }
Index: XIOS/dev/branch_yushan/src/functor/minimum.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/functor/minimum.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/functor/minimum.cpp	(revision 1037)
@@ -2,5 +2,4 @@
 #include "array_new.hpp"
 #include <algorithm>
-#include "utils.hpp"
 
 namespace xios
@@ -27,5 +26,5 @@
       {
         const double * it1  = _dinput.dataFirst(),
-                      *end1 = _dinput.dataFirst() + _dinput.numElements();
+                      * end1 = _dinput.dataFirst() + _dinput.numElements();
         double * it   = _doutput.dataFirst();
         
@@ -36,7 +35,7 @@
           { 
             for (; it1 != end1; it1++, it++) 
-              if (!NumTraits<double>::isnan(*it1))
+              if (*it1!=missingValue)
               {
-                if (!NumTraits<double>::isnan(*it)) *it = std::min(*it1, *it);
+                if (*it != missingValue) *it = std::min(*it1, *it);
                 else *it=*it1 ;
               }
Index: XIOS/dev/branch_yushan/src/interface/c/icdata.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/interface/c/icdata.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/c/icdata.cpp	(revision 1037)
@@ -11,5 +11,5 @@
 
 #include "xios.hpp"
-#include "oasis_cinterface.hpp"
+//#include "oasis_cinterface.hpp"
 
 #include "attribute_template.hpp"
@@ -27,5 +27,4 @@
 #include "array_new.hpp"
 
-
 extern "C"
 {
@@ -57,4 +56,6 @@
       MPI_Comm local_comm;
       MPI_Comm return_comm;
+      
+      fc_comm_map.clear();
 
       if (!cstr2string(client_id, len_client_id, str)) return;
@@ -63,7 +64,13 @@
       MPI_Initialized(&initialized);
       if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm);
-      else local_comm=MPI_COMM_NULL;
+      else local_comm = MPI_COMM_NULL;
+      
+     
+
       CXios::initClientSide(str, local_comm, return_comm);
-      *f_return_comm=MPI_Comm_c2f(return_comm);
+      *f_return_comm = MPI_Comm_c2f(return_comm);
+
+      printf("in icdata.cpp, f_return_comm = %d\n", *f_return_comm);
+
       CTimer::get("XIOS init").suspend();
       CTimer::get("XIOS").suspend();
@@ -79,5 +86,9 @@
      CTimer::get("XIOS init context").resume();
      comm=MPI_Comm_f2c(*f_comm);
+    
      CClient::registerContext(str, comm);
+     
+     //printf("client register context OK\n");
+     
      CTimer::get("XIOS init context").suspend();
      CTimer::get("XIOS").suspend();
@@ -100,5 +111,7 @@
      CTimer::get("XIOS close definition").resume();
      CContext* context = CContext::getCurrent();
+     
      context->closeDefinition();
+     
      CTimer::get("XIOS close definition").suspend();
      CTimer::get("XIOS").suspend();
@@ -109,6 +122,13 @@
      CTimer::get("XIOS").resume();
      CTimer::get("XIOS context finalize").resume();
+     
+     
+     
      CContext* context = CContext::getCurrent();
+     //printf("CContext* context = CContext::getCurrent();\n");
      context->finalize();
+     
+     //printf("client context_finalize OK\n");
+     
      CTimer::get("XIOS context finalize").suspend();
      CTimer::get("XIOS").suspend();
@@ -429,5 +449,7 @@
       CContext* context = CContext::getCurrent();
       if (!context->hasServer && !context->client->isAttachedModeEnabled())
-        context->checkBuffersAndListen();
+      {
+        context->checkBuffersAndListen();
+      }  
 
       CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData);
Index: XIOS/dev/branch_yushan/src/interface/c/oasis_cinterface.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/interface/c/oasis_cinterface.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/c/oasis_cinterface.cpp	(revision 1037)
@@ -1,5 +1,5 @@
 #include "oasis_cinterface.hpp"
 #include <string>
-#include "mpi.hpp"
+//#include "mpi_std.hpp"
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/interface/c_attr/icfield_attr.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/c_attr/icfield_attr.cpp	(revision 1037)
@@ -67,56 +67,4 @@
 
 
-  void cxios_set_field_cell_methods(field_Ptr field_hdl, const char * cell_methods, int cell_methods_size)
-  {
-    std::string cell_methods_str;
-    if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return;
-    CTimer::get("XIOS").resume();
-    field_hdl->cell_methods.setValue(cell_methods_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(field_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size))
-      ERROR("void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_field_cell_methods(field_Ptr field_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = field_hdl->cell_methods.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
-  void cxios_set_field_cell_methods_mode(field_Ptr field_hdl, const char * cell_methods_mode, int cell_methods_mode_size)
-  {
-    std::string cell_methods_mode_str;
-    if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return;
-    CTimer::get("XIOS").resume();
-    field_hdl->cell_methods_mode.fromString(cell_methods_mode_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(field_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size))
-      ERROR("void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_field_cell_methods_mode(field_Ptr field_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = field_hdl->cell_methods_mode.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
   void cxios_set_field_compression_level(field_Ptr field_hdl, int compression_level)
   {
@@ -232,30 +180,4 @@
      CTimer::get("XIOS").resume();
      bool isDefined = field_hdl->enabled.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
-  void cxios_set_field_expr(field_Ptr field_hdl, const char * expr, int expr_size)
-  {
-    std::string expr_str;
-    if (!cstr2string(expr, expr_size, expr_str)) return;
-    CTimer::get("XIOS").resume();
-    field_hdl->expr.setValue(expr_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(field_hdl->expr.getInheritedValue(), expr, expr_size))
-      ERROR("void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_field_expr(field_Ptr field_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = field_hdl->expr.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
Index: XIOS/dev/branch_yushan/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 1037)
@@ -67,56 +67,4 @@
 
 
-  void cxios_set_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods, int cell_methods_size)
-  {
-    std::string cell_methods_str;
-    if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return;
-    CTimer::get("XIOS").resume();
-    fieldgroup_hdl->cell_methods.setValue(cell_methods_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(fieldgroup_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size))
-      ERROR("void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = fieldgroup_hdl->cell_methods.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
-  void cxios_set_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods_mode, int cell_methods_mode_size)
-  {
-    std::string cell_methods_mode_str;
-    if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return;
-    CTimer::get("XIOS").resume();
-    fieldgroup_hdl->cell_methods_mode.fromString(cell_methods_mode_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(fieldgroup_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size))
-      ERROR("void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = fieldgroup_hdl->cell_methods_mode.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
   void cxios_set_fieldgroup_compression_level(fieldgroup_Ptr fieldgroup_hdl, int compression_level)
   {
@@ -232,30 +180,4 @@
      CTimer::get("XIOS").resume();
      bool isDefined = fieldgroup_hdl->enabled.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
-  void cxios_set_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, const char * expr, int expr_size)
-  {
-    std::string expr_str;
-    if (!cstr2string(expr, expr_size, expr_str)) return;
-    CTimer::get("XIOS").resume();
-    fieldgroup_hdl->expr.setValue(expr_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(fieldgroup_hdl->expr.getInheritedValue(), expr, expr_size))
-      ERROR("void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = fieldgroup_hdl->expr.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
Index: XIOS/dev/branch_yushan/src/interface/c_attr/icinterpolate_domain_attr.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/interface/c_attr/icinterpolate_domain_attr.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/c_attr/icinterpolate_domain_attr.cpp	(revision 1037)
@@ -18,25 +18,25 @@
   typedef xios::CInterpolateDomain* interpolate_domain_Ptr;
 
-  void cxios_set_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size)
+  void cxios_set_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, const char * file, int file_size)
   {
-    std::string mode_str;
-    if (!cstr2string(mode, mode_size, mode_str)) return;
+    std::string file_str;
+    if (!cstr2string(file, file_size, file_str)) return;
     CTimer::get("XIOS").resume();
-    interpolate_domain_hdl->mode.fromString(mode_str);
+    interpolate_domain_hdl->file.setValue(file_str);
     CTimer::get("XIOS").suspend();
   }
 
-  void cxios_get_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)
+  void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)
   {
     CTimer::get("XIOS").resume();
-    if (!string_copy(interpolate_domain_hdl->mode.getInheritedStringValue(), mode, mode_size))
-      ERROR("void cxios_get_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)", << "Input string is too short");
+    if (!string_copy(interpolate_domain_hdl->file.getInheritedValue(), file, file_size))
+      ERROR("void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)", << "Input string is too short");
     CTimer::get("XIOS").suspend();
   }
 
-  bool cxios_is_defined_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl)
+  bool cxios_is_defined_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl)
   {
      CTimer::get("XIOS").resume();
-     bool isDefined = interpolate_domain_hdl->mode.hasInheritedValue();
+     bool isDefined = interpolate_domain_hdl->file.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
@@ -88,52 +88,3 @@
      return isDefined;
   }
-
-
-  void cxios_set_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, const char * weight_filename, int weight_filename_size)
-  {
-    std::string weight_filename_str;
-    if (!cstr2string(weight_filename, weight_filename_size, weight_filename_str)) return;
-    CTimer::get("XIOS").resume();
-    interpolate_domain_hdl->weight_filename.setValue(weight_filename_str);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size)
-  {
-    CTimer::get("XIOS").resume();
-    if (!string_copy(interpolate_domain_hdl->weight_filename.getInheritedValue(), weight_filename, weight_filename_size))
-      ERROR("void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size)", << "Input string is too short");
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = interpolate_domain_hdl->weight_filename.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
-
-
-  void cxios_set_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool write_weight)
-  {
-    CTimer::get("XIOS").resume();
-    interpolate_domain_hdl->write_weight.setValue(write_weight);
-    CTimer::get("XIOS").suspend();
-  }
-
-  void cxios_get_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool* write_weight)
-  {
-    CTimer::get("XIOS").resume();
-    *write_weight = interpolate_domain_hdl->write_weight.getInheritedValue();
-    CTimer::get("XIOS").suspend();
-  }
-
-  bool cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl)
-  {
-     CTimer::get("XIOS").resume();
-     bool isDefined = interpolate_domain_hdl->write_weight.hasInheritedValue();
-     CTimer::get("XIOS").suspend();
-     return isDefined;
-  }
 }
Index: XIOS/dev/branch_yushan/src/interface/fortran/idata.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran/idata.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran/idata.F90	(revision 1037)
@@ -465,4 +465,5 @@
    INTEGER :: f_return_comm
 
+
       IF (PRESENT(local_comm)) THEN
         f_local_comm=local_comm
@@ -472,4 +473,8 @@
 
       CALL cxios_init_client(client_id,LEN(client_id),f_local_comm,f_return_comm)
+      
+      
+      !print*, "in fortran, world_f = ", MPI_COMM_WORLD 
+      print*, "in fortran, f_return_comm = ", f_return_comm 
 
       IF (PRESENT(return_comm)) return_comm=f_return_comm
Index: XIOS/dev/branch_yushan/src/interface/fortran_attr/field_interface_attr.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran_attr/field_interface_attr.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran_attr/field_interface_attr.F90	(revision 1037)
@@ -50,46 +50,4 @@
 
 
-    SUBROUTINE cxios_set_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
-    END SUBROUTINE cxios_set_field_cell_methods
-
-    SUBROUTINE cxios_get_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
-    END SUBROUTINE cxios_get_field_cell_methods
-
-    FUNCTION cxios_is_defined_field_cell_methods(field_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-    END FUNCTION cxios_is_defined_field_cell_methods
-
-
-    SUBROUTINE cxios_set_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
-    END SUBROUTINE cxios_set_field_cell_methods_mode
-
-    SUBROUTINE cxios_get_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
-    END SUBROUTINE cxios_get_field_cell_methods_mode
-
-    FUNCTION cxios_is_defined_field_cell_methods_mode(field_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods_mode
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-    END FUNCTION cxios_is_defined_field_cell_methods_mode
-
-
     SUBROUTINE cxios_set_field_compression_level(field_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
@@ -189,25 +147,4 @@
 
 
-    SUBROUTINE cxios_set_field_expr(field_hdl, expr, expr_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
-      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
-    END SUBROUTINE cxios_set_field_expr
-
-    SUBROUTINE cxios_get_field_expr(field_hdl, expr, expr_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
-      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
-    END SUBROUTINE cxios_get_field_expr
-
-    FUNCTION cxios_is_defined_field_expr(field_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_expr
-      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
-    END FUNCTION cxios_is_defined_field_expr
-
-
     SUBROUTINE cxios_set_field_field_ref(field_hdl, field_ref, field_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: XIOS/dev/branch_yushan/src/interface/fortran_attr/fieldgroup_interface_attr.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 1037)
@@ -50,46 +50,4 @@
 
 
-    SUBROUTINE cxios_set_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
-    END SUBROUTINE cxios_set_fieldgroup_cell_methods
-
-    SUBROUTINE cxios_get_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
-    END SUBROUTINE cxios_get_fieldgroup_cell_methods
-
-    FUNCTION cxios_is_defined_fieldgroup_cell_methods(fieldgroup_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-    END FUNCTION cxios_is_defined_fieldgroup_cell_methods
-
-
-    SUBROUTINE cxios_set_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
-    END SUBROUTINE cxios_set_fieldgroup_cell_methods_mode
-
-    SUBROUTINE cxios_get_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
-      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
-    END SUBROUTINE cxios_get_fieldgroup_cell_methods_mode
-
-    FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods_mode
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-    END FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode
-
-
     SUBROUTINE cxios_set_fieldgroup_compression_level(fieldgroup_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
@@ -189,25 +147,4 @@
 
 
-    SUBROUTINE cxios_set_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
-      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
-    END SUBROUTINE cxios_set_fieldgroup_expr
-
-    SUBROUTINE cxios_get_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
-      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
-    END SUBROUTINE cxios_get_fieldgroup_expr
-
-    FUNCTION cxios_is_defined_fieldgroup_expr(fieldgroup_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_expr
-      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
-    END FUNCTION cxios_is_defined_fieldgroup_expr
-
-
     SUBROUTINE cxios_set_fieldgroup_field_ref(fieldgroup_hdl, field_ref, field_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: XIOS/dev/branch_yushan/src/interface/fortran_attr/ifield_attr.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran_attr/ifield_attr.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran_attr/ifield_attr.F90	(revision 1037)
@@ -12,8 +12,8 @@
 
   SUBROUTINE xios(set_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -22,6 +22,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -31,5 +29,4 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -59,16 +56,16 @@
       (field_id,field_hdl)
       CALL xios(set_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr)
 
   SUBROUTINE xios(set_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -76,6 +73,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -85,5 +80,4 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -111,17 +105,16 @@
 
       CALL xios(set_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr_hdl)
 
   SUBROUTINE xios(set_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  &
-    , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  &
-    , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  &
-    , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  &
-     )
+    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
+    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -129,6 +122,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -138,5 +129,4 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset_
@@ -173,14 +163,4 @@
       ENDIF
 
-      IF (PRESENT(cell_methods_)) THEN
-        CALL cxios_set_field_cell_methods &
-      (field_hdl%daddr, cell_methods_, len(cell_methods_))
-      ENDIF
-
-      IF (PRESENT(cell_methods_mode_)) THEN
-        CALL cxios_set_field_cell_methods_mode &
-      (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
-      ENDIF
-
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_field_compression_level &
@@ -210,9 +190,4 @@
       ENDIF
 
-      IF (PRESENT(expr_)) THEN
-        CALL cxios_set_field_expr &
-      (field_hdl%daddr, expr_, len(expr_))
-      ENDIF
-
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_set_field_field_ref &
@@ -321,8 +296,8 @@
 
   SUBROUTINE xios(get_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -331,6 +306,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -340,5 +313,4 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -368,16 +340,16 @@
       (field_id,field_hdl)
       CALL xios(get_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr)
 
   SUBROUTINE xios(get_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -385,6 +357,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -394,5 +364,4 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -420,17 +389,16 @@
 
       CALL xios(get_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr_hdl)
 
   SUBROUTINE xios(get_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  &
-    , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  &
-    , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  &
-    , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  &
-     )
+    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
+    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -438,6 +406,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -447,5 +413,4 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset_
@@ -482,14 +447,4 @@
       ENDIF
 
-      IF (PRESENT(cell_methods_)) THEN
-        CALL cxios_get_field_cell_methods &
-      (field_hdl%daddr, cell_methods_, len(cell_methods_))
-      ENDIF
-
-      IF (PRESENT(cell_methods_mode_)) THEN
-        CALL cxios_get_field_cell_methods_mode &
-      (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
-      ENDIF
-
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_field_compression_level &
@@ -519,9 +474,4 @@
       ENDIF
 
-      IF (PRESENT(expr_)) THEN
-        CALL cxios_get_field_expr &
-      (field_hdl%daddr, expr_, len(expr_))
-      ENDIF
-
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_get_field_field_ref &
@@ -630,8 +580,8 @@
 
   SUBROUTINE xios(is_defined_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -642,8 +592,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
-      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
-      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -656,6 +602,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
-      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -702,16 +646,16 @@
       (field_id,field_hdl)
       CALL xios(is_defined_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr)
 
   SUBROUTINE xios(is_defined_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -721,8 +665,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
-      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
-      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -735,6 +675,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
-      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -779,17 +717,16 @@
 
       CALL xios(is_defined_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
-      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
+      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
+      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr_hdl)
 
   SUBROUTINE xios(is_defined_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  &
-    , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  &
-    , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  &
-    , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  &
-     )
+    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
+    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -799,8 +736,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_
       LOGICAL(KIND=C_BOOL) :: axis_ref__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_
-      LOGICAL(KIND=C_BOOL) :: cell_methods__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_
-      LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -813,6 +746,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL(KIND=C_BOOL) :: enabled__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: expr_
-      LOGICAL(KIND=C_BOOL) :: expr__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_
       LOGICAL(KIND=C_BOOL) :: field_ref__tmp
@@ -868,16 +799,4 @@
       ENDIF
 
-      IF (PRESENT(cell_methods_)) THEN
-        cell_methods__tmp = cxios_is_defined_field_cell_methods &
-      (field_hdl%daddr)
-        cell_methods_ = cell_methods__tmp
-      ENDIF
-
-      IF (PRESENT(cell_methods_mode_)) THEN
-        cell_methods_mode__tmp = cxios_is_defined_field_cell_methods_mode &
-      (field_hdl%daddr)
-        cell_methods_mode_ = cell_methods_mode__tmp
-      ENDIF
-
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_field_compression_level &
@@ -910,10 +829,4 @@
       ENDIF
 
-      IF (PRESENT(expr_)) THEN
-        expr__tmp = cxios_is_defined_field_expr &
-      (field_hdl%daddr)
-        expr_ = expr__tmp
-      ENDIF
-
       IF (PRESENT(field_ref_)) THEN
         field_ref__tmp = cxios_is_defined_field_field_ref &
Index: XIOS/dev/branch_yushan/src/interface/fortran_attr/ifieldgroup_attr.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 1037)
@@ -12,9 +12,8 @@
 
   SUBROUTINE xios(set_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -23,6 +22,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -32,5 +29,4 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -61,18 +57,16 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(set_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_fieldgroup_attr)
 
   SUBROUTINE xios(set_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -80,6 +74,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -89,5 +81,4 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -116,18 +107,16 @@
 
       CALL xios(set_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_fieldgroup_attr_hdl)
 
   SUBROUTINE xios(set_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  &
-    , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
-    , unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  &
+    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  &
+    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -135,6 +124,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -144,5 +131,4 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset_
@@ -180,14 +166,4 @@
       ENDIF
 
-      IF (PRESENT(cell_methods_)) THEN
-        CALL cxios_set_fieldgroup_cell_methods &
-      (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_))
-      ENDIF
-
-      IF (PRESENT(cell_methods_mode_)) THEN
-        CALL cxios_set_fieldgroup_cell_methods_mode &
-      (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
-      ENDIF
-
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_fieldgroup_compression_level &
@@ -217,9 +193,4 @@
       ENDIF
 
-      IF (PRESENT(expr_)) THEN
-        CALL cxios_set_fieldgroup_expr &
-      (fieldgroup_hdl%daddr, expr_, len(expr_))
-      ENDIF
-
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_set_fieldgroup_field_ref &
@@ -333,9 +304,8 @@
 
   SUBROUTINE xios(get_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -344,6 +314,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -353,5 +321,4 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -382,18 +349,16 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(get_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_fieldgroup_attr)
 
   SUBROUTINE xios(get_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -401,6 +366,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -410,5 +373,4 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -437,18 +399,16 @@
 
       CALL xios(get_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_fieldgroup_attr_hdl)
 
   SUBROUTINE xios(get_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  &
-    , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
-    , unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  &
+    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  &
+    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -456,6 +416,4 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -465,5 +423,4 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset_
@@ -501,14 +458,4 @@
       ENDIF
 
-      IF (PRESENT(cell_methods_)) THEN
-        CALL cxios_get_fieldgroup_cell_methods &
-      (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_))
-      ENDIF
-
-      IF (PRESENT(cell_methods_mode_)) THEN
-        CALL cxios_get_fieldgroup_cell_methods_mode &
-      (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
-      ENDIF
-
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_fieldgroup_compression_level &
@@ -538,9 +485,4 @@
       ENDIF
 
-      IF (PRESENT(expr_)) THEN
-        CALL cxios_get_fieldgroup_expr &
-      (fieldgroup_hdl%daddr, expr_, len(expr_))
-      ENDIF
-
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_get_fieldgroup_field_ref &
@@ -654,9 +596,8 @@
 
   SUBROUTINE xios(is_defined_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -667,8 +608,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
-      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
-      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -681,6 +618,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
-      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -729,18 +664,16 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(is_defined_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr)
 
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -750,8 +683,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
-      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
-      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -764,6 +693,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
-      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -810,18 +737,16 @@
 
       CALL xios(is_defined_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
-      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
-      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
+      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  &
-    , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
-    , unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  &
+    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  &
+    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -831,8 +756,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_
       LOGICAL(KIND=C_BOOL) :: axis_ref__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_
-      LOGICAL(KIND=C_BOOL) :: cell_methods__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_
-      LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -845,6 +766,4 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL(KIND=C_BOOL) :: enabled__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: expr_
-      LOGICAL(KIND=C_BOOL) :: expr__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_
       LOGICAL(KIND=C_BOOL) :: field_ref__tmp
@@ -902,16 +821,4 @@
       ENDIF
 
-      IF (PRESENT(cell_methods_)) THEN
-        cell_methods__tmp = cxios_is_defined_fieldgroup_cell_methods &
-      (fieldgroup_hdl%daddr)
-        cell_methods_ = cell_methods__tmp
-      ENDIF
-
-      IF (PRESENT(cell_methods_mode_)) THEN
-        cell_methods_mode__tmp = cxios_is_defined_fieldgroup_cell_methods_mode &
-      (fieldgroup_hdl%daddr)
-        cell_methods_mode_ = cell_methods_mode__tmp
-      ENDIF
-
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_fieldgroup_compression_level &
@@ -944,10 +851,4 @@
       ENDIF
 
-      IF (PRESENT(expr_)) THEN
-        expr__tmp = cxios_is_defined_fieldgroup_expr &
-      (fieldgroup_hdl%daddr)
-        expr_ = expr__tmp
-      ENDIF
-
       IF (PRESENT(field_ref_)) THEN
         field_ref__tmp = cxios_is_defined_fieldgroup_field_ref &
Index: XIOS/dev/branch_yushan/src/interface/fortran_attr/iinterpolate_domain_attr.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran_attr/iinterpolate_domain_attr.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran_attr/iinterpolate_domain_attr.F90	(revision 1037)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_interpolate_domain_attr)  &
-    ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_id, file, order, renormalize )
 
     IMPLICIT NONE
@@ -18,61 +18,43 @@
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       INTEGER  , OPTIONAL, INTENT(IN) :: order
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename
-      LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight
-      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_handle) &
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(set_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+      ( interpolate_domain_hdl, file, order, renormalize )
 
   END SUBROUTINE xios(set_interpolate_domain_attr)
 
   SUBROUTINE xios(set_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_hdl, file, order, renormalize )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       INTEGER  , OPTIONAL, INTENT(IN) :: order
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename
-      LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight
-      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(set_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+      ( interpolate_domain_hdl, file, order, renormalize )
 
   END SUBROUTINE xios(set_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(set_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  &
-     )
+    ( interpolate_domain_hdl, file_, order_, renormalize_ )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file_
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: order_
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize_
       LOGICAL (KIND=C_BOOL) :: renormalize__tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename_
-      LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight_
-      LOGICAL (KIND=C_BOOL) :: write_weight__tmp
 
       IF (PRESENT(file_)) THEN
         CALL cxios_set_interpolate_domain_file &
       (interpolate_domain_hdl%daddr, file_, len(file_))
-      ENDIF
-
-      IF (PRESENT(mode_)) THEN
-        CALL cxios_set_interpolate_domain_mode &
-      (interpolate_domain_hdl%daddr, mode_, len(mode_))
       ENDIF
 
@@ -88,19 +70,8 @@
       ENDIF
 
-      IF (PRESENT(weight_filename_)) THEN
-        CALL cxios_set_interpolate_domain_weight_filename &
-      (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_))
-      ENDIF
-
-      IF (PRESENT(write_weight_)) THEN
-        write_weight__tmp = write_weight_
-        CALL cxios_set_interpolate_domain_write_weight &
-      (interpolate_domain_hdl%daddr, write_weight__tmp)
-      ENDIF
-
   END SUBROUTINE xios(set_interpolate_domain_attr_hdl_)
 
   SUBROUTINE xios(get_interpolate_domain_attr)  &
-    ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_id, file, order, renormalize )
 
     IMPLICIT NONE
@@ -108,61 +79,43 @@
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: order
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename
-      LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight
-      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_handle) &
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(get_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+      ( interpolate_domain_hdl, file, order, renormalize )
 
   END SUBROUTINE xios(get_interpolate_domain_attr)
 
   SUBROUTINE xios(get_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_hdl, file, order, renormalize )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: order
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename
-      LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight
-      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+      ( interpolate_domain_hdl, file, order, renormalize )
 
   END SUBROUTINE xios(get_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(get_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  &
-     )
+    ( interpolate_domain_hdl, file_, order_, renormalize_ )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file_
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: order_
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize_
       LOGICAL (KIND=C_BOOL) :: renormalize__tmp
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename_
-      LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight_
-      LOGICAL (KIND=C_BOOL) :: write_weight__tmp
 
       IF (PRESENT(file_)) THEN
         CALL cxios_get_interpolate_domain_file &
       (interpolate_domain_hdl%daddr, file_, len(file_))
-      ENDIF
-
-      IF (PRESENT(mode_)) THEN
-        CALL cxios_get_interpolate_domain_mode &
-      (interpolate_domain_hdl%daddr, mode_, len(mode_))
       ENDIF
 
@@ -178,19 +131,8 @@
       ENDIF
 
-      IF (PRESENT(weight_filename_)) THEN
-        CALL cxios_get_interpolate_domain_weight_filename &
-      (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_))
-      ENDIF
-
-      IF (PRESENT(write_weight_)) THEN
-        CALL cxios_get_interpolate_domain_write_weight &
-      (interpolate_domain_hdl%daddr, write_weight__tmp)
-        write_weight_ = write_weight__tmp
-      ENDIF
-
   END SUBROUTINE xios(get_interpolate_domain_attr_hdl_)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr)  &
-    ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_id, file, order, renormalize )
 
     IMPLICIT NONE
@@ -199,24 +141,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: file
       LOGICAL(KIND=C_BOOL) :: file_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
-      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: order
       LOGICAL(KIND=C_BOOL) :: order_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL(KIND=C_BOOL) :: renormalize_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename
-      LOGICAL(KIND=C_BOOL) :: weight_filename_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight
-      LOGICAL(KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_handle) &
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(is_defined_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+      ( interpolate_domain_hdl, file, order, renormalize )
 
   END SUBROUTINE xios(is_defined_interpolate_domain_attr)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_hdl, file, order, renormalize )
 
     IMPLICIT NONE
@@ -224,23 +160,16 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: file
       LOGICAL(KIND=C_BOOL) :: file_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
-      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: order
       LOGICAL(KIND=C_BOOL) :: order_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL(KIND=C_BOOL) :: renormalize_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename
-      LOGICAL(KIND=C_BOOL) :: weight_filename_tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight
-      LOGICAL(KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(is_defined_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
+      ( interpolate_domain_hdl, file, order, renormalize )
 
   END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  &
-     )
+    ( interpolate_domain_hdl, file_, order_, renormalize_ )
 
     IMPLICIT NONE
@@ -248,14 +177,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: file_
       LOGICAL(KIND=C_BOOL) :: file__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: mode_
-      LOGICAL(KIND=C_BOOL) :: mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: order_
       LOGICAL(KIND=C_BOOL) :: order__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize_
       LOGICAL(KIND=C_BOOL) :: renormalize__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename_
-      LOGICAL(KIND=C_BOOL) :: weight_filename__tmp
-      LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight_
-      LOGICAL(KIND=C_BOOL) :: write_weight__tmp
 
       IF (PRESENT(file_)) THEN
@@ -265,10 +188,4 @@
       ENDIF
 
-      IF (PRESENT(mode_)) THEN
-        mode__tmp = cxios_is_defined_interpolate_domain_mode &
-      (interpolate_domain_hdl%daddr)
-        mode_ = mode__tmp
-      ENDIF
-
       IF (PRESENT(order_)) THEN
         order__tmp = cxios_is_defined_interpolate_domain_order &
@@ -283,16 +200,4 @@
       ENDIF
 
-      IF (PRESENT(weight_filename_)) THEN
-        weight_filename__tmp = cxios_is_defined_interpolate_domain_weight_filename &
-      (interpolate_domain_hdl%daddr)
-        weight_filename_ = weight_filename__tmp
-      ENDIF
-
-      IF (PRESENT(write_weight_)) THEN
-        write_weight__tmp = cxios_is_defined_interpolate_domain_write_weight &
-      (interpolate_domain_hdl%daddr)
-        write_weight_ = write_weight__tmp
-      ENDIF
-
   END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)
 
Index: XIOS/dev/branch_yushan/src/interface/fortran_attr/interpolate_domain_interface_attr.F90
===================================================================
--- XIOS/dev/branch_yushan/src/interface/fortran_attr/interpolate_domain_interface_attr.F90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/interface/fortran_attr/interpolate_domain_interface_attr.F90	(revision 1037)
@@ -29,25 +29,4 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
     END FUNCTION cxios_is_defined_interpolate_domain_file
-
-
-    SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
-      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
-    END SUBROUTINE cxios_set_interpolate_domain_mode
-
-    SUBROUTINE cxios_get_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
-      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
-    END SUBROUTINE cxios_get_interpolate_domain_mode
-
-    FUNCTION cxios_is_defined_interpolate_domain_mode(interpolate_domain_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_mode
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-    END FUNCTION cxios_is_defined_interpolate_domain_mode
 
 
@@ -89,44 +68,4 @@
     END FUNCTION cxios_is_defined_interpolate_domain_renormalize
 
-
-    SUBROUTINE cxios_set_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: weight_filename
-      INTEGER  (kind = C_INT)     , VALUE        :: weight_filename_size
-    END SUBROUTINE cxios_set_interpolate_domain_weight_filename
-
-    SUBROUTINE cxios_get_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: weight_filename
-      INTEGER  (kind = C_INT)     , VALUE        :: weight_filename_size
-    END SUBROUTINE cxios_get_interpolate_domain_weight_filename
-
-    FUNCTION cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_weight_filename
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-    END FUNCTION cxios_is_defined_interpolate_domain_weight_filename
-
-
-    SUBROUTINE cxios_set_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-      LOGICAL (KIND=C_BOOL)      , VALUE :: write_weight
-    END SUBROUTINE cxios_set_interpolate_domain_write_weight
-
-    SUBROUTINE cxios_get_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C)
-      USE ISO_C_BINDING
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-      LOGICAL (KIND=C_BOOL)             :: write_weight
-    END SUBROUTINE cxios_get_interpolate_domain_write_weight
-
-    FUNCTION cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_hdl) BIND(C)
-      USE ISO_C_BINDING
-      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_write_weight
-      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
-    END FUNCTION cxios_is_defined_interpolate_domain_write_weight
-
   END INTERFACE
 
Index: XIOS/dev/branch_yushan/src/io/nc4_data_output.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/io/nc4_data_output.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/io/nc4_data_output.cpp	(revision 1037)
@@ -21,5 +21,5 @@
             , filename(filename)
       {
-        SuperClass::type = MULTI_FILE;
+    SuperClass::type = MULTI_FILE;
       }
 
@@ -33,5 +33,5 @@
             , isCollective(isCollective)
       {
-        SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE;
+    SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE;
       }
 
@@ -1458,126 +1458,126 @@
       void CNc4DataOutput::writeField_(CField* field)
       {
-        CContext* context = CContext::getCurrent() ;
-        CContextServer* server=context->server ;
-
-        std::vector<StdString> dims, coodinates;
-        CGrid* grid = field->grid;
-        if (!grid->doGridHaveDataToWrite())
+         CContext* context = CContext::getCurrent() ;
+         CContextServer* server=context->server ;
+
+         std::vector<StdString> dims, coodinates;
+         CGrid* grid = field->grid;
+         if (!grid->doGridHaveDataToWrite())
           if (SuperClass::type==MULTI_FILE) return ;
 
-        CArray<int,1> axisDomainOrder = grid->axis_domain_order;
-        int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0;
-        std::vector<StdString> domainList = grid->getDomainList();
-        std::vector<StdString> axisList   = grid->getAxisList();
-        std::vector<StdString> scalarList = grid->getScalarList();        
-
-        StdString timeid  = getTimeCounterName();
-        StdString dimXid,dimYid;
-        std::deque<StdString> dimIdList, dimCoordList;
-        bool hasArea = false;
-        StdString cellMeasures = "area:";
-        bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output;
-
-        for (int i = 0; i < numElement; ++i)
-        {
-          if (2 == axisDomainOrder(i))
-          {
-            CDomain* domain = CDomain::get(domainList[idxDomain]);
-            StdString domId = domain->getDomainOutputName();
-            StdString appendDomId  = singleDomain ? "" : "_" + domId ;
-
-            if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured)
+         CArray<int,1> axisDomainOrder = grid->axis_domain_order;
+         int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0;
+         std::vector<StdString> domainList = grid->getDomainList();
+         std::vector<StdString> axisList   = grid->getAxisList();
+         std::vector<StdString> scalarList = grid->getScalarList();
+
+         StdString timeid  = getTimeCounterName();
+         StdString dimXid,dimYid;
+         std::deque<StdString> dimIdList, dimCoordList;
+         bool hasArea = false;
+         StdString cellMeasures = "area:";
+         bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output;
+
+         for (int i = 0; i < numElement; ++i)
+         {
+           if (2 == axisDomainOrder(i))
+           {
+             CDomain* domain = CDomain::get(domainList[idxDomain]);
+             StdString domId = domain->getDomainOutputName();
+             StdString appendDomId  = singleDomain ? "" : "_" + domId ;
+
+             if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured)
+             {
+               dimIdList.push_back(domId + "_points");
+               field->setUseCompressedOutput();
+             }
+
+             switch (domain->type)
+             {
+               case CDomain::type_attr::curvilinear:
+                 if (!compressedOutput || !domain->isCompressible())
+                 {
+                   dimXid     = StdString("x").append(appendDomId);
+                   dimIdList.push_back(dimXid);
+                   dimYid     = StdString("y").append(appendDomId);
+                   dimIdList.push_back(dimYid);
+                 }
+                 dimCoordList.push_back(StdString("nav_lon").append(appendDomId));
+                 dimCoordList.push_back(StdString("nav_lat").append(appendDomId));
+                 break ;
+               case CDomain::type_attr::rectilinear:
+                 if (!compressedOutput || !domain->isCompressible())
+                 {
+                   dimXid     = StdString("lon").append(appendDomId);
+                   dimIdList.push_back(dimXid);
+                   dimYid     = StdString("lat").append(appendDomId);
+                   dimIdList.push_back(dimYid);
+                 }
+                 break ;
+               case CDomain::type_attr::unstructured:
+               {
+           if (SuperClassWriter::useCFConvention)
+           {
+            dimXid     = StdString("cell").append(appendDomId);
+            dimIdList.push_back(dimXid);
+            dimCoordList.push_back(StdString("lon").append(appendDomId));
+            dimCoordList.push_back(StdString("lat").append(appendDomId));
+          }
+           else
+           {
+            StdString domainName = domain->name;
+            if (domain->nvertex == 1)
             {
-              dimIdList.push_back(domId + "_points");
-              field->setUseCompressedOutput();
+              dimXid     = "n" + domainName + "_node";
+              dimIdList.push_back(dimXid);
+              dimCoordList.push_back(StdString(domainName + "_node_x"));
+              dimCoordList.push_back(StdString(domainName + "_node_y"));
             }
-
-            switch (domain->type)
+            else if (domain->nvertex == 2)
             {
-              case CDomain::type_attr::curvilinear:
-                if (!compressedOutput || !domain->isCompressible())
-                {
-                  dimXid     = StdString("x").append(appendDomId);
-                  dimIdList.push_back(dimXid);
-                  dimYid     = StdString("y").append(appendDomId);
-                  dimIdList.push_back(dimYid);
-                }
-                dimCoordList.push_back(StdString("nav_lon").append(appendDomId));
-                dimCoordList.push_back(StdString("nav_lat").append(appendDomId));
-              break ;
-              case CDomain::type_attr::rectilinear:
-                if (!compressedOutput || !domain->isCompressible())
-                {
-                  dimXid     = StdString("lon").append(appendDomId);
-                  dimIdList.push_back(dimXid);
-                  dimYid     = StdString("lat").append(appendDomId);
-                  dimIdList.push_back(dimYid);
-                }
-              break ;
-              case CDomain::type_attr::unstructured:
-              {
-                if (SuperClassWriter::useCFConvention)
-                {
-                  dimXid     = StdString("cell").append(appendDomId);
-                  dimIdList.push_back(dimXid);
-                  dimCoordList.push_back(StdString("lon").append(appendDomId));
-                  dimCoordList.push_back(StdString("lat").append(appendDomId));
-                }
-                else
-                {
-                  StdString domainName = domain->name;
-                  if (domain->nvertex == 1)
-                  {
-                    dimXid     = "n" + domainName + "_node";
-                    dimIdList.push_back(dimXid);
-                    dimCoordList.push_back(StdString(domainName + "_node_x"));
-                    dimCoordList.push_back(StdString(domainName + "_node_y"));
-                  }
-                  else if (domain->nvertex == 2)
-                  {
-                    dimXid     = "n" + domainName + "_edge";
-                    dimIdList.push_back(dimXid);
-                    dimCoordList.push_back(StdString(domainName + "_edge_x"));
-                    dimCoordList.push_back(StdString(domainName + "_edge_y"));
-                  }
-                  else
-                  {
-                    dimXid     = "n" + domainName + "_face";
-                    dimIdList.push_back(dimXid);
-                    dimCoordList.push_back(StdString(domainName + "_face_x"));
-                    dimCoordList.push_back(StdString(domainName + "_face_y"));
-                  }
-                }  // ugrid convention
-              }  // case unstructured domain
-            }
-
-            if (domain->hasArea)
-            {
-              hasArea = true;
-              cellMeasures += " area" + appendDomId;
-            }
-            ++idxDomain;
-          }
-          else if (1 == axisDomainOrder(i))
-          {
-            CAxis* axis = CAxis::get(axisList[idxAxis]);
-            StdString axisId = axis->getAxisOutputName();
-
-            if (compressedOutput && axis->isCompressible())
-            {
-              dimIdList.push_back(axisId + "_points");
-              field->setUseCompressedOutput();
+              dimXid     = "n" + domainName + "_edge";
+              dimIdList.push_back(dimXid);
+              dimCoordList.push_back(StdString(domainName + "_edge_x"));
+              dimCoordList.push_back(StdString(domainName + "_edge_y"));
             }
             else
-              dimIdList.push_back(axisId);
-
-            dimCoordList.push_back(axisId);
-            ++idxAxis;
-          }
-          else // scalar
-          {
+            {
+              dimXid     = "n" + domainName + "_face";
+              dimIdList.push_back(dimXid);
+              dimCoordList.push_back(StdString(domainName + "_face_x"));
+              dimCoordList.push_back(StdString(domainName + "_face_y"));
+            }
+          }  // ugrid convention
+        }  // case unstructured domain
+             }
+
+             if (domain->hasArea)
+             {
+               hasArea = true;
+               cellMeasures += " area" + appendDomId;
+             }
+             ++idxDomain;
+           }
+           else if (1 == axisDomainOrder(i))
+           {
+             CAxis* axis = CAxis::get(axisList[idxAxis]);
+             StdString axisId = axis->getAxisOutputName();
+
+             if (compressedOutput && axis->isCompressible())
+             {
+               dimIdList.push_back(axisId + "_points");
+               field->setUseCompressedOutput();
+             }
+             else
+               dimIdList.push_back(axisId);
+
+             dimCoordList.push_back(axisId);
+             ++idxAxis;
+           }
+           else // scalar
+           {
              /* Do nothing here */
-          }
-        }
+           }
+         }
 
 /*
@@ -1589,51 +1589,51 @@
                              : latid;
 */
-        StdString fieldid = field->getFieldOutputName();
-
-        nc_type type ;
-        if (field->prec.isEmpty()) type =  NC_FLOAT ;
-        else
-        {
-          if (field->prec==2) type = NC_SHORT ;
-          else if (field->prec==4)  type =  NC_FLOAT ;
-          else if (field->prec==8)   type =  NC_DOUBLE ;
-        }
-
-        bool wtime   = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once);
-
-        if (wtime)
-        {
-
-          //StdOStringStream oss;
-          // oss << "time_" << field->operation.getValue()
-          //     << "_" << field->getRelFile()->output_freq.getValue();
+         StdString fieldid = field->getFieldOutputName();
+
+         nc_type type ;
+         if (field->prec.isEmpty()) type =  NC_FLOAT ;
+         else
+         {
+           if (field->prec==2) type = NC_SHORT ;
+           else if (field->prec==4)  type =  NC_FLOAT ;
+           else if (field->prec==8)   type =  NC_DOUBLE ;
+         }
+
+         bool wtime   = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once);
+
+         if (wtime)
+         {
+
+            //StdOStringStream oss;
+           // oss << "time_" << field->operation.getValue()
+           //     << "_" << field->getRelFile()->output_freq.getValue();
           //oss
-          if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant"));
-          else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered"));
-          dims.push_back(timeid);
-        }
-
-        if (compressedOutput && grid->isCompressible())
-        {
-          dims.push_back(grid->getId() + "_points");
-          field->setUseCompressedOutput();
-        }
-        else
-        {
-          while (!dimIdList.empty())
-          {
-            dims.push_back(dimIdList.back());
-            dimIdList.pop_back();
-          }
-        }
-
-        while (!dimCoordList.empty())
-        {
-          coodinates.push_back(dimCoordList.back());
-          dimCoordList.pop_back();
-        }
-
-        try
-        {
+            if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant"));
+            else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered"));
+            dims.push_back(timeid);
+         }
+
+         if (compressedOutput && grid->isCompressible())
+         {
+           dims.push_back(grid->getId() + "_points");
+           field->setUseCompressedOutput();
+         }
+         else
+         {
+           while (!dimIdList.empty())
+           {
+             dims.push_back(dimIdList.back());
+             dimIdList.pop_back();
+           }
+         }
+
+         while (!dimCoordList.empty())
+         {
+           coodinates.push_back(dimCoordList.back());
+           dimCoordList.pop_back();
+         }
+
+         try
+         {
            SuperClassWriter::addVariable(fieldid, type, dims);
 
@@ -1650,25 +1650,5 @@
                  ("units", field->unit.getValue(), &fieldid);
 
-           // Ugrid field attributes "mesh" and "location"
-           if (!SuperClassWriter::useCFConvention)
-           {
-            if (!domainList.empty())
-            {
-              CDomain* domain = CDomain::get(domainList[0]); // Suppose that we have only domain
-              StdString mesh = domain->name;
-              SuperClassWriter::addAttribute("mesh", mesh, &fieldid);
-              StdString location;
-              if (domain->nvertex == 1)
-                location = "node";
-              else if (domain->nvertex == 2)
-                location = "edge";
-              else if (domain->nvertex > 2)
-                location = "face";
-              SuperClassWriter::addAttribute("location", location, &fieldid);
-            }
-
-           }
-
-           if (!field->valid_min.isEmpty())
+            if (!field->valid_min.isEmpty())
               SuperClassWriter::addAttribute
                  ("valid_min", field->valid_min.getValue(), &fieldid);
@@ -1694,35 +1674,4 @@
            vector<CVariable*> listVars = field->getAllVariables() ;
            for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ;
-
-           bool alreadyAddCellMethod = false;
-           StdString cellMethodsPrefix(""), cellMethodsSuffix("");
-           if (!field->cell_methods.isEmpty())
-           {
-              StdString cellMethodString = field->cell_methods;
-              if (field->cell_methods_mode.isEmpty() ||
-                 (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode))
-              {
-                SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid);
-                alreadyAddCellMethod = true;
-              }
-              else
-              {
-                switch (field->cell_methods_mode)
-                {
-                  case (CField::cell_methods_mode_attr::prefix):
-                    cellMethodsPrefix = cellMethodString;
-                    cellMethodsPrefix += " ";
-                    break;
-                  case (CField::cell_methods_mode_attr::suffix):
-                    cellMethodsSuffix = " ";
-                    cellMethodsSuffix += cellMethodString;
-                    break;
-                  case (CField::cell_methods_mode_attr::none):
-                    break;
-                  default:
-                    break;
-                }
-              }
-           }
 
 
@@ -1738,5 +1687,5 @@
               SuperClassWriter::addAttribute("interval_write", freqOut.toStringUDUnits(), &fieldid);
 
-              StdString cellMethods(cellMethodsPrefix + "time: ");
+              StdString cellMethods = "time: ";
               if (field->operation.getValue() == "instant") cellMethods += "point";
               else if (field->operation.getValue() == "average") cellMethods += "mean";
@@ -1745,7 +1694,5 @@
               if (freqOp.resolve(*context->calendar) != freqOut.resolve(*context->calendar))
                 cellMethods += " (interval: " + freqOpStr + ")";
-              cellMethods += cellMethodsSuffix;
-              if (!alreadyAddCellMethod)
-                SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid);
+              SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid);
            }
 
@@ -1813,5 +1760,5 @@
        if (SuperClassWriter::useCFConvention)
              this->writeFileAttributes(filename, description,
-                                       StdString("CF-1.6"),
+                                       StdString("CF-1.5"),
                                        StdString("An IPSL model"),
                                        this->getTimeStamp());
@@ -1981,6 +1928,5 @@
         if (!field->wasWritten())
         {
-          if (appendMode && field->file->record_offset.isEmpty() && 
-              field->getOperationTimeType() != func::CFunctor::once)
+          if (appendMode && field->file->record_offset.isEmpty())
           {
             field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1);
@@ -2015,12 +1961,6 @@
             time_data_bound(1) = lastWrite;
           }
-          
-          if (field->file->time_counter.isEmpty())
-            if (field->hasTimeInstant && !field->hasTimeCentered)
-              time_counter(0) = lastWrite;
-            else 
-              time_counter(0) = (lastWrite + lastLastWrite) / 2;
-
-          else if (field->file->time_counter == CFile::time_counter_attr::instant)
+
+          if (field->file->time_counter == CFile::time_counter_attr::instant)
             time_counter(0) = lastWrite;
           else if (field->file->time_counter == CFile::time_counter_attr::centered)
@@ -2030,13 +1970,5 @@
 
 
-          if (field->file->time_counter.isEmpty())
-            if (field->hasTimeInstant && !field->hasTimeCentered)
-              time_counter_bound(0) = time_counter_bound(1) = lastWrite;
-            else 
-            {
-              time_counter_bound(0) = lastLastWrite;
-              time_counter_bound(1) = lastWrite;
-            }          
-          else if (field->file->time_counter == CFile::time_counter_attr::instant)
+          if (field->file->time_counter == CFile::time_counter_attr::instant)
             time_counter_bound(0) = time_counter_bound(1) = lastWrite;
           else if (field->file->time_counter == CFile::time_counter_attr::centered)
@@ -2087,10 +2019,8 @@
                    SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1);
                    SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1);
-                   if (field->file->time_counter.isEmpty() ||  
-                      (field->file->time_counter != CFile::time_counter_attr::none))
+                   if (field->file->time_counter != CFile::time_counter_attr::none)
                    {
                      SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1);
-                     if (field->file->time_counter.isEmpty() || 
-                        (field->file->time_counter != CFile::time_counter_attr::record))
+                     if (field->file->time_counter != CFile::time_counter_attr::record)
                        SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1);
                    }
@@ -2225,10 +2155,8 @@
                    SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot);
                    SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot);
-                   if (field->file->time_counter.isEmpty() || 
-                      (field->file->time_counter != CFile::time_counter_attr::none))
+                   if (field->file->time_counter != CFile::time_counter_attr::none)
                    {
                      SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1, isRoot);
-                     if (field->file->time_counter.isEmpty() ||  
-                        (field->file->time_counter != CFile::time_counter_attr::record))
+                     if (field->file->time_counter != CFile::time_counter_attr::record)
                        SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot);
                    }
@@ -2271,16 +2199,10 @@
          StdString timeid(getTimeCounterName());
          StdString timeBoundId("axis_nbounds");
- 
+
          if (field->getOperationTimeType() == func::CFunctor::instant)
          {
             axisid = "time_instant";
             axisBoundId = "time_instant_bounds";
-            field->hasTimeInstant = true;                   
-         }
-
-         if (field->getOperationTimeType() == func::CFunctor::centered)
-         {
-            field->hasTimeCentered = true;            
-         }          
+         }
 
          try
@@ -2314,6 +2236,5 @@
            }
 
-           if (field->file->time_counter.isEmpty() ||  
-              (field->file->time_counter != CFile::time_counter_attr::none))
+           if (field->file->time_counter != CFile::time_counter_attr::none)
            {
              // Adding time_counter
@@ -2327,6 +2248,5 @@
                 SuperClassWriter::addAttribute("axis", string("T"), &axisid);
 
-                if (field->file->time_counter.isEmpty() || 
-                   (field->file->time_counter != CFile::time_counter_attr::record))
+                if (field->file->time_counter != CFile::time_counter_attr::record)
                 {
                   CDate timeOrigin = cal->getTimeOrigin();
@@ -2340,6 +2260,5 @@
 
              // Adding time_counter_bound dimension
-             if (field->file->time_counter.isEmpty() ||  
-                (field->file->time_counter != CFile::time_counter_attr::record))
+             if (field->file->time_counter != CFile::time_counter_attr::record)
              {
                 if (!SuperClassWriter::varExist(axisBoundId))
@@ -2516,5 +2435,5 @@
            SuperClassWriter::addAttribute("title"      , description);
            SuperClassWriter::addAttribute("Conventions", conventions);
-           // SuperClassWriter::addAttribute("production" , production);
+           SuperClassWriter::addAttribute("production" , production);
            SuperClassWriter::addAttribute("timeStamp"  , timeStamp);
          }
Index: XIOS/dev/branch_yushan/src/io/netCdfInterface.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/io/netCdfInterface.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/io/netCdfInterface.hpp	(revision 1037)
@@ -17,4 +17,5 @@
 
 #include "mpi.hpp"
+//#include <mpi.h>
 #include "netcdf.hpp"
 
Index: XIOS/dev/branch_yushan/src/io/onetcdf4.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/io/onetcdf4.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/io/onetcdf4.cpp	(revision 1037)
@@ -3,5 +3,5 @@
 #include "onetcdf4.hpp"
 #include "group_template.hpp"
-#include "mpi.hpp"
+//#include "mpi_std.hpp"
 #include "netcdf.hpp"
 #include "netCdfInterface.hpp"
@@ -48,4 +48,6 @@
          }
          wmpi = comm && !multifile;
+         
+         MPI_Info info_null;
 
          if (wmpi)
@@ -56,5 +58,5 @@
          {
             if (wmpi)
-               CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);
+               CNetCdfInterface::createPar(filename, mode, *comm, info_null, this->ncidp);
             else
                CNetCdfInterface::create(filename, mode, this->ncidp);
@@ -66,5 +68,5 @@
             mode |= NC_WRITE;
             if (wmpi)
-               CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);
+               CNetCdfInterface::openPar(filename, mode, *comm, info_null, this->ncidp);
             else
                CNetCdfInterface::open(filename, mode, this->ncidp);
Index: XIOS/dev/branch_yushan/src/io/onetcdf4.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/io/onetcdf4.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/io/onetcdf4.hpp	(revision 1037)
@@ -8,4 +8,5 @@
 #include "array_new.hpp"
 #include "mpi.hpp"
+//#include <mpi.h>
 #include "netcdf.hpp"
 
Index: XIOS/dev/branch_yushan/src/mpi.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/mpi.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/mpi.hpp	(revision 1037)
@@ -11,5 +11,11 @@
 #define OMPI_SKIP_MPICXX
 
-#include <mpi.h>
+#ifdef _usingEP
+  #include "../extern/src_ep/ep_lib.hpp"
+  using namespace ep_lib;
+#elif _usingMPI
+  #include <mpi.h>
+#endif
+
 
 #endif
Index: XIOS/dev/branch_yushan/src/node/axis.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/axis.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/axis.cpp	(revision 1037)
@@ -264,8 +264,4 @@
       isDistributed_ = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) ||
                        (!this->n.isEmpty() && (this->n != this->n_glo));
-
-      // A same stupid condition to make sure that if there is only one client, axis
-      // should be considered to be distributed. This should be a temporary solution     
-      isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize);
    }
 
Index: XIOS/dev/branch_yushan/src/node/context.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/context.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/context.cpp	(revision 1037)
@@ -339,15 +339,15 @@
    }
 
+   //! Server side: Put server into a loop in order to listen message from client
+   bool CContext::eventLoop(void)
+   {
+     return server->eventLoop();
+   }
+
    //! Try to send the buffers and receive possible answers
    bool CContext::checkBuffersAndListen(void)
    {
      client->checkBuffers();
-
-     bool hasTmpBufferedEvent = client->hasTemporarilyBufferedEvent();
-     if (hasTmpBufferedEvent)
-       hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent();
-
-     // Don't process events if there is a temporarily buffered event
-     return server->eventLoop(!hasTmpBufferedEvent);
+     return server->eventLoop();
    }
 
@@ -389,43 +389,50 @@
    void CContext::closeDefinition(void)
    {
+     int myRank;
+     MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
+     //printf("myRank = %d, hasClient = %d, hasServer = %d\n", myRank, hasClient, hasServer);
+
      // There is nothing client need to send to server
      if (hasClient)
      {
        // After xml is parsed, there are some more works with post processing
-       postProcessing();
-     }
-     setClientServerBuffer();
+       postProcessing(); 
+       //printf("myRank = %d,                postProcessing OK\n", myRank);
+     }
+     setClientServerBuffer(); //printf("myRank = %d, setClientServerBuffer OK\n", myRank);
 
      if (hasClient && !hasServer)
      {
       // Send all attributes of current context to server
-      this->sendAllAttributesToServer();
+      this->sendAllAttributesToServer(); //printf("myRank = %d, this->sendAllAttributesToServer OK\n", myRank);
 
       // Send all attributes of current calendar
       CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer();
+      //printf("myRank = %d, CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer OK\n", myRank);
 
       // We have enough information to send to server
       // First of all, send all enabled files
-       sendEnabledFiles();
+       sendEnabledFiles();  //printf("myRank = %d, sendEnabledFiles OK\n", myRank);
 
       // Then, send all enabled fields
-       sendEnabledFields();
+       sendEnabledFields();  //printf("myRank = %d, sendEnabledFields OK\n", myRank);
 
       // At last, we have all info of domain and axis, then send them
-       sendRefDomainsAxis();
+       sendRefDomainsAxis();  //printf("myRank = %d, sendRefDomainsAxis OK\n", myRank);
 
       // After that, send all grid (if any)
-       sendRefGrid();
+       sendRefGrid(); //printf("myRank = %d, sendRefGrid OK\n", myRank);
     }
 
     // We have a xml tree on the server side and now, it should be also processed
-    if (hasClient && !hasServer) sendPostProcessing();
+    if (hasClient && !hasServer) sendPostProcessing();  
 
     // There are some processings that should be done after all of above. For example: check mask or index
     if (hasClient)
     {
-      this->buildFilterGraphOfEnabledFields();
-      buildFilterGraphOfFieldsWithReadAccess();
-      this->solveAllRefOfEnabledFields(true);
+      this->buildFilterGraphOfEnabledFields();  //printf("myRank = %d, buildFilterGraphOfEnabledFields OK\n", myRank);
+      buildFilterGraphOfFieldsWithReadAccess();  //printf("myRank = %d, buildFilterGraphOfFieldsWithReadAccess OK\n", myRank);
+      this->solveAllRefOfEnabledFields(true);  //printf("myRank = %d, solveAllRefOfEnabledFields OK\n", myRank);
     }
 
@@ -434,11 +441,11 @@
 
     // Nettoyage de l'arborescence
-    if (hasClient && !hasServer) CleanTree(); // Only on client side??
+    if (hasClient && !hasServer) CleanTree();
 
     if (hasClient)
     {
-      sendCreateFileHeader();
-
-      startPrefetchingOfEnabledReadModeFiles();
+      sendCreateFileHeader();  //printf("myRank = %d, sendCreateFileHeader OK\n", myRank);
+
+      startPrefetchingOfEnabledReadModeFiles();  //printf("myRank = %d, startPrefetchingOfEnabledReadModeFiles OK\n", myRank);
     }
    }
@@ -479,4 +486,5 @@
    {
      int size = this->enabledFiles.size();
+     
      for (int i = 0; i < size; ++i)
      {
@@ -566,5 +574,4 @@
    {
       const std::vector<CFile*> allFiles = CFile::getAll();
-      const CDate& initDate = calendar->getInitDate();
 
       for (unsigned int i = 0; i < allFiles.size(); i++)
@@ -572,26 +579,8 @@
          {
             if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixÃ© Ã  vrai.
-            {
-              if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep()))
-              {
-                error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl
-                    << "Output frequency in file \""<<allFiles[i]->getFileOutputName()
-                    <<"\" is less than the time step. File will not be written."<<endl;
-              }
-              else
                enabledFiles.push_back(allFiles[i]);
-            }
          }
-         else
-         {
-           if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep()))
-           {
-             error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl
-                 << "Output frequency in file \""<<allFiles[i]->getFileOutputName()
-                 <<"\" is less than the time step. File will not be written."<<endl;
-           }
-           else
-             enabledFiles.push_back(allFiles[i]); // otherwise true by default
-         }
+         else enabledFiles.push_back(allFiles[i]); // otherwise true by default
+
 
       if (enabledFiles.size() == 0)
@@ -812,4 +801,8 @@
    void CContext::postProcessing()
    {
+     int myRank;
+     MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
+     //printf("myRank = %d, in postProcessing, isPostProcessed = %d\n", myRank, isPostProcessed);
      if (isPostProcessed) return;
 
@@ -820,41 +813,41 @@
         ERROR("CContext::postProcessing()", << "A timestep must be defined for the context \"" << getId() << "!\"")
       // Calendar first update to set the current date equals to the start date
-      calendar->update(0);
+      calendar->update(0);  //printf("myRank = %d, calendar->update(0) OK\n", myRank);
 
       // Find all inheritance in xml structure
-      this->solveAllInheritance();
+      this->solveAllInheritance();  //printf("myRank = %d, this->solveAllInheritance OK\n", myRank);
 
       // Check if some axis, domains or grids are eligible to for compressed indexed output.
       // Warning: This must be done after solving the inheritance and before the rest of post-processing
-      checkAxisDomainsGridsEligibilityForCompressedOutput();
+      checkAxisDomainsGridsEligibilityForCompressedOutput();  //printf("myRank = %d, checkAxisDomainsGridsEligibilityForCompressedOutput OK\n", myRank);
 
       // Check if some automatic time series should be generated
       // Warning: This must be done after solving the inheritance and before the rest of post-processing
-      prepareTimeseries();
+      prepareTimeseries();  //printf("myRank = %d, prepareTimeseries OK\n", myRank);
 
       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
-      this->findEnabledFiles();
-      this->findEnabledReadModeFiles();
+      this->findEnabledFiles();  //printf("myRank = %d, this->findEnabledFiles OK\n", myRank);
+      this->findEnabledReadModeFiles();  //printf("myRank = %d, this->findEnabledReadModeFiles OK\n", myRank);
 
       // Find all enabled fields of each file
-      this->findAllEnabledFields();
-      this->findAllEnabledFieldsInReadModeFiles();
+      this->findAllEnabledFields();  //printf("myRank = %d, this->findAllEnabledFields OK\n", myRank);
+      this->findAllEnabledFieldsInReadModeFiles();  //printf("myRank = %d, this->findAllEnabledFieldsInReadModeFiles OK\n", myRank);
 
      if (hasClient && !hasServer)
      {
       // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis)
-      this->readAttributesOfEnabledFieldsInReadModeFiles();
+      this->readAttributesOfEnabledFieldsInReadModeFiles();  //printf("myRank = %d, this->readAttributesOfEnabledFieldsInReadModeFiles OK\n", myRank);
      }
 
       // Only search and rebuild all reference objects of enable fields, don't transform
-      this->solveOnlyRefOfEnabledFields(false);
+      this->solveOnlyRefOfEnabledFields(false);  //printf("myRank = %d, this->solveOnlyRefOfEnabledFields(false) OK\n", myRank);
 
       // Search and rebuild all reference object of enabled fields
-      this->solveAllRefOfEnabledFields(false);
+      this->solveAllRefOfEnabledFields(false);  //printf("myRank = %d, this->solveAllRefOfEnabledFields(false) OK\n", myRank);
 
       // Find all fields with read access from the public API
-      findFieldsWithReadAccess();
+      findFieldsWithReadAccess();  //printf("myRank = %d, findFieldsWithReadAccess OK\n", myRank);
       // and solve the all reference for them
-      solveAllRefOfFieldsWithReadAccess();
+      solveAllRefOfFieldsWithReadAccess();  //printf("myRank = %d, solveAllRefOfFieldsWithReadAccess OK\n", myRank);
 
       isPostProcessed = true;
@@ -1240,6 +1233,6 @@
          event.push(*itRank,1,msg);
        client->sendEvent(event);
-     }
-     else client->sendEvent(event);
+    }
+    else client->sendEvent(event);
   }
 
Index: XIOS/dev/branch_yushan/src/node/context.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/context.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/context.hpp	(revision 1037)
@@ -93,4 +93,6 @@
 
          // Put sever or client into loop state
+         bool eventLoop(void);
+
          bool checkBuffersAndListen(void);
 
Index: XIOS/dev/branch_yushan/src/node/domain.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/domain.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/domain.cpp	(revision 1037)
@@ -698,11 +698,7 @@
      computeNGlobDomain();
      checkZoom();
-     
+
      isDistributed_ = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) ||
                         (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo));
-
-     // A stupid condition to make sure that if there is only one client, domain
-     // should be considered to be distributed. This should be a temporary solution     
-     isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize);
    }
 
@@ -1307,12 +1303,28 @@
    void CDomain::checkAttributesOnClientAfterTransformation()
    {
-     CContext* context=CContext::getCurrent() ;
-
+     int myRank;
+     MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
+     CContext* context=CContext::getCurrent() ;  //printf("myRank = %d, CContext::getCurrent OK\n", myRank);
+
+     //printf("myRank = %d, this->isClientAfterTransformationChecked = %d\n", myRank, this->isClientAfterTransformationChecked);
      if (this->isClientAfterTransformationChecked) return;
+     //printf("myRank = %d, context->hasClient = %d\n", myRank, context->hasClient);
      if (context->hasClient)
      {
-       this->checkMask();
-       if (hasLonLat || hasArea || isCompressible_) this->computeConnectedServer();
-       if (hasLonLat) this->completeLonLatClient();
+       this->checkMask();  //printf("myRank = %d, this->checkMask OK\n", myRank);
+       //printf("myRank = %d, hasLonLat = %d, hasArea = %d, isCompressible_ = %d\n", myRank, hasLonLat, hasArea, isCompressible_);
+       if (hasLonLat || hasArea || isCompressible_) 
+        {
+          //printf("myRank = %d, start this->computeConnectedServer\n", myRank);
+          this->computeConnectedServer();
+          //printf("myRank = %d, this->computeConnectedServer OK\n", myRank);
+        }
+       //printf("myRank = %d, hasLonLat = %d\n", myRank, hasLonLat);
+       if (hasLonLat) 
+        {
+          this->completeLonLatClient();
+          //printf("myRank = %d, this->completeLonLatClient OK\n", myRank);
+        }
      }
 
@@ -1448,4 +1460,7 @@
   void CDomain::computeConnectedServer(void)
   {
+    int myRank;
+    MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
     CContext* context=CContext::getCurrent() ;
     CContextClient* client=context->client ;
@@ -1534,4 +1549,5 @@
       }
     }
+    
 
     size_t globalSizeIndex = 1, indexBegin, indexEnd;
@@ -1555,13 +1571,22 @@
       indexEnd = indexBegin + range - 1;
     }
-
+    
     CServerDistributionDescription serverDescription(nGlobDomain_, nbServer);
     if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
     else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
 
+    //printf("myRank = %d, check 7 OK\n", myRank);
+
     CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
                                                                                 client->intraComm);
-    clientServerMap->computeServerIndexMapping(globalIndexDomain);
+    //printf("myRank = %d new OK\n", myRank);
+
+    clientServerMap->computeServerIndexMapping(globalIndexDomain);  
+    //printf("myRank = %d, clientServerMap->computeServerIndexMapping(globalIndexDomain) OK\n", myRank);
+    
     const CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
+    //printf("myRank = %d, clientServerMap->getGlobalIndexOnServer OK\n", myRank);
+    
+    //printf("myRank = %d, check 8 OK\n", myRank);
 
     CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
@@ -1597,4 +1622,6 @@
     }
 
+    //printf("myRank = %d, check 9 OK\n", myRank);
+
     connectedServerRank_.clear();
     for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) {
@@ -1605,4 +1632,5 @@
 
     delete clientServerMap;
+    //printf("myRank = %d, check 10 OK\n", myRank);
   }
 
Index: XIOS/dev/branch_yushan/src/node/field.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/field.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/field.cpp	(revision 1037)
@@ -36,8 +36,5 @@
       , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false)
       , useCompressedOutput(false)
-      , hasTimeInstant(false)
-      , hasTimeCentered(false)
-      , wasDataAlreadyReceivedFromServer(false)
-      , isEOF(false)
+      , isReadDataRequestPending(false)
    { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
 
@@ -50,8 +47,5 @@
       , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false)
       , useCompressedOutput(false)
-      , hasTimeInstant(false)
-      , hasTimeCentered(false)
-      , wasDataAlreadyReceivedFromServer(false)
-      , isEOF(false)
+      , isReadDataRequestPending(false)
    { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
 
@@ -253,29 +247,23 @@
   }
 
-  bool CField::sendReadDataRequest(const CDate& tsDataRequested)
+  void CField::sendReadDataRequest(void)
   {
     CContext* context = CContext::getCurrent();
     CContextClient* client = context->client;
 
-    lastDataRequestedFromServer = tsDataRequested;
-
-    if (!isEOF) // No need to send the request if we already know we are at EOF
-    {
-      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);
-    }
-    else
-      serverSourceFilter->signalEndOfStream(tsDataRequested);
-
-    return !isEOF;
+    lastDataRequestedFromServer = context->getCalendar()->getCurrentDate();
+    isReadDataRequestPending = true;
+
+    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);
   }
 
@@ -288,17 +276,17 @@
     const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
 
-    bool dataRequested = false;
-
-    while (currentDate >= lastDataRequestedFromServer)
-    {
-      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);
-    }
-
-    return dataRequested;
+    bool requestData = (currentDate >= lastDataRequestedFromServer + file->output_freq.getValue());
+
+    if (requestData)
+    {
+      cout<<"currentDate : "<<currentDate<<endl ;
+      cout<<"lastDataRequestedFromServer : "<<lastDataRequestedFromServer<<endl ;
+      cout<<"file->output_freq.getValue() : "<<file->output_freq.getValue()<<endl ;
+      cout<<"lastDataRequestedFromServer + file->output_freq.getValue() : "<<lastDataRequestedFromServer + file->output_freq.getValue()<<endl ;
+
+      sendReadDataRequest();
+    }
+
+    return requestData;
   }
 
@@ -322,62 +310,16 @@
 
     map<int, CArray<double,1> >::iterator it;
-    if (!grid->doGridHaveDataDistributed())
-    {
-       if (client->isServerLeader())
-       {
-          if (!data_srv.empty())
-          {
-            it = data_srv.begin();
-            const std::list<int>& ranks = client->getRanksServerLeader();
-            for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-            {
-              msgs.push_back(CMessage());
-              CMessage& msg = msgs.back();
-              msg << getId();
-              if (hasData)
-                msg << getNStep() - 1 << it->second;
-              else
-                msg << int(-1);
-              event.push(*itRank, 1, msg);
-            }
-          }
-          client->sendEvent(event);
-       } 
-       else 
-       {
-          // if (!data_srv.empty())
-          // {
-          //   it = data_srv.begin();
-          //   const std::list<int>& ranks = client->getRanksServerNotLeader();
-          //   for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-          //   {
-          //     msgs.push_back(CMessage());
-          //     CMessage& msg = msgs.back();
-          //     msg << getId();
-          //     if (hasData)
-          //       msg << getNStep() - 1 << it->second;
-          //     else
-          //       msg << int(-1);
-          //     event.push(*itRank, 1, msg);
-          //   }
-          // }
-          client->sendEvent(event);
-       }
-    }
-    else
-    {
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-        msgs.push_back(CMessage());
-        CMessage& msg = msgs.back();
-        msg << getId();
-        if (hasData)
-          msg << getNStep() - 1 << it->second;
-        else
-          msg << int(-1);
-        event.push(it->first, grid->nbSenders[it->first], msg);
-      }
-      client->sendEvent(event);
-    }
+    for (it = data_srv.begin(); it != data_srv.end(); it++)
+    {
+      msgs.push_back(CMessage());
+      CMessage& msg = msgs.back();
+      msg << getId();
+      if (hasData)
+        msg << getNStep() - 1 << it->second;
+      else
+        msg << int(-1);
+      event.push(it->first, grid->nbSenders[it->first], msg);
+    }
+    client->sendEvent(event);
   }
 
@@ -402,4 +344,6 @@
         this->incrementNStep();
 
+
+
         if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) )
           return false;
@@ -435,4 +379,6 @@
     std::map<int, CArray<double,1> > data;
 
+    bool isEOF = false;
+
     for (int i = 0; i < ranks.size(); i++)
     {
@@ -447,16 +393,10 @@
     }
 
-    if (wasDataAlreadyReceivedFromServer)
-      lastDataReceivedFromServer = lastDataReceivedFromServer + file->output_freq;
+    if (isEOF)
+      serverSourceFilter->signalEndOfStream(lastDataRequestedFromServer);
     else
-    {
-      lastDataReceivedFromServer = context->getCalendar()->getInitDate();
-      wasDataAlreadyReceivedFromServer = true;
-    }
-
-    if (isEOF)
-      serverSourceFilter->signalEndOfStream(lastDataReceivedFromServer);
-    else
-      serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data);
+      serverSourceFilter->streamDataFromServer(lastDataRequestedFromServer, data);
+
+    isReadDataRequestPending = false;
   }
 
@@ -681,6 +621,9 @@
    void CField::solveAllReferenceEnabledField(bool doSending2Server)
    {
-     CContext* context = CContext::getCurrent();
-     solveOnlyReferenceEnabledField(doSending2Server);
+     int myRank;
+     MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
+     CContext* context = CContext::getCurrent();  //printf("my_Rank = %d, CContext* context = CContext::getCurrent OK\n", myRank);
+     solveOnlyReferenceEnabledField(doSending2Server);  //printf("my_Rank = %d, solveOnlyReferenceEnabledField(doSending2Server) OK\n", myRank);
 
      if (!areAllReferenceSolved)
@@ -690,21 +633,28 @@
         if (context->hasClient)
         {
-          solveRefInheritance(true);
-          if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false);
+          solveRefInheritance(true);  //printf("my_Rank = %d, solveRefInheritance(true) OK\n", myRank);
+          if (hasDirectFieldReference()) 
+          {
+            getDirectFieldReference()->solveAllReferenceEnabledField(false); 
+            //printf("my_Rank = %d, getDirectFieldReference()->solveAllReferenceEnabledField(false) OK\n", myRank);
+          }
         }
         else if (context->hasServer)
+        {
           solveServerOperation();
-
-        solveGridReference();
-     }
-
-     solveGridDomainAxisRef(doSending2Server);
+          //printf("my_Rank = %d, solveServerOperation OK\n", myRank);
+        }
+
+        solveGridReference();  //printf("my_Rank = %d, solveGridReference OK\n", myRank);
+     }
+
+     solveGridDomainAxisRef(doSending2Server);  //printf("my_Rank = %d, solveGridDomainAxisRef(doSending2Server) OK\n", myRank);
 
      if (context->hasClient)
      {
-       solveTransformedGrid();
-     }
-
-     solveCheckMaskIndex(doSending2Server);
+       solveTransformedGrid();  //printf("my_Rank = %d, solveTransformedGrid OK\n", myRank);
+     }
+
+     solveCheckMaskIndex(doSending2Server);  //printf("FIELD.CPP: my_Rank = %d, solveCheckMaskIndex(doSending2Server) OK\n", myRank);
    }
 
@@ -783,26 +733,8 @@
      {
        // Check if we have an expression to parse
-       if (hasExpression())
-       {
-         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));
-         boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this);
-
-         // Check if a spatial transformation is needed
-         if (!field_ref.isEmpty())
-         {
-           CGrid* gridRef = CField::get(field_ref)->grid;
-
-           if (grid && grid != gridRef && grid->hasTransform())
-           {
-             bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
-             double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);
-             std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue);
-
-             filter->connectOutput(filters.first, 0);
-             filter = filters.second;
-           }
-         }
-
-         instantDataFilter = filter;
+       if (!content.empty())
+       {
+         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(content + '\0'));
+         instantDataFilter = expr->reduce(gc, *this);
        }
        // Check if we have a reference on another field
@@ -811,13 +743,8 @@
        // Check if the data is to be read from a file
        else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
-         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,
-                                                                                                     freq_offset.isEmpty() ? NoneDu : freq_offset,
-                                                                                                     true));
+         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid,
+                                                                                                     freq_offset.isEmpty() ? NoneDu : freq_offset));
        else // The data might be passed from the model
-       {
-          bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
-          double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);
-          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false,
-                                                                                                      ignoreMissingValue, defaultValue));       }
+         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid));
      }
 
@@ -858,9 +785,10 @@
      // Check if a spatial transformation is needed
      if (grid && grid != fieldRef->grid && grid->hasTransform())
-     {       
-       bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
-       double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);                                
-       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue);
-     }
+     {
+       double defaultValue = 0.0;
+       if (!default_value.isEmpty()) defaultValue = this->default_value;
+       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue);
+     }
+
      else
        filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc));
@@ -882,5 +810,5 @@
    boost::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc)
    {
-     if (instantDataFilter || !hasExpression())
+     if (instantDataFilter || content.empty())
        ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)",
              "Impossible to add a self reference to a field which has already been parsed or which does not have an expression.");
@@ -891,25 +819,15 @@
        {
          if (!serverSourceFilter)
-           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,
-                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset,
-                                                                                   true));
+           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid,
+                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset));
 
          selfReferenceFilter = serverSourceFilter;
        }
        else if (!field_ref.isEmpty())
-       {
-         CField* fieldRef = CField::get(field_ref);
-         fieldRef->buildFilterGraph(gc, false); 
-         selfReferenceFilter = fieldRef->getInstantDataFilter();
-       }
+         selfReferenceFilter = getFieldReference(gc);
        else
        {
          if (!clientSourceFilter)
-         {
-           bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
-           double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
-           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false,
-                                                                                   ignoreMissingValue, defaultValue));
-         }
+           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid));
 
          selfReferenceFilter = clientSourceFilter;
@@ -945,5 +863,5 @@
 
        const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
-       
+
        boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
                                                                              CContext::getCurrent()->getCalendar()->getInitDate(),
@@ -957,47 +875,4 @@
      return it->second;
    }
-
-  /*!
-    * Returns the temporal filter corresponding to the field's temporal operation
-    * for the specified operation frequency.
-    *
-    * \param gc the garbage collector to use
-    * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed
-    * \return the output pin corresponding to the requested temporal filter
-    */
-   
-   boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)
-   {
-     if (instantDataFilter || !hasExpression())
-       ERROR("COutputPin* CField::getSelfTemporalDataFilter(CGarbageCollector& gc)",
-             "Impossible to add a self reference to a field which has already been parsed or which does not have an expression.");
-
-     if (!selfReferenceFilter) getSelfReference(gc) ;
-
-     if (serverSourceFilter || clientSourceFilter)
-     {
-       if (operation.isEmpty())
-         ERROR("void CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)",
-               << "An operation must be defined for field \"" << getId() << "\".");
-
-       if (freq_op.isEmpty()) freq_op.setValue(TimeStep);
-       if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu);
-
-       const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
-
-       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
-                                                                             CContext::getCurrent()->getCalendar()->getInitDate(),
-                                                                             freq_op, freq_offset, outFreq,
-                                                                             ignoreMissingValue, ignoreMissingValue ? default_value : 0.0));
-       selfReferenceFilter->connectOutput(temporalFilter, 0);
-       return temporalFilter ;
-     }
-     else if (!field_ref.isEmpty())
-     {
-       CField* fieldRef = CField::get(field_ref);
-       fieldRef->buildFilterGraph(gc, false); 
-       return fieldRef->getTemporalDataFilter(gc, outFreq) ;
-     }
-  }
 
    //----------------------------------------------------------------
@@ -1153,6 +1028,5 @@
      else if (grid && grid->hasTransform() && !grid->isTransformed())
      {
-       // Temporarily deactivate the self-transformation of grid
-       //grid->transformGrid(grid);
+       grid->transformGrid(grid);
      }
    }
@@ -1430,24 +1304,4 @@
    }
 
-   /*!
-    * Returns string arithmetic expression associated to the field.
-    * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string.
-    */
-   const string& CField::getExpression(void)
-   {
-     if (!expr.isEmpty() && content.empty())
-     {
-       content = expr;
-       expr.reset();
-     }
-
-     return content;
-   }
-
-   bool CField::hasExpression(void) const
-   {
-     return (!expr.isEmpty() || !content.empty());
-   }
-
    DEFINE_REF_FUNC(Field,field)
 } // namespace xios
Index: XIOS/dev/branch_yushan/src/node/field.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/field.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/field.hpp	(revision 1037)
@@ -124,5 +124,4 @@
          boost::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc);
          boost::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);
-         boost::shared_ptr<COutputPin> getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);
 
 //         virtual void fromBinary(StdIStream& is);
@@ -143,5 +142,5 @@
         void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers);
         void writeField(void);
-        bool sendReadDataRequest(const CDate& tsDataRequested);
+        void sendReadDataRequest(void);
         bool sendReadDataRequestIfNeeded(void);
         static void recvReadDataRequest(CEventServer& event);
@@ -179,7 +178,4 @@
         const std::vector<StdString>& getRefDomainAxisIds();
 
-        const string& getExpression(void);
-        bool hasExpression(void) const;
-
       public:
          /// PropriÃ©tÃ©s privÃ©es ///
@@ -195,6 +191,5 @@
          bool isEOF;
          CDate lastlast_Write_srv, last_Write_srv, last_operation_srv;
-         CDate lastDataRequestedFromServer, lastDataReceivedFromServer;
-         bool wasDataAlreadyReceivedFromServer;
+         CDate lastDataRequestedFromServer;
 
          map<int,boost::shared_ptr<func::CFunctor> > foperation_srv;
@@ -206,9 +201,6 @@
          bool isReferenceSolved;
          std::vector<StdString> domAxisScalarIds_;
+         bool isReadDataRequestPending;
          bool useCompressedOutput;
-
-         // Two variable to identify the time_counter meta data written in file, which has no time_counter
-         bool hasTimeInstant;
-         bool hasTimeCentered;
 
          DECLARE_REF_FUNC(Field,field)
Index: XIOS/dev/branch_yushan/src/node/field_impl.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/field_impl.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/field_impl.hpp	(revision 1037)
@@ -19,6 +19,8 @@
   {
     if (clientSourceFilter)
+    {
       clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
-    else if (instantDataFilter)
+    }
+    else if (!field_ref.isEmpty() || !content.empty())
       ERROR("void CField::setData(const CArray<double, N>& _data)",
             << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation.");
Index: XIOS/dev/branch_yushan/src/node/file.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/file.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/file.cpp	(revision 1037)
@@ -17,4 +17,5 @@
 #include "mpi.hpp"
 
+
 namespace xios {
 
@@ -29,4 +30,6 @@
      setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group"));
    }
+   
+
 
    CFile::CFile(const StdString & id)
@@ -38,4 +41,5 @@
       setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group"));
     }
+   
 
    CFile::~CFile(void)
@@ -235,9 +239,7 @@
       const int recordOffset = record_offset.isEmpty() ? 0 : record_offset;
 
-      // set<CAxis*> setAxis;
-      // set<CDomain*> setDomains;
-      set<StdString> setAxis;
-      set<StdString> setDomains;
-      
+      set<CAxis*> setAxis;
+      set<CDomain*> setDomains;
+
       std::vector<CField*>::iterator it, end = this->enabledFields.end();
       for (it = this->enabledFields.begin(); it != end; it++)
@@ -247,10 +249,8 @@
          std::vector<CAxis*> vecAxis = field->grid->getAxis();
          for (size_t i = 0; i < vecAxis.size(); ++i)
-            setAxis.insert(vecAxis[i]->getAxisOutputName());
-            // setAxis.insert(vecAxis[i]);
+            setAxis.insert(vecAxis[i]);
          std::vector<CDomain*> vecDomains = field->grid->getDomains();
          for (size_t i = 0; i < vecDomains.size(); ++i)
-            setDomains.insert(vecDomains[i]->getDomainOutputName());
-            // setDomains.insert(vecDomains[i]);
+            setDomains.insert(vecDomains[i]);
 
          field->resetNStep(recordOffset);
@@ -264,5 +264,5 @@
       if (allDomainEmpty) MPI_Comm_free(&fileComm);
 
-      // if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered);
+      if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered);
       if (time_counter_name.isEmpty()) time_counter_name = "time_counter";
     }
@@ -375,5 +375,6 @@
          if (pos2!=std::string::npos)
          {
-           middlePart=filename.substr(pos1,pos2-pos1) ;           
+           middlePart=filename.substr(pos1,pos2-pos1) ;
+           cout<<pos2<<endl ;
            pos2+=strEndDate.size() ;
            lastPart=filename.substr(pos2,filename.size()-pos2) ;
@@ -580,5 +581,7 @@
           this->data_in->closeFile();
        }
+
       if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm);
+
    }
    //----------------------------------------------------------------
@@ -715,4 +718,5 @@
    {
      int size = this->enabledFields.size();
+     
      for (int i = 0; i < size; ++i)
      {
@@ -745,5 +749,5 @@
      int size = this->enabledFields.size();
      for (int i = 0; i < size; ++i)
-       this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate());
+       this->enabledFields[i]->sendReadDataRequest();
    }
 
Index: XIOS/dev/branch_yushan/src/node/file.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/file.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/file.hpp	(revision 1037)
@@ -12,4 +12,7 @@
 #include "attribute_enum_impl.hpp"
 #include "mpi.hpp"
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
 
 namespace xios {
Index: XIOS/dev/branch_yushan/src/node/grid.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/grid.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/grid.cpp	(revision 1037)
@@ -166,10 +166,14 @@
    void CGrid::checkAttributesAfterTransformation()
    {
-      setAxisList();
-      std::vector<CAxis*> axisListP = this->getAxis();
+      int myRank;
+      MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
+      setAxisList();  //printf("myRank = %d, setAxisList OK\n", myRank);
+      std::vector<CAxis*> axisListP = this->getAxis();  //printf("myRank = %d, this->getAxis OK\n", myRank);
       if (!axisListP.empty())
       {
         int idx = 0;
         axisPositionInGrid_.resize(0);
+        
         for (int i = 0; i < axis_domain_order.numElements(); ++i)
         {
@@ -179,4 +183,5 @@
             axisPositionInGrid_.push_back(idx);
             ++idx;
+            //printf("myRank = %d, axisPositionInGrid_.push_back OK\n", myRank);
           }
           else if (2 == elementDimension) idx += 2;
@@ -186,14 +191,17 @@
         {
           axisListP[i]->checkAttributesOnClientAfterTransformation(globalDim_,axisPositionInGrid_[i]);
-        }
-      }
-
-      setDomainList();
-      std::vector<CDomain*> domListP = this->getDomains();
+          //printf("myRank = %d, axisListP[%d/%d]->checkAttributesOnClientAfterTransformation OK\n", myRank, i, axisListP.size());
+        }
+      }
+
+      setDomainList(); //printf("myRank = %d, setDomainList OK\n", myRank);
+      std::vector<CDomain*> domListP = this->getDomains(); //printf("myRank = %d, this->getDomains OK\n", myRank);
       if (!domListP.empty())
       {
         for (int i = 0; i < domListP.size(); ++i)
         {
+          //printf("myRank = %d, start domListP[%d]->checkAttributesOnClientAfterTransformation\n", myRank, i);
           domListP[i]->checkAttributesOnClientAfterTransformation();
+          //printf("myRank = %d, domListP[%d]->checkAttributesOnClientAfterTransformation OK\n", myRank, i);
         }
       }
@@ -272,5 +280,8 @@
    void CGrid::checkMaskIndex(bool doSendingIndex)
    {
-     CContext* context = CContext::getCurrent();
+     int myRank;
+     MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
+
+     CContext* context = CContext::getCurrent(); 
      CContextClient* client=context->client;
 
@@ -278,8 +289,11 @@
      {
        if (context->hasClient)
-          if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; }
+          if (this->isChecked && doSendingIndex && !isIndexSent) 
+            { 
+              sendIndexScalarGrid(); 
+              this->isIndexSent = true; 
+            }
 
        if (this->isChecked) return;
-
        if (context->hasClient)
        {
@@ -287,11 +301,14 @@
        }
 
-       if (!(this->hasTransform() && !this->isTransformed()))
-        this->isChecked = true;
+       this->isChecked = true;
        return;
      }
-
+     
      if (context->hasClient)
-      if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndex(); this->isIndexSent = true; }
+      if (this->isChecked && doSendingIndex && !isIndexSent) 
+        {
+          sendIndex(); 
+          this->isIndexSent = true;
+        }
 
      if (this->isChecked) return;
@@ -299,14 +316,9 @@
      if (context->hasClient)
      {
-        this->checkAttributesAfterTransformation();
-        this->checkMask();
-        this->computeIndex();
+        this->checkAttributesAfterTransformation(); 
+        this->checkMask();  
+        this->computeIndex();  
      }
-
-     if (!(this->hasTransform() && !this->isTransformed())) 
-      this->isChecked = true;
-
-     if (!(this->hasTransform() && (!this->isGenerated())))
-      this->isChecked = true; 
+     this->isChecked = true;
    }
 
@@ -1051,5 +1063,5 @@
         int rank = *itRank;
         int nb = 1;
-        storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));        
+        storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));
         listOutIndex.push_back(CArray<size_t,1>(nb));
 
@@ -1063,5 +1075,4 @@
         }
 
-        storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
         listMsg.push_back(CMessage());
         listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back();
@@ -1072,19 +1083,5 @@
     }
     else
-    {
-      const std::list<int>& ranks = client->getRanksServerNotLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        int rank = *itRank;
-        int nb = 1;        
-        storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));
-        CArray<int, 1>& outLocalIndexToServer = storeIndex_fromSrv[rank];
-        for (int k = 0; k < nb; ++k)
-        {          
-          outLocalIndexToServer(k)  = 0;
-        }
-      }
       client->sendEvent(event);
-    }
   }
 
@@ -1114,10 +1111,10 @@
           outLocalIndexToServer(idx) = itIndex->second;
         }
-        
+
+        //int nbClient = client->clientSize; // This stupid variable signals the servers the number of client connect to them
         const std::list<int>& ranks = client->getRanksServerLeader();
         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
         {
           storeIndex_toSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-          storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
           listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
 
@@ -1129,20 +1126,6 @@
         client->sendEvent(event);
       }
-      else 
-      {
-        int indexSize = globalLocalIndexSendToServer.size();        
-        CArray<int,1> outLocalIndexToServer(indexSize);
-        for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
-        {          
-          outLocalIndexToServer(idx) = itIndex->second;
-        }
-        
-        const std::list<int>& ranks = client->getRanksServerNotLeader();
-        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-        {          
-          storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-        }
+      else
         client->sendEvent(event);
-      }
     }
     else
@@ -1177,5 +1160,5 @@
           nb = globalIndexTmp[rank].size();
 
-        storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb)));        
+        storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb)));
         listOutIndex.push_back(CArray<size_t,1>(nb));
 
@@ -1189,5 +1172,4 @@
         }
 
-        storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
         listMsg.push_back(CMessage());
         listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
Index: XIOS/dev/branch_yushan/src/node/grid.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/grid.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/grid.hpp	(revision 1037)
@@ -221,5 +221,4 @@
 
          map<int, CArray<int, 1> > storeIndex_toSrv;
-         map<int, CArray<int, 1> > storeIndex_fromSrv;
          map<int,int> nbSenders;
 
Index: XIOS/dev/branch_yushan/src/node/interpolate_domain.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/interpolate_domain.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/interpolate_domain.cpp	(revision 1037)
@@ -48,43 +48,47 @@
     }
 
-    if (this->mode.isEmpty()) this->mode.setValue(mode_attr::compute);
-    if (this->write_weight.isEmpty()) this->write_weight.setValue(false);
+    StdString weightFile = "interpolation_weights_" + domainSrc->getDomainOutputName();
 
-    StdString weightFile;
-    switch (this->mode)
-    {
-      case mode_attr::read:
-        if (this->weight_filename.isEmpty())
-        {
-          if (!this->write_weight)
+    if (!this->mode.isEmpty())
+    { 
+      if (mode_attr::read == this->mode)
+      {
+         if (this->file.isEmpty())
+         {
             ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
                  << "Read mode is activated but there is no file specified." << std::endl
                  << "Please define a correct file containing interpolation weights with option 'file'. ");
-        }
-        else
-        {
-          weightFile = this->weight_filename;
-          ifstream f(weightFile.c_str());
-          if (!f.good())
-            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
-                  << "Read mode is activated but file "  << weightFile << " doesn't exist." << std::endl
-                  << "Please check this file ");
-        }
-        break;
-      case mode_attr::compute:
-        break;
-      case mode_attr::read_or_compute:
-        if (!this->weight_filename.isEmpty() && !this->write_weight)
-        {
-          weightFile = this->weight_filename;
-          ifstream f(weightFile.c_str());
-          if (!f.good())
-            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
-                  << "read_or_compute mode is activated but file "  << weightFile << " doesn't exist." << std::endl
-                  << "Please check this file ");
-        }
-        break;
-      default:
-        break;
+         }
+         else
+         {
+           weightFile = this->file;
+           ifstream f(weightFile.c_str());
+           if (!f.good())
+             ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
+                   << "Read mode is activated but file "  << weightFile << " doesn't exist." << std::endl
+                   << "Please check this file ");
+         }
+      }
+      else
+      {
+        if (file.isEmpty())
+          this->file.setValue(weightFile);
+      }   
+    }
+    else
+    {
+      if (!file.isEmpty()) // set mode read
+      {
+         weightFile = this->file;
+         ifstream f(weightFile.c_str());
+         if (!f.good()) // file doesn't exist
+           this->mode.setValue(mode_attr::write);
+         else
+           this->mode.setValue(mode_attr::read);
+      }
+      else // only calculate weights() Mode set write but there is no file)
+      {
+        this->mode.setValue(mode_attr::write);
+      }
     }
 
Index: XIOS/dev/branch_yushan/src/node/interpolate_domain.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/interpolate_domain.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/interpolate_domain.hpp	(revision 1037)
@@ -50,5 +50,5 @@
       virtual ~CInterpolateDomain(void);
 
-      virtual void checkValid(CDomain* domainSource);
+      virtual void checkValid(CDomain* axisDest);
 
       /// Accesseurs statiques ///
Index: XIOS/dev/branch_yushan/src/node/mesh.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/node/mesh.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/node/mesh.cpp	(revision 1037)
@@ -11,14 +11,14 @@
 /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-  CMesh::CMesh(void) :  nbNodesGlo(0), nbEdgesGlo(0)
-            ,  node_start(0), node_count(0)
-            ,  edge_start(0), edge_count(0)
-            ,  nbFaces_(0), nbNodes_(0), nbEdges_(0)
-            ,  nodesAreWritten(false), edgesAreWritten(false), facesAreWritten(false)
+  CMesh::CMesh(void) :  nbNodesGlo{0}, nbEdgesGlo{0}
+            ,  node_start{0}, node_count{0}
+            ,  edge_start{0}, edge_count{0}
+            ,  nbFaces_{0}, nbNodes_{0}, nbEdges_{0}
+            ,  nodesAreWritten{false}, edgesAreWritten{false}, facesAreWritten{false}
             ,  node_lon(), node_lat()
             ,  edge_lon(), edge_lat(), edge_nodes()
             ,  face_lon(), face_lat()
             ,  face_nodes()
-            ,  pNodeGlobalIndex(NULL), pEdgeGlobalIndex(NULL)
+            ,  pNodeGlobalIndex{NULL}, pEdgeGlobalIndex{NULL}
   {
   }
@@ -91,4 +91,30 @@
       seed ^= sizetHash(first) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
     }
+    return seed ;
+  }
+
+///----------------------------------------------------------------
+/*!
+ * \fn size_t generateEdgeIndex(size_t first, size_t second, int rank)
+ * Generates an edge index.
+ * If the same edge is generated by two processes, each process will have its own edge index.
+ * \param [in] first Edge node.
+ * \param [in] second Edge node.
+ * \param [in] rank MPI process rank.
+ */
+  size_t generateEdgeIndex(size_t first, size_t second, int rank)
+  {
+    size_t seed = rank ;
+    if (first < second)
+    {
+      seed = hashPair(seed, first);
+      seed = hashPair(seed, second);
+    }
+    else
+    {
+      seed = hashPair(seed, second);
+      seed = hashPair(seed, first);
+    }
+
     return seed ;
   }
@@ -115,25 +141,4 @@
     return seed ;
   }
-
-  ///----------------------------------------------------------------
-  /*!
-   * \fn size_t generateNodeIndex(vector<size_t>& valList)
-   * Generates a node index unique for all processes.
-   * \param [in] valList Vector storing four node hashes.
-   */
-    size_t generateNodeIndex(vector<size_t>& valList)
-    {
-      // Sort is needed to avoid problems for nodes with lon = 0 generated by faces in east and west semisphere
-      vector<size_t> vec = valList;
-      sort (vec.begin(), vec.end());
-      size_t seed = vec[0] ;
-      int it = 1;
-      for(; it != vec.size(); ++it)
-      {
-         seed = hashPair(seed, vec[it]);
-      }
-      return seed ;
-    }
-
 
 ///----------------------------------------------------------------
@@ -595,5 +600,4 @@
         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2Idx;
         CArray<size_t,1> nodeHashList(nbEdges_*nvertex*4);
-        int nbHash = 0;
         for (int ne = 0; ne < nbEdges_; ++ne)
         {
@@ -605,103 +609,69 @@
               if (nodeHash2Idx[hashValues[nh]].size() == 0)
               {
-                nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues));
+                nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues, mpiRank));
                 nodeHash2Idx[hashValues[nh]].push_back(mpiRank);
-                nodeHashList(nbHash) = hashValues[nh];
-                ++nbHash;
               }
-            }
-          }
-        }
-        nodeHashList.resizeAndPreserve(nbHash);
+              nodeHashList((ne*nvertex + nv)*4 + nh) = hashValues[nh];
+            }
+          }
+        }
 
         // (2.2) Generating global node indexes
-        // The ownership criterion: priority of the process of smaller index
+        // The ownership criterion: priority of the process holding the smaller index
         // Maps generated in this step are:
-        // Maps generated in this step are:
-         // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]>
-         // nodeIdx2Idx = <idx, <rankOwner, idx>>
-
-         CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm);
-         dhtNodeHash.computeIndexInfoMapping(nodeHashList);
-         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap();
-
-
-         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx;
-         CArray<size_t,1> nodeIdxList(nbEdges_*nvertex*4);
-         size_t nIdx = 0;
-
-         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it)
-         {
-           size_t rankMin = (it->second)[1];
-           size_t idx = (it->second)[0];
-           for (int i = 2; i < (it->second).size();)
-           {
-             if ( (it->second)[i+1] < rankMin)
-             {
-               idx = (it->second)[i];
-               rankMin = (it->second)[i+1];
-               (it->second)[i+1] = (it->second)[i-1];
-             }
-             i += 2;
-           }
-           if (nodeIdx2Idx.count(idx) == 0)
-           {
-             if (mpiRank == rankMin)
-             {
-               nodeIdx2Idx[idx].push_back(rankMin);
-               nodeIdx2Idx[idx].push_back(idx);
-             }
-             nodeIdxList(nIdx) = idx;
-             ++nIdx;
-           }
-         }
-         nodeIdxList.resizeAndPreserve(nIdx);
-
-         // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. =>
-         // Solution: global node indexing by hand.
-         // Maps modified in this step:
-         // nodeIdx2Idx = <idx, idxGlo>
-         int nodeCount = nodeIdx2Idx.size();
-         int nodeStart, nbNodes;
-         MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
-         int nNodes = nodeStart;
-         MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
-         nbNodesGlo = nNodes;
-
-         nodeStart -= nodeCount;
-         node_start = nodeStart;
-         node_count = nodeCount;
-         CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once
-         size_t count = 0;
-
-         for (int ne = 0; ne < nbEdges_; ++ne)
-         {
-           for (int nv = 0; nv < nvertex; ++nv)
-           {
-             vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne));
-             size_t nodeIdx = generateNodeIndex(hashValues);
-             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx);
-             if (it != nodeIdx2Idx.end())
-             {
-               if (dummyMap.count(nodeIdx) == 0)
-               {
-                 dummyMap[nodeIdx].push_back(nodeIdx);
-                 (it->second)[1] = node_start + count;
-                 ++count;
-               }
-             }
-           }
-         }
-
-         CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm);
-         dhtNodeIdx.computeIndexInfoMapping(nodeIdxList);
-         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap();
+        // nodeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]>
+        // nodeIdx2IdxMin = <idx, idxMin>
+        // nodeIdx2IdxGlo = <idxMin, idxMin>
+
+        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo;
+        CArray<size_t,1> nodeIdxMinList(nbEdges_*nvertex);
+
+        CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm);
+        dhtNodeHash.computeIndexInfoMapping(nodeHashList);
+        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap();
+        size_t iIdxMin = 0;
+
+        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it)
+        {
+          size_t idx = (it->second)[0];
+          size_t idxMin = (it->second)[0];
+          for (int i = 2; i < (it->second).size();)
+          {
+            if (mpiRank == (it->second)[i+1])
+            {
+              idx = (it->second)[i];
+            }
+            if ((it->second)[i] < idxMin)
+            {
+                idxMin = (it->second)[i];
+                (it->second)[i] = (it->second)[i-2];
+            }
+            i += 2;
+          }
+          (it->second)[0] = idxMin;
+          if (nodeIdx2IdxMin.count(idx) == 0)
+          {
+            nodeIdx2IdxMin[idx].push_back(idxMin);
+            if (idx == idxMin)
+              nodeIdx2IdxGlo[idxMin].push_back(idxMin);
+            nodeIdxMinList(iIdxMin) = idxMin;
+            ++iIdxMin;
+          }
+        }
+        nodeIdxMinList.resizeAndPreserve(iIdxMin);
+        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm);
+        CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm);
+        dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList);
+        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap();
+        // nodeIdx2IdxGlo holds global indexes only for nodes owned by a process
+        // nodeIdxMin2IdxGlo holds global indexes for all nodes generated by a process
 
         // (2.3) Saving variables: node_lon, node_lat, edge_nodes
         // Creating map nodeHash2IdxGlo <hash, idxGlo>
         // Creating map edgeHash2IdxGlo <hash, idxGlo>
-//        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();
-//        node_count = dhtNodeIdxGlo.getIndexCount();
-//        node_start = dhtNodeIdxGlo.getIndexStart();
+        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();
+        node_count = dhtNodeIdxGlo.getIndexCount();
+        node_start = dhtNodeIdxGlo.getIndexStart();
         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2IdxGlo;
         node_lon.resize(node_count);
@@ -715,14 +685,22 @@
           {
             hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne));
-            size_t myIdx = generateNodeIndex(hashValues);
-            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxGlo.find(myIdx);
-            idxGlo = (itIdx->second)[1];
-
-            if (mpiRank == (itIdx->second)[0])
-            {
+            size_t myIdx = generateNodeIndex(hashValues, mpiRank);
+            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxMin.find(myIdx);
+            size_t ownerIdx = (itIdx->second)[0];
+
+            if (myIdx == ownerIdx)
+            {
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdx2IdxGlo.find(myIdx);
+              idxGlo = (itIdxGlo->second)[0];
 //              node_lon(idxGlo - node_start) = (bounds_lon(nv, ne) == 360.) ? (0.) : (bounds_lon(nv, ne));
               node_lon(idxGlo - node_start) = bounds_lon(nv, ne);
               node_lat(idxGlo - node_start) = bounds_lat(nv, ne);
             }
+            else
+            {
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdxMin2IdxGlo.find(ownerIdx);
+              idxGlo = (itIdxGlo->second)[0];
+            }
+
             edge_nodes(nv,ne) = idxGlo;
             for (int nh = 0; nh < 4; ++nh)
@@ -815,5 +793,5 @@
         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHash2Rank;
         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face;
-        CArray<size_t,1> edgeIdxList(nbFaces_*nvertex);
+        CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex);
         size_t iIdx = 0;
 
@@ -846,10 +824,10 @@
               if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0)
               {
-                edgeIdxList(iIdx) = edgeIdxGlo;
+                edgeIdxGloList(iIdx) = edgeIdxGlo;
                 ++iIdx;
               }
               edgeIdxGlo2Face[edgeIdxGlo].push_back(faceIdxGlo);
+              edgeHash2Rank[edgeHash].push_back(itEdgeHash->first);
               edgeHash2Rank[edgeHash].push_back(mpiRank);
-              edgeHash2Rank[edgeHash].push_back(itEdgeHash->second[0]);
             }
             else
@@ -859,5 +837,5 @@
           }
         }
-        edgeIdxList.resizeAndPreserve(iIdx);
+        edgeIdxGloList.resizeAndPreserve(iIdx);
 
         // (1.3) Saving remaining variables edge_faces and face_faces
@@ -868,85 +846,30 @@
         dhtEdgeHash.computeIndexInfoMapping(edgeHashList);
         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap();
-
-        // edgeHash2Info = <edgeHash, < rank1, idxGlo, rank2, idxGlo>>
-        int edgeCount = 0;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHashMin2IdxGlo;
+
+        // edgeHash2Info = <edgeHash, <idxGlo, rank1, idxGlo, rank2>>
+        // edgeHashMin2IdxGlo = <edgeHashMin, idxGlo>
         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it)
         {
           vector <size_t> edgeInfo = it->second;
-          if (edgeInfo[0] == mpiRank)
-          {
-            ++edgeCount;
-          }
-        }
-
-        int edgeStart, nbEdges;
-        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
-        int nEdges = edgeStart;
-        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
-        nbEdgesGlo = nEdges;
-
-        // edges to be splitted equally between procs
-        if ( (nbEdgesGlo % mpiSize) == 0)
-        {
-          edge_count = nbEdgesGlo/mpiSize;
-          edge_start = mpiRank*edge_count;
-        }
-        else
-        {
-          if (mpiRank == (mpiSize - 1) )
-          {
-            edge_count = nbEdgesGlo/mpiSize;
-            edge_start = mpiRank*(nbEdgesGlo/mpiSize + 1);
-          }
-          else
-          {
-            edge_count = nbEdgesGlo/mpiSize + 1;
-            edge_start = mpiRank*edge_count;
-          }
-        }
-        CArray<size_t,1> edgeIdxGloList(edge_count);
-        for (int i = 0; i < edge_count; ++i)
-        {
-          edgeIdxGloList(i) = i + edge_start;
-        }
-
-        CClientClientDHTSizet dhtEdgeIdxGlo2Face (edgeIdxGlo2Face, comm);
+          if (edgeInfo.size() == 4)                       // two processes generate the same edge
+            if (edgeInfo[1] > edgeInfo[3])
+              edgeInfo[1] = edgeInfo[3];
+          if (edgeInfo[1] == mpiRank)
+            edgeHashMin2IdxGlo[it->first].push_back(edgeInfo[0]);
+        }
+
+        CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeHashMin2IdxGlo, comm);
+        edge_count = dhtEdgeIdxGlo.getIndexCount();
+        edge_start = dhtEdgeIdxGlo.getIndexStart();
+
+        edge_faces.resize(2, edge_count);
+        face_faces.resize(nvertex, nbFaces_);
+
         CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm);
-        dhtEdgeIdxGlo2Face.computeIndexInfoMapping(edgeIdxGloList);
-        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdgeIdxGlo2Face.getInfoIndexMap();
-        dhtEdge2Face.computeIndexInfoMapping(edgeIdxList);
-        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2FaceIdx = dhtEdge2Face.getInfoIndexMap();
-
-
-        edge_faces.resize(2, edge_count);
-        for (int i = 0; i < edge_count; ++i)
-        {
-          CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdxGlo2FaceIdx.find(i + edge_start);
-          int indexGlo = it->first;
-          vector<size_t> faces = it->second;
-          int face1 = faces[0];
-          edge_faces(0, indexGlo - edge_start) = face1;
-          if (faces.size() == 2)
-          {
-            int face2 = faces[1];
-            edge_faces(1, indexGlo - edge_start) = face2;
-          }
-          else
-          {
-            edge_faces(1, indexGlo - edge_start) = -999;
-          }
-        }
-
-        size_t tmp;
-        vector<size_t> tmpVec;
-        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2FaceIdx.begin(); it != edgeIdx2FaceIdx.end(); it++)
-        {
-          tmp = it->first;
-          tmpVec = it->second;
-          tmp++;
-        }
-
-        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2, itIndex;
-        face_faces.resize(nvertex, nbFaces_);
+        dhtEdge2Face.computeIndexInfoMapping(edgeIdxGloList);
+        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap();
+        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2;
+
         for (int nf = 0; nf < nbFaces_; ++nf)
         {
@@ -973,13 +896,14 @@
               size_t faceIdxGlo = nbFacesAccum + nf;
               size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]);
-              itEdgeHash = edgeHash2Info.find(edgeHash);
-              int edgeIdxGlo = (itEdgeHash->second)[1];
-
-              if ( (itEdgeHash->second)[0] == mpiRank)
+              itEdgeHash = edgeHash2IdxGlo.find(edgeHash);
+              if (itEdgeHash != edgeHashMin2IdxGlo.end())
               {
-                itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo);
+                int edgeIdxGlo = itEdgeHash->second[0];
+                itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo);
                 int face1 = itFace1->second[0];
                 if (itFace1->second.size() == 1)
                 {
+                  edge_faces(0, edgeIdxGlo - edge_start) = face1;
+                  edge_faces(1, edgeIdxGlo - edge_start) = -999;
                   face_faces(nv1, nf) = 999999;
                 }
@@ -987,4 +911,6 @@
                 {
                   int face2 = itFace1->second[1];
+                  edge_faces(0, edgeIdxGlo - edge_start) = face1;
+                  edge_faces(1, edgeIdxGlo - edge_start) = face2;
                   face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1);
                 }
@@ -992,5 +918,7 @@
               else
               {
-                itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo);
+                itEdgeHash = edgeHashMin2IdxGlo.find(edgeHash);
+                size_t edgeIdxGlo = itEdgeHash->second[0];
+                itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo);
                 int face1 = itFace1->second[0];
                 int face2 = itFace1->second[1];
@@ -1029,5 +957,4 @@
         CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it1, it2;
         CArray<size_t,1> edgeHashList(nbFaces_*nvertex);
-        int nEdgeHash = 0;
         for (int nf = 0; nf < nbFaces_; ++nf)
         {
@@ -1051,65 +978,73 @@
             face_nodes(nv1,nf) = it1->second[0];
             size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]);
-            if (edgeHash2Idx.count(edgeHash) == 0)
-            {
-              edgeHash2Idx[edgeHash].push_back(edgeHash);
-              edgeHash2Idx[edgeHash].push_back(mpiRank);
-              edgeHashList(nEdgeHash) = edgeHash;
-              ++nEdgeHash;
-            }
-          }
-        }
-        edgeHashList.resizeAndPreserve(nEdgeHash);
-
-        // (2.3) Generating global edge indexes
-        // The ownership criterion: priority of the process with smaller rank
+            edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(it1->second[0], it2->second[0], mpiRank));
+            edgeHash2Idx[edgeHash].push_back(mpiRank);
+            edgeHashList(nf*nvertex + nv1) = edgeHash;
+          }
+        }
+
+        // (2.2) Generating global edge indexes
+        // The ownership criterion: priority of the process holding the smaller index
         // Maps generated in this step are:
-        // edgeIdx2Idx = = <idx, <rankOwner, idx>>
-        // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>>
+        // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]>
+        // edgeIdx2IdxMin = = <idx, idxMin>
+        // edgeIdx2IdxGlo = <idxMin, idxGlo>
 
         CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm);
         dhtEdgeHash.computeIndexInfoMapping(edgeHashList);
         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap();
-        // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]>
-
-        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx;
+
+        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo;
+        CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex);
+        size_t iIdxMin = 0;
 
         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it)
         {
-          size_t rankMin = (it->second)[1];
+          size_t idxMin = (it->second)[0];
           size_t idx = (it->second)[0];
-
           for (int i = 2; i < (it->second).size();)
           {
-            if ((it->second)[i+1] < rankMin)
-            {
-              rankMin = (it->second)[i+1];
+            if (mpiRank == (it->second)[i+1])
+            {
               idx = (it->second)[i];
-              (it->second)[i+1] = (it->second)[i-1];
+            }
+            if ((it->second)[i] < idxMin)
+            {
+                idxMin = (it->second)[i];
+                (it->second)[i] = (it->second)[i-2];
             }
             i += 2;
           }
-          if (edgeIdx2Idx.count(idx) == 0)
-          {
-            if (mpiRank == rankMin)
-            {
-              edgeIdx2Idx[idx].push_back(rankMin);
-              edgeIdx2Idx[idx].push_back(idx);
-            }
-          }
-        }
-
-        int edgeCount = edgeIdx2Idx.size();
-        int edgeStart, nbEdges;
-        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
-        int nEdges = edgeStart;
-        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
-        nbEdgesGlo = nEdges;
-
-        edgeStart -= edgeCount;
-        edge_start = edgeStart;
-        edge_count = edgeCount;
-        CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap;
-        int count = 0;
+          (it->second)[0] = idxMin;
+          if (edgeIdx2IdxMin.count(idx) == 0)
+          {
+            edgeIdx2IdxMin[idx].push_back(idxMin);
+            if (idx == idxMin)
+              edgeIdx2IdxGlo[idxMin].push_back(idxMin);
+            edgeIdxMinList(iIdxMin) = idxMin;
+            ++iIdxMin;
+          }
+        }
+        edgeIdxMinList.resizeAndPreserve(iIdxMin);
+        CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm);
+        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm);
+        dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList);
+        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap();
+        // edgeIdx2IdxGlo holds global indexes only for edges owned by a process
+        // edgeIdxMin2IdxGlo holds global indexes for all edges generated by a process
+
+        // (2.3) Saving variables: edge_lon, edge_lat, face_edges
+        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal();
+        edge_count = dhtEdgeIdxGlo.getIndexCount();
+        edge_start = dhtEdgeIdxGlo.getIndexStart();
+        edge_lon.resize(edge_count);
+        edge_lat.resize(edge_count);
+        edge_nodes.resize(2, edge_count);
+        face_edges.resize(nvertex, nbFaces_);
+
+        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face;
+        CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex);
+        size_t iIdx = 0;
 
         for (int nf = 0; nf < nbFaces_; ++nf)
@@ -1133,70 +1068,19 @@
               it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2));
             }
-            size_t nodeIdxGlo1 = it1->second[0];
-            size_t nodeIdxGlo2 = it2->second[0];
-
-            if (nodeIdxGlo1 != nodeIdxGlo2)
-            {
-              size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
-              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx);
-              if (it != edgeIdx2Idx.end())
-              {
-                if (dummyEdgeMap.count(edgeIdx) == 0)
-                {
-                  dummyEdgeMap[edgeIdx].push_back(edgeIdx);
-                  (it->second)[1] = edge_start + count;
-                  ++count;
-                }
-              }
-            }
-          }
-        }
-
-        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm);
-        dhtEdgeIdx.computeIndexInfoMapping(edgeHashList);
-        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap();
-
-        // (2.4) Saving variables: edge_lon, edge_lat, face_edges
-        edge_lon.resize(edge_count);
-        edge_lat.resize(edge_count);
-        edge_nodes.resize(2, edge_count);
-        face_edges.resize(nvertex, nbFaces_);
-
-        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face;
-        CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex);
-        size_t iIdx = 0;
-
-        for (int nf = 0; nf < nbFaces_; ++nf)
-        {
-          for (int nv1 = 0; nv1 < nvertex; ++nv1)
-          {
-            // Getting global indexes of edge's nodes
-            int nh1 = 0;
-            int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation
-            it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1));
-            while (it1 == nodeHash2IdxGlo.end())
-            {
-              ++nh1;
-              it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1));
-            }
-            int nh2 = 0;
-            it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv2)*4 + nh2));
-            while (it2 == nodeHash2IdxGlo.end())
-            {
-              ++nh2;
-              it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2));
-            }
             // Getting edge global index
             size_t nodeIdxGlo1 = it1->second[0];
             size_t nodeIdxGlo2 = it2->second[0];
-            size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
+            size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank);
             if (nodeIdxGlo1 != nodeIdxGlo2)
             {
-              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx);
-              int edgeIdxGlo = (itIdx->second)[1];
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx);
+              size_t ownerIdx = (itIdx->second)[0];
+              int edgeIdxGlo = 0;
               size_t faceIdxGlo = nbFacesAccum + nf;
 
-              if (mpiRank == (itIdx->second)[0])
+              if (myIdx == ownerIdx)
               {
+                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);
+                edgeIdxGlo = (itIdxGlo->second)[0];
                 double edgeLon;
                 double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf));
@@ -1212,4 +1096,9 @@
                 edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2;
               }
+              else
+              {
+                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);
+                edgeIdxGlo = (itIdxGlo->second)[0];
+              }
               face_edges(nv1,nf) = edgeIdxGlo;
               if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0)
@@ -1228,5 +1117,5 @@
         edgeIdxGloList.resizeAndPreserve(iIdx);
 
-        // (2.5) Saving remaining variables edge_faces and face_faces
+        // (2.4) Saving remaining variables edge_faces and face_faces
         edge_faces.resize(2, edge_count);
         face_faces.resize(nvertex, nbFaces_);
@@ -1236,5 +1125,4 @@
         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap();
         CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdxGlo1, itNodeIdxGlo2;
-        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx;
 
         for (int nf = 0; nf < nbFaces_; ++nf)
@@ -1261,11 +1149,13 @@
             size_t nodeIdxGlo2 = it2->second[0];
 
-            size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
-            itIdx = edgeIdx2IdxGlo.find(myIdx);
+            size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank);
+            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx);
+            size_t ownerIdx = (itIdx->second)[0];
             size_t faceIdxGlo = nbFacesAccum + nf;
-            int edgeIdxGlo = (itIdx->second)[1];
-
-            if (mpiRank == (itIdx->second)[0])
-            {
+
+            if (myIdx == ownerIdx)
+            {
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);
+              int edgeIdxGlo = (itIdxGlo->second)[0];
               it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo);
               int face1 = it1->second[0];
@@ -1286,4 +1176,6 @@
             else
             {
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);
+              size_t edgeIdxGlo = (itIdxGlo->second)[0];
               it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo);
               int face1 = it1->second[0];
@@ -1308,6 +1200,5 @@
           {
             hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf));
-//            size_t nodeIndex = generateNodeIndex(hashValues, mpiRank);
-            size_t nodeIndex = generateNodeIndex(hashValues);
+            size_t nodeIndex = generateNodeIndex(hashValues, mpiRank);
             for (int nh = 0; nh < 4; ++nh)
             {
@@ -1325,9 +1216,9 @@
 
         // (3.2) Generating global node indexes
-        // The ownership criterion: priority of the process with smaller rank.
-        // With any other criterion it is not possible to have consistent node indexing for different number of procs.
+        // The ownership criterion: priority of the process holding the smaller index
         // Maps generated in this step are:
-        // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]>
-        // nodeIdx2Idx = <idx, <rankOwner, idx>>
+        // nodeHash2Info = <hash, [[idxMin, rankMin], [idx1, rank1], [idx3, rank3]..]>
+        // nodeIdx2IdxMin = = <idx, idxMin>
+        // nodeIdx2IdxGlo = <idxMin, idxGlo>
 
         CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm);
@@ -1335,80 +1226,48 @@
         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap();
 
-        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx;
-        CArray<size_t,1> nodeIdxList(nbFaces_*nvertex*4);
-        size_t nIdx = 0;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo;
+        CArray<size_t,1> nodeIdxMinList(nbFaces_*nvertex*4);
+        size_t iIdxMin = 0;
 
         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it)
         {
-          size_t rankMin = (it->second)[1];
+          size_t idxMin = (it->second)[0];
           size_t idx = (it->second)[0];
           for (int i = 2; i < (it->second).size();)
           {
-            if ( (it->second)[i+1] < rankMin)
+            if (mpiRank == (it->second)[i+1])
             {
               idx = (it->second)[i];
-              rankMin = (it->second)[i+1];
-              (it->second)[i+1] = (it->second)[i-1];
+            }
+            if ((it->second)[i] < idxMin)
+            {
+                idxMin = (it->second)[i];
+                (it->second)[i] = (it->second)[i-2];
             }
             i += 2;
           }
-          if (nodeIdx2Idx.count(idx) == 0)
-          {
-            if (mpiRank == rankMin)
-            {
-              nodeIdx2Idx[idx].push_back(rankMin);
-              nodeIdx2Idx[idx].push_back(idx);
-            }
-            nodeIdxList(nIdx) = idx;
-            ++nIdx;
-          }
-        }
-
-//        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm);
-        // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. =>
-        // Solution: global node indexing by hand.
-        // Maps modified in this step:
-        // nodeIdx2Idx = <idx, idxGlo>
-        int nodeCount = nodeIdx2Idx.size();
-        int nodeStart, nbNodes;
-        MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
-        int nNodes = nodeStart;
-        MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
-        nbNodesGlo = nNodes;
-
-        nodeStart -= nodeCount;
-        node_start = nodeStart;
-        node_count = nodeCount;
-        CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once
-        size_t count = 0;
-
-        for (int nf = 0; nf < nbFaces_; ++nf)
-        {
-          for (int nv = 0; nv < nvertex; ++nv)
-          {
-            vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf));
-            size_t nodeIdx = generateNodeIndex(hashValues);
-            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx);
-            if (it != nodeIdx2Idx.end())
-            {
-              if (dummyMap.count(nodeIdx) == 0)
-              {
-                dummyMap[nodeIdx].push_back(nodeIdx);
-                (it->second)[1] = node_start + count;
-                ++count;
-              }
-            }
-          }
-        }
-        nodeIdxList.resizeAndPreserve(nIdx);
-        CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm);
-        dhtNodeIdx.computeIndexInfoMapping(nodeIdxList);
-        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap();
+          (it->second)[0] = idxMin;
+          if (nodeIdx2IdxMin.count(idx) == 0)
+          {
+            nodeIdx2IdxMin[idx].push_back(idxMin);
+            if (idx == idxMin)
+              nodeIdx2IdxGlo[idxMin].push_back(idxMin);
+            nodeIdxMinList(iIdxMin) = idxMin;
+            ++iIdxMin;
+          }
+        }
+
+        nodeIdxMinList.resizeAndPreserve(iIdxMin);
+        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm);
+        CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm);
+        dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList);
+        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap();
 
         // (3.3) Saving node data: node_lon, node_lat, and face_nodes
         // Generating edgeHash2Info = <hash, <idx, rank>> and edgeHashList
-//        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();
-//        node_count = dhtNodeIdxGlo.getIndexCount();
-//        node_start = dhtNodeIdxGlo.getIndexStart();
+        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();
+        node_count = dhtNodeIdxGlo.getIndexCount();
+        node_start = dhtNodeIdxGlo.getIndexStart();
         node_lon.resize(node_count);
         node_lat.resize(node_count);
@@ -1427,21 +1286,28 @@
             vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf));
             vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf));
-            size_t nodeIdx1 = generateNodeIndex(hashValues1);
-            size_t nodeIdx2 = generateNodeIndex(hashValues2);
-            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1);
-            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2);
-            size_t ownerRank = (itNodeIdx1->second)[0];
-            nodeIdxGlo1 = (itNodeIdx1->second)[1];
-            nodeIdxGlo2 = (itNodeIdx2->second)[1];
-
-            if (mpiRank == ownerRank)
-            {
+            size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank);
+            size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank);
+            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxMin.find(myNodeIdx1);
+            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxMin.find(myNodeIdx2);
+            size_t ownerNodeIdx = (itNodeIdx1->second)[0];
+
+            if (myNodeIdx1 == ownerNodeIdx)
+            {
+              itNodeIdxGlo1 = nodeIdx2IdxGlo.find(myNodeIdx1);
+              nodeIdxGlo1 = (itNodeIdxGlo1->second)[0];
               node_lon(nodeIdxGlo1 - node_start) = bounds_lon(nv1, nf);
               node_lat(nodeIdxGlo1 - node_start) = bounds_lat(nv1, nf);
             }
+            else
+            {
+              itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find(ownerNodeIdx);
+              nodeIdxGlo1 = (itNodeIdxGlo1->second)[0];
+            }
+            itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((itNodeIdx2->second)[0]);
+            nodeIdxGlo2 = (itNodeIdxGlo2->second)[0];
             if (nodeIdxGlo1 != nodeIdxGlo2)
             {
               size_t edgeHash = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
-              edgeHash2Idx[edgeHash].push_back(edgeHash);
+              edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank));
               edgeHash2Idx[edgeHash].push_back(mpiRank);
               edgeHashList(nEdgeHash) = edgeHash;
@@ -1455,6 +1321,6 @@
         // (3.4) Generating global edge indexes
         // Maps generated in this step are:
-        // edgeIdx2Idx = = <idx, <rankOwner, idx>>
-        // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>>
+        // edgeIdx2IdxMin = = <idx, idxMin>
+        // edgeIdx2IdxGlo = <idxMin, idxGlo>
 
         CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm);
@@ -1463,84 +1329,49 @@
         // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]>
 
-        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin;
+        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo;
+        CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex);
+        iIdxMin = 0;
 
         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it)
         {
-          size_t rankMin = (it->second)[1];
+          size_t idxMin = (it->second)[0];
           size_t idx = (it->second)[0];
 
           for (int i = 2; i < (it->second).size();)
           {
-            if ((it->second)[i+1] < rankMin)
-            {
-              rankMin = (it->second)[i+1];
+            if (mpiRank == (it->second)[i+1])
+            {
               idx = (it->second)[i];
-              (it->second)[i+1] = (it->second)[i-1];
+            }
+            if ((it->second)[i] < idxMin)
+            {
+                idxMin = (it->second)[i];
+                (it->second)[i] = (it->second)[i-2];
             }
             i += 2;
           }
-          if (edgeIdx2Idx.count(idx) == 0)
-          {
-            if (mpiRank == rankMin)
-            {
-              edgeIdx2Idx[idx].push_back(rankMin);
-              edgeIdx2Idx[idx].push_back(idx);
-            }
-          }
-        }
-
-        int edgeCount = edgeIdx2Idx.size();
-        int edgeStart, nbEdges;
-        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
-        int nEdges = edgeStart;
-        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
-        nbEdgesGlo = nEdges;
-
-        edgeStart -= edgeCount;
-        edge_start = edgeStart;
-        edge_count = edgeCount;
-        CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap;
-        count = 0;
-
-        for (int nf = 0; nf < nbFaces_; ++nf)
-        {
-          for (int nv1 = 0; nv1 < nvertex; ++nv1)
-          {
-            int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation
-            vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf));
-            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf));
-            size_t nodeIdx1 = generateNodeIndex(hashValues1);
-            size_t nodeIdx2 = generateNodeIndex(hashValues2);
-            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1);
-            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2);
-            nodeIdxGlo1 = (itNodeIdx1->second)[1];
-            nodeIdxGlo2 = (itNodeIdx2->second)[1];
-
-            if (nodeIdxGlo1 != nodeIdxGlo2)
-            {
-              size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
-              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx);
-              if (it != edgeIdx2Idx.end())
-              {
-                if (dummyEdgeMap.count(edgeIdx) == 0)
-                {
-                  dummyEdgeMap[edgeIdx].push_back(edgeIdx);
-                  (it->second)[1] = edge_start + count;
-                  ++count;
-                }
-              }
-            }
-          }
-        }
-        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm);
-        dhtEdgeIdx.computeIndexInfoMapping(edgeHashList);
-        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap();
+          (it->second)[0] = idxMin;
+          if (edgeIdx2IdxMin.count(idx) == 0)
+          {
+            edgeIdx2IdxMin[idx].push_back(idxMin);
+            if (idx == idxMin)
+              edgeIdx2IdxGlo[idxMin].push_back(idxMin);
+            edgeIdxMinList(iIdxMin) = idxMin;
+            ++iIdxMin;
+          }
+        }
+        edgeIdxMinList.resizeAndPreserve(iIdxMin);
+        CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm);
+        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm);
+        dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList);
+        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap();
 
         // (3.5) Saving variables: edge_lon, edge_lat, face_edges
         // Creating map edgeIdxGlo2Face <idxGlo, face>
-//        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal();
-//        edge_count = dhtEdgeIdxGlo.getIndexCount();
-//        edge_start = dhtEdgeIdxGlo.getIndexStart();
-
+
+        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal();
+        edge_count = dhtEdgeIdxGlo.getIndexCount();
+        edge_start = dhtEdgeIdxGlo.getIndexStart();
         edge_lon.resize(edge_count);
         edge_lat.resize(edge_count);
@@ -1562,20 +1393,25 @@
             vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf));
 
-            size_t nodeIdx1 = generateNodeIndex(hashValues1);
-            size_t nodeIdx2 = generateNodeIndex(hashValues2);
-            it1 = nodeIdx2IdxGlo.find(nodeIdx1);
-            it2 = nodeIdx2IdxGlo.find(nodeIdx2);
-            size_t nodeIdxGlo1 = (it1->second)[1];
-            size_t nodeIdxGlo2 = (it2->second)[1];
+            size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank);
+            size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank);
+            it1 = nodeIdx2IdxMin.find(myNodeIdx1);
+            it2 = nodeIdx2IdxMin.find(myNodeIdx2);
+            itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]);
+            itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]);
+            size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0];
+            size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0];
 
             if (nodeIdxGlo1 != nodeIdxGlo2)
             {
-              size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
-              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx);
-              int edgeIdxGlo = (itIdx->second)[1];
+              size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank);
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx);
+              size_t ownerIdx = (itIdx->second)[0];
+              int edgeIdxGlo;
               size_t faceIdxGlo = nbFacesAccum + nf;
 
-              if (mpiRank == (itIdx->second)[0])
+              if (myIdx == ownerIdx)
               {
+                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);
+                edgeIdxGlo = (itIdxGlo->second)[0];
                 double edgeLon;
                 double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf));
@@ -1591,4 +1427,9 @@
                 edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2;
               }
+              else
+              {
+                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);
+                edgeIdxGlo = (itIdxGlo->second)[0];
+              }
               face_edges(nv1,nf) = edgeIdxGlo;
               if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0)
@@ -1624,20 +1465,24 @@
             vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf));
 
-            size_t myNodeIdx1 = generateNodeIndex(hashValues1);
-            size_t myNodeIdx2 = generateNodeIndex(hashValues2);
+            size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank);
+            size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank);
             if (myNodeIdx1 != myNodeIdx2)
             {
-              it1 = nodeIdx2IdxGlo.find(myNodeIdx1);
-              it2 = nodeIdx2IdxGlo.find(myNodeIdx2);
-              size_t nodeIdxGlo1 = (it1->second)[1];
-              size_t nodeIdxGlo2 = (it2->second)[1];
-              size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);
-              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx);
-              int edgeIdxGlo = (itIdx->second)[1];
-
+              it1 = nodeIdx2IdxMin.find(myNodeIdx1);
+              it2 = nodeIdx2IdxMin.find(myNodeIdx2);
+              itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]);
+              itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]);
+              size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0];
+              size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0];
+
+              size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank);
+              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx);
+              size_t ownerIdx = (itIdx->second)[0];
               size_t faceIdxGlo = nbFacesAccum + nf;
 
-              if (mpiRank == (itIdx->second)[0])
+              if (myIdx == ownerIdx)
               {
+                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);
+                int edgeIdxGlo = (itIdxGlo->second)[0];
                 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo);
                 int face1 = it1->second[0];
@@ -1655,12 +1500,14 @@
                   face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1);
                 }
-              }
+              } // myIdx == ownerIdx
               else
               {
+                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);
+                size_t edgeIdxGlo = (itIdxGlo->second)[0];
                 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo);
                 int face1 = it1->second[0];
                 int face2 = it1->second[1];
                 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1);
-              }
+              } // myIdx != ownerIdx
             } // myNodeIdx1 != myNodeIdx2
             else
@@ -1668,5 +1515,4 @@
           }
         }
-
       }
       facesAreWritten = true;
Index: XIOS/dev/branch_yushan/src/parse_expr/filter_expr_node.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/filter_expr_node.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/filter_expr_node.cpp	(revision 1037)
@@ -40,24 +40,15 @@
   boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const
   {
-    boost::shared_ptr<COutputPin> outputPin;
-
-    if (fieldId == "this")
-      outputPin = thisField.getSelfTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op);
-    else if (CField::has(fieldId))
-    {
-      CField* field = CField::get(fieldId);
-      if (field == &thisField)
-        ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",
-              << "The field " << fieldId << " has an invalid reference to itself. "
-              << "Use the keyword \"this\" if you want to reference the input data sent to this field.");
-
-      field->buildFilterGraph(gc, false);
-      outputPin = field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op);
-    }
-    else
+    if (!CField::has(fieldId))
       ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",
             << "The field " << fieldId << " does not exist.");
 
-    return outputPin;
+    CField* field = CField::get(fieldId);
+    if (field == &thisField)
+      ERROR("boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",
+            << "The field " << fieldId << " has an invalid reference to itself.");
+
+    field->buildFilterGraph(gc, false);
+    return field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op);
   }
 
Index: XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp	(revision 1037)
@@ -10,5 +10,5 @@
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 37
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
@@ -143,5 +143,13 @@
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
@@ -169,4 +177,5 @@
 
     #define YY_LESS_LINENO(n)
+    #define YY_LINENO_REWIND_TO(ptr)
     
 /* Return all but the first "n" matched characters back to the input stream. */
@@ -347,4 +356,5 @@
 extern char *yytext;
 #define yytext_ptr yytext
+
 static yyconst flex_int16_t yy_nxt[][128] =
     {
@@ -564,5 +574,5 @@
       -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
       -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
-      -12,   23,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
+      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
       -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
       -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
@@ -579,11 +589,11 @@
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
-      -13,  -13,  -13,  -13,  -13,  -13,   24,  -13,   25,   25,
-       25,   25,   25,   25,   25,   25,   25,   25,  -13,  -13,
-      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,   26,
+      -13,  -13,  -13,  -13,  -13,  -13,   23,  -13,   24,   24,
+       24,   24,   24,   24,   24,   24,   24,   24,  -13,  -13,
+      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,   25,
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
-      -13,   26,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
+      -13,   25,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
 
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
@@ -598,5 +608,5 @@
       -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
       -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
-      -14,   27,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
+      -14,   26,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
       -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
 
@@ -616,5 +626,5 @@
 
       -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,
-      -15,   28,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,
+      -15,   27,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,
       -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,
       -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,
@@ -633,5 +643,5 @@
       -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
       -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
-      -16,   29,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
+      -16,   28,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
       -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
       -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
@@ -650,12 +660,12 @@
       -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
       -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
-      -17,  -17,  -17,  -17,  -17,   30,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
-
-       30,  -17,  -17,  -17,  -17,  -17,  -17,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
-       30,   30,   30,  -17,  -17,  -17,  -17,  -17
+      -17,  -17,  -17,  -17,  -17,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+
+       29,  -17,  -17,  -17,  -17,  -17,  -17,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,  -17,  -17,  -17,  -17,  -17
     },
 
@@ -665,14 +675,14 @@
       -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
       -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
-      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,   31,   31,
-       31,   31,   31,   31,   31,   31,   31,   31,  -18,  -18,
-
-      -18,  -18,  -18,  -18,  -18,   31,   31,   31,   31,   31,
-       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
-       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
-       31,  -18,  -18,  -18,  -18,   31,  -18,   31,   31,   31,
-       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
-       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
-       31,   31,   31,  -18,  -18,  -18,  -18,  -18
+      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,  -18,  -18,
+
+      -18,  -18,  -18,  -18,  -18,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,  -18,  -18,  -18,  -18,   30,  -18,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,  -18,  -18,  -18,  -18,  -18
     },
 
@@ -735,13 +745,13 @@
       -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,
 
-      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,  -22,  -22,
-      -22,  -22,  -22,  -22,  -22,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,  -22,  -22,  -22,  -22,   32,  -22,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,  -22,  -22,  -22,  -22,  -22
+      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,  -22,  -22,
+      -22,  -22,  -22,  -22,  -22,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,  -22,  -22,  -22,  -22,   31,  -22,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,  -22,  -22,  -22,  -22,  -22
     },
 
@@ -749,4 +759,9 @@
         3,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
 
+      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
+      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
+      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
+      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,   32,   32,
+       32,   32,   32,   32,   32,   32,   32,   32,  -23,  -23,
       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
@@ -754,9 +769,4 @@
       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
 
       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
@@ -769,12 +779,12 @@
       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
-      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,   33,   33,
-       33,   33,   33,   33,   33,   33,   33,   33,  -24,  -24,
+      -24,  -24,  -24,  -24,  -24,  -24,   23,  -24,   24,   24,
+       24,   24,   24,   24,   24,   24,   24,   24,  -24,  -24,
+      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,   25,
+      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
+
       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
-
-      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
-      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
-      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
+      -24,   25,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24
@@ -786,12 +796,12 @@
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
-      -25,  -25,  -25,  -25,  -25,  -25,   24,  -25,   25,   25,
-
-       25,   25,   25,   25,   25,   25,   25,   25,  -25,  -25,
-      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,   26,
+      -25,  -25,  -25,   33,  -25,   33,  -25,  -25,   34,   34,
+
+       34,   34,   34,   34,   34,   34,   34,   34,  -25,  -25,
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
-      -25,   26,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
+      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
+      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25
@@ -804,6 +814,6 @@
       -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
       -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
-      -26,  -26,  -26,   34,  -26,   34,  -26,  -26,   35,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,  -26,  -26,
+      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
+      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
       -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
       -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
@@ -856,13 +866,13 @@
 
       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29
+      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,  -29,  -29,
+      -29,  -29,  -29,  -29,  -29,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,  -29,  -29,  -29,  -29,   35,  -29,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,  -29,  -29,  -29,  -29,  -29
 
     },
@@ -873,14 +883,14 @@
       -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,
       -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,
-      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,  -30,  -30,
-      -30,  -30,  -30,  -30,  -30,   36,   36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,  -30,  -30,  -30,  -30,   36,  -30,   36,   36,   36,
-
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,   36,   36,  -30,  -30,  -30,  -30,  -30
+      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,  -30,  -30,
+      -30,  -30,  -30,  -30,  -30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,  -30,  -30,  -30,  -30,   30,  -30,   30,   30,   30,
+
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,  -30,  -30,  -30,  -30,  -30
     },
 
@@ -910,11 +920,11 @@
       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   32,   32,
        32,   32,   32,   32,   32,   32,   32,   32,  -32,  -32,
-      -32,  -32,  -32,  -32,  -32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,  -32,  -32,  -32,  -32,   32,  -32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,  -32,  -32,  -32,  -32,  -32
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   25,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,   25,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32
     },
 
@@ -925,11 +935,11 @@
       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
-      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   33,   33,
-       33,   33,   33,   33,   33,   33,   33,   33,  -33,  -33,
-      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   26,
+      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   34,   34,
+       34,   34,   34,   34,   34,   34,   34,   34,  -33,  -33,
       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
-      -33,   26,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
+      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
+      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
 
       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
@@ -942,6 +952,6 @@
       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
-      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,   35,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,  -34,  -34,
+      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,   34,   34,
+       34,   34,   34,   34,   34,   34,   34,   34,  -34,  -34,
       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
@@ -962,29 +972,11 @@
 
        35,   35,   35,   35,   35,   35,   35,   35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35
-    },
-
-    {
-        3,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
-      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
-
-      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
-      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
-      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,  -36,  -36,
-      -36,  -36,  -36,  -36,  -36,   36,   36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,  -36,  -36,  -36,  -36,   36,  -36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
-
-       36,   36,   36,  -36,  -36,  -36,  -36,  -36
+      -35,  -35,  -35,  -35,  -35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,  -35,  -35,  -35,  -35,   35,  -35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,  -35,  -35,  -35,  -35,  -35
     },
 
@@ -1006,6 +998,6 @@
 	(yy_c_buf_p) = yy_cp;
 
-#define YY_NUM_RULES 20
-#define YY_END_OF_BUFFER 21
+#define YY_NUM_RULES 19
+#define YY_END_OF_BUFFER 20
 /* This struct is not used in this scanner,
    but its presence is necessary. */
@@ -1015,10 +1007,10 @@
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_accept[37] =
+static yyconst flex_int16_t yy_accept[36] =
     {   0,
-        0,    0,   21,   20,    1,   20,   17,   18,    8,    6,
-        7,    9,    2,   12,   20,   13,   20,    5,   10,   19,
-        1,    4,   16,    0,    2,    0,   14,   11,   15,    3,
-        5,    4,    2,    0,    2,    3
+        0,    0,   20,   19,    1,   19,   16,   17,    8,    6,
+        7,    9,    2,   12,   19,   13,   19,    5,   10,   18,
+        1,    4,    0,    2,    0,   14,   11,   15,    3,    5,
+        4,    2,    0,    2,    3
     } ;
 
@@ -1026,10 +1018,10 @@
 static char *yy_last_accepting_cpos;
 
-static yyconst yy_state_type yy_NUL_trans[37] =
+static yyconst yy_state_type yy_NUL_trans[36] =
     {   0,
        20,   20,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0
+        0,    0,    0,    0,    0
     } ;
 
@@ -1061,5 +1053,5 @@
 #include "yacc_parser.hpp"
 
-#line 1064 "lex_parser.cpp"
+#line 1056 "lex_parser.cpp"
 
 #define INITIAL 0
@@ -1142,5 +1134,10 @@
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
@@ -1227,9 +1224,4 @@
 	register int yy_act;
     
-#line 29 "lex_parser.lex"
-
-
-#line 1233 "lex_parser.cpp"
-
 	if ( !(yy_init) )
 		{
@@ -1257,4 +1249,10 @@
 		yy_load_buffer_state( );
 		}
+
+	{
+#line 29 "lex_parser.lex"
+
+
+#line 1257 "lex_parser.cpp"
 
 	while ( 1 )		/* loops until end-of-file is reached */
@@ -1390,28 +1388,23 @@
 case 16:
 YY_RULE_SETUP
-#line 67 "lex_parser.lex"
-return NE;
+#line 68 "lex_parser.lex"
+return LEFT_PARENTHESIS;
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
 #line 69 "lex_parser.lex"
-return LEFT_PARENTHESIS;
+return RIGHT_PARENTHESIS;
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 70 "lex_parser.lex"
-return RIGHT_PARENTHESIS;
+#line 71 "lex_parser.lex"
+return END;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
 #line 72 "lex_parser.lex"
-return END;
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 73 "lex_parser.lex"
 ECHO;
 	YY_BREAK
-#line 1416 "lex_parser.cpp"
+#line 1409 "lex_parser.cpp"
 case YY_STATE_EOF(INITIAL):
 	yyterminate();
@@ -1544,4 +1537,5 @@
 	} /* end of action switch */
 		} /* end of scanning one token */
+	} /* end of user's declarations */
 } /* end of yylex */
 
@@ -2402,3 +2396,3 @@
 #define YYTABLES_NAME "yytables"
 
-#line 73 "lex_parser.lex"
+#line 71 "lex_parser.lex"
Index: XIOS/dev/branch_yushan/src/parse_expr/lex_parser.lex
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/lex_parser.lex	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/lex_parser.lex	(revision 1037)
@@ -65,5 +65,4 @@
 "<=" return LE;
 ">=" return GE;
-"/=" return NE;
 
 "("  return LEFT_PARENTHESIS;
Index: XIOS/dev/branch_yushan/src/parse_expr/operator_expr.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/operator_expr.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/operator_expr.hpp	(revision 1037)
@@ -43,5 +43,4 @@
       opScalarScalar[string("le")] = le_ss;
       opScalarScalar[string("ge")] = ge_ss;
-      opScalarScalar[string("ne")] = ne_ss;
 
       opField[string("neg")] = neg_f;
@@ -64,5 +63,4 @@
       opFieldField[string("le")] = le_ff;
       opFieldField[string("ge")] = ge_ff;
-      opFieldField[string("ne")] = ne_ff;
 
       opFieldScalar[string("add")] = add_fs;
@@ -76,5 +74,4 @@
       opFieldScalar[string("le")] = le_fs;
       opFieldScalar[string("ge")] = ge_fs;
-      opFieldScalar[string("ne")] = ne_fs;
 
       opScalarField[string("add")] = add_sf;
@@ -87,5 +84,4 @@
       opScalarField[string("le")] = le_sf;
       opScalarField[string("ge")] = ge_sf;
-      opScalarField[string("ne")] = ne_sf;
     }
 
@@ -164,5 +160,4 @@
     static inline double le_ss(double x, double y)    { return x <= y; }
     static inline double ge_ss(double x, double y)    { return x >= y; }
-    static inline double ne_ss(double x, double y)    { return x != y; }
 
     static inline CArray<double,1> neg_f(const CArray<double,1>& x)   { return Array<double,1>(-x); }
@@ -185,5 +180,4 @@
     static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); }
-    static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x != y); }
 
     static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(x + y); }
@@ -197,5 +191,4 @@
     static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x >= y); }
-    static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x != y); }
 
     static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x + y); }
@@ -208,5 +201,4 @@
     static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); }
-    static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x != y); }
   };
 
Index: XIOS/dev/branch_yushan/src/parse_expr/scalar_expr_node.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/scalar_expr_node.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/scalar_expr_node.cpp	(revision 1037)
@@ -23,16 +23,8 @@
   double CScalarVarExprNode::reduce() const
   {
-    // $missing_value will be replaced with NaN
-    if (varId == "missing_value")
-    {
-      return std::numeric_limits<double>::quiet_NaN();
-    }
-    else
-    {
-      if (!CVariable::has(varId)) 
-        ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist.");
+    if (!CVariable::has(varId)) 
+      ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist.");
 
-      return CVariable::get(varId)->getData<double>();
-    }
+    return CVariable::get(varId)->getData<double>();
   }
 
Index: XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.cpp	(revision 1037)
@@ -1,18 +1,18 @@
-/* A Bison parser, made by GNU Bison 2.7.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
@@ -27,5 +27,5 @@
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
@@ -45,5 +45,5 @@
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.7"
+#define YYBISON_VERSION "3.0.2"
 
 /* Skeleton name.  */
@@ -63,6 +63,5 @@
 
 /* Copy the first part of user declarations.  */
-/* Line 371 of yacc.c  */
-#line 1 "yacc_parser.yacc"
+#line 1 "yacc_parser.yacc" /* yacc.c:339  */
 
 #include "filter_expr_node.hpp"
@@ -97,12 +96,11 @@
   }
 
-/* Line 371 of yacc.c  */
-#line 101 "yacc_parser.cpp"
-
-# ifndef YY_NULL
+#line 99 "yacc_parser.cpp" /* yacc.c:339  */
+
+# ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULL nullptr
+#   define YY_NULLPTR nullptr
 #  else
-#   define YY_NULL 0
+#   define YY_NULLPTR 0
 #  endif
 # endif
@@ -120,5 +118,5 @@
 #ifndef YY_YY_YACC_PARSER_HPP_INCLUDED
 # define YY_YY_YACC_PARSER_HPP_INCLUDED
-/* Enabling traces.  */
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -128,38 +126,36 @@
 #endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NUMBER = 258,
-     VAR = 259,
-     ID = 260,
-     AVERAGE = 261,
-     PLUS = 262,
-     MINUS = 263,
-     TIMES = 264,
-     DIVIDE = 265,
-     POWER = 266,
-     EQ = 267,
-     LT = 268,
-     GT = 269,
-     LE = 270,
-     GE = 271,
-     NE = 272,
-     LEFT_PARENTHESIS = 273,
-     RIGHT_PARENTHESIS = 274,
-     END = 275,
-     NEG = 276
-   };
-#endif
-
-
+  enum yytokentype
+  {
+    NUMBER = 258,
+    VAR = 259,
+    ID = 260,
+    AVERAGE = 261,
+    PLUS = 262,
+    MINUS = 263,
+    TIMES = 264,
+    DIVIDE = 265,
+    POWER = 266,
+    EQ = 267,
+    LT = 268,
+    GT = 269,
+    LE = 270,
+    GE = 271,
+    LEFT_PARENTHESIS = 272,
+    RIGHT_PARENTHESIS = 273,
+    END = 274,
+    NEG = 275
+  };
+#endif
+
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-/* Line 387 of yacc.c  */
-#line 35 "yacc_parser.yacc"
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+#line 35 "yacc_parser.yacc" /* yacc.c:355  */
 
   std::string* str;                /* symbol table index */
@@ -167,28 +163,14 @@
   xios::IFilterExprNode* filterNode;
 
-
-/* Line 387 of yacc.c  */
-#line 172 "yacc_parser.cpp"
-} YYSTYPE;
+#line 166 "yacc_parser.cpp" /* yacc.c:355  */
+};
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+
 extern YYSTYPE yylval;
 
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
 int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
 #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */
@@ -196,6 +178,5 @@
 /* Copy the second part of user declarations.  */
 
-/* Line 390 of yacc.c  */
-#line 200 "yacc_parser.cpp"
+#line 181 "yacc_parser.cpp" /* yacc.c:358  */
 
 #ifdef short
@@ -211,9 +192,6 @@
 #ifdef YYTYPE_INT8
 typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#else
 typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
 #endif
 
@@ -235,6 +213,5 @@
 # elif defined size_t
 #  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
@@ -258,4 +235,31 @@
 #endif
 
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# endif
+#endif
+
 /* Suppress unused-variable warnings by "using" E.  */
 #if ! defined lint || defined __GNUC__
@@ -265,21 +269,23 @@
 #endif
 
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(N) (N)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
 #else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
-#endif
-{
-  return yyi;
-}
-#endif
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
 
 #if ! defined yyoverflow || YYERROR_VERBOSE
@@ -300,6 +306,5 @@
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
@@ -313,6 +318,6 @@
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
@@ -330,5 +335,5 @@
 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
-	     && (defined YYFREE || defined free)))
+             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 #   ifndef EXIT_SUCCESS
@@ -338,6 +343,5 @@
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined malloc && ! defined EXIT_SUCCESS
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -345,6 +349,5 @@
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined free && ! defined EXIT_SUCCESS
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -356,5 +359,5 @@
 #if (! defined yyoverflow \
      && (! defined __cplusplus \
-	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
@@ -381,14 +384,14 @@
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
-	Stack = &yyptr->Stack_alloc;					\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
 
 #endif
@@ -409,5 +412,5 @@
             (Dst)[yyi] = (Src)[yyi];            \
         }                                       \
-      while (YYID (0))
+      while (0)
 #  endif
 # endif
@@ -417,23 +420,25 @@
 #define YYFINAL  16
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   229
+#define YYLAST   204
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  22
+#define YYNTOKENS  21
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  4
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  56
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  116
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYNRULES  52
+/* YYNSTATES -- Number of states.  */
+#define YYNSTATES  108
+
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   276
-
-#define YYTRANSLATE(YYX)						\
+#define YYMAXUTOK   275
+
+#define YYTRANSLATE(YYX)                                                \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
 static const yytype_uint8 yytranslate[] =
 {
@@ -465,56 +470,17 @@
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21
+      15,    16,    17,    18,    19,    20
 };
 
 #if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     5,     8,    10,    12,    16,    20,    24,
-      28,    31,    35,    39,    43,    47,    51,    55,    59,    63,
-      68,    70,    72,    76,    80,    84,    88,    91,    95,    99,
-     103,   107,   111,   115,   119,   123,   127,   131,   135,   139,
-     143,   147,   151,   155,   159,   163,   167,   171,   175,   179,
-     183,   187,   191,   195,   199,   203,   207
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      23,     0,    -1,    20,    -1,    25,    20,    -1,     3,    -1,
-       4,    -1,    24,     7,    24,    -1,    24,     8,    24,    -1,
-      24,     9,    24,    -1,    24,    10,    24,    -1,     8,    24,
-      -1,    24,    11,    24,    -1,    24,    12,    24,    -1,    24,
-      13,    24,    -1,    24,    14,    24,    -1,    24,    15,    24,
-      -1,    24,    16,    24,    -1,    24,    17,    24,    -1,    18,
-      24,    19,    -1,     5,    18,    24,    19,    -1,     5,    -1,
-       6,    -1,    25,     7,    25,    -1,    25,     8,    25,    -1,
-      25,     9,    25,    -1,    25,    10,    25,    -1,     8,    25,
-      -1,    25,    11,    25,    -1,    25,    12,    25,    -1,    25,
-      13,    25,    -1,    25,    14,    25,    -1,    25,    15,    25,
-      -1,    25,    16,    25,    -1,    25,    17,    25,    -1,    18,
-      25,    19,    -1,    25,     7,    24,    -1,    24,     7,    25,
-      -1,    25,     8,    24,    -1,    24,     8,    25,    -1,    25,
-       9,    24,    -1,    24,     9,    25,    -1,    25,    10,    24,
-      -1,    24,    10,    25,    -1,    25,    11,    24,    -1,    25,
-      12,    24,    -1,    24,    12,    25,    -1,    25,    13,    24,
-      -1,    24,    13,    25,    -1,    25,    14,    24,    -1,    24,
-      14,    25,    -1,    25,    15,    24,    -1,    24,    15,    25,
-      -1,    25,    16,    24,    -1,    24,    16,    25,    -1,    25,
-      17,    24,    -1,    24,    17,    25,    -1,     5,    18,    25,
-      19,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
        0,    61,    61,    62,    66,    67,    68,    69,    70,    71,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+      72,    73,    74,    75,    76,    77,    78,    79,    80,    84,
       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
-     115,   116,   117,   118,   119,   120,   121
+     115,   116,   117
 };
 #endif
@@ -526,199 +492,180 @@
 {
   "$end", "error", "$undefined", "NUMBER", "VAR", "ID", "AVERAGE", "PLUS",
-  "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", "NE",
+  "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE",
   "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "END", "NEG", "$accept", "Line",
-  "Expression", "Field_expr", YY_NULL
+  "Expression", "Field_expr", YY_NULLPTR
 };
 #endif
 
 # ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
 static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276
+     275
 };
 # endif
 
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+#define YYPACT_NINF -13
+
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-13)))
+
+#define YYTABLE_NINF -1
+
+#define yytable_value_is_error(Yytable_value) \
+  0
+
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
+static const yytype_int16 yypact[] =
+{
+      90,   -13,   -13,   -12,   -13,    35,    35,   -13,    44,   188,
+     103,    35,    24,    34,   116,   128,   -13,    35,    35,    35,
+      35,    65,    35,    35,    35,    35,    35,    35,    35,    35,
+      35,    35,    35,    35,    35,    35,    35,   -13,   140,   152,
+     -13,   -13,    -7,    23,    -7,    23,    24,    34,    24,    34,
+      54,    65,    65,    24,     0,    67,     0,    67,     0,    67,
+       0,    67,     0,    67,    -7,    23,    -7,    23,    24,    34,
+      24,    34,    24,    34,     0,    67,     0,    67,     0,    67,
+       0,    67,     0,    67,   -13,   -13,    65,    24,   164,    65,
+      65,    65,    65,    65,    65,    65,    65,    65,   176,    95,
+      95,    24,    24,    92,    92,    92,    92,    92
+};
+
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       0,     4,     5,    19,    20,     0,     0,     2,     0,     0,
+       0,     0,    10,    25,     0,     0,     1,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     3,     0,     0,
+      17,    32,     6,    34,     7,    36,     8,    38,     9,    40,
+       0,     0,     0,    11,    12,    43,    13,    45,    14,    47,
+      15,    49,    16,    51,    33,    21,    35,    22,    37,    23,
+      39,    24,    41,    26,    42,    27,    44,    28,    46,    29,
+      48,    30,    50,    31,    18,    52,     0,    10,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     6,
+       7,     8,     9,    12,    13,    14,    15,    16
+};
+
+  /* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -13,   -13,    -5,    31
+};
+
+  /* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     8,     9,    10
+};
+
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
+static const yytype_uint8 yytable[] =
+{
+      12,    14,    19,    20,    21,    11,    38,    17,    18,    19,
+      20,    21,    42,    44,    46,    48,    53,    54,    56,    58,
+      60,    62,    64,    66,    68,    70,    72,    74,    76,    78,
+      80,    82,    29,    30,    31,    21,    13,    15,     1,     2,
+       3,     4,    39,     5,    16,    31,    87,    88,    43,    45,
+      47,    49,     6,    55,    57,    59,    61,    63,    65,    67,
+      69,    71,    73,    75,    77,    79,    81,    83,     1,     2,
+      50,    86,     0,    51,    27,    28,    29,    30,    31,     0,
+       0,    98,    52,     0,    99,   100,   101,   102,   103,   104,
+     105,   106,   107,     1,     2,     3,     4,     0,     5,    89,
+      90,    91,    92,    21,    91,    92,    21,     6,     0,     7,
+      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
+       0,     0,    37,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,     0,    40,    27,    28,    29,    30,    31,
+      32,    33,    34,    35,    36,     0,    41,    17,    18,    19,
+      20,    21,    22,    23,    24,    25,    26,     0,    84,    27,
+      28,    29,    30,    31,    32,    33,    34,    35,    36,     0,
+      85,    89,    90,    91,    92,    21,    93,    94,    95,    96,
+      97,     0,    40,    89,    90,    91,    92,    21,    93,    94,
+      95,    96,    97,     0,    84,    17,    18,    19,    20,    21,
+      22,    23,    24,    25,    26
+};
+
+static const yytype_int8 yycheck[] =
+{
+       5,     6,     9,    10,    11,    17,    11,     7,     8,     9,
+      10,    11,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36,     9,    10,    11,    11,     5,     6,     3,     4,
+       5,     6,    11,     8,     0,    11,    51,    52,    17,    18,
+      19,    20,    17,    22,    23,    24,    25,    26,    27,    28,
+      29,    30,    31,    32,    33,    34,    35,    36,     3,     4,
+       5,    17,    -1,     8,     7,     8,     9,    10,    11,    -1,
+      -1,    86,    17,    -1,    89,    90,    91,    92,    93,    94,
+      95,    96,    97,     3,     4,     5,     6,    -1,     8,     7,
+       8,     9,    10,    11,     9,    10,    11,    17,    -1,    19,
+       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+      -1,    -1,    19,     7,     8,     9,    10,    11,    12,    13,
+      14,    15,    16,    -1,    18,     7,     8,     9,    10,    11,
+      12,    13,    14,    15,    16,    -1,    18,     7,     8,     9,
+      10,    11,    12,    13,    14,    15,    16,    -1,    18,     7,
+       8,     9,    10,    11,    12,    13,    14,    15,    16,    -1,
+      18,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+      16,    -1,    18,     7,     8,     9,    10,    11,    12,    13,
+      14,    15,    16,    -1,    18,     7,     8,     9,    10,    11,
+      12,    13,    14,    15,    16
+};
+
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,     3,     4,     5,     6,     8,    17,    19,    22,    23,
+      24,    17,    23,    24,    23,    24,     0,     7,     8,     9,
+      10,    11,    12,    13,    14,    15,    16,     7,     8,     9,
+      10,    11,    12,    13,    14,    15,    16,    19,    23,    24,
+      18,    18,    23,    24,    23,    24,    23,    24,    23,    24,
+       5,     8,    17,    23,    23,    24,    23,    24,    23,    24,
+      23,    24,    23,    24,    23,    24,    23,    24,    23,    24,
+      23,    24,    23,    24,    23,    24,    23,    24,    23,    24,
+      23,    24,    23,    24,    18,    18,    17,    23,    23,     7,
+       8,     9,    10,    12,    13,    14,    15,    16,    23,    23,
+      23,    23,    23,    23,    23,    23,    23,    23
+};
+
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    22,    23,    23,    24,    24,    24,    24,    24,    24,
+       0,    21,    22,    22,    23,    23,    23,    23,    23,    23,
+      23,    23,    23,    23,    23,    23,    23,    23,    23,    24,
       24,    24,    24,    24,    24,    24,    24,    24,    24,    24,
-      25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
-      25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
-      25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
-      25,    25,    25,    25,    25,    25,    25
+      24,    24,    24,    24,    24,    24,    24,    24,    24,    24,
+      24,    24,    24,    24,    24,    24,    24,    24,    24,    24,
+      24,    24,    24
 };
 
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
 static const yytype_uint8 yyr2[] =
 {
        0,     2,     1,     2,     1,     1,     3,     3,     3,     3,
-       2,     3,     3,     3,     3,     3,     3,     3,     3,     4,
-       1,     1,     3,     3,     3,     3,     2,     3,     3,     3,
+       2,     3,     3,     3,     3,     3,     3,     3,     4,     1,
+       1,     3,     3,     3,     3,     2,     3,     3,     3,     3,
        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
-       3,     3,     3,     3,     3,     3,     4
+       3,     3,     4
 };
 
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       0,     4,     5,    20,    21,     0,     0,     2,     0,     0,
-       0,     0,    10,    26,     0,     0,     1,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     3,
-       0,     0,    18,    34,     6,    36,     7,    38,     8,    40,
-       9,    42,     0,     0,     0,    11,    12,    45,    13,    47,
-      14,    49,    15,    51,    16,    53,    17,    55,    35,    22,
-      37,    23,    39,    24,    41,    25,    43,    27,    44,    28,
-      46,    29,    48,    30,    50,    31,    52,    32,    54,    33,
-      19,    56,     0,    10,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     6,     7,     8,     9,
-      12,    13,    14,    15,    16,    17
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] =
-{
-      -1,     8,     9,    10
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -14
-static const yytype_int16 yypact[] =
-{
-      97,   -14,   -14,   -13,   -14,    70,    70,   -14,    37,   207,
-     115,    70,    32,    34,   129,   142,   -14,    70,    70,    70,
-      70,   103,    70,    70,    70,    70,    70,    70,    70,    70,
-      70,    70,    70,    70,    70,    70,    70,    70,    70,   -14,
-     155,   168,   -14,   -14,    -7,    25,    -7,    25,    32,    34,
-      32,    34,    28,   103,   103,    32,     0,    72,     0,    72,
-       0,    72,     0,    72,     0,    72,     0,    72,    -7,    25,
-      -7,    25,    32,    34,    32,    34,    32,    34,     0,    72,
-       0,    72,     0,    72,     0,    72,     0,    72,     0,    72,
-     -14,   -14,   103,    32,   181,   103,   103,   103,   103,   103,
-     103,   103,   103,   103,   103,   194,    31,    31,    32,    32,
-     218,   218,   218,   218,   218,   218
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-     -14,   -14,    -5,    33
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
-{
-      12,    14,    19,    20,    21,    11,    40,    17,    18,    19,
-      20,    21,    44,    46,    48,    50,    55,    56,    58,    60,
-      62,    64,    66,    68,    70,    72,    74,    76,    78,    80,
-      82,    84,    86,    88,    30,    31,    32,    16,    13,    15,
-      97,    98,    21,    21,    41,    32,    92,     0,    93,    94,
-      45,    47,    49,    51,     0,    57,    59,    61,    63,    65,
-      67,    69,    71,    73,    75,    77,    79,    81,    83,    85,
-      87,    89,     0,     1,     2,     3,     4,     0,     5,    28,
-      29,    30,    31,    32,     0,     0,     0,   105,     6,     0,
-     106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
-       1,     2,     3,     4,     0,     5,     1,     2,    52,     0,
-       0,    53,     0,     0,     0,     6,     0,     7,     0,     0,
-       0,    54,    28,    29,    30,    31,    32,    33,    34,    35,
-      36,    37,    38,     0,     0,    39,    17,    18,    19,    20,
-      21,    22,    23,    24,    25,    26,    27,     0,    42,    28,
-      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-       0,    43,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,     0,    90,    28,    29,    30,    31,    32,
-      33,    34,    35,    36,    37,    38,     0,    91,    95,    96,
-      97,    98,    21,    99,   100,   101,   102,   103,   104,     0,
-      42,    95,    96,    97,    98,    21,    99,   100,   101,   102,
-     103,   104,     0,    90,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    26,    27,    95,    96,    97,    98,    21
-};
-
-#define yypact_value_is_default(Yystate) \
-  (!!((Yystate) == (-14)))
-
-#define yytable_value_is_error(Yytable_value) \
-  YYID (0)
-
-static const yytype_int8 yycheck[] =
-{
-       5,     6,     9,    10,    11,    18,    11,     7,     8,     9,
-      10,    11,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36,    37,    38,     9,    10,    11,     0,     5,     6,
-       9,    10,    11,    11,    11,    11,    18,    -1,    53,    54,
-      17,    18,    19,    20,    -1,    22,    23,    24,    25,    26,
-      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-      37,    38,    -1,     3,     4,     5,     6,    -1,     8,     7,
-       8,     9,    10,    11,    -1,    -1,    -1,    92,    18,    -1,
-      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
-       3,     4,     5,     6,    -1,     8,     3,     4,     5,    -1,
-      -1,     8,    -1,    -1,    -1,    18,    -1,    20,    -1,    -1,
-      -1,    18,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    -1,    -1,    20,     7,     8,     9,    10,
-      11,    12,    13,    14,    15,    16,    17,    -1,    19,     7,
-       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
-      -1,    19,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    -1,    19,     7,     8,     9,    10,    11,
-      12,    13,    14,    15,    16,    17,    -1,    19,     7,     8,
-       9,    10,    11,    12,    13,    14,    15,    16,    17,    -1,
-      19,     7,     8,     9,    10,    11,    12,    13,    14,    15,
-      16,    17,    -1,    19,     7,     8,     9,    10,    11,    12,
-      13,    14,    15,    16,    17,     7,     8,     9,    10,    11
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,     3,     4,     5,     6,     8,    18,    20,    23,    24,
-      25,    18,    24,    25,    24,    25,     0,     7,     8,     9,
-      10,    11,    12,    13,    14,    15,    16,    17,     7,     8,
-       9,    10,    11,    12,    13,    14,    15,    16,    17,    20,
-      24,    25,    19,    19,    24,    25,    24,    25,    24,    25,
-      24,    25,     5,     8,    18,    24,    24,    25,    24,    25,
-      24,    25,    24,    25,    24,    25,    24,    25,    24,    25,
-      24,    25,    24,    25,    24,    25,    24,    25,    24,    25,
-      24,    25,    24,    25,    24,    25,    24,    25,    24,    25,
-      19,    19,    18,    24,    24,     7,     8,     9,    10,    12,
-      13,    14,    15,    16,    17,    24,    24,    24,    24,    24,
-      24,    24,    24,    24,    24,    24
-};
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
-
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL		goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
+
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
+
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
 
 #define YYRECOVERING()  (!!yyerrstatus)
@@ -737,25 +684,13 @@
     {                                                           \
       yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;							\
-    }								\
-while (YYID (0))
+      YYERROR;                                                  \
+    }                                                           \
+while (0)
 
 /* Error token number */
-#define YYTERROR	1
-#define YYERRCODE	256
-
-
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
+#define YYTERROR        1
+#define YYERRCODE       256
+
+
 
 /* Enable debugging if requested.  */
@@ -767,38 +702,34 @@
 # endif
 
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
-do {									  \
-  if (yydebug)								  \
-    {									  \
-      YYFPRINTF (stderr, "%s ", Title);					  \
-      yy_symbol_print (stderr,						  \
-		  Type, Value); \
-      YYFPRINTF (stderr, "\n");						  \
-    }									  \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT.  |
+`----------------------------------------*/
+
 static void
 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-#endif
 {
   FILE *yyo = yyoutput;
@@ -809,12 +740,6 @@
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
 # endif
-  switch (yytype)
-    {
-      default:
-        break;
-    }
+  YYUSE (yytype);
 }
 
@@ -824,20 +749,9 @@
 `--------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-#endif
-{
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+{
+  YYFPRINTF (yyoutput, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 
   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
@@ -850,14 +764,6 @@
 `------------------------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
 {
   YYFPRINTF (stderr, "Stack now");
@@ -870,9 +776,9 @@
 }
 
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
 
 
@@ -881,36 +787,29 @@
 `------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
-    YYSTYPE *yyvsp;
-    int yyrule;
-#endif
-{
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
+{
+  unsigned long int yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned long int yylno = yyrline[yyrule];
   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-	     yyrule - 1, yylno);
+             yyrule - 1, yylno);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       		       );
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                                              );
       YYFPRINTF (stderr, "\n");
     }
 }
 
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, Rule); \
+} while (0)
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
@@ -926,5 +825,5 @@
 
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
+#ifndef YYINITDEPTH
 # define YYINITDEPTH 200
 #endif
@@ -949,13 +848,6 @@
 #  else
 /* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
 yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
 {
   YYSIZE_T yylen;
@@ -973,14 +865,6 @@
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static char *
 yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
 {
   char *yyd = yydest;
@@ -1012,25 +896,25 @@
 
       for (;;)
-	switch (*++yyp)
-	  {
-	  case '\'':
-	  case ',':
-	    goto do_not_strip_quotes;
-
-	  case '\\':
-	    if (*++yyp != '\\')
-	      goto do_not_strip_quotes;
-	    /* Fall through.  */
-	  default:
-	    if (yyres)
-	      yyres[yyn] = *yyp;
-	    yyn++;
-	    break;
-
-	  case '"':
-	    if (yyres)
-	      yyres[yyn] = '\0';
-	    return yyn;
-	  }
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
+
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            /* Fall through.  */
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
+
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
     do_not_strip_quotes: ;
     }
@@ -1055,9 +939,9 @@
                 yytype_int16 *yyssp, int yytoken)
 {
-  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
-  const char *yyformat = YY_NULL;
+  const char *yyformat = YY_NULLPTR;
   /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
@@ -1067,8 +951,4 @@
 
   /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
      - If this state is a consistent state with a default action, then
        the only way this function was invoked is if the default action
@@ -1120,5 +1000,5 @@
                 yyarg[yycount++] = yytname[yyx];
                 {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
                   if (! (yysize <= yysize1
                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
@@ -1187,29 +1067,15 @@
 `-----------------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
 {
   YYUSE (yyvaluep);
-
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
-  switch (yytype)
-    {
-
-      default:
-        break;
-    }
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
@@ -1220,16 +1086,6 @@
 int yychar;
 
-
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
 /* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
-
+YYSTYPE yylval;
 /* Number of syntax errors so far.  */
 int yynerrs;
@@ -1240,25 +1096,6 @@
 `----------*/
 
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
 {
     int yystate;
@@ -1267,6 +1104,6 @@
 
     /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
+       'yyss': related to states.
+       'yyvs': related to semantic values.
 
        Refer to the stacks through separate pointers, to allow yyoverflow
@@ -1336,21 +1173,21 @@
 #ifdef yyoverflow
       {
-	/* Give user a chance to reallocate the stack.  Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	yytype_int16 *yyss1 = yyss;
-
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow (YY_("memory exhausted"),
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-		    &yystacksize);
-
-	yyss = yyss1;
-	yyvs = yyvs1;
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yystacksize);
+
+        yyss = yyss1;
+        yyvs = yyvs1;
       }
 #else /* no yyoverflow */
@@ -1360,20 +1197,20 @@
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-	goto yyexhaustedlab;
+        goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
+        yystacksize = YYMAXDEPTH;
 
       {
-	yytype_int16 *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss_alloc, yyss);
-	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
       }
 # endif
@@ -1384,8 +1221,8 @@
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
+                  (unsigned long int) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
+        YYABORT;
     }
 
@@ -1416,5 +1253,5 @@
     {
       YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
+      yychar = yylex ();
     }
 
@@ -1481,5 +1318,5 @@
 
   /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
+     '$$ = $1'.
 
      Otherwise, the following line sets YYVAL to garbage.
@@ -1495,336 +1332,311 @@
     {
         case 2:
-/* Line 1792 of yacc.c  */
-#line 61 "yacc_parser.yacc"
+#line 61 "yacc_parser.yacc" /* yacc.c:1646  */
     { /* Nothing to do */ }
+#line 1337 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 3:
-/* Line 1792 of yacc.c  */
-#line 62 "yacc_parser.yacc"
-    { parsed = (yyvsp[(1) - (2)].filterNode); }
+#line 62 "yacc_parser.yacc" /* yacc.c:1646  */
+    { parsed = (yyvsp[-1].filterNode); }
+#line 1343 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 4:
-/* Line 1792 of yacc.c  */
-#line 66 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); }
+#line 66 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); }
+#line 1349 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 5:
-/* Line 1792 of yacc.c  */
-#line 67 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); }
+#line 67 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); }
+#line 1355 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 6:
-/* Line 1792 of yacc.c  */
-#line 68 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "add", (yyvsp[(3) - (3)].scalarNode)); }
+#line 68 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); }
+#line 1361 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 7:
-/* Line 1792 of yacc.c  */
-#line 69 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "minus", (yyvsp[(3) - (3)].scalarNode)); }
+#line 69 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); }
+#line 1367 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 8:
-/* Line 1792 of yacc.c  */
-#line 70 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "mult", (yyvsp[(3) - (3)].scalarNode)); }
+#line 70 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); }
+#line 1373 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 9:
-/* Line 1792 of yacc.c  */
-#line 71 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "div", (yyvsp[(3) - (3)].scalarNode)); }
+#line 71 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); }
+#line 1379 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 10:
-/* Line 1792 of yacc.c  */
-#line 72 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[(2) - (2)].scalarNode)); }
+#line 72 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); }
+#line 1385 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 11:
-/* Line 1792 of yacc.c  */
-#line 73 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "pow", (yyvsp[(3) - (3)].scalarNode)); }
+#line 73 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); }
+#line 1391 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 12:
-/* Line 1792 of yacc.c  */
-#line 74 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "eq", (yyvsp[(3) - (3)].scalarNode)); }
+#line 74 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].scalarNode)); }
+#line 1397 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 13:
-/* Line 1792 of yacc.c  */
-#line 75 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "lt", (yyvsp[(3) - (3)].scalarNode)); }
+#line 75 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].scalarNode)); }
+#line 1403 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 14:
-/* Line 1792 of yacc.c  */
-#line 76 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "gt", (yyvsp[(3) - (3)].scalarNode)); }
+#line 76 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].scalarNode)); }
+#line 1409 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 15:
-/* Line 1792 of yacc.c  */
-#line 77 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "le", (yyvsp[(3) - (3)].scalarNode)); }
+#line 77 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].scalarNode)); }
+#line 1415 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 16:
-/* Line 1792 of yacc.c  */
-#line 78 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "ge", (yyvsp[(3) - (3)].scalarNode)); }
+#line 78 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].scalarNode)); }
+#line 1421 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 17:
-/* Line 1792 of yacc.c  */
-#line 79 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "ne", (yyvsp[(3) - (3)].scalarNode)); }
+#line 79 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = (yyvsp[-1].scalarNode); }
+#line 1427 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 18:
-/* Line 1792 of yacc.c  */
-#line 80 "yacc_parser.yacc"
-    { (yyval.scalarNode) = (yyvsp[(2) - (3)].scalarNode); }
+#line 80 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); }
+#line 1433 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 19:
-/* Line 1792 of yacc.c  */
-#line 81 "yacc_parser.yacc"
-    { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].scalarNode)); delete (yyvsp[(1) - (4)].str); }
+#line 84 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); }
+#line 1439 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 20:
-/* Line 1792 of yacc.c  */
-#line 85 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); }
+#line 85 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); }
+#line 1445 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 21:
-/* Line 1792 of yacc.c  */
-#line 86 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); }
+#line 86 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); }
+#line 1451 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 22:
-/* Line 1792 of yacc.c  */
-#line 87 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "add", (yyvsp[(3) - (3)].filterNode)); }
+#line 87 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); }
+#line 1457 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 23:
-/* Line 1792 of yacc.c  */
-#line 88 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "minus", (yyvsp[(3) - (3)].filterNode)); }
+#line 88 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); }
+#line 1463 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 24:
-/* Line 1792 of yacc.c  */
-#line 89 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "mult", (yyvsp[(3) - (3)].filterNode)); }
+#line 89 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); }
+#line 1469 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 25:
-/* Line 1792 of yacc.c  */
-#line 90 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "div", (yyvsp[(3) - (3)].filterNode)); }
+#line 90 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); }
+#line 1475 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 26:
-/* Line 1792 of yacc.c  */
-#line 91 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[(2) - (2)].filterNode)); }
+#line 91 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); }
+#line 1481 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 27:
-/* Line 1792 of yacc.c  */
-#line 92 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "pow", (yyvsp[(3) - (3)].filterNode)); }
+#line 92 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].filterNode)); }
+#line 1487 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 28:
-/* Line 1792 of yacc.c  */
-#line 93 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "eq", (yyvsp[(3) - (3)].filterNode)); }
+#line 93 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].filterNode)); }
+#line 1493 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 29:
-/* Line 1792 of yacc.c  */
-#line 94 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "lt", (yyvsp[(3) - (3)].filterNode)); }
+#line 94 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].filterNode)); }
+#line 1499 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 30:
-/* Line 1792 of yacc.c  */
-#line 95 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "gt", (yyvsp[(3) - (3)].filterNode)); }
+#line 95 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].filterNode)); }
+#line 1505 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 31:
-/* Line 1792 of yacc.c  */
-#line 96 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "le", (yyvsp[(3) - (3)].filterNode)); }
+#line 96 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].filterNode)); }
+#line 1511 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 32:
-/* Line 1792 of yacc.c  */
-#line 97 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "ge", (yyvsp[(3) - (3)].filterNode)); }
+#line 97 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = (yyvsp[-1].filterNode); }
+#line 1517 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 33:
-/* Line 1792 of yacc.c  */
-#line 98 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "ne", (yyvsp[(3) - (3)].filterNode)); }
+#line 98 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); }
+#line 1523 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 34:
-/* Line 1792 of yacc.c  */
-#line 99 "yacc_parser.yacc"
-    { (yyval.filterNode) = (yyvsp[(2) - (3)].filterNode); }
+#line 99 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); }
+#line 1529 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 35:
-/* Line 1792 of yacc.c  */
-#line 100 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "add", (yyvsp[(3) - (3)].scalarNode)); }
+#line 100 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); }
+#line 1535 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 36:
-/* Line 1792 of yacc.c  */
-#line 101 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "add", (yyvsp[(3) - (3)].filterNode)); }
+#line 101 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); }
+#line 1541 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 37:
-/* Line 1792 of yacc.c  */
-#line 102 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "minus", (yyvsp[(3) - (3)].scalarNode)); }
+#line 102 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); }
+#line 1547 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 38:
-/* Line 1792 of yacc.c  */
-#line 103 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "minus", (yyvsp[(3) - (3)].filterNode)); }
+#line 103 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); }
+#line 1553 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 39:
-/* Line 1792 of yacc.c  */
-#line 104 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "mult", (yyvsp[(3) - (3)].scalarNode)); }
+#line 104 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); }
+#line 1559 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 40:
-/* Line 1792 of yacc.c  */
-#line 105 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "mult", (yyvsp[(3) - (3)].filterNode)); }
+#line 105 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); }
+#line 1565 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 41:
-/* Line 1792 of yacc.c  */
-#line 106 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "div", (yyvsp[(3) - (3)].scalarNode)); }
+#line 106 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); }
+#line 1571 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 42:
-/* Line 1792 of yacc.c  */
-#line 107 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "div", (yyvsp[(3) - (3)].filterNode)); }
+#line 107 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].scalarNode)); }
+#line 1577 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 43:
-/* Line 1792 of yacc.c  */
-#line 108 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "pow", (yyvsp[(3) - (3)].scalarNode)); }
+#line 108 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].filterNode)); }
+#line 1583 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 44:
-/* Line 1792 of yacc.c  */
-#line 109 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "eq", (yyvsp[(3) - (3)].scalarNode)); }
+#line 109 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].scalarNode)); }
+#line 1589 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 45:
-/* Line 1792 of yacc.c  */
-#line 110 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "eq", (yyvsp[(3) - (3)].filterNode)); }
+#line 110 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].filterNode)); }
+#line 1595 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 46:
-/* Line 1792 of yacc.c  */
-#line 111 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "lt", (yyvsp[(3) - (3)].scalarNode)); }
+#line 111 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].scalarNode)); }
+#line 1601 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 47:
-/* Line 1792 of yacc.c  */
-#line 112 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "lt", (yyvsp[(3) - (3)].filterNode)); }
+#line 112 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].filterNode)); }
+#line 1607 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 48:
-/* Line 1792 of yacc.c  */
-#line 113 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "gt", (yyvsp[(3) - (3)].scalarNode)); }
+#line 113 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].scalarNode)); }
+#line 1613 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 49:
-/* Line 1792 of yacc.c  */
-#line 114 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "gt", (yyvsp[(3) - (3)].filterNode)); }
+#line 114 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].filterNode)); }
+#line 1619 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 50:
-/* Line 1792 of yacc.c  */
-#line 115 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "le", (yyvsp[(3) - (3)].scalarNode)); }
+#line 115 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].scalarNode)); }
+#line 1625 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 51:
-/* Line 1792 of yacc.c  */
-#line 116 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "le", (yyvsp[(3) - (3)].filterNode)); }
+#line 116 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].filterNode)); }
+#line 1631 "yacc_parser.cpp" /* yacc.c:1646  */
     break;
 
   case 52:
-/* Line 1792 of yacc.c  */
-#line 117 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "ge", (yyvsp[(3) - (3)].scalarNode)); }
-    break;
-
-  case 53:
-/* Line 1792 of yacc.c  */
-#line 118 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "ge", (yyvsp[(3) - (3)].filterNode)); }
-    break;
-
-  case 54:
-/* Line 1792 of yacc.c  */
-#line 119 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "ne", (yyvsp[(3) - (3)].scalarNode)); }
-    break;
-
-  case 55:
-/* Line 1792 of yacc.c  */
-#line 120 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "ne", (yyvsp[(3) - (3)].filterNode)); }
-    break;
-
-  case 56:
-/* Line 1792 of yacc.c  */
-#line 121 "yacc_parser.yacc"
-    { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].filterNode)); delete (yyvsp[(1) - (4)].str); }
-    break;
-
-
-/* Line 1792 of yacc.c  */
-#line 1829 "yacc_parser.cpp"
+#line 117 "yacc_parser.yacc" /* yacc.c:1646  */
+    { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); }
+#line 1637 "yacc_parser.cpp" /* yacc.c:1646  */
+    break;
+
+
+#line 1641 "yacc_parser.cpp" /* yacc.c:1646  */
       default: break;
     }
@@ -1848,5 +1660,5 @@
   *++yyvsp = yyval;
 
-  /* Now `shift' the result of the reduction.  Determine what state
+  /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
@@ -1863,7 +1675,7 @@
 
 
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
@@ -1916,18 +1728,18 @@
     {
       /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
+         error, discard it.  */
 
       if (yychar <= YYEOF)
-	{
-	  /* Return failure if at end of input.  */
-	  if (yychar == YYEOF)
-	    YYABORT;
-	}
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
       else
-	{
-	  yydestruct ("Error: discarding",
-		      yytoken, &yylval);
-	  yychar = YYEMPTY;
-	}
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval);
+          yychar = YYEMPTY;
+        }
     }
 
@@ -1948,5 +1760,5 @@
      goto yyerrorlab;
 
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -1961,5 +1773,5 @@
 `-------------------------------------------------------------*/
 yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
   for (;;)
@@ -1967,21 +1779,21 @@
       yyn = yypact[yystate];
       if (!yypact_value_is_default (yyn))
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
 
       /* Pop the current state because it cannot handle the error token.  */
       if (yyssp == yyss)
-	YYABORT;
+        YYABORT;
 
 
       yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp);
+                  yystos[yystate], yyvsp);
       YYPOPSTACK (1);
       yystate = *yyssp;
@@ -2034,5 +1846,5 @@
                   yytoken, &yylval);
     }
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
@@ -2041,5 +1853,5 @@
     {
       yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp);
+                  yystos[*yyssp], yyvsp);
       YYPOPSTACK (1);
     }
@@ -2052,11 +1864,7 @@
     YYSTACK_FREE (yymsg);
 #endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
+  return yyresult;
 }
-
-
-/* Line 2055 of yacc.c  */
-#line 123 "yacc_parser.yacc"
+#line 119 "yacc_parser.yacc" /* yacc.c:1906  */
 
 
Index: XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.hpp	(revision 1037)
@@ -1,18 +1,18 @@
-/* A Bison parser, made by GNU Bison 2.7.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
@@ -27,5 +27,5 @@
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
@@ -33,5 +33,5 @@
 #ifndef YY_YY_YACC_PARSER_HPP_INCLUDED
 # define YY_YY_YACC_PARSER_HPP_INCLUDED
-/* Enabling traces.  */
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -41,38 +41,36 @@
 #endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NUMBER = 258,
-     VAR = 259,
-     ID = 260,
-     AVERAGE = 261,
-     PLUS = 262,
-     MINUS = 263,
-     TIMES = 264,
-     DIVIDE = 265,
-     POWER = 266,
-     EQ = 267,
-     LT = 268,
-     GT = 269,
-     LE = 270,
-     GE = 271,
-     NE = 272,
-     LEFT_PARENTHESIS = 273,
-     RIGHT_PARENTHESIS = 274,
-     END = 275,
-     NEG = 276
-   };
+  enum yytokentype
+  {
+    NUMBER = 258,
+    VAR = 259,
+    ID = 260,
+    AVERAGE = 261,
+    PLUS = 262,
+    MINUS = 263,
+    TIMES = 264,
+    DIVIDE = 265,
+    POWER = 266,
+    EQ = 267,
+    LT = 268,
+    GT = 269,
+    LE = 270,
+    GE = 271,
+    LEFT_PARENTHESIS = 272,
+    RIGHT_PARENTHESIS = 273,
+    END = 274,
+    NEG = 275
+  };
 #endif
 
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
 {
-/* Line 2058 of yacc.c  */
-#line 35 "yacc_parser.yacc"
+#line 35 "yacc_parser.yacc" /* yacc.c:1909  */
 
   std::string* str;                /* symbol table index */
@@ -80,28 +78,14 @@
   xios::IFilterExprNode* filterNode;
 
-
-/* Line 2058 of yacc.c  */
-#line 85 "yacc_parser.hpp"
-} YYSTYPE;
+#line 81 "yacc_parser.hpp" /* yacc.c:1909  */
+};
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+
 extern YYSTYPE yylval;
 
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
 int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
 #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */
Index: XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.yacc
===================================================================
--- XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.yacc	(revision 1036)
+++ XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.yacc	(revision 1037)
@@ -42,9 +42,9 @@
 %token <str> VAR ID AVERAGE
 %token PLUS MINUS TIMES DIVIDE POWER
-%token EQ LT GT LE GE NE
+%token EQ LT GT LE GE
 %token LEFT_PARENTHESIS RIGHT_PARENTHESIS
 %token <str> END
 
-%left EQ LT GT LE GE NE
+%left EQ LT GT LE GE
 %left PLUS MINUS
 %left TIMES DIVIDE
@@ -77,5 +77,4 @@
           | Expression LE Expression  { $$ = new CScalarBinaryOpExprNode($1, "le", $3); }
           | Expression GE Expression  { $$ = new CScalarBinaryOpExprNode($1, "ge", $3); }
-          | Expression NE Expression  { $$ = new CScalarBinaryOpExprNode($1, "ne", $3); }
           | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS    { $$ = $2; }
           | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = new CScalarUnaryOpExprNode(*$1, $3); delete $1; }
@@ -96,5 +95,4 @@
           | Field_expr LE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "le", $3); }
           | Field_expr GE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ge", $3); }
-          | Field_expr NE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ne", $3); }
           | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS	{ $$ = $2; }
           | Field_expr PLUS Expression   { $$ = new CFilterFieldScalarOpExprNode($1, "add", $3); }
@@ -117,6 +115,4 @@
           | Field_expr GE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ge", $3); }
           | Expression GE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ge", $3); }
-          | Field_expr NE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ne", $3); }
-          | Expression NE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ne", $3); }
           | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = new CFilterUnaryOpExprNode(*$1, $3); delete $1; }
           ;
Index: XIOS/dev/branch_yushan/src/registry.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/registry.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/registry.cpp	(revision 1037)
@@ -4,4 +4,5 @@
 #include <fstream>
 #include <sstream>
+
 
 namespace xios
@@ -221,8 +222,9 @@
 
     int* sizes=new int[mpiSize] ;
-    CBufferOut localBuffer(this->size()) ;
+    size_t st = this->size();
+    CBufferOut localBuffer(st) ;
     this->toBuffer(localBuffer) ;
     int localSize=localBuffer.count() ;
-    MPI_Gather(&localSize,1,MPI_INT,sizes,1,MPI_INT,0,comm) ;
+    MPI_Gather(&localSize,1,MPI_INT,sizes,1,MPI_INT,0,comm) ;    
 
     char* globalBuffer ;
@@ -252,4 +254,5 @@
     }
     else  MPI_Gatherv(localBuffer.start(),localSize,MPI_CHAR,globalBuffer,sizes,displs,MPI_CHAR,0,comm) ;   
+    
     delete[] sizes ;
     
@@ -258,5 +261,5 @@
   void CRegistry::hierarchicalGatherRegistry(void)
   {
-    hierarchicalGatherRegistry(communicator) ;
+    //hierarchicalGatherRegistry(communicator) ;
   }
 
Index: XIOS/dev/branch_yushan/src/registry.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/registry.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/registry.hpp	(revision 1037)
@@ -6,4 +6,8 @@
 #include "mpi.hpp"
 #include "message.hpp"
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
+
 
 // Those two headers can be replaced by the C++11 equivalent in the future
@@ -23,6 +27,9 @@
 
 /** Constructor, the communicator is used for bcast or gather operation between MPI processes */
+     
       CRegistry(const MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {}
-
+      
+     
+      
 /** Copy constructor */
       CRegistry(const CRegistry& reg) ;
Index: XIOS/dev/branch_yushan/src/server.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/server.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/server.cpp	(revision 1037)
@@ -9,5 +9,5 @@
 #include <boost/functional/hash.hpp>
 #include <boost/algorithm/string.hpp>
-#include "mpi.hpp"
+//#include "mpi.hpp"
 #include "tracer.hpp"
 #include "timer.hpp"
@@ -26,21 +26,14 @@
     bool CServer::finished=false ;
     bool CServer::is_MPI_Initialized ;
+
+    
     CEventScheduler* CServer::eventScheduler = 0;
    
     void CServer::initialize(void)
     {
-      int initialized ;
-      MPI_Initialized(&initialized) ;
-      if (initialized) is_MPI_Initialized=true ;
-      else is_MPI_Initialized=false ;
-
       // Not using OASIS
       if (!CXios::usingOasis)
       {
 
-        if (!is_MPI_Initialized)
-        {
-          MPI_Init(NULL, NULL);
-        }
         CTimer::get("XIOS").resume() ;
 
@@ -50,5 +43,5 @@
         unsigned long* hashAll ;
 
-//        int rank ;
+
         int size ;
         int myColor ;
@@ -77,6 +70,9 @@
 
         myColor=colors[hashServer] ;
-        MPI_Comm_split(MPI_COMM_WORLD,myColor,rank,&intraComm) ;
-
+
+
+        MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ;
+
+        
         int serverLeader=leaders[hashServer] ;
         int clientLeader;
@@ -96,4 +92,5 @@
              MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ;
              interComm.push_back(newComm) ;
+             printf("after inter create, interComm.size = %lu\n", interComm.size());
            }
          }
@@ -104,5 +101,4 @@
       else
       {
-//        int rank ,size;
         int size;
         if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId);
@@ -148,9 +144,13 @@
      
       delete eventScheduler ;
+      
+      
 
       for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++)
         MPI_Comm_free(&(*it));
+
       for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++)
         MPI_Comm_free(&(*it));
+
       MPI_Comm_free(&intraComm);
 
@@ -158,6 +158,8 @@
       {
         if (CXios::usingOasis) oasis_finalize();
-        else MPI_Finalize() ;
+        else  {MPI_Finalize() ; printf("CServer::finalize called MPI_finalize\n");}
       }
+
+      
       report(0)<<"Performance report : Time spent for XIOS : "<<CTimer::get("XIOS server").getCumulatedTime()<<endl  ;
       report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl  ;
@@ -174,17 +176,23 @@
          if (isRoot)
          {
-           listenContext();
-           if (!finished) listenFinalize() ;
+           listenContext(); 
+           if (!finished) listenFinalize() ; 
          }
          else
          {
-           listenRootContext();
-           if (!finished) listenRootFinalize() ;
-         }
-
+           listenRootContext(); 
+           if (!finished) 
+           {
+             listenRootFinalize() ; 
+           }
+         }
+         
          contextEventLoop() ;
          if (finished && contextList.empty()) stop=true ;
+         
          eventScheduler->checkEvent() ;
        }
+       
+       
        CTimer::get("XIOS server").suspend() ;
      }
@@ -195,4 +203,5 @@
         int msg ;
         int flag ;
+        
 
         for(it=interComm.begin();it!=interComm.end();it++)
@@ -205,5 +214,7 @@
            {
               MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ;
+              printf(" CServer : Receive client finalize\n");
               info(20)<<" CServer : Receive client finalize"<<endl ;
+
               MPI_Comm_free(&(*it));
               interComm.erase(it) ;
@@ -234,5 +245,5 @@
         MPI_Status status ;
         int msg ;
-
+        
         traceOff() ;
         MPI_Iprobe(0,4,intraComm, &flag, &status) ;
@@ -249,24 +260,30 @@
 
        MPI_Status status ;
-       int flag ;
-       static char* buffer ;
+       int flag = false ;
+       static void* buffer ;
        static MPI_Request request ;
        static bool recept=false ;
        int rank ;
-       int count ;
+       int count ; 
 
        if (recept==false)
-       {
+       {      
          traceOff() ;
          MPI_Iprobe(MPI_ANY_SOURCE,1,CXios::globalComm, &flag, &status) ;
          traceOn() ;
+         
          if (flag==true)
          {
+           #ifdef _usingMPI
            rank=status.MPI_SOURCE ;
+           #elif _usingEP
+           rank= status.ep_src ;
+           #endif
            MPI_Get_count(&status,MPI_CHAR,&count) ;
            buffer=new char[count] ;
-           MPI_Irecv((void*)buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ;
+           MPI_Irecv(buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ;
            recept=true ;
          }
+          
        }
        else
@@ -277,7 +294,13 @@
          if (flag==true)
          {
+           #ifdef _usingMPI
            rank=status.MPI_SOURCE ;
+           #elif _usingEP
+           rank= status.ep_src ;
+           #endif
            MPI_Get_count(&status,MPI_CHAR,&count) ;
-           recvContextMessage((void*)buffer,count) ;
+           recvContextMessage(buffer,count) ;
+           printf("listerContext register context OK, interComm size = %lu\n", interComm.size());
+           
            delete [] buffer ;
            recept=false ;
@@ -322,4 +345,5 @@
          MPI_Waitall(size-1,requests,status) ;
          registerContext(buff,count,it->second.leaderRank) ;
+         printf("recvContextMessage register context OK\n");
 
          recvContextId.erase(it) ;
@@ -335,5 +359,5 @@
        MPI_Status status ;
        int flag ;
-       static char* buffer ;
+       static void* buffer ;
        static MPI_Request request ;
        static bool recept=false ;
@@ -341,4 +365,5 @@
        int count ;
        const int root=0 ;
+       
 
        if (recept==false)
@@ -351,5 +376,5 @@
            MPI_Get_count(&status,MPI_CHAR,&count) ;
            buffer=new char[count] ;
-           MPI_Irecv((void*)buffer,count,MPI_CHAR,root,2,intraComm,&request) ;
+           MPI_Irecv(buffer,count,MPI_CHAR,root,2,intraComm,&request) ;
            recept=true ;
          }
@@ -361,5 +386,6 @@
          {
            MPI_Get_count(&status,MPI_CHAR,&count) ;
-           registerContext((void*)buffer,count) ;
+           registerContext(buffer,count) ;
+           printf("listenRootContext register context OK, interComm size = %lu\n", interComm.size());
            delete [] buffer ;
            recept=false ;
@@ -381,4 +407,5 @@
 
        MPI_Comm contextIntercomm;
+       
        MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm);
 
@@ -386,11 +413,18 @@
        MPI_Intercomm_merge(contextIntercomm,1,&inter);
        MPI_Barrier(inter);
+       
 
        CContext* context=CContext::create(contextId);
        contextList[contextId]=context;
        context->initServer(intraComm,contextIntercomm);
+       
+       
 
        contextInterComms.push_back(contextIntercomm);
+       
+       
        MPI_Comm_free(&inter);
+       
+       printf(" ****   server: register context OK\n");
      }
 
Index: XIOS/dev/branch_yushan/src/server.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/server.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/server.hpp	(revision 1037)
@@ -7,4 +7,8 @@
 #include "mpi.hpp"
 #include "event_scheduler.hpp"
+
+#ifdef _usingEP
+#include "ep_declaration.hpp"
+#endif
 
 namespace xios
Index: XIOS/dev/branch_yushan/src/test/test_client.f90
===================================================================
--- XIOS/dev/branch_yushan/src/test/test_client.f90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/test/test_client.f90	(revision 1037)
@@ -35,13 +35,14 @@
 
   CALL MPI_INIT(ierr)
-
   CALL init_wait
-
-!!! XIOS Initialization (get the local communicator)
-
+  
   CALL xios_initialize(id,return_comm=comm)
+  
+  print*, "test_client xios_initialize OK"
 
   CALL MPI_COMM_RANK(comm,rank,ierr)
+  print*, "test_client MPI_COMM_RANK OK"
   CALL MPI_COMM_SIZE(comm,size,ierr)
+  
 
   DO j=1,nj_glo
@@ -70,9 +71,15 @@
   lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1)
   field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
+  
+  CALL xios_context_initialize("test",comm)
 
-  CALL xios_context_initialize("test",comm)
   CALL xios_get_handle("test",ctx_hdl)
+  print*, "Client xios_get_handle OK"
   CALL xios_set_current_context(ctx_hdl)
-
+  print*, "Client xios_set_current_handle OK"  
+  
+  
+  
+  
   CALL xios_get_calendar_type(calendar_type)
   PRINT *, "calendar_type = ", calendar_type
@@ -91,7 +98,8 @@
   CALL xios_add_child(file_hdl,field_hdl)
   CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C")
-
+  
   dtime%second = 3600
   CALL xios_set_timestep(dtime)
+  print*, "Client xios_set_timestep OK"  
 
   ! The calendar is created as soon as the calendar type is defined. This way
@@ -119,20 +127,26 @@
   ni=0 ; lonvalue(:,:)=0;
   CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue)
-
   print *,"ni",ni
-  print *,"lonvalue",lonvalue;
+  !print *,"lonvalue",lonvalue;
 
   CALL xios_is_defined_field_attr("field_A",enabled=ok)
   PRINT *,"field_A : attribute enabled is defined ? ",ok
+  
   CALL xios_close_context_definition()
+  print*, "xios_close_context_definition OK"  
 
   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A")
-  DO ts=1,24*10
+  !DO ts=1,24*10
+  DO ts=1,24
     CALL xios_update_calendar(ts)
+    print*, "xios_update_calendar OK, ts = ", ts
     CALL xios_send_field("field_A",field_A)
-    CALL wait_us(5000) ;
+    print*, "xios_send_field OK, ts = ", ts
+    CALL wait_us(5000)
   ENDDO
+  
 
   CALL xios_context_finalize()
+  print*, "xios_context_finalize OK"  
 
   DEALLOCATE(lon, lat, field_A, lonvalue)
Index: XIOS/dev/branch_yushan/src/test/test_regular.f90
===================================================================
--- XIOS/dev/branch_yushan/src/test/test_regular.f90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/test/test_regular.f90	(revision 1037)
@@ -18,5 +18,5 @@
   INTEGER :: comm  
   INTEGER :: ierr
-  INTEGER :: sizeComm, rank    ! SIZE is a fortran function
+  INTEGER :: size, rank
 
   INTEGER :: nlon = 100 
@@ -94,19 +94,19 @@
 
   CALL MPI_COMM_RANK(comm,rank,ierr)
-  CALL MPI_COMM_SIZE(comm,sizeComm,ierr)
+  CALL MPI_COMM_SIZE(comm,size,ierr)
 
-  IF (MOD(ncell, sizeComm) == 0) THEN
-    ni = ncell/sizeComm
+  IF (MOD(ncell, size) == 0) THEN
+    ni = ncell/size
     ibegin = rank*ni
   ELSE
-    IF (rank < MOD(ncell, sizeComm)) THEN
-      ni = ncell/sizeComm + 1
-      ibegin = rank*(ncell/sizeComm + 1)
+    IF (rank < MOD(ncell, size)) THEN
+      ni = ncell/size + 1
+      ibegin = rank*(ncell/size + 1)
     ELSE
-      ni = ncell/sizeComm
-      IF (rank == MOD(ncell, sizeComm)) THEN
-        ibegin = rank*(ncell/sizeComm + 1)
+      ni = ncell/size
+      IF (rank == MOD(ncell, size)) THEN
+        ibegin = rank*(ncell/size + 1)
       ELSE
-        ibegin = MOD(ncell,sizeComm)*(ncell/sizeComm + 1) + (rank-MOD(ncell,sizeComm))*ncell/sizeComm
+        ibegin = MOD(ncell,size)*(ncell/size + 1) + (rank-MOD(ncell,size))*ncell/size
       END IF
     END IF
@@ -118,8 +118,8 @@
   ALLOCATE(bounds_lat(4,ni))
   ALLOCATE(field_temp(ni,ntime)) 
-  lon = lon_glo(1+ibegin:ibegin+ni)
-  lat = lat_glo(1+ibegin:ibegin+ni)
-  bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:ibegin+ni)
-  bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:ibegin+ni)
+  lon = lon_glo(1+ibegin:1+ibegin+ni)
+  lat = lat_glo(1+ibegin:1+ibegin+ni)
+  bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:1+ibegin+ni)
+  bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:1+ibegin+ni)
   field_temp(:,:) = rank
 
Index: XIOS/dev/branch_yushan/src/test/test_remap.f90
===================================================================
--- XIOS/dev/branch_yushan/src/test/test_remap.f90	(revision 1036)
+++ XIOS/dev/branch_yushan/src/test/test_remap.f90	(revision 1037)
@@ -91,7 +91,6 @@
     IF (MOD(i,10)==0) THEN
       src_mask_2D(i)=.FALSE.
-      src_field_2D(i) = 100000
     ELSE
-      src_mask_2D(i)=.TRUE.      
+      src_mask_2D(i)=.TRUE.
     ENDIF
   ENDDO
@@ -100,16 +99,9 @@
     lval(i) = i*100
     src_field_pression(:,i) = i * 100
-    IF (MOD(i,3)==0) THEN
-      ! src_field_pression(:,i) = 100000
-      src_field_3D(:,i) = 100000
-    ELSE
-      ! src_field_pression(:,i) = i * 100
-      src_field_3D(:,i) = src_field_3D(:,i) + i * 10 
-    ENDIF
-    ! src_field_3D(:,i) = src_field_3D(:,i) + i * 10    
+    src_field_3D(:,i) = src_field_3D(:,i) + i * 10    
   ENDDO
 
   DO i=1,llm2
-    src_field_4D(:,:,i) = src_field_3D(:,:) + i * 100
+    src_field_4D(:,:,i) = src_field_3D(:,:)
   ENDDO
 
@@ -192,5 +184,4 @@
     CALL xios_send_field("src_field_2D_clone",src_field_2D)
     CALL xios_send_field("src_field_3D",src_field_3D)
-    CALL xios_send_field("src_field_3D_clone",src_field_3D)
     CALL xios_send_field("src_field_4D",src_field_4D)
     CALL xios_send_field("src_field_3D_pression",src_field_pression)
Index: XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.cpp	(revision 1037)
@@ -3,10 +3,9 @@
    \author Ha NGUYEN
    \since 8 Sep 2016
-   \date 9 Jan 2017
+   \date 8 Sep 2016
 
    \brief average reduction
  */
 #include "average_reduction.hpp"
-#include "utils.hpp"
 
 namespace xios {
@@ -30,54 +29,25 @@
                                        const double* dataInput,
                                        CArray<double,1>& dataOut,
-                                       std::vector<bool>& flagInitial,
-                                       const double& defaultValue)
+                                       std::vector<bool>& flagInitial)
 {
   if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; }
-  bool hasMissingValue = NumTraits<double>::isnan(defaultValue);
 
-  if (hasMissingValue)
+  int nbLocalIndex = localIndex.size();
+  int currentlocalIndex = 0;
+  double currentWeight  = 0.0;
+  for (int idx = 0; idx < nbLocalIndex; ++idx)
   {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-    double currentWeight  = 0.0;
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    currentlocalIndex = localIndex[idx].first;
+    currentWeight     = localIndex[idx].second;
+
+    if (flagInitial[currentlocalIndex])
     {
-      currentlocalIndex = localIndex[idx].first;
-      currentWeight     = localIndex[idx].second;
-      if (!NumTraits<double>::isnan(*(dataInput + idx)))
-      {
-        if (flagInitial[currentlocalIndex])
-        {
-          dataOut(currentlocalIndex) = *(dataInput + idx);
-          flagInitial[currentlocalIndex] = false;
-        }
-        else
-        {
-          dataOut(currentlocalIndex)  += *(dataInput + idx);
-          weights_(currentlocalIndex) += 1.0;
-        }
-      }
+      dataOut(currentlocalIndex) = *(dataInput + idx);
+      flagInitial[currentlocalIndex] = false;
     }
-  }
-  else
-  {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-    double currentWeight  = 0.0;
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    else
     {
-      currentlocalIndex = localIndex[idx].first;
-      currentWeight     = localIndex[idx].second;
-
-      if (flagInitial[currentlocalIndex])
-      {
-        dataOut(currentlocalIndex) = *(dataInput + idx);
-        flagInitial[currentlocalIndex] = false;
-      }
-      else
-      {
-        dataOut(currentlocalIndex)  += *(dataInput + idx);
-        weights_(currentlocalIndex) += 1.0;
-      }
+      dataOut(currentlocalIndex)  += *(dataInput + idx);
+      weights_(currentlocalIndex) += 1.0;
     }
   }
Index: XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.hpp	(revision 1037)
@@ -26,6 +26,5 @@
                      const double* dataInput,
                      CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     const double& defaultValue);
+                     std::vector<bool>& flagInitial);
 
   virtual void updateData(CArray<double,1>& dataOut);
Index: XIOS/dev/branch_yushan/src/transformation/Functions/extract.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/extract.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/extract.cpp	(revision 1037)
@@ -29,6 +29,5 @@
                                        const double* dataInput,
                                        CArray<double,1>& dataOut,
-                                       std::vector<bool>& flagInitial,
-                                       const double& defaultValue)
+                                       std::vector<bool>& flagInitial)
 {
   int nbLocalIndex = localIndex.size();
Index: XIOS/dev/branch_yushan/src/transformation/Functions/extract.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/extract.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/extract.hpp	(revision 1037)
@@ -26,6 +26,5 @@
                      const double* dataInput,
                      CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     const double& defaultValue);
+                     std::vector<bool>& flagInitial);
 
   virtual ~CExtractReductionAlgorithm() {}
Index: XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.cpp	(revision 1037)
@@ -8,5 +8,4 @@
  */
 #include "max_reduction.hpp"
-#include "utils.hpp"
 
 namespace xios {
@@ -30,46 +29,21 @@
                                    const double* dataInput,
                                    CArray<double,1>& dataOut,
-                                   std::vector<bool>& flagInitial,
-                                   const double& defaultValue)
+                                   std::vector<bool>& flagInitial)
 {
-  bool hasMissingValue = NumTraits<double>::isnan(defaultValue);
-
-  if (hasMissingValue)
+  int nbLocalIndex = localIndex.size();
+  int currentlocalIndex = 0;
+  double currentWeight  = 0.0;
+  for (int idx = 0; idx < nbLocalIndex; ++idx)
   {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;    
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    currentlocalIndex = localIndex[idx].first;
+    currentWeight     = localIndex[idx].second;
+    if (flagInitial[currentlocalIndex])
     {
-      currentlocalIndex = localIndex[idx].first;      
-      if (!NumTraits<double>::isnan(*(dataInput + idx)))
-      {
-        if (flagInitial[currentlocalIndex])
-        {
-          dataOut(currentlocalIndex) = *(dataInput + idx);
-          flagInitial[currentlocalIndex] = false;
-        }
-        else
-        {
-          dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex));
-        }
-      }
+      dataOut(currentlocalIndex) = *(dataInput + idx);
+      flagInitial[currentlocalIndex] = false;
     }
-  }
-  else
-  {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;    
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    else
     {
-      currentlocalIndex = localIndex[idx].first;      
-      if (flagInitial[currentlocalIndex])
-      {
-        dataOut(currentlocalIndex) = *(dataInput + idx);
-        flagInitial[currentlocalIndex] = false;
-      }
-      else
-      {
-        dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex));
-      }
+      dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex));
     }
   }
Index: XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.hpp	(revision 1037)
@@ -26,6 +26,5 @@
                      const double* dataInput,
                      CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     const double& defaultValue);
+                     std::vector<bool>& flagInitial);
 
   virtual ~CMaxReductionAlgorithm() {}
Index: XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.cpp	(revision 1037)
@@ -3,10 +3,9 @@
    \author Ha NGUYEN
    \since 27 June 2016
-   \date 9 Jan 2017
+   \date 27 June 2016
 
    \brief min reduction
  */
 #include "min_reduction.hpp"
-#include "utils.hpp"
 
 namespace xios {
@@ -30,46 +29,19 @@
                                    const double* dataInput,
                                    CArray<double,1>& dataOut,
-                                   std::vector<bool>& flagInitial,
-                                   const double& defaultValue)
+                                   std::vector<bool>& flagInitial)
 {
-  bool hasMissingValue = NumTraits<double>::isnan(defaultValue);
-
-  if (hasMissingValue)
+  int nbLocalIndex = localIndex.size();
+  int currentlocalIndex = 0;
+  for (int idx = 0; idx < nbLocalIndex; ++idx)
   {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    currentlocalIndex = localIndex[idx].first;
+    if (flagInitial[currentlocalIndex])
     {
-      currentlocalIndex = localIndex[idx].first;
-      if (!NumTraits<double>::isnan(*(dataInput + idx)))
-      {
-        if (flagInitial[currentlocalIndex])
-        {
-          dataOut(currentlocalIndex) = *(dataInput + idx);
-          flagInitial[currentlocalIndex] = false;
-        }
-        else
-        {
-          dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex));
-        }
-      }
+      dataOut(currentlocalIndex) = *(dataInput + idx);
+      flagInitial[currentlocalIndex] = false;
     }
-  }
-  else
-  {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    else
     {
-      currentlocalIndex = localIndex[idx].first;
-      if (flagInitial[currentlocalIndex])
-      {
-        dataOut(currentlocalIndex) = *(dataInput + idx);
-        flagInitial[currentlocalIndex] = false;
-      }
-      else
-      {
-        dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex));
-      }
+      dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex));
     }
   }
Index: XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.hpp	(revision 1037)
@@ -26,6 +26,5 @@
                      const double* dataInput,
                      CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     const double& defaultValue);
+                     std::vector<bool>& flagInitial);
 
   virtual ~CMinReductionAlgorithm() {}
Index: XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp	(revision 1037)
@@ -45,6 +45,5 @@
                      const double* dataInput,
                      CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     const double& defaultValue) = 0;
+                     std::vector<bool>& flagInitial) = 0;
   /*!
     Update local data 
Index: XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.cpp	(revision 1037)
@@ -3,10 +3,9 @@
    \author Ha NGUYEN
    \since 27 June 2016
-   \date 9 Jan 2017
+   \date 27 June 2016
 
    \brief sum reduction
  */
 #include "sum_reduction.hpp"
-#include "utils.hpp"
 
 namespace xios {
@@ -30,45 +29,21 @@
                                    const double* dataInput,
                                    CArray<double,1>& dataOut,
-                                   std::vector<bool>& flagInitial,
-                                   const double& defaultValue)
+                                   std::vector<bool>& flagInitial)
 {
-  bool hasMissingValue = NumTraits<double>::isnan(defaultValue);
-  if (hasMissingValue)
+  int nbLocalIndex = localIndex.size();
+  int currentlocalIndex = 0;
+  double currentWeight  = 0.0;
+  for (int idx = 0; idx < nbLocalIndex; ++idx)
   {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;    
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    currentlocalIndex = localIndex[idx].first;
+    currentWeight     = localIndex[idx].second;
+    if (flagInitial[currentlocalIndex])
     {
-      currentlocalIndex = localIndex[idx].first;   
-      if (!NumTraits<double>::isnan(*(dataInput + idx)))
-      {   
-        if (flagInitial[currentlocalIndex])
-        {
-          dataOut(currentlocalIndex) = *(dataInput + idx);
-          flagInitial[currentlocalIndex] = false;
-        }
-        else
-        {
-          dataOut(currentlocalIndex) += *(dataInput + idx);
-        }
-      }
-    }    
-  }
-  else
-  {
-    int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;    
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
+      dataOut(currentlocalIndex) = *(dataInput + idx);
+      flagInitial[currentlocalIndex] = false;
+    }
+    else
     {
-      currentlocalIndex = localIndex[idx].first;      
-      if (flagInitial[currentlocalIndex])
-      {
-        dataOut(currentlocalIndex) = *(dataInput + idx);
-        flagInitial[currentlocalIndex] = false;
-      }
-      else
-      {
-        dataOut(currentlocalIndex) += *(dataInput + idx);
-      }
+      dataOut(currentlocalIndex) += *(dataInput + idx);
     }
   }
Index: XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.hpp	(revision 1037)
@@ -26,6 +26,5 @@
                      const double* dataInput,
                      CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     const double& defaultValue);
+                     std::vector<bool>& flagInitial);
 
   virtual ~CSumReductionAlgorithm() {}
Index: XIOS/dev/branch_yushan/src/transformation/axis_algorithm_extract_domain.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/axis_algorithm_extract_domain.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/axis_algorithm_extract_domain.cpp	(revision 1037)
@@ -71,5 +71,5 @@
                                         const double& defaultValue)
 {
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue);
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial);
 }
 
Index: XIOS/dev/branch_yushan/src/transformation/axis_algorithm_inverse.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/axis_algorithm_inverse.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/axis_algorithm_inverse.cpp	(revision 1037)
@@ -211,6 +211,7 @@
 
   status.resize(requests.size());
+  //printf("(%d) src/transformation/axis_algorithm_inverse 1st waitall\n", clientRank);
   MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
+  //printf("(%d) src/transformation/axis_algorithm_inverse 1st waitall OK\n", clientRank);
 
   std::vector<MPI_Request>().swap(requests);
@@ -245,6 +246,8 @@
   }
   status.resize(requests.size());
+  //printf("(%d) src/transformation/axis_algorithm_inverse 2nd waitall\n", clientRank);
+
   MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
+  //printf("(%d) src/transformation/axis_algorithm_inverse 2nd waitall OK\n", clientRank);
 
   size_t nGloAxisDest = axisDest_->n_glo.getValue() - 1;
Index: XIOS/dev/branch_yushan/src/transformation/axis_algorithm_reduce_domain.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/axis_algorithm_reduce_domain.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/axis_algorithm_reduce_domain.cpp	(revision 1037)
@@ -79,5 +79,5 @@
                                        const double& defaultValue)
 {
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue);
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial);
 }
 
Index: XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.cpp	(revision 1037)
@@ -48,40 +48,10 @@
 
 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false)
-{
-  CContext* context = CContext::getCurrent();
+: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false)
+{
   interpDomain_->checkValid(domainSource);
-  fileToReadWrite_ = "xios_interpolation_weights_";
-
-  if (interpDomain_->weight_filename.isEmpty())
-  {
-    fileToReadWrite_ += context->getId() + "_" + 
-                    domainSource->getDomainOutputName() + "_" + 
-                    domainDestination->getDomainOutputName() + ".nc";    
-  }
-  else 
-    fileToReadWrite_ = interpDomain_->weight_filename;
-
-  ifstream f(fileToReadWrite_.c_str());  
-  switch (interpDomain_->mode)
-  {
-    case CInterpolateDomain::mode_attr::read:
-      readFromFile_ = true;      
-      break;
-    case CInterpolateDomain::mode_attr::compute:
-      readFromFile_ = false;
-      break;
-    case CInterpolateDomain::mode_attr::read_or_compute:      
-      if (!f.good())
-        readFromFile_ = false;
-      else
-        readFromFile_ = true;
-      break;
-    default:
-      break;
-  } 
-
-  writeToFile_ = interpDomain_->write_weight;  
-    
+  if ((CInterpolateDomain::mode_attr::write == interpDomain_->mode) &&
+      (!interpDomain_->file.isEmpty()))
+    writeToFile_ = true;
 }
 
@@ -384,5 +354,5 @@
   }
 
-  if (writeToFile_ && !readFromFile_)
+  if (writeToFile_)
      writeRemapInfo(interpMapValue);
   exchangeRemapInfo(interpMapValue);
@@ -469,5 +439,5 @@
 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
 {
-  if (readFromFile_ && !writeToFile_)  
+  if (CInterpolateDomain::mode_attr::read == interpDomain_->mode)  
     readRemapInfo();
   else
@@ -478,12 +448,14 @@
 
 void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-{  
-  writeInterpolationInfo(fileToReadWrite_, interpMapValue);
+{
+  std::string filename = interpDomain_->file.getValue();
+  writeInterpolationInfo(filename, interpMapValue);
 }
 
 void CDomainAlgorithmInterpolate::readRemapInfo()
-{  
+{
+  std::string filename = interpDomain_->file.getValue();
   std::map<int,std::vector<std::pair<int,double> > > interpMapValue;
-  readInterpolationInfo(fileToReadWrite_, interpMapValue);
+  readInterpolationInfo(filename, interpMapValue);
 
   exchangeRemapInfo(interpMapValue);
@@ -636,6 +608,9 @@
     int countBuff = 0;
     MPI_Get_count(&recvStatus, MPI_INT, &countBuff);
+    #ifdef _usingMPI
     clientSrcRank = recvStatus.MPI_SOURCE;
-
+    #elif _usingEP
+    clientSrcRank = recvStatus.ep_src;
+    #endif
     MPI_Recv((recvIndexSrcBuff + receivedSize),
              recvBuffSize,
@@ -681,5 +656,5 @@
                                                                 const StdSize size)
 {
-  return CONetCDF4::addDimension(name, size);  
+  CONetCDF4::addDimension(name, size);  
 }
 
@@ -687,10 +662,5 @@
                                                                const std::vector<StdString>& dim)
 {
-  return CONetCDF4::addVariable(name, type, dim);
-}
-
-void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition()
-{
-  CONetCDF4::definition_end();
+  CONetCDF4::addVariable(name, type, dim);
 }
 
@@ -756,17 +726,10 @@
   MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm);
   
-  if (0 == globalNbWeight)
-  {
-    info << "There is no interpolation weights calculated between "
-         << "domain source: " << domainSrc_->getDomainOutputName()
-         << " and domain destination: " << domainDest_->getDomainOutputName()
-         << std::endl;
-    return;
-  }
-
   std::vector<StdSize> start(1, startIndex - localNbWeight);
   std::vector<StdSize> count(1, localNbWeight);
-  
-  WriteNetCdf netCdfWriter(filename, client->intraComm);  
+
+  WriteNetCdf netCdfWriter(filename, client->intraComm);
+
+  // netCdfWriter = CONetCDF4(filename, false, false, true, client->intraComm, false);
 
   // Define some dimensions
@@ -782,14 +745,8 @@
   netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims);
 
-  // End of definition
-  netCdfWriter.endDefinition();
-
   // // Write variables
-  if (0 != localNbWeight)
-  {
-    netCdfWriter.writeDataIndex(src_idx, "src_idx", false, 0, &start, &count);
-    netCdfWriter.writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count);
-    netCdfWriter.writeDataIndex(weights, "weight", false, 0, &start, &count);
-  }
+  netCdfWriter.writeDataIndex(src_idx, "src_idx", true, 0, &start, &count);
+  netCdfWriter.writeDataIndex(dst_idx, "dst_idx", true, 0, &start, &count);
+  netCdfWriter.writeDataIndex(weights, "weight", true, 0, &start, &count);
 
   netCdfWriter.closeFile();
Index: XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.hpp	(revision 1037)
@@ -48,6 +48,4 @@
   CInterpolateDomain* interpDomain_;
   bool writeToFile_;
-  bool readFromFile_;
-  StdString fileToReadWrite_;
 
   // class WriteNetCdf;
@@ -59,5 +57,4 @@
     int addVariableWrite(const StdString& name, nc_type type,
                          const std::vector<StdString>& dim);
-    void endDefinition();
     void writeDataIndex(const CArray<int,1>& data, const StdString& name,
                         bool collective, StdSize record,
Index: XIOS/dev/branch_yushan/src/transformation/generic_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/generic_algorithm_transformation.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/generic_algorithm_transformation.cpp	(revision 1037)
@@ -11,5 +11,4 @@
 #include "context_client.hpp"
 #include "client_client_dht_template.hpp"
-#include "utils.hpp"
 
 namespace xios {
@@ -32,11 +31,11 @@
                                             const double& defaultValue)
 {
-  int nbLocalIndex = localIndex.size();  
-  bool hasMissingValue = NumTraits<double>::isnan(defaultValue);  
+  int nbLocalIndex = localIndex.size();
+  bool hasMissingValue = (0.0 != defaultValue) ? true : false;
   if (hasMissingValue)
   {
     for (int idx = 0; idx < nbLocalIndex; ++idx)
     {
-      if (NumTraits<double>::isnan(*(dataInput + idx)))
+      if (defaultValue == *(dataInput + idx))
       {
         flagInitial[localIndex[idx].first] = false;
Index: XIOS/dev/branch_yushan/src/transformation/grid_transformation.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/grid_transformation.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/grid_transformation.cpp	(revision 1037)
@@ -531,5 +531,7 @@
 
   status.resize(requests.size());
+  //printf("(%d) src/transformation/grid_transformation 1st waitall\n", clientRank);
   MPI_Waitall(requests.size(), &requests[0], &status[0]);
+  //printf("(%d) src/transformation/grid_transformation 1st waitall OK\n", clientRank);
 
   // Okie, now use the mask to identify which index source we need to send, then also signal the destination which masked index we will return
@@ -583,5 +585,7 @@
   }
   status.resize(requests.size());
+  //printf("(%d) src/transformation/grid_transformation 2nd waitall\n", clientRank);
   MPI_Waitall(requests.size(), &requests[0], &status[0]);
+  //printf("(%d) src/transformation/grid_transformation 2nd waitall OK\n", clientRank);
 
   // Cool, now we can fill in local index of grid destination (counted for masked index)
Index: XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_extract_axis.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_extract_axis.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_extract_axis.cpp	(revision 1037)
@@ -58,5 +58,5 @@
                                          const double& defaultValue)
 {
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue);
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial);
 }
 
Index: XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_axis.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_axis.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_axis.cpp	(revision 1037)
@@ -90,5 +90,5 @@
                                          const double& defaultValue)
 {
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue);
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial);
 }
 
Index: XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_domain.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_domain.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_domain.cpp	(revision 1037)
@@ -84,5 +84,5 @@
                                          const double& defaultValue)
 {
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue);
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial);
 }
 
Index: XIOS/dev/branch_yushan/src/utils.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/utils.hpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/utils.hpp	(revision 1037)
@@ -257,7 +257,4 @@
     return 1e-12;
   }
-  static inline bool isnan(const Scalar& v) {
-    return (v != v);
-  }
 };
 
Index: XIOS/dev/branch_yushan/src/xml_parser.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/xml_parser.cpp	(revision 1036)
+++ XIOS/dev/branch_yushan/src/xml_parser.cpp	(revision 1037)
@@ -70,8 +70,16 @@
                   CContext::setCurrent(attributes["id"]) ;
 
+                  bool hasctxt = CContext::has(attributes["id"]);
+
+                  if(hasctxt)
+                  {
+                     DEBUG("The context will not be processed because it exist an other context with the same id" );
+                     continue;
+                  }
 
                   if (isParseAll)
                   {
                     CContext* context = CContext::create(attributes["id"]);
+//                  if (!hasctxt)  group_context->addChild(context);
                     context->parse(node);
 
@@ -84,4 +92,5 @@
                     {
                       CContext* context = CContext::create(*it);
+  //                  if (!hasctxt)  group_context->addChild(context);
                       context->parse(node);
 
