Changeset 1037 for XIOS/dev


Ignore:
Timestamp:
01/25/17 16:25:17 (7 years ago)
Author:
yushan
Message:

initialize the branch

Location:
XIOS/dev/branch_yushan
Files:
42 added
112 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/bld.cfg

    r1010 r1037  
    2929src::netcdf $PWD/extern/netcdf4 
    3030src::remap $PWD/extern/remap/src 
     31src::src_ep_dev $PWD/extern/src_ep_dev 
    3132bld::lib xios 
    32 bld::target libxios.a  
     33#bld::target libxios.a  
    3334#bld::target generate_fortran_interface.exe  
    3435bld::target xios_server.exe  
    35 bld::target test_remap.exe 
    36 bld::target test_regular.exe 
    37 bld::target test_new_features.exe test_unstruct_complete.exe  
    38 bld::target test_client.exe test_complete.exe test_xios2_cmip6.exe 
     36#test_remap.exe 
     37#bld::target test_new_features.exe test_unstruct_complete.exe  
     38bld::target test_client.exe #test_complete.exe 
    3939bld::exe_dep 
    4040 
  • XIOS/dev/branch_yushan/src/attribute_map.cpp

    r996 r1037  
    2828 
    2929      //--------------------------------------------------------------- 
     30 
     31      bool CAttributeMap::hasAttribute(const StdString& key) const 
     32      { 
     33         return (this->find(key) != this->end()); 
     34      } 
    3035 
    3136      void CAttributeMap::clearAttribute(const StdString& key) 
  • XIOS/dev/branch_yushan/src/attribute_map.hpp

    r996 r1037  
    2020 
    2121            /// Tests /// 
    22             bool hasAttribute(const StdString & key) const; 
     22            inline bool hasAttribute(const StdString & key) const; 
    2323 
    2424            /// Accesseurs /// 
     
    7272      };  // class CAttributeMap 
    7373 
    74       inline bool CAttributeMap::hasAttribute(const StdString& key) const 
    75       { 
    76          return (this->find(key) != this->end()); 
    77       } 
    78  
    7974} // namespace xios 
    8075 
  • XIOS/dev/branch_yushan/src/attribute_template_impl.hpp

    r1028 r1037  
    7171         T CAttributeTemplate<T>::getValue(void) const 
    7272      { 
    73         return CType<T>::get() ; 
    74 /* 
    75         if (SuperClass::isEmpty()) 
    76         { 
    77            ERROR("T CAttributeTemplate<T>::getValue(void) const", 
    78                  << "[ id = " << this->getId() << "]" 
    79                  << " L'attribut est requis mais n'est pas défini !"); 
    80          } 
    81         return (SuperClass::getValue<T>()); 
     73         return CType<T>::get() ; 
     74/* 
     75         if (SuperClass::isEmpty()) 
     76         { 
     77            ERROR("T CAttributeTemplate<T>::getValue(void) const", 
     78                  << "[ id = " << this->getId() << "]" 
     79                  << " L'attribut est requis mais n'est pas défini !"); 
     80          } 
     81         return (SuperClass::getValue<T>()); 
    8282*/ 
    8383      } 
  • XIOS/dev/branch_yushan/src/buffer_client.cpp

    r917 r1037  
    77#include "mpi.hpp" 
    88#include "tracer.hpp" 
     9 
    910 
    1011namespace xios 
     
    8081      traceOn(); 
    8182      if (flag == true) pending = false; 
     83 
     84      //printf("\ncheckbuffer, flag = %d, pending = %d; request = %p, count = %d\n", flag, pending, &request, count); 
    8285    } 
    8386 
  • XIOS/dev/branch_yushan/src/buffer_client.hpp

    r917 r1037  
    66#include "mpi.hpp" 
    77#include "cxios.hpp" 
     8#ifdef _usingEP 
     9#include "ep_declaration.hpp" 
     10#endif 
    811 
    912namespace xios 
  • XIOS/dev/branch_yushan/src/client.cpp

    r1032 r1037  
    3030      if (initialized) is_MPI_Initialized=true ; 
    3131      else is_MPI_Initialized=false ; 
     32       
     33      //return; 
    3234 
    3335// don't use OASIS 
     
    8789 
    8890          MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ; 
     91         
    8992 
    9093          if (CXios::usingServer) 
     
    97100            MPI_Comm_rank(intraComm,&intraCommRank) ; 
    98101            info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 
    99                  <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ; 
     102                 <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader<<endl ; 
    100103            MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 
    101104          } 
     
    148151 
    149152      MPI_Comm_dup(intraComm,&returnComm) ; 
     153 
    150154    } 
    151155 
     
    160164      if (!CXios::isServer) 
    161165      { 
     166       
     167         
     168         
    162169        int size,rank,globalRank ; 
    163170        size_t message_size ; 
     
    165172        MPI_Comm contextInterComm ; 
    166173 
     174         
    167175        MPI_Comm_size(contextComm,&size) ; 
    168176        MPI_Comm_rank(contextComm,&rank) ; 
     
    173181        CMessage msg ; 
    174182        msg<<idServer<<size<<globalRank ; 
    175 //        msg<<id<<size<<globalRank ; 
     183 
    176184 
    177185        int messageSize=msg.size() ; 
    178         char * buff = new char[messageSize] ; 
    179         CBufferOut buffer((void*)buff,messageSize) ; 
     186        void * buff = new char[messageSize] ; 
     187        CBufferOut buffer(buff,messageSize) ; 
    180188        buffer<<msg ; 
    181  
    182         MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 
     189         
     190         
     191 
     192        MPI_Send(buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 
    183193        delete [] buff ; 
     194         
     195        printf("====== Client: begin context_init \n"); 
     196       
    184197 
    185198        MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 
    186199        info(10)<<"Register new Context : "<<id<<endl ; 
     200         
     201        cout<<"Register new Context : "<<id<<endl ; 
     202               
    187203 
    188204        MPI_Comm inter ; 
    189205        MPI_Intercomm_merge(contextInterComm,0,&inter) ; 
    190206        MPI_Barrier(inter) ; 
    191  
     207         
     208         
    192209        context->initClient(contextComm,contextInterComm) ; 
     210         
     211        printf("====== Client: context_init OK\n"); 
    193212 
    194213        contextInterComms.push_back(contextInterComm); 
     
    220239 
    221240      MPI_Comm_rank(intraComm,&rank) ; 
     241       
     242      printf("CClient::finalize called isServer = %d\n", CXios::isServer); 
    222243  
    223244      if (!CXios::isServer) 
     
    227248        { 
    228249          MPI_Send(&msg,1,MPI_INT,0,0,interComm) ; 
     250          printf(" CClient : send finalize sign to server 0\n"); 
    229251        } 
    230252      } 
     
    241263      { 
    242264        if (CXios::usingOasis) oasis_finalize(); 
    243         else MPI_Finalize() ; 
     265        else {MPI_Finalize() ; printf("CClient::finalize called MPI_finalize\n");} 
    244266      } 
    245267       
  • XIOS/dev/branch_yushan/src/client.hpp

    r655 r1037  
    44#include "xios_spl.hpp" 
    55#include "mpi.hpp" 
     6#ifdef _usingEP 
     7//#include "ep_declaration.hpp" 
     8#endif 
     9 
    610 
    711namespace xios 
  • XIOS/dev/branch_yushan/src/client_client_dht_template_impl.hpp

    r892 r1037  
    1010#include "utils.hpp" 
    1111#include "mpi_tag.hpp" 
     12#ifdef _usingEP 
     13#include "ep_declaration.hpp" 
     14#endif 
     15 
    1216 
    1317namespace xios 
     
    3741  : H(clientIntraComm), index2InfoMapping_(), indexToInfoMappingLevel_(), nbClient_(0) 
    3842{ 
     43   
    3944  MPI_Comm_size(clientIntraComm, &nbClient_); 
    4045  this->computeMPICommLevel(); 
    41   int nbLvl = this->getNbLevel(); 
     46  int nbLvl = this->getNbLevel();   
    4247  sendRank_.resize(nbLvl); 
    4348  recvRank_.resize(nbLvl); 
    4449  Index2VectorInfoTypeMap indexToVecInfoMap; 
    45   indexToVecInfoMap.rehash(std::ceil(indexInfoMap.size()/indexToVecInfoMap.max_load_factor())); 
    46   typename Index2InfoTypeMap::const_iterator it = indexInfoMap.begin(), ite = indexInfoMap.end(); 
    47   for (; it != ite; ++it) indexToVecInfoMap[it->first].push_back(it->second); 
    48   computeDistributedIndex(indexToVecInfoMap, clientIntraComm, nbLvl-1); 
     50  indexToVecInfoMap.rehash(std::ceil(indexInfoMap.size()/indexToVecInfoMap.max_load_factor()));  
     51  typename Index2InfoTypeMap::const_iterator it = indexInfoMap.begin(), ite = indexInfoMap.end();  
     52  for (; it != ite; ++it) 
     53  { 
     54    indexToVecInfoMap[it->first].push_back(it->second); 
     55  }  
     56   
     57  computeDistributedIndex(indexToVecInfoMap, clientIntraComm, nbLvl-1);  
    4958} 
    5059 
     
    179188  { 
    180189    if (0 != recvNbIndexClientCount[idx]) 
     190    { 
    181191      recvIndexFromClients(recvRankClient[idx], recvIndexBuff+currentIndex, recvNbIndexClientCount[idx], commLevel, request); 
     192    } 
    182193    currentIndex += recvNbIndexClientCount[idx]; 
    183194  } 
     
    189200 
    190201  std::vector<MPI_Status> status(request.size()); 
     202 
     203  //printf("1(%d): calling wait all for %lu requests\n", clientRank, request.size()); 
     204 
    191205  MPI_Waitall(request.size(), &request[0], &status[0]); 
     206 
     207 
     208  //printf("               1(%d): calling wait all for %lu requests OK\n", clientRank, request.size()); 
    192209 
    193210  CArray<size_t,1>* tmpGlobalIndex; 
     
    294311 
    295312  std::vector<MPI_Status> statusOnReturn(requestOnReturn.size()); 
     313  //printf("2(%d): calling wait all for %lu requests\n", clientRank, requestOnReturn.size()); 
    296314  MPI_Waitall(requestOnReturn.size(), &requestOnReturn[0], &statusOnReturn[0]); 
     315 
     316  //printf("            2(%d): calling wait all for %lu requests OK\n", clientRank, requestOnReturn.size()); 
    297317 
    298318  Index2VectorInfoTypeMap indexToInfoMapping; 
     
    363383                                                            int level) 
    364384{ 
     385  //printf("in computeDistributedIndex(const Index2VectorInfoTypeMap& indexInfoMap, const MPI_Comm& commLevel, int level)\n"); 
    365386  int clientRank; 
    366387  MPI_Comm_rank(commLevel,&clientRank); 
     
    418439  } 
    419440 
     441  //printf("check 4 OK. clientRank = %d\n", clientRank); 
     442 
    420443  // Calculate from how many clients each client receive message. 
    421444  // Calculate size of buffer for receiving message 
     
    423446  sendRecvRank(level, sendBuff, sendNbIndexBuff, 
    424447               recvRankClient, recvNbIndexClientCount); 
     448  //printf("sendRecvRank OK\n"); 
    425449 
    426450  int recvNbIndexCount = 0; 
     
    435459    recvInfoBuff = new unsigned char[recvNbIndexCount*ProcessDHTElement<InfoType>::typeSize()]; 
    436460  } 
     461 
     462  //printf("check 5 OK. clientRank = %d\n", clientRank); 
    437463 
    438464  // If a client holds information about index and the corresponding which don't belong to it, 
     
    447473    { 
    448474      recvIndexFromClients(recvRankClient[idx], recvIndexBuff+currentIndex, recvNbIndexClientCount[idx], commLevel, request); 
     475 
    449476      recvInfoFromClients(recvRankClient[idx], 
    450477                          recvInfoBuff+currentIndex*ProcessDHTElement<InfoType>::typeSize(), 
    451478                          recvNbIndexClientCount[idx]*ProcessDHTElement<InfoType>::typeSize(), 
    452479                          commLevel, request); 
     480 
    453481    } 
    454482    currentIndex += recvNbIndexClientCount[idx]; 
    455483  } 
     484 
     485  //printf("check 6 OK. clientRank = %d\n", clientRank); 
    456486 
    457487  boost::unordered_map<int, size_t* >::iterator itbIndex = client2ClientIndex.begin(), itIndex, 
    458488                                                iteIndex = client2ClientIndex.end(); 
    459489  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 
     490  { 
    460491    sendIndexToClients(itIndex->first, itIndex->second, sendNbIndexBuff[itIndex->first-groupRankBegin], commLevel, request); 
     492 
     493  } 
     494 
     495  //printf("check 7 OK. clientRank = %d\n", clientRank); 
     496 
    461497  boost::unordered_map<int, unsigned char*>::iterator itbInfo = client2ClientInfo.begin(), itInfo, 
    462498                                                      iteInfo = client2ClientInfo.end(); 
    463499  for (itInfo = itbInfo; itInfo != iteInfo; ++itInfo) 
     500  { 
    464501    sendInfoToClients(itInfo->first, itInfo->second, sendNbInfo[itInfo->first-groupRankBegin], commLevel, request); 
    465502 
     503  } 
     504 
     505  //printf("check 8 OK. clientRank = %d\n", clientRank); 
    466506  std::vector<MPI_Status> status(request.size()); 
     507 
    467508  MPI_Waitall(request.size(), &request[0], &status[0]); 
    468509 
     
    480521    { 
    481522      ProcessDHTElement<InfoType>::unpackElement(infoValue, infoBuff, infoIndex); 
     523      unsigned long pp = *(recvIndexBuff+currentIndex+i); 
     524       
    482525      indexToInfoMapping[*(recvIndexBuff+currentIndex+i)].push_back(infoValue); 
    483526    } 
    484527    currentIndex += count; 
    485528  } 
     529 
     530  //printf("check 9 OK. clientRank = %d\n", clientRank); 
    486531 
    487532  if (0 != recvNbIndexCount) 
     
    498543      delete [] it->second; 
    499544 
     545  //printf("check 10 OK. clientRank = %d\n", clientRank); 
    500546  // Ok, now do something recursive 
    501547  if (0 < level) 
     
    523569  MPI_Request request; 
    524570  requestSendIndex.push_back(request); 
     571 
    525572  MPI_Isend(indices, indiceSize, MPI_UNSIGNED_LONG, 
    526573            clientDestRank, MPI_DHT_INDEX, clientIntraComm, &(requestSendIndex.back())); 
     
    541588  MPI_Request request; 
    542589  requestRecvIndex.push_back(request); 
     590 
    543591  MPI_Irecv(indices, indiceSize, MPI_UNSIGNED_LONG, 
    544592            clientSrcRank, MPI_DHT_INDEX, clientIntraComm, &(requestRecvIndex.back())); 
     
    560608  MPI_Request request; 
    561609  requestSendInfo.push_back(request); 
    562  
     610  //printf("MPI_IsendInfo(info, infoSize, MPI_CHAR,... char count = %d, dest = %d, buf_size = %d\n", infoSize, clientDestRank, sizeof(*info) ); 
    563611  MPI_Isend(info, infoSize, MPI_CHAR, 
    564612            clientDestRank, MPI_DHT_INFO, clientIntraComm, &(requestSendInfo.back())); 
     
    668716    ++nRequest; 
    669717  } 
    670  
     718   
     719  int clientRank; 
     720  MPI_Comm_rank(this->internalComm_,&clientRank); 
     721  //printf("4(%d): calling wait all for %lu requests\n", clientRank, sendNbRank.size()+recvNbRank.size()); 
    671722  MPI_Waitall(sendNbRank.size()+recvNbRank.size(), &request[0], &requestStatus[0]); 
     723  //printf("        4(%d): calling wait all for %lu requests OK\n", clientRank, sendNbRank.size()+recvNbRank.size()); 
    672724} 
    673725 
     
    686738                                                 std::vector<int>& recvNbRank, std::vector<int>& recvNbElements) 
    687739{ 
     740  int myRank; 
     741  MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     742  //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); 
    688743  int groupBegin = this->getGroupBegin()[level]; 
    689744 
     
    702757  for (int idx = 0; idx < recvBuffSize; ++idx) 
    703758  { 
     759    //printf("myRank = %d starts irecv with src = %d, tag = %d, idx = %d\n", myRank, recvRank[idx], MPI_DHT_INDEX_0, idx); 
    704760    MPI_Irecv(&recvBuff[0]+2*idx, 2, MPI_INT, 
    705761              recvRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]); 
     762    //printf("myRank = %d MPI_Irecv OK, idx = %d, nRequest = %d\n", myRank, idx, nRequest); 
    706763    ++nRequest; 
    707764  } 
     765 
     766  //printf("myRank = %d, check 1 OK\n", myRank); 
    708767 
    709768  for (int idx = 0; idx < sendBuffSize; ++idx) 
     
    716775  for (int idx = 0; idx < sendBuffSize; ++idx) 
    717776  { 
     777    //printf("myRank = %d starts isend with dest = %d, tag = %d, idx = %d\n", myRank, sendRank[idx], MPI_DHT_INDEX_0, idx); 
    718778    MPI_Isend(&sendBuff[idx*2], 2, MPI_INT, 
    719779              sendRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]); 
     780    //printf("myRank = %d MPI_Isend OK, idx = %d, nRequest = %d\n", myRank, idx, nRequest); 
    720781    ++nRequest; 
    721782  } 
    722783 
     784  MPI_Barrier(this->internalComm_); 
     785 
     786  //printf("myRank = %d, check 2 OK\n", myRank); 
     787 
     788  int clientRank; 
     789  MPI_Comm_rank(this->internalComm_,&clientRank); 
     790 
     791  //printf("5(%d): calling wait all for %lu requests\n", myRank, sendBuffSize+recvBuffSize); 
    723792  MPI_Waitall(sendBuffSize+recvBuffSize, &request[0], &requestStatus[0]); 
     793  //printf("            5(%d): calling wait all for %lu requests OK\n", myRank, sendBuffSize+recvBuffSize); 
     794  //printf("check 3 OK\n"); 
     795 
    724796  int nbRecvRank = 0, nbRecvElements = 0; 
    725797  recvNbRank.clear(); 
     
    733805    } 
    734806  } 
    735 } 
    736  
    737 } 
     807  //printf("check 4 OK\n"); 
     808} 
     809 
     810} 
  • XIOS/dev/branch_yushan/src/client_server_mapping.hpp

    r843 r1037  
    1414#include "mpi.hpp" 
    1515#include <boost/unordered_map.hpp> 
     16#ifdef _usingEP 
     17#include "ep_declaration.hpp" 
     18#endif 
     19 
    1620 
    1721namespace xios { 
  • XIOS/dev/branch_yushan/src/config/field_attribute.conf

    r998 r1037  
    1111DECLARE_ATTRIBUTE(int,       level) 
    1212DECLARE_ATTRIBUTE(int,       prec) 
    13 DECLARE_ATTRIBUTE(StdString, expr) 
    1413 
    1514DECLARE_ATTRIBUTE(bool,      enabled) 
     
    3433DECLARE_ATTRIBUTE(bool,      ts_enabled) 
    3534DECLARE_ATTRIBUTE(CDuration, ts_split_freq) 
    36  
    37 DECLARE_ATTRIBUTE(StdString, cell_methods) 
    38 DECLARE_ENUM4(cell_methods_mode,  overwrite, prefix, suffix, none) 
  • XIOS/dev/branch_yushan/src/config/interpolate_domain_attribute.conf

    r1014 r1037  
    11/* GLOBAL */ 
     2DECLARE_ATTRIBUTE(StdString, file) 
    23DECLARE_ATTRIBUTE(int, order) 
    34DECLARE_ATTRIBUTE(bool, renormalize) 
    45 
    56/* Write interpolation weights into file */ 
    6 DECLARE_ENUM3(mode,compute,read,read_or_compute) 
    7 DECLARE_ATTRIBUTE(StdString, weight_filename) 
    8 DECLARE_ATTRIBUTE(bool, write_weight) 
     7DECLARE_ENUM2(mode,write,read) 
  • XIOS/dev/branch_yushan/src/context_client.cpp

    r1033 r1037  
    5050        for (int i = 0; i < serverByClient; i++) 
    5151          ranksServerLeader.push_back(rankStart + i); 
    52  
    53         ranksServerNotLeader.resize(0); 
    5452      } 
    5553      else 
     
    6260          if (clientRank % (clientByServer + 1) == 0) 
    6361            ranksServerLeader.push_back(clientRank / (clientByServer + 1)); 
    64           else 
    65             ranksServerNotLeader.push_back(clientRank / (clientByServer + 1)); 
    6662        } 
    6763        else 
     
    7066          if (rank % clientByServer == 0) 
    7167            ranksServerLeader.push_back(remain + rank / clientByServer); 
    72           else 
    73             ranksServerNotLeader.push_back(remain + rank / clientByServer); 
    74         }         
     68        } 
    7569      } 
    7670 
     
    8579    { 
    8680      list<int> ranks = event.getRanks(); 
    87  
    8881      if (!event.isEmpty()) 
    8982      { 
    9083        list<int> sizes = event.getSizes(); 
    9184 
    92         // We force the getBuffers call to be non-blocking on the servers 
    93         list<CBufferOut*> buffList; 
    94         bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient); 
    95  
    96         if (couldBuffer) 
    97         { 
    98           event.send(timeLine, sizes, buffList); 
    99  
    100           checkBuffers(ranks); 
    101  
    102           if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode 
    103           { 
    104             waitEvent(ranks); 
    105             CContext::setCurrent(context->getId()); 
    106           } 
    107         } 
    108         else 
    109         { 
    110           tmpBufferedEvent.ranks = ranks; 
    111           tmpBufferedEvent.sizes = sizes; 
    112  
    113           for (list<int>::const_iterator it = sizes.begin(); it != sizes.end(); it++) 
    114             tmpBufferedEvent.buffers.push_back(new CBufferOut(*it)); 
    115  
    116           event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers); 
    117         } 
     85        list<CBufferOut*> buffList = getBuffers(ranks, sizes); 
     86 
     87        event.send(timeLine, sizes, buffList); 
     88 
     89        checkBuffers(ranks); 
     90      } 
     91 
     92      if (isAttachedModeEnabled()) 
     93      { 
     94        waitEvent(ranks); 
     95        CContext::setCurrent(context->getId()); 
    11896      } 
    11997 
    12098      timeLine++; 
    121     } 
    122  
    123     /*! 
    124      * Send the temporarily buffered event (if any). 
    125      * 
    126      * \return true if a temporarily buffered event could be sent, false otherwise  
    127      */ 
    128     bool CContextClient::sendTemporarilyBufferedEvent() 
    129     { 
    130       bool couldSendTmpBufferedEvent = false; 
    131  
    132       if (hasTemporarilyBufferedEvent()) 
    133       { 
    134         list<CBufferOut*> buffList; 
    135         if (getBuffers(tmpBufferedEvent.ranks, tmpBufferedEvent.sizes, buffList, true)) // Non-blocking call 
    136         { 
    137           list<CBufferOut*>::iterator it, itBuffer; 
    138  
    139           for (it = tmpBufferedEvent.buffers.begin(), itBuffer = buffList.begin(); it != tmpBufferedEvent.buffers.end(); it++, itBuffer++) 
    140             (*itBuffer)->put((char*)(*it)->start(), (*it)->count()); 
    141  
    142           checkBuffers(tmpBufferedEvent.ranks); 
    143  
    144           tmpBufferedEvent.clear(); 
    145  
    146           couldSendTmpBufferedEvent = true; 
    147         } 
    148       } 
    149  
    150       return couldSendTmpBufferedEvent; 
    15199    } 
    152100 
     
    159107    { 
    160108      parentServer->server->setPendingEvent(); 
     109      size_t pendingmapSize; 
    161110      while (checkBuffers(ranks)) 
    162111      { 
    163         parentServer->server->listen(); 
    164         parentServer->server->checkPendingRequest(); 
     112        parentServer->server->listen();  
     113        parentServer->server->checkPendingRequest();  
    165114      } 
    166115 
    167116      while (parentServer->server->hasPendingEvent()) 
    168117      { 
    169        parentServer->server->eventLoop(); 
     118       parentServer->server->eventLoop(); //printf("parentServer->server->eventLoop()\n"); 
    170119      } 
    171120    } 
    172121 
    173122    /*! 
    174      * Get buffers for each connection to the servers. This function blocks until there is enough room in the buffers unless 
    175      * it is explicitly requested to be non-blocking. 
    176      * 
    177      * \param [in] serverList list of rank of connected server 
    178      * \param [in] sizeList size of message corresponding to each connection 
    179      * \param [out] retBuffers list of buffers that can be used to store an event 
    180      * \param [in] nonBlocking whether this function should be non-blocking 
    181      * \return whether the already allocated buffers could be used 
     123    Setup buffer for each connection to server and verify their state to put content into them 
     124    \param [in] serverList list of rank of connected server 
     125    \param [in] sizeList size of message corresponding to each connection 
     126    \return List of buffer input which event can be placed 
    182127    */ 
    183     bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking /*= false*/) 
     128    list<CBufferOut*> CContextClient::getBuffers(list<int>& serverList, list<int>& sizeList) 
    184129    { 
    185       list<int>::const_iterator itServer, itSize; 
     130      list<int>::iterator itServer, itSize; 
    186131      list<CClientBuffer*> bufferList; 
    187       map<int,CClientBuffer*>::const_iterator it; 
     132      map<int,CClientBuffer*>::iterator it; 
    188133      list<CClientBuffer*>::iterator itBuffer; 
     134      list<CBufferOut*>  retBuffer; 
    189135      bool areBuffersFree; 
    190136 
     
    212158          context->server->listen(); 
    213159        } 
    214       } while (!areBuffersFree && !nonBlocking); 
     160      } while (!areBuffersFree); 
    215161      CTimer::get("Blocking time").suspend(); 
    216162 
    217       if (areBuffersFree) 
    218       { 
    219         for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++) 
    220           retBuffers.push_back((*itBuffer)->getBuffer(*itSize)); 
    221       } 
    222  
    223       return areBuffersFree; 
     163      for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++) 
     164      { 
     165        retBuffer.push_back((*itBuffer)->getBuffer(*itSize)); 
     166      } 
     167      return retBuffer; 
    224168   } 
    225169 
     
    291235       if (ratio < minBufferSizeEventSizeRatio) minBufferSizeEventSizeRatio = ratio; 
    292236     } 
     237     #ifdef _usingMPI 
    293238     MPI_Allreduce(MPI_IN_PLACE, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 
    294  
     239     #elif _usingEP 
     240     MPI_Allreduce(&minBufferSizeEventSizeRatio, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 
     241     #endif 
     242      
    295243     if (minBufferSizeEventSizeRatio < 1.0) 
    296244       ERROR("void CContextClient::setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize)", 
     
    301249                          + 1;                                   // the other local buffer might contain only one event 
    302250   } 
    303  
    304   /*! 
    305   Get leading server in the group of connected server 
    306   \return ranks of leading servers 
    307   */ 
    308   const std::list<int>& CContextClient::getRanksServerNotLeader(void) const 
    309   { 
    310     return ranksServerNotLeader; 
    311   } 
    312  
    313   /*! 
    314   Check if client connects to leading server 
    315   \return connected(true), not connected (false) 
    316   */ 
    317   bool CContextClient::isServerNotLeader(void) const 
    318   { 
    319     return !ranksServerNotLeader.empty(); 
    320   } 
    321251 
    322252  /*! 
     
    354284   { 
    355285     map<int,CClientBuffer*>::iterator itBuff; 
    356      bool stop = false; 
    357  
    358      CTimer::get("Blocking time").resume(); 
    359      while (hasTemporarilyBufferedEvent()) 
    360      { 
    361        checkBuffers(); 
    362        sendTemporarilyBufferedEvent(); 
    363      } 
    364      CTimer::get("Blocking time").suspend(); 
     286     bool stop = true; 
    365287 
    366288     CEventClient event(CContext::GetType(), CContext::EVENT_ID_CONTEXT_FINALIZE); 
     
    376298 
    377299     CTimer::get("Blocking time").resume(); 
    378      while (!stop) 
     300     while (stop) 
    379301     { 
    380302       checkBuffers(); 
    381        if (hasTemporarilyBufferedEvent()) 
    382          sendTemporarilyBufferedEvent(); 
    383  
    384        stop = true; 
    385        for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest(); 
     303       stop = false; 
     304       for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop |= itBuff->second->hasPendingRequest(); 
    386305     } 
    387306     CTimer::get("Blocking time").suspend(); 
  • XIOS/dev/branch_yushan/src/context_client.hpp

    r1033 r1037  
    1010#include "mpi.hpp" 
    1111#include "registry.hpp" 
     12#ifdef _usingEP 
     13//#include "ep_declaration.hpp" 
     14#endif 
     15 
    1216 
    1317namespace xios 
     
    3135      // Send event to server 
    3236      void sendEvent(CEventClient& event); 
    33       bool sendTemporarilyBufferedEvent(); 
    3437      void waitEvent(list<int>& ranks); 
    3538 
    36       // Functions to set/get buffers 
    37       bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 
     39      // Functions relates to set/get buffers 
     40      list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList); 
    3841      void newBuffer(int rank); 
    3942      bool checkBuffers(list<int>& ranks); 
     
    4245 
    4346      bool isServerLeader(void) const; 
    44       bool isServerNotLeader(void) const; 
    4547      const std::list<int>& getRanksServerLeader(void) const; 
    46       const std::list<int>& getRanksServerNotLeader(void) const; 
    4748 
    4849      bool isAttachedModeEnabled() const; 
    49  
    50       bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); }; 
    5150 
    5251      // Close and finalize context client 
     
    7978      StdSize maxBufferedEvents; 
    8079 
    81       struct { 
    82         std::list<int> ranks, sizes; 
    83         std::list<CBufferOut*> buffers; 
    84  
    85         bool isEmpty() const { return ranks.empty(); }; 
    86         void clear() { 
    87           ranks.clear(); 
    88           sizes.clear(); 
    89  
    90           for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++) 
    91             delete *it; 
    92  
    93           buffers.clear(); 
    94         }; 
    95       } tmpBufferedEvent; //! Event temporarily buffered (used only on the server) 
    96  
    9780      //! Context for server (Only used in attached mode) 
    9881      CContext* parentServer; 
     
    10083      //! List of server ranks for which the client is leader 
    10184      std::list<int> ranksServerLeader; 
    102  
    103       //! List of server ranks for which the client is not leader 
    104       std::list<int> ranksServerNotLeader; 
    10585 
    10686    public: // Some function should be removed in the future 
  • XIOS/dev/branch_yushan/src/context_server.cpp

    r1033 r1037  
    5757  } 
    5858 
    59   bool CContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 
     59  bool CContextServer::eventLoop(void) 
    6060  { 
    6161    listen(); 
    6262    checkPendingRequest(); 
    63     if (enableEventsProcessing) 
    64       processEvents(); 
     63    processEvents(); 
    6564    return finished; 
    6665  } 
     
    7776    for(rank=0;rank<commSize;rank++) 
    7877    { 
     78      //printf("in CContextServer::listen, rank = %d, commSize = %d, pendingRequest.find(rank) = %d\n", rank, commSize, pendingRequest.find(rank)); 
    7979      if (pendingRequest.find(rank)==pendingRequest.end()) 
    8080      { 
     
    8585        { 
    8686          it=buffers.find(rank); 
     87           
    8788          if (it==buffers.end()) // Receive the buffer size and allocate the buffer 
    8889          { 
     
    9192            mapBufferSize_.insert(std::make_pair(rank, buffSize)); 
    9293            it=(buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer(buffSize)))).first; 
     94            //printf("find message, is buffer end, receiving, buffSize = %d, rank = %d, commSize = %d\n", buffSize, rank, commSize); 
    9395          } 
    9496          else 
    9597          { 
     98             
    9699            MPI_Get_count(&status,MPI_CHAR,&count); 
    97100            if (it->second->isBufferFree(count)) 
     
    100103              MPI_Irecv(addr,count,MPI_CHAR,rank,20,interComm,&pendingRequest[rank]); 
    101104              bufferRequest[rank]=addr; 
     105              //printf("find message, i-receiving to buffer %p, rank = %d, commSize = %d\n", addr, rank, commSize); 
    102106            } 
    103107          } 
     
    116120    int count; 
    117121    MPI_Status status; 
     122 
     123    //printf("enter checkPendingRequest\n"); 
    118124 
    119125    for(it=pendingRequest.begin();it!=pendingRequest.end();it++) 
     
    185191         // The best way to properly solve this problem will be to use the event scheduler also in attached mode 
    186192         // for now just set up a MPI barrier 
    187          if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ; 
     193         if (!CServer::eventScheduler) MPI_Barrier(intraComm) ; 
    188194 
    189195         CTimer::get("Process events").resume(); 
  • XIOS/dev/branch_yushan/src/context_server.hpp

    r1033 r1037  
    1515 
    1616    CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ; 
    17     bool eventLoop(bool enableEventsProcessing = true); 
     17    bool eventLoop(void) ; 
    1818    void listen(void) ; 
    1919    void checkPendingRequest(void) ; 
  • XIOS/dev/branch_yushan/src/cxios.cpp

    r1029 r1037  
    3030  bool CXios::isOptPerformance = true; 
    3131  CRegistry* CXios::globalRegistry = 0; 
    32   double CXios::recvFieldTimeout = 10.0; 
    3332 
    3433  //! Parse configuration file and create some objects from it 
    3534  void CXios::initialize() 
    3635  { 
     36     
     37     
    3738    set_new_handler(noMemory); 
    3839    parseFile(rootFile); 
     
    6465    bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor); 
    6566    minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double)); 
    66     recvFieldTimeout = getin<double>("recv_field_timeout", 10.0); 
    67     if (recvFieldTimeout < 0.0) 
    68       ERROR("CXios::parseXiosConfig()", "recv_field_timeout cannot be negative."); 
    69  
    70     globalComm=MPI_COMM_WORLD ; 
     67 
     68    int num_ep; 
     69    if(isClient)  
     70    {  
     71      num_ep = 1; 
     72    } 
     73     
     74    if(isServer)  
     75    {  
     76      num_ep = 1;  
     77    } 
     78     
     79    MPI_Info info; 
     80    MPI_Comm *ep_comm; 
     81    MPI_Comm_create_endpoints(MPI_COMM_WORLD, num_ep, info, ep_comm);  
     82       
     83    globalComm = ep_comm[0]; 
     84     
     85    int tmp_size; 
     86    MPI_Comm_size(globalComm, &tmp_size); 
     87    printf("globalcomm size = %d\n", tmp_size); 
     88 
     89     
    7190  } 
    7291 
     
    7998  void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 
    8099  { 
     100    isClient = true; 
     101     
    81102    initialize() ; 
    82103 
    83     isClient = true; 
    84  
     104    
    85105    CClient::initialize(codeId,localComm,returnComm) ; 
    86106    if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; 
     
    89109    // and the clients are also servers 
    90110    isServer = !usingServer; 
    91  
     111     
     112     
    92113    if (printLogs2Files) 
    93114    { 
     
    100121      CClient::openErrorStream(); 
    101122    } 
     123     
     124    
    102125  } 
    103126 
     
    123146  void CXios::initServer() 
    124147  { 
     148    int initialized; 
     149    MPI_Initialized(&initialized); 
     150    if (initialized) CServer::is_MPI_Initialized=true ; 
     151    else CServer::is_MPI_Initialized=false ; 
     152       
     153  
     154    if(!CServer::is_MPI_Initialized) 
     155    { 
     156      MPI_Init(NULL, NULL); 
     157    } 
     158       
    125159    set_new_handler(noMemory); 
    126160    std::set<StdString> parseList; 
     
    133167  void CXios::initServerSide(void) 
    134168  { 
    135     initServer(); 
     169     
    136170    isClient = false; 
    137171    isServer = true; 
    138  
     172     
     173    initServer(); 
     174     
     175     
    139176    // Initialize all aspects MPI 
    140177    CServer::initialize(); 
    141178    if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ; 
    142179     
     180       
    143181    if (printLogs2Files) 
    144182    { 
     
    151189      CServer::openErrorStream(); 
    152190    } 
    153  
     191     
    154192    // Enter the loop to listen message from Client 
    155193    CServer::eventLoop(); 
     194     
     195    printf("server eventloop OK\n"); 
    156196 
    157197    // Finalize 
     
    162202       delete globalRegistry ; 
    163203     } 
     204      
     205     printf("server globalRegistry OK\n"); 
     206      
    164207    CServer::finalize(); 
     208     
     209    printf("server finalize OK\n"); 
     210     
    165211    CServer::closeInfoStream(); 
    166212  } 
  • XIOS/dev/branch_yushan/src/cxios.hpp

    r1029 r1037  
    55#include "mpi.hpp" 
    66#include "registry.hpp" 
     7#ifdef _usingEP 
     8//#include "ep_declaration.hpp" 
     9#endif 
     10 
    711 
    812namespace xios 
     
    4549     static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 
    4650     static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 
    47      static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field 
    4851 
    4952    public: 
  • XIOS/dev/branch_yushan/src/declare_ref_func.hpp

    r996 r1037  
    5151    SuperClassAttribute::setAttributes(refer_ptr, apply);              \ 
    5252  }                                                                    \ 
    53   if (this->hasAttribute("name") && this->name.isEmpty()) \ 
    54     this->name.setValue(this->get##type##OutputName());                \ 
    5553}                                                                      \ 
    5654                                                                       \ 
     
    104102      tmp_ptr = refer_ptr;                                             \ 
    105103      refer_ptr = tmp_ptr->getDirect##type##Reference();               \ 
    106       if (refer_ptr->hasAutoGeneratedId() &&                           \ 
    107           refer_ptr->hasDirect##type##Reference())                     \ 
     104      if (refer_ptr->hasDirect##type##Reference())                     \ 
    108105        nameRef = refer_ptr->name_##_ref;                              \ 
    109       else {                                                           \ 
    110         nameRef = refer_ptr->getId(); break;                           \ 
    111       }                                                                \ 
    112106      if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr))        \ 
    113107      {                                                                \ 
  • XIOS/dev/branch_yushan/src/dht_auto_indexing.cpp

    r1002 r1037  
    7979    for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx) 
    8080    { 
    81 //      (itIdx->second)[0] = beginIndexOnProc_ + idx; 
    82       (itIdx->second)[1] = beginIndexOnProc_ + idx; 
     81      (itIdx->second)[0] = beginIndexOnProc_ + idx; 
    8382      globalIndex_[idx] = beginIndexOnProc_ + idx; 
    8483      ++idx ; 
  • XIOS/dev/branch_yushan/src/dht_auto_indexing.hpp

    r924 r1037  
    1212 
    1313#include "client_client_dht_template.hpp" 
     14#ifdef _usingEP 
     15#include "ep_declaration.hpp" 
     16#endif 
    1417 
    1518namespace xios 
  • XIOS/dev/branch_yushan/src/event_scheduler.cpp

    r591 r1037  
    22#include "xios_spl.hpp" 
    33#include "mpi.hpp" 
     4 
    45 
    56namespace xios 
  • XIOS/dev/branch_yushan/src/event_scheduler.hpp

    r591 r1037  
    44#include "xios_spl.hpp" 
    55#include "mpi.hpp" 
     6#ifdef _usingEP 
     7#include "ep_declaration.hpp" 
     8#endif 
     9 
    610 
    711namespace xios 
  • XIOS/dev/branch_yushan/src/filter/file_writer_filter.cpp

    r1018 r1037  
    22#include "exception.hpp" 
    33#include "field.hpp" 
    4 #include "utils.hpp" 
    54 
    65namespace xios 
     
    1716  void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    1817  { 
    19     bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() &&  
    20                                !field->default_value.isEmpty() &&  
    21                                field->detect_missing_value == true); 
    22     if (ignoreMissingValue) 
    23     { 
    24       double missingValue = field->default_value; 
    25       size_t nbData = data[0]->data.numElements(); 
    26       for (size_t idx = 0; idx < nbData; ++idx) 
    27       { 
    28         if (NumTraits<double>::isnan(data[0]->data(idx))) 
    29           data[0]->data(idx) = missingValue; 
    30       } 
    31     }     
    32  
    3318    field->sendUpdateData(data[0]->data); 
    3419  } 
  • XIOS/dev/branch_yushan/src/filter/filter.cpp

    r1006 r1037  
    55  CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine) 
    66    : CInputPin(gc, inputSlotsCount) 
    7     , COutputPin(gc) 
     7    , COutputPin() 
    88    , engine(engine) 
    99    , inputSlotCount(inputSlotCount) 
     
    1414    CDataPacketPtr outputPacket = engine->apply(data); 
    1515    if (outputPacket) 
    16       onOutputReady(outputPacket); 
    17   } 
    18  
    19   void CFilter::setInputTrigger(size_t inputSlot, COutputPin* trigger) 
    20   { 
    21     // Was the filter already triggerable? If not, we need to inform 
    22     // all downstream filters. 
    23     bool wasTriggerable = canBeTriggered(); 
    24  
    25     CInputPin::setInputTrigger(inputSlot, trigger); 
    26  
    27     if (!wasTriggerable) 
    28       setOutputTriggers(); 
    29   } 
    30  
    31   void CFilter::trigger(Time timestamp) 
    32   { 
    33     CInputPin::trigger(timestamp); 
    34  
    35     COutputPin::trigger(timestamp); 
    36   } 
    37  
    38   bool CFilter::canBeTriggered() const 
    39   { 
    40     return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); 
     16      deliverOuput(outputPacket); 
    4117  } 
    4218} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/filter.hpp

    r1006 r1037  
    2626      CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine); 
    2727 
    28       /*! 
    29        * Sets the trigger for a specific input slot. 
    30        * 
    31        * \param inputSlot the input slot number 
    32        * \param trigger the corresponding trigger 
    33        */ 
    34       void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger); 
    35  
    36       /*! 
    37        * Triggers the filter for the specified timestamp. 
    38        * 
    39        * \param timestamp the timestamp for which we are triggering the filter 
    40        */ 
    41       void virtual trigger(Time timestamp); 
    42  
    43       /*! 
    44        * Tests if the filter can be triggered. 
    45        * 
    46        * \return true if the filter can be triggered 
    47        */ 
    48       bool virtual canBeTriggered() const; 
    49  
    5028    protected: 
    5129      IFilterEngine* engine; //!< The filter engine, might be the filter itself 
  • XIOS/dev/branch_yushan/src/filter/garbage_collector.cpp

    r1006 r1037  
    33namespace xios 
    44{ 
    5   void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) 
     5  void CGarbageCollector::registerFilter(CInputPin* inputPin, Time timestamp) 
    66  { 
    7     registeredObjects[timestamp].insert(Object); 
     7    registeredFilters[timestamp].insert(inputPin); 
    88  } 
    99 
    10   void CGarbageCollector::unregisterObject(InvalidableObject* Object, Time timestamp) 
     10  void CGarbageCollector::unregisterFilter(CInputPin* inputPin, Time timestamp) 
    1111  { 
    12     std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.find(timestamp); 
    13     if (it != registeredObjects.end()) 
    14       it->second.erase(Object); 
     12    std::map<Time, std::set<CInputPin*> >::iterator it = registeredFilters.find(timestamp); 
     13    if (it != registeredFilters.end()) 
     14      it->second.erase(inputPin); 
    1515  } 
    1616 
    1717  void CGarbageCollector::invalidate(Time timestamp) 
    1818  { 
    19     std::map<Time, std::set<InvalidableObject*> >::iterator it    = registeredObjects.begin(), 
    20                                                             itEnd = registeredObjects.lower_bound(timestamp); 
     19    std::map<Time, std::set<CInputPin*> >::iterator it    = registeredFilters.begin(), 
     20                                                    itEnd = registeredFilters.lower_bound(timestamp); 
    2121    for (; it != itEnd; ++it) 
    2222    { 
    23       std::set<InvalidableObject*>::iterator itObject    = it->second.begin(), 
    24                                              itObjectEnd = it->second.end(); 
    25       for (; itObject != itObjectEnd; ++itObject) 
    26         (*itObject)->invalidate(timestamp); 
     23      std::set<CInputPin*>::iterator itFilter    = it->second.begin(), 
     24                                     itFilterEnd = it->second.end(); 
     25      for (; itFilter != itFilterEnd; ++itFilter) 
     26        (*itFilter)->invalidate(timestamp); 
    2727    } 
    28     registeredObjects.erase(registeredObjects.begin(), itEnd); 
     28    registeredFilters.erase(registeredFilters.begin(), itEnd); 
    2929  } 
    3030} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/garbage_collector.hpp

    r1006 r1037  
    55#include <set> 
    66 
    7 #include "date.hpp" 
     7#include "input_pin.hpp" 
    88 
    99namespace xios 
    1010{ 
    11   /*! 
    12    * Interface shared by all objects that might need to invalidate packets. 
    13    */ 
    14   struct InvalidableObject 
    15   { 
    16     /*! 
    17      * Removes all pending packets which are older than the specified timestamp. 
    18      * 
    19      * \param timestamp the timestamp used for invalidation 
    20      */ 
    21     void virtual invalidate(Time timestamp) = 0; 
    22   }; // struct InvalidableObject 
    23  
    2411  /*! 
    2512   * A basic garbage collector which ensures no old packets linger in the filter graph. 
     
    3522 
    3623      /*! 
    37        * Registers an object for a specified timestamp. 
     24       * Registers a filter for a specified timestamp. 
    3825       * 
    39        * \param object the object to register 
    40        * \param timestamp the timestamp for which the object is registered 
     26       * \param inputPin the input pin of the filter to register 
     27       * \param timestamp the timestamp for which the filter is registered 
    4128       */ 
    42       void registerObject(InvalidableObject* object, Time timestamp); 
     29      void registerFilter(CInputPin* inputPin, Time timestamp); 
    4330 
    4431      /*! 
    45        * Removes a object previously registered for a specified timestamp. 
     32       * Removes a filter previously registered for a specified timestamp. 
    4633       * 
    47        * \param object the object to unregister 
    48        * \param timestamp the timestamp for which the object is unregistered 
     34       * \param inputPin the input pin of the filter to unregister 
     35       * \param timestamp the timestamp for which the filter is unregistered 
    4936       */ 
    50       void unregisterObject(InvalidableObject* object, Time timestamp); 
     37      void unregisterFilter(CInputPin* inputPin, Time timestamp); 
    5138 
    5239      /*! 
    53        * Ensures all registered objects invalidate packets older than the specified timestamp. 
     40       * Ensures all registered filters invalidate packets older than the specified timestamp. 
    5441       * 
    5542       * \param timestamp the timestamp used for invalidation 
     
    6148      CGarbageCollector& operator=(const CGarbageCollector&); 
    6249 
    63       std::map<Time, std::set<InvalidableObject*> > registeredObjects; //!< Currently registered objects 
     50      std::map<Time, std::set<CInputPin*> > registeredFilters; //!< Currently registered filters 
    6451  }; // class CGarbageCollector 
    6552} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/input_pin.cpp

    r1006 r1037  
    11#include "input_pin.hpp" 
    2 #include "output_pin.hpp" 
    32#include "garbage_collector.hpp" 
    43#include "exception.hpp" 
     
    98    : gc(gc) 
    109    , slotsCount(slotsCount) 
    11     , triggers(slotsCount) 
    12     , hasTriggers(false) 
    1310  { /* Nothing to do */ } 
    1411 
     
    2623    { 
    2724      it = inputs.insert(std::make_pair(packet->timestamp, InputBuffer(slotsCount))).first; 
    28       gc.registerObject(this, packet->timestamp); 
     25      gc.registerFilter(this, packet->timestamp); 
    2926    } 
     27 
    3028    it->second.slotsFilled++; 
    3129    it->second.packets[inputSlot] = packet; 
     
    3432    { 
    3533      // Unregister before calling onInputReady in case the filter registers again 
    36       gc.unregisterObject(this, packet->timestamp); 
     34      gc.unregisterFilter(this, packet->timestamp); 
    3735      onInputReady(it->second.packets); 
    3836      inputs.erase(it); 
    3937    } 
    40   } 
    41  
    42   void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger) 
    43   { 
    44     if (inputSlot >= slotsCount) 
    45       ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)", 
    46             "The input slot " << inputSlot << " does not exist."); 
    47     if (triggers[inputSlot]) 
    48       ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)", 
    49             "The trigger for input slot " << inputSlot << " has already been set."); 
    50  
    51     triggers[inputSlot] = trigger; 
    52     hasTriggers = true; 
    53   } 
    54  
    55   void CInputPin::trigger(Time timestamp) 
    56   { 
    57     if (hasTriggers) // Don't use canBeTriggered here, this function is virtual and can be overriden 
    58     { 
    59       std::map<Time, InputBuffer>::iterator it = inputs.find(timestamp); 
    60       bool nothingReceived = (it == inputs.end()); 
    61  
    62       for (size_t s = 0; s < slotsCount; s++) 
    63       { 
    64         if (triggers[s] && (nothingReceived || !it->second.packets[s])) 
    65           triggers[s]->trigger(timestamp); 
    66       } 
    67     } 
    68   } 
    69  
    70   bool CInputPin::canBeTriggered() const 
    71   { 
    72     return hasTriggers; 
    7338  } 
    7439 
  • XIOS/dev/branch_yushan/src/filter/input_pin.hpp

    r1006 r1037  
    55#include <map> 
    66 
    7 #include "garbage_collector.hpp" 
    87#include "data_packet.hpp" 
    98 
    109namespace xios 
    1110{ 
    12   class COutputPin; 
     11  class CGarbageCollector; 
    1312 
    1413  /*! 
    1514   * An input pin handles the data packets received by a filter. 
    1615   */ 
    17   class CInputPin : public InvalidableObject 
     16  class CInputPin 
    1817  { 
    1918    public: 
     
    2827 
    2928      /*! 
    30        * Sets the trigger for a specific input slot. 
    31        * 
    32        * \param inputSlot the input slot number 
    33        * \param trigger the corresponding trigger 
    34        */ 
    35       void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger); 
    36  
    37       /*! 
    3829       * Receives a data packet from an upstream filter on 
    3930       * the specified input slot. 
     
    4637 
    4738      /*! 
    48        * Triggers the input of any buffered packet for the specified timestamp. 
    49        * 
    50        * \param timestamp the timestamp for which we are triggering the input 
    51        */ 
    52       void virtual trigger(Time timestamp); 
    53  
    54       /*! 
    55        * Tests if the pin can be triggered. 
    56        * 
    57        * \return true if the pin can be triggered 
    58        */ 
    59       bool virtual canBeTriggered() const; 
    60  
    61       /*! 
    6239       * Removes all pending packets which are older than the specified timestamp. 
    6340       * 
     
    6744 
    6845    protected: 
     46      CGarbageCollector& gc; //!< The garbage collector associated to the input pin 
     47 
    6948      /*! 
    7049       * Function triggered when all slots have been filled for a specific timestamp. 
     
    9675      }; 
    9776 
    98       CGarbageCollector& gc; //!< The garbage collector associated to the input pin 
    99  
    10077      size_t slotsCount; //!< The number of slots 
    10178 
    10279      //! Input buffer, store the packets until all slots are full for a timestep 
    10380      std::map<Time, InputBuffer> inputs; 
    104  
    105       //! Store the triggers corresponding to the input slots 
    106       std::vector<COutputPin*> triggers; 
    107  
    108       //! Whether some triggers have been set 
    109       bool hasTriggers; 
    11081  }; // class CInputPin 
    11182} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/output_pin.cpp

    r1006 r1037  
    44namespace xios 
    55{ 
    6   COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/) 
    7     : gc(gc) 
    8     , manualTrigger(manualTrigger) 
    9   { /* Nothing to do */ } 
    10  
    116  void COutputPin::connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot) 
    127  { 
     
    1611 
    1712    outputs.push_back(std::make_pair(inputPin, inputSlot)); 
    18  
    19     if (canBeTriggered()) 
    20       inputPin->setInputTrigger(inputSlot, this); 
    21   } 
    22  
    23   void COutputPin::onOutputReady(CDataPacketPtr packet) 
    24   { 
    25     if (!packet) 
    26       ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)", 
    27             "The packet cannot be null."); 
    28  
    29     if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden 
    30     { 
    31       outputPackets[packet->timestamp] = packet; 
    32       gc.registerObject(this, packet->timestamp); 
    33     } 
    34     else 
    35       deliverOuput(packet); 
    3613  } 
    3714 
     
    4421    std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 
    4522    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
     23    { 
    4624      it->first->setInput(it->second, packet); 
    47   } 
    48  
    49   void COutputPin::trigger(Time timestamp) 
    50   { 
    51     if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden 
    52     { 
    53       std::map<Time, CDataPacketPtr>::iterator it = outputPackets.find(timestamp); 
    54       if (it != outputPackets.end()) 
    55       { 
    56         gc.unregisterObject(this, timestamp); 
    57         deliverOuput(it->second); 
    58         outputPackets.erase(it); 
    59       } 
    6025    } 
    6126  } 
    62  
    63   bool COutputPin::canBeTriggered() const 
    64   { 
    65     return manualTrigger; 
    66   } 
    67  
    68   void COutputPin::setOutputTriggers() 
    69   { 
    70     std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 
    71     for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
    72       it->first->setInputTrigger(it->second, this); 
    73   } 
    74  
    75   void COutputPin::invalidate(Time timestamp) 
    76   { 
    77     outputPackets.erase(outputPackets.begin(), outputPackets.lower_bound(timestamp)); 
    78   } 
    7927} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/output_pin.hpp

    r1006 r1037  
    22#define __XIOS_COutputPin__ 
    33 
    4 #include "garbage_collector.hpp" 
    54#include "input_pin.hpp" 
    65 
     
    109   * An output pin handles the connections with downstream filters. 
    1110   */ 
    12   class COutputPin : public InvalidableObject 
     11  class COutputPin 
    1312  { 
    1413    public: 
    15       /*! 
    16        * Constructs an ouput pin with manual or automatic trigger 
    17        * and an associated garbage collector. 
    18        * 
    19        * \param gc the garbage collector associated with this ouput pin 
    20        * \param slotsCount the number of slots 
    21        */ 
    22       COutputPin(CGarbageCollector& gc, bool manualTrigger = false); 
    23  
    2414      /*! 
    2515       * Connects to a specific slot of the input pin of a downstream filter. 
     
    3121      void connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot); 
    3222 
    33       /*! 
    34        * Triggers the output of any buffered packet for the specified timestamp. 
    35        * 
    36        * \param timestamp the timestamp for which we are triggering the output 
    37        */ 
    38       void virtual trigger(Time timestamp); 
    39  
    40       /*! 
    41        * Tests if the pin can be triggered. 
    42        * 
    43        * \return true if the pin can be triggered 
    44        */ 
    45       bool virtual canBeTriggered() const; 
    46  
    47       /*! 
    48        * Removes all pending packets which are older than the specified timestamp. 
    49        * 
    50        * \param timestamp the timestamp used for invalidation 
    51        */ 
    52       void virtual invalidate(Time timestamp); 
    53  
    5423    protected: 
    55       /*! 
    56        * Function triggered when a packet is ready to be delivered. 
    57        * 
    58        * \param packet the packet ready for output 
    59        */ 
    60       void onOutputReady(CDataPacketPtr packet); 
    61  
    62       /*! 
    63        * Informs the downstream pins that this output pin should be triggered. 
    64        */ 
    65       void setOutputTriggers(); 
    66  
    67     private: 
    6824      /*! 
    6925       * Delivers an output packet to the downstreams filter. 
     
    7329      void deliverOuput(CDataPacketPtr packet); 
    7430 
    75       CGarbageCollector& gc; //!< The garbage collector associated to the output pin 
    76  
    77       //!< Whether the ouput should be triggered manually 
    78       bool manualTrigger; 
    79  
     31    private: 
    8032      //!< The list of connected filters and the corresponding slot numbers 
    8133      std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> > outputs; 
    82  
    83       //! Output buffer, store the packets until the output is triggered 
    84       std::map<Time, CDataPacketPtr> outputPackets; 
    8534  }; // class COutputPin 
    8635} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/source_filter.cpp

    r1018 r1037  
    33#include "exception.hpp" 
    44#include "calendar_util.hpp" 
    5 #include <limits>  
    65 
    76namespace xios 
    87{ 
    9   CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
    10                                const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 
    11                                bool hasMissingValue /*= false*/, 
    12                                double defaultValue /*= 0.0*/) 
    13     : COutputPin(gc, manualTrigger) 
    14     , grid(grid) 
     8  CSourceFilter::CSourceFilter(CGrid* grid, const CDuration offset /*= NoneDu*/) 
     9    : grid(grid) 
    1510    , offset(offset) 
    16     , hasMissingValue(hasMissingValue), defaultValue(defaultValue) 
    1711  { 
    1812    if (!grid) 
     
    3226 
    3327    packet->data.resize(grid->storeIndex_client.numElements()); 
     28 
    3429    grid->inputField(data, packet->data); 
    3530 
    36     // Convert missing values to NaN 
    37     if (hasMissingValue) 
    38     { 
    39       double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    40       size_t nbData = packet->data.numElements(); 
    41       for (size_t idx = 0; idx < nbData; ++idx) 
    42       { 
    43         if (defaultValue == packet->data(idx)) 
    44           packet->data(idx) = nanValue; 
    45       } 
    46     } 
    47  
    48     onOutputReady(packet); 
     31    deliverOuput(packet); 
    4932  } 
    5033 
     
    6649    packet->status = CDataPacket::NO_ERROR; 
    6750 
    68     // if (data.size() != grid->storeIndex_toSrv.size()) 
    69     if (data.size() != grid->storeIndex_fromSrv.size()) 
     51    if (data.size() != grid->storeIndex_toSrv.size()) 
    7052      ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)", 
    7153            << "Incoherent data received from servers," 
    72             << " expected " << grid->storeIndex_fromSrv.size() << " chunks but " << data.size() << " were given."); 
     54            << " expected " << grid->storeIndex_toSrv.size() << " chunks but " << data.size() << " were given."); 
    7355 
    7456    packet->data.resize(grid->storeIndex_client.numElements()); 
     
    7658    for (it = data.begin(); it != itEnd; it++) 
    7759    { 
    78       // CArray<int,1>& index = grid->storeIndex_toSrv[it->first]; 
    79       CArray<int,1>& index = grid->storeIndex_fromSrv[it->first]; 
     60      CArray<int,1>& index = grid->storeIndex_toSrv[it->first]; 
     61 
    8062      for (int n = 0; n < index.numElements(); n++) 
    8163        packet->data(index(n)) = it->second(n); 
    8264    } 
    8365 
    84     onOutputReady(packet); 
     66    deliverOuput(packet); 
    8567  } 
    8668 
     
    9173    packet->timestamp = date; 
    9274    packet->status = CDataPacket::END_OF_STREAM; 
    93     onOutputReady(packet); 
     75    deliverOuput(packet); 
    9476  } 
    9577} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/source_filter.hpp

    r1018 r1037  
    1919       * Constructs a source filter accepting data attached to the specified grid. 
    2020       * 
    21        * \param gc the garbage collector associated with this filter 
    2221       * \param grid the grid to which the data is attached 
    2322       * \param offset the offset applied to the timestamp of all packets 
    24        * \param manualTrigger whether the output should be triggered manually 
    25        * \param hasMissingValue whether data has missing value 
    26        * \param defaultValue missing value to detect 
    2723       */ 
    28       CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
    29                     const CDuration offset = NoneDu, bool manualTrigger = false, 
    30                     bool hasMissingValue = false, 
    31                     double defaultValue = 0.0); 
     24      CSourceFilter(CGrid* grid, const CDuration offset = NoneDu); 
    3225 
    3326      /*! 
     
    6255      CGrid* grid; //!< The grid attached to the data the filter can accept 
    6356      const CDuration offset; //!< The offset applied to the timestamp of all packets 
    64       bool hasMissingValue; 
    65       double defaultValue; 
    6657  }; // class CSourceFilter 
    6758} // namespace xios 
  • XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.cpp

    r1018 r1037  
    1111 
    1212  std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
    13   CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue) 
     13  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue) 
    1414  { 
    1515    if (!srcGrid || !destGrid) 
     
    2626      const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs(); 
    2727      size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size()); 
    28       double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : missingValue; 
    2928      boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
    3029 
     
    5453    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue); 
    5554    if (outputPacket) 
    56       onOutputReady(outputPacket); 
     55      deliverOuput(outputPacket); 
    5756  } 
    5857 
     
    104103      } 
    105104      packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 
    106       if (0 != packet->data.numElements()) 
    107         (packet->data)(0) = defaultValue; 
     105      packet->data = defaultValue; 
    108106      apply(data[0]->data, packet->data); 
    109107    } 
     
    220218    if (dataCurrentDest.numElements() != dataDest.numElements()) 
    221219    ERROR("CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)", 
    222           "Incoherent between the received size and expected size. " << std::endl  
    223           << "Expected size: " << dataDest.numElements() << std::endl  
    224           << "Received size: " << dataCurrentDest.numElements()); 
     220          "Incoherent between the received size and expected size" << 
     221          "Expected size: " << dataDest.numElements() << 
     222          "Received size: " << dataCurrentDest.numElements()); 
    225223 
    226224    dataDest = dataCurrentDest; 
  • XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.hpp

    r1018 r1037  
    3232       * \param srcGrid the source grid 
    3333       * \param destGrid the destination grid 
    34        * \param hasMissingValue whether field source has missing value 
    35        * \param defaultValue default value 
    3634       * \return the first and the last filters of the filter graph 
    3735       */ 
    3836      static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
    39       buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue); 
     37      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue); 
    4038 
    4139    protected: 
  • XIOS/dev/branch_yushan/src/filter/store_filter.cpp

    r1029 r1037  
    88  CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid) 
    99    : CInputPin(gc, 1) 
    10     , gc(gc) 
    1110    , context(context) 
    1211    , grid(grid) 
     
    2423    CTimer timer("CStoreFilter::getPacket"); 
    2524    CConstDataPacketPtr packet; 
    26     const double timeout = CXios::recvFieldTimeout; 
     25    const double timeout = 10; // 10 seconds timeout 
    2726 
    2827    do 
    2928    { 
    30       if (canBeTriggered()) 
    31         trigger(timestamp); 
    32  
    3329      timer.resume(); 
    3430 
     
    4339 
    4440    if (!packet) 
    45     { 
    46       std::map<Time, CDataPacketPtr>::const_iterator it ; 
    47       info(0)<<"Impossible to get the packet with timestamp = " << timestamp<<std::endl<<"Available timestamp are : "<<std::endl ; 
    48       for(it=packets.begin();it!=packets.end();++it) info(0)<<it->first<<"  "; 
    49       info(0)<<std::endl ; 
    5041      ERROR("CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) const", 
    5142            << "Impossible to get the packet with timestamp = " << timestamp); 
    52     } 
     43 
    5344    return packet; 
    5445  } 
     
    7869    // The packet is always destroyed by the garbage collector 
    7970    // so we register but never unregister 
    80     gc.registerObject(this, data[0]->timestamp); 
     71    gc.registerFilter(this, data[0]->timestamp); 
    8172  } 
    8273 
  • XIOS/dev/branch_yushan/src/filter/store_filter.hpp

    r1006 r1037  
    6565 
    6666    private: 
    67       CGarbageCollector& gc; //!< The garbage collector associated to the filter 
    6867      CContext* context; //!< The context to which the data belongs 
    6968      CGrid* grid; //!< The grid attached to the data the filter can accept 
  • XIOS/dev/branch_yushan/src/filter/temporal_filter.cpp

    r1018 r1037  
    1515    , isFirstOperation(true) 
    1616  { 
    17     double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue; 
    18      
    1917#define DECLARE_FUNCTOR(MType, mtype) \ 
    2018    if (opId.compare(#mtype) == 0) \ 
     
    2220      if (ignoreMissingValue) \ 
    2321      { \ 
    24         functor.reset(new func::C##MType(tmpData, defaultValue)); \ 
     22        functor.reset(new func::C##MType(tmpData, missingValue)); \ 
    2523      } \ 
    2624      else \ 
  • XIOS/dev/branch_yushan/src/functor/accumulate.cpp

    r1018 r1037  
    11#include "accumulate.hpp" 
    22#include "array_new.hpp" 
    3 #include "utils.hpp" 
    43 
    54namespace xios 
     
    3433            double* out=_doutput.dataFirst(); 
    3534            for (i=0; i<n; ++i,++in,++out)  
    36               if (!NumTraits<double>::isnan(*in)) 
     35              if (*in!=missingValue) 
    3736              { 
    38                 if(!NumTraits<double>::isnan(*out)) *out  += *in; 
     37                if(*out!=missingValue) *out  += *in; 
    3938                else *out=*in ; 
    4039              } 
  • XIOS/dev/branch_yushan/src/functor/average.cpp

    r1018 r1037  
    11#include "average.hpp" 
    22#include "array_new.hpp" 
    3 #include "utils.hpp" 
    43 
    54namespace xios 
     
    4342            int* nc=nbcalls.dataFirst() ; 
    4443            for (i=0; i<n; ++i,++nc,++in)  
    45               if (!NumTraits<double>::isnan(*in)) (*nc) ++; 
     44              if (*in!=missingValue) (*nc) ++; 
    4645          } 
    4746        } 
     
    5554            int* nc=nbcalls.dataFirst() ; 
    5655            for (i=0; i<n; ++i,++in,++out,++nc)  
    57               if (!NumTraits<double>::isnan(*in))  
     56              if (*in!=missingValue)  
    5857              { 
    5958                if (*nc != 0) (*out)  += *in; 
  • XIOS/dev/branch_yushan/src/functor/maximum.cpp

    r1018 r1037  
    11#include "maximum.hpp" 
    22#include "array_new.hpp" 
    3 #include "utils.hpp" 
     3 
     4 
    45 
    56namespace xios 
     
    3435           {  
    3536             for (; it1 != end1; it1++, it++)  
    36                if (!NumTraits<double>::isnan(*it1)) 
     37               if (*it1 != missingValue) 
    3738               { 
    38                  if (!NumTraits<double>::isnan(*it)) *it = std::max(*it1, *it); 
     39                 if ( *it != missingValue) *it = std::max(*it1, *it); 
    3940                 else *it=*it1 ;   
    4041               } 
  • XIOS/dev/branch_yushan/src/functor/minimum.cpp

    r1018 r1037  
    22#include "array_new.hpp" 
    33#include <algorithm> 
    4 #include "utils.hpp" 
    54 
    65namespace xios 
     
    2726      { 
    2827        const double * it1  = _dinput.dataFirst(), 
    29                       *end1 = _dinput.dataFirst() + _dinput.numElements(); 
     28                      * end1 = _dinput.dataFirst() + _dinput.numElements(); 
    3029        double * it   = _doutput.dataFirst(); 
    3130         
     
    3635          {  
    3736            for (; it1 != end1; it1++, it++)  
    38               if (!NumTraits<double>::isnan(*it1)) 
     37              if (*it1!=missingValue) 
    3938              { 
    40                 if (!NumTraits<double>::isnan(*it)) *it = std::min(*it1, *it); 
     39                if (*it != missingValue) *it = std::min(*it1, *it); 
    4140                else *it=*it1 ; 
    4241              } 
  • XIOS/dev/branch_yushan/src/interface/c/icdata.cpp

    r961 r1037  
    1111 
    1212#include "xios.hpp" 
    13 #include "oasis_cinterface.hpp" 
     13//#include "oasis_cinterface.hpp" 
    1414 
    1515#include "attribute_template.hpp" 
     
    2727#include "array_new.hpp" 
    2828 
    29  
    3029extern "C" 
    3130{ 
     
    5756      MPI_Comm local_comm; 
    5857      MPI_Comm return_comm; 
     58       
     59      fc_comm_map.clear(); 
    5960 
    6061      if (!cstr2string(client_id, len_client_id, str)) return; 
     
    6364      MPI_Initialized(&initialized); 
    6465      if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm); 
    65       else local_comm=MPI_COMM_NULL; 
     66      else local_comm = MPI_COMM_NULL; 
     67       
     68      
     69 
    6670      CXios::initClientSide(str, local_comm, return_comm); 
    67       *f_return_comm=MPI_Comm_c2f(return_comm); 
     71      *f_return_comm = MPI_Comm_c2f(return_comm); 
     72 
     73      printf("in icdata.cpp, f_return_comm = %d\n", *f_return_comm); 
     74 
    6875      CTimer::get("XIOS init").suspend(); 
    6976      CTimer::get("XIOS").suspend(); 
     
    7986     CTimer::get("XIOS init context").resume(); 
    8087     comm=MPI_Comm_f2c(*f_comm); 
     88     
    8189     CClient::registerContext(str, comm); 
     90      
     91     //printf("client register context OK\n"); 
     92      
    8293     CTimer::get("XIOS init context").suspend(); 
    8394     CTimer::get("XIOS").suspend(); 
     
    100111     CTimer::get("XIOS close definition").resume(); 
    101112     CContext* context = CContext::getCurrent(); 
     113      
    102114     context->closeDefinition(); 
     115      
    103116     CTimer::get("XIOS close definition").suspend(); 
    104117     CTimer::get("XIOS").suspend(); 
     
    109122     CTimer::get("XIOS").resume(); 
    110123     CTimer::get("XIOS context finalize").resume(); 
     124      
     125      
     126      
    111127     CContext* context = CContext::getCurrent(); 
     128     //printf("CContext* context = CContext::getCurrent();\n"); 
    112129     context->finalize(); 
     130      
     131     //printf("client context_finalize OK\n"); 
     132      
    113133     CTimer::get("XIOS context finalize").suspend(); 
    114134     CTimer::get("XIOS").suspend(); 
     
    429449      CContext* context = CContext::getCurrent(); 
    430450      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
    431         context->checkBuffersAndListen(); 
     451      { 
     452        context->checkBuffersAndListen(); 
     453      }   
    432454 
    433455      CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 
  • XIOS/dev/branch_yushan/src/interface/c/oasis_cinterface.cpp

    r501 r1037  
    11#include "oasis_cinterface.hpp" 
    22#include <string> 
    3 #include "mpi.hpp" 
     3//#include "mpi_std.hpp" 
    44 
    55namespace xios 
  • XIOS/dev/branch_yushan/src/interface/c_attr/icfield_attr.cpp

    r1005 r1037  
    6767 
    6868 
    69   void cxios_set_field_cell_methods(field_Ptr field_hdl, const char * cell_methods, int cell_methods_size) 
    70   { 
    71     std::string cell_methods_str; 
    72     if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return; 
    73     CTimer::get("XIOS").resume(); 
    74     field_hdl->cell_methods.setValue(cell_methods_str); 
    75     CTimer::get("XIOS").suspend(); 
    76   } 
    77  
    78   void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size) 
    79   { 
    80     CTimer::get("XIOS").resume(); 
    81     if (!string_copy(field_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size)) 
    82       ERROR("void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short"); 
    83     CTimer::get("XIOS").suspend(); 
    84   } 
    85  
    86   bool cxios_is_defined_field_cell_methods(field_Ptr field_hdl) 
    87   { 
    88      CTimer::get("XIOS").resume(); 
    89      bool isDefined = field_hdl->cell_methods.hasInheritedValue(); 
    90      CTimer::get("XIOS").suspend(); 
    91      return isDefined; 
    92   } 
    93  
    94  
    95   void cxios_set_field_cell_methods_mode(field_Ptr field_hdl, const char * cell_methods_mode, int cell_methods_mode_size) 
    96   { 
    97     std::string cell_methods_mode_str; 
    98     if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return; 
    99     CTimer::get("XIOS").resume(); 
    100     field_hdl->cell_methods_mode.fromString(cell_methods_mode_str); 
    101     CTimer::get("XIOS").suspend(); 
    102   } 
    103  
    104   void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size) 
    105   { 
    106     CTimer::get("XIOS").resume(); 
    107     if (!string_copy(field_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size)) 
    108       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"); 
    109     CTimer::get("XIOS").suspend(); 
    110   } 
    111  
    112   bool cxios_is_defined_field_cell_methods_mode(field_Ptr field_hdl) 
    113   { 
    114      CTimer::get("XIOS").resume(); 
    115      bool isDefined = field_hdl->cell_methods_mode.hasInheritedValue(); 
    116      CTimer::get("XIOS").suspend(); 
    117      return isDefined; 
    118   } 
    119  
    120  
    12169  void cxios_set_field_compression_level(field_Ptr field_hdl, int compression_level) 
    12270  { 
     
    232180     CTimer::get("XIOS").resume(); 
    233181     bool isDefined = field_hdl->enabled.hasInheritedValue(); 
    234      CTimer::get("XIOS").suspend(); 
    235      return isDefined; 
    236   } 
    237  
    238  
    239   void cxios_set_field_expr(field_Ptr field_hdl, const char * expr, int expr_size) 
    240   { 
    241     std::string expr_str; 
    242     if (!cstr2string(expr, expr_size, expr_str)) return; 
    243     CTimer::get("XIOS").resume(); 
    244     field_hdl->expr.setValue(expr_str); 
    245     CTimer::get("XIOS").suspend(); 
    246   } 
    247  
    248   void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size) 
    249   { 
    250     CTimer::get("XIOS").resume(); 
    251     if (!string_copy(field_hdl->expr.getInheritedValue(), expr, expr_size)) 
    252       ERROR("void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)", << "Input string is too short"); 
    253     CTimer::get("XIOS").suspend(); 
    254   } 
    255  
    256   bool cxios_is_defined_field_expr(field_Ptr field_hdl) 
    257   { 
    258      CTimer::get("XIOS").resume(); 
    259      bool isDefined = field_hdl->expr.hasInheritedValue(); 
    260182     CTimer::get("XIOS").suspend(); 
    261183     return isDefined; 
  • XIOS/dev/branch_yushan/src/interface/c_attr/icfieldgroup_attr.cpp

    r1005 r1037  
    6767 
    6868 
    69   void cxios_set_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods, int cell_methods_size) 
    70   { 
    71     std::string cell_methods_str; 
    72     if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return; 
    73     CTimer::get("XIOS").resume(); 
    74     fieldgroup_hdl->cell_methods.setValue(cell_methods_str); 
    75     CTimer::get("XIOS").suspend(); 
    76   } 
    77  
    78   void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size) 
    79   { 
    80     CTimer::get("XIOS").resume(); 
    81     if (!string_copy(fieldgroup_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size)) 
    82       ERROR("void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short"); 
    83     CTimer::get("XIOS").suspend(); 
    84   } 
    85  
    86   bool cxios_is_defined_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl) 
    87   { 
    88      CTimer::get("XIOS").resume(); 
    89      bool isDefined = fieldgroup_hdl->cell_methods.hasInheritedValue(); 
    90      CTimer::get("XIOS").suspend(); 
    91      return isDefined; 
    92   } 
    93  
    94  
    95   void cxios_set_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods_mode, int cell_methods_mode_size) 
    96   { 
    97     std::string cell_methods_mode_str; 
    98     if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return; 
    99     CTimer::get("XIOS").resume(); 
    100     fieldgroup_hdl->cell_methods_mode.fromString(cell_methods_mode_str); 
    101     CTimer::get("XIOS").suspend(); 
    102   } 
    103  
    104   void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size) 
    105   { 
    106     CTimer::get("XIOS").resume(); 
    107     if (!string_copy(fieldgroup_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size)) 
    108       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"); 
    109     CTimer::get("XIOS").suspend(); 
    110   } 
    111  
    112   bool cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl) 
    113   { 
    114      CTimer::get("XIOS").resume(); 
    115      bool isDefined = fieldgroup_hdl->cell_methods_mode.hasInheritedValue(); 
    116      CTimer::get("XIOS").suspend(); 
    117      return isDefined; 
    118   } 
    119  
    120  
    12169  void cxios_set_fieldgroup_compression_level(fieldgroup_Ptr fieldgroup_hdl, int compression_level) 
    12270  { 
     
    232180     CTimer::get("XIOS").resume(); 
    233181     bool isDefined = fieldgroup_hdl->enabled.hasInheritedValue(); 
    234      CTimer::get("XIOS").suspend(); 
    235      return isDefined; 
    236   } 
    237  
    238  
    239   void cxios_set_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, const char * expr, int expr_size) 
    240   { 
    241     std::string expr_str; 
    242     if (!cstr2string(expr, expr_size, expr_str)) return; 
    243     CTimer::get("XIOS").resume(); 
    244     fieldgroup_hdl->expr.setValue(expr_str); 
    245     CTimer::get("XIOS").suspend(); 
    246   } 
    247  
    248   void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size) 
    249   { 
    250     CTimer::get("XIOS").resume(); 
    251     if (!string_copy(fieldgroup_hdl->expr.getInheritedValue(), expr, expr_size)) 
    252       ERROR("void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)", << "Input string is too short"); 
    253     CTimer::get("XIOS").suspend(); 
    254   } 
    255  
    256   bool cxios_is_defined_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl) 
    257   { 
    258      CTimer::get("XIOS").resume(); 
    259      bool isDefined = fieldgroup_hdl->expr.hasInheritedValue(); 
    260182     CTimer::get("XIOS").suspend(); 
    261183     return isDefined; 
  • XIOS/dev/branch_yushan/src/interface/c_attr/icinterpolate_domain_attr.cpp

    r1014 r1037  
    1818  typedef xios::CInterpolateDomain* interpolate_domain_Ptr; 
    1919 
    20   void cxios_set_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size) 
     20  void cxios_set_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, const char * file, int file_size) 
    2121  { 
    22     std::string mode_str; 
    23     if (!cstr2string(mode, mode_size, mode_str)) return; 
     22    std::string file_str; 
     23    if (!cstr2string(file, file_size, file_str)) return; 
    2424    CTimer::get("XIOS").resume(); 
    25     interpolate_domain_hdl->mode.fromString(mode_str); 
     25    interpolate_domain_hdl->file.setValue(file_str); 
    2626    CTimer::get("XIOS").suspend(); 
    2727  } 
    2828 
    29   void cxios_get_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size) 
     29  void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size) 
    3030  { 
    3131    CTimer::get("XIOS").resume(); 
    32     if (!string_copy(interpolate_domain_hdl->mode.getInheritedStringValue(), mode, mode_size)) 
    33       ERROR("void cxios_get_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)", << "Input string is too short"); 
     32    if (!string_copy(interpolate_domain_hdl->file.getInheritedValue(), file, file_size)) 
     33      ERROR("void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)", << "Input string is too short"); 
    3434    CTimer::get("XIOS").suspend(); 
    3535  } 
    3636 
    37   bool cxios_is_defined_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl) 
     37  bool cxios_is_defined_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl) 
    3838  { 
    3939     CTimer::get("XIOS").resume(); 
    40      bool isDefined = interpolate_domain_hdl->mode.hasInheritedValue(); 
     40     bool isDefined = interpolate_domain_hdl->file.hasInheritedValue(); 
    4141     CTimer::get("XIOS").suspend(); 
    4242     return isDefined; 
     
    8888     return isDefined; 
    8989  } 
    90  
    91  
    92   void cxios_set_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, const char * weight_filename, int weight_filename_size) 
    93   { 
    94     std::string weight_filename_str; 
    95     if (!cstr2string(weight_filename, weight_filename_size, weight_filename_str)) return; 
    96     CTimer::get("XIOS").resume(); 
    97     interpolate_domain_hdl->weight_filename.setValue(weight_filename_str); 
    98     CTimer::get("XIOS").suspend(); 
    99   } 
    100  
    101   void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size) 
    102   { 
    103     CTimer::get("XIOS").resume(); 
    104     if (!string_copy(interpolate_domain_hdl->weight_filename.getInheritedValue(), weight_filename, weight_filename_size)) 
    105       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"); 
    106     CTimer::get("XIOS").suspend(); 
    107   } 
    108  
    109   bool cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl) 
    110   { 
    111      CTimer::get("XIOS").resume(); 
    112      bool isDefined = interpolate_domain_hdl->weight_filename.hasInheritedValue(); 
    113      CTimer::get("XIOS").suspend(); 
    114      return isDefined; 
    115   } 
    116  
    117  
    118   void cxios_set_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool write_weight) 
    119   { 
    120     CTimer::get("XIOS").resume(); 
    121     interpolate_domain_hdl->write_weight.setValue(write_weight); 
    122     CTimer::get("XIOS").suspend(); 
    123   } 
    124  
    125   void cxios_get_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool* write_weight) 
    126   { 
    127     CTimer::get("XIOS").resume(); 
    128     *write_weight = interpolate_domain_hdl->write_weight.getInheritedValue(); 
    129     CTimer::get("XIOS").suspend(); 
    130   } 
    131  
    132   bool cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl) 
    133   { 
    134      CTimer::get("XIOS").resume(); 
    135      bool isDefined = interpolate_domain_hdl->write_weight.hasInheritedValue(); 
    136      CTimer::get("XIOS").suspend(); 
    137      return isDefined; 
    138   } 
    13990} 
  • XIOS/dev/branch_yushan/src/interface/fortran/idata.F90

    r965 r1037  
    465465   INTEGER :: f_return_comm 
    466466 
     467 
    467468      IF (PRESENT(local_comm)) THEN 
    468469        f_local_comm=local_comm 
     
    472473 
    473474      CALL cxios_init_client(client_id,LEN(client_id),f_local_comm,f_return_comm) 
     475       
     476       
     477      !print*, "in fortran, world_f = ", MPI_COMM_WORLD  
     478      print*, "in fortran, f_return_comm = ", f_return_comm  
    474479 
    475480      IF (PRESENT(return_comm)) return_comm=f_return_comm 
  • XIOS/dev/branch_yushan/src/interface/fortran_attr/field_interface_attr.F90

    r1005 r1037  
    5050 
    5151 
    52     SUBROUTINE cxios_set_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C) 
    53       USE ISO_C_BINDING 
    54       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    55       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods 
    56       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size 
    57     END SUBROUTINE cxios_set_field_cell_methods 
    58  
    59     SUBROUTINE cxios_get_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C) 
    60       USE ISO_C_BINDING 
    61       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    62       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods 
    63       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size 
    64     END SUBROUTINE cxios_get_field_cell_methods 
    65  
    66     FUNCTION cxios_is_defined_field_cell_methods(field_hdl) BIND(C) 
    67       USE ISO_C_BINDING 
    68       LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods 
    69       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    70     END FUNCTION cxios_is_defined_field_cell_methods 
    71  
    72  
    73     SUBROUTINE cxios_set_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C) 
    74       USE ISO_C_BINDING 
    75       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    76       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode 
    77       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size 
    78     END SUBROUTINE cxios_set_field_cell_methods_mode 
    79  
    80     SUBROUTINE cxios_get_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C) 
    81       USE ISO_C_BINDING 
    82       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    83       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode 
    84       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size 
    85     END SUBROUTINE cxios_get_field_cell_methods_mode 
    86  
    87     FUNCTION cxios_is_defined_field_cell_methods_mode(field_hdl) BIND(C) 
    88       USE ISO_C_BINDING 
    89       LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods_mode 
    90       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    91     END FUNCTION cxios_is_defined_field_cell_methods_mode 
    92  
    93  
    9452    SUBROUTINE cxios_set_field_compression_level(field_hdl, compression_level) BIND(C) 
    9553      USE ISO_C_BINDING 
     
    189147 
    190148 
    191     SUBROUTINE cxios_set_field_expr(field_hdl, expr, expr_size) BIND(C) 
    192       USE ISO_C_BINDING 
    193       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    194       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr 
    195       INTEGER  (kind = C_INT)     , VALUE        :: expr_size 
    196     END SUBROUTINE cxios_set_field_expr 
    197  
    198     SUBROUTINE cxios_get_field_expr(field_hdl, expr, expr_size) BIND(C) 
    199       USE ISO_C_BINDING 
    200       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    201       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr 
    202       INTEGER  (kind = C_INT)     , VALUE        :: expr_size 
    203     END SUBROUTINE cxios_get_field_expr 
    204  
    205     FUNCTION cxios_is_defined_field_expr(field_hdl) BIND(C) 
    206       USE ISO_C_BINDING 
    207       LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_expr 
    208       INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
    209     END FUNCTION cxios_is_defined_field_expr 
    210  
    211  
    212149    SUBROUTINE cxios_set_field_field_ref(field_hdl, field_ref, field_ref_size) BIND(C) 
    213150      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan/src/interface/fortran_attr/fieldgroup_interface_attr.F90

    r1005 r1037  
    5050 
    5151 
    52     SUBROUTINE cxios_set_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C) 
    53       USE ISO_C_BINDING 
    54       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    55       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods 
    56       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size 
    57     END SUBROUTINE cxios_set_fieldgroup_cell_methods 
    58  
    59     SUBROUTINE cxios_get_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C) 
    60       USE ISO_C_BINDING 
    61       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    62       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods 
    63       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size 
    64     END SUBROUTINE cxios_get_fieldgroup_cell_methods 
    65  
    66     FUNCTION cxios_is_defined_fieldgroup_cell_methods(fieldgroup_hdl) BIND(C) 
    67       USE ISO_C_BINDING 
    68       LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods 
    69       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    70     END FUNCTION cxios_is_defined_fieldgroup_cell_methods 
    71  
    72  
    73     SUBROUTINE cxios_set_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C) 
    74       USE ISO_C_BINDING 
    75       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    76       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode 
    77       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size 
    78     END SUBROUTINE cxios_set_fieldgroup_cell_methods_mode 
    79  
    80     SUBROUTINE cxios_get_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C) 
    81       USE ISO_C_BINDING 
    82       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    83       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode 
    84       INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size 
    85     END SUBROUTINE cxios_get_fieldgroup_cell_methods_mode 
    86  
    87     FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_hdl) BIND(C) 
    88       USE ISO_C_BINDING 
    89       LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods_mode 
    90       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    91     END FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode 
    92  
    93  
    9452    SUBROUTINE cxios_set_fieldgroup_compression_level(fieldgroup_hdl, compression_level) BIND(C) 
    9553      USE ISO_C_BINDING 
     
    189147 
    190148 
    191     SUBROUTINE cxios_set_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C) 
    192       USE ISO_C_BINDING 
    193       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    194       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr 
    195       INTEGER  (kind = C_INT)     , VALUE        :: expr_size 
    196     END SUBROUTINE cxios_set_fieldgroup_expr 
    197  
    198     SUBROUTINE cxios_get_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C) 
    199       USE ISO_C_BINDING 
    200       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    201       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr 
    202       INTEGER  (kind = C_INT)     , VALUE        :: expr_size 
    203     END SUBROUTINE cxios_get_fieldgroup_expr 
    204  
    205     FUNCTION cxios_is_defined_fieldgroup_expr(fieldgroup_hdl) BIND(C) 
    206       USE ISO_C_BINDING 
    207       LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_expr 
    208       INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    209     END FUNCTION cxios_is_defined_fieldgroup_expr 
    210  
    211  
    212149    SUBROUTINE cxios_set_fieldgroup_field_ref(fieldgroup_hdl, field_ref, field_ref_size) BIND(C) 
    213150      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan/src/interface/fortran_attr/ifield_attr.F90

    r1005 r1037  
    1212 
    1313  SUBROUTINE xios(set_field_attr)  & 
    14     ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    15     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    16     , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    17     , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     14    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     15    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     16    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     17    , unit, valid_max, valid_min ) 
    1818 
    1919    IMPLICIT NONE 
     
    2222      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 
    2323      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 
    24       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    25       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
    2624      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    2725      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    3129      LOGICAL  , OPTIONAL, INTENT(IN) :: enabled 
    3230      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    33       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr 
    3431      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 
    3532      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset 
     
    5956      (field_id,field_hdl) 
    6057      CALL xios(set_field_attr_hdl_)   & 
    61       ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    62       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    63       , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    64       , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     58      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     59      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     60      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     61      , unit, valid_max, valid_min ) 
    6562 
    6663  END SUBROUTINE xios(set_field_attr) 
    6764 
    6865  SUBROUTINE xios(set_field_attr_hdl)  & 
    69     ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    70     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    71     , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    72     , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     66    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     67    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     68    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     69    , unit, valid_max, valid_min ) 
    7370 
    7471    IMPLICIT NONE 
     
    7673      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 
    7774      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 
    78       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    79       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
    8075      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    8176      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    8580      LOGICAL  , OPTIONAL, INTENT(IN) :: enabled 
    8681      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    87       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr 
    8882      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 
    8983      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset 
     
    111105 
    112106      CALL xios(set_field_attr_hdl_)  & 
    113       ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    114       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    115       , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    116       , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     107      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     108      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     109      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     110      , unit, valid_max, valid_min ) 
    117111 
    118112  END SUBROUTINE xios(set_field_attr_hdl) 
    119113 
    120114  SUBROUTINE xios(set_field_attr_hdl_)   & 
    121     ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  & 
    122     , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  & 
    123     , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  & 
    124     , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  & 
    125      ) 
     115    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  & 
     116    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  & 
     117    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  & 
     118    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    126119 
    127120    IMPLICIT NONE 
     
    129122      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_ 
    130123      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_ 
    131       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_ 
    132       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_ 
    133124      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_ 
    134125      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ 
     
    138129      LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_ 
    139130      LOGICAL (KIND=C_BOOL) :: enabled__tmp 
    140       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_ 
    141131      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_ 
    142132      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset_ 
     
    173163      ENDIF 
    174164 
    175       IF (PRESENT(cell_methods_)) THEN 
    176         CALL cxios_set_field_cell_methods & 
    177       (field_hdl%daddr, cell_methods_, len(cell_methods_)) 
    178       ENDIF 
    179  
    180       IF (PRESENT(cell_methods_mode_)) THEN 
    181         CALL cxios_set_field_cell_methods_mode & 
    182       (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_)) 
    183       ENDIF 
    184  
    185165      IF (PRESENT(compression_level_)) THEN 
    186166        CALL cxios_set_field_compression_level & 
     
    210190      ENDIF 
    211191 
    212       IF (PRESENT(expr_)) THEN 
    213         CALL cxios_set_field_expr & 
    214       (field_hdl%daddr, expr_, len(expr_)) 
    215       ENDIF 
    216  
    217192      IF (PRESENT(field_ref_)) THEN 
    218193        CALL cxios_set_field_field_ref & 
     
    321296 
    322297  SUBROUTINE xios(get_field_attr)  & 
    323     ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    324     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    325     , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    326     , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     298    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     299    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     300    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     301    , unit, valid_max, valid_min ) 
    327302 
    328303    IMPLICIT NONE 
     
    331306      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 
    332307      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 
    333       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    334       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    335308      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    336309      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    340313      LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled 
    341314      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    342       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr 
    343315      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 
    344316      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset 
     
    368340      (field_id,field_hdl) 
    369341      CALL xios(get_field_attr_hdl_)   & 
    370       ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    371       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    372       , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    373       , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     342      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     343      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     344      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     345      , unit, valid_max, valid_min ) 
    374346 
    375347  END SUBROUTINE xios(get_field_attr) 
    376348 
    377349  SUBROUTINE xios(get_field_attr_hdl)  & 
    378     ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    379     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    380     , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    381     , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     350    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     351    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     352    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     353    , unit, valid_max, valid_min ) 
    382354 
    383355    IMPLICIT NONE 
     
    385357      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 
    386358      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 
    387       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    388       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    389359      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    390360      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    394364      LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled 
    395365      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    396       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr 
    397366      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 
    398367      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset 
     
    420389 
    421390      CALL xios(get_field_attr_hdl_)  & 
    422       ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    423       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    424       , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    425       , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     391      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     392      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     393      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     394      , unit, valid_max, valid_min ) 
    426395 
    427396  END SUBROUTINE xios(get_field_attr_hdl) 
    428397 
    429398  SUBROUTINE xios(get_field_attr_hdl_)   & 
    430     ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  & 
    431     , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  & 
    432     , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  & 
    433     , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  & 
    434      ) 
     399    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  & 
     400    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  & 
     401    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  & 
     402    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    435403 
    436404    IMPLICIT NONE 
     
    438406      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_ 
    439407      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_ 
    440       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_ 
    441       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
    442408      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_ 
    443409      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ 
     
    447413      LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_ 
    448414      LOGICAL (KIND=C_BOOL) :: enabled__tmp 
    449       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_ 
    450415      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_ 
    451416      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset_ 
     
    482447      ENDIF 
    483448 
    484       IF (PRESENT(cell_methods_)) THEN 
    485         CALL cxios_get_field_cell_methods & 
    486       (field_hdl%daddr, cell_methods_, len(cell_methods_)) 
    487       ENDIF 
    488  
    489       IF (PRESENT(cell_methods_mode_)) THEN 
    490         CALL cxios_get_field_cell_methods_mode & 
    491       (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_)) 
    492       ENDIF 
    493  
    494449      IF (PRESENT(compression_level_)) THEN 
    495450        CALL cxios_get_field_compression_level & 
     
    519474      ENDIF 
    520475 
    521       IF (PRESENT(expr_)) THEN 
    522         CALL cxios_get_field_expr & 
    523       (field_hdl%daddr, expr_, len(expr_)) 
    524       ENDIF 
    525  
    526476      IF (PRESENT(field_ref_)) THEN 
    527477        CALL cxios_get_field_field_ref & 
     
    630580 
    631581  SUBROUTINE xios(is_defined_field_attr)  & 
    632     ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    633     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    634     , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    635     , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     582    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     583    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     584    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     585    , unit, valid_max, valid_min ) 
    636586 
    637587    IMPLICIT NONE 
     
    642592      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 
    643593      LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 
    644       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods 
    645       LOGICAL(KIND=C_BOOL) :: cell_methods_tmp 
    646       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    647       LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
    648594      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    649595      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    656602      LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 
    657603      LOGICAL(KIND=C_BOOL) :: enabled_tmp 
    658       LOGICAL, OPTIONAL, INTENT(OUT) :: expr 
    659       LOGICAL(KIND=C_BOOL) :: expr_tmp 
    660604      LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 
    661605      LOGICAL(KIND=C_BOOL) :: field_ref_tmp 
     
    702646      (field_id,field_hdl) 
    703647      CALL xios(is_defined_field_attr_hdl_)   & 
    704       ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    705       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    706       , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    707       , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     648      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     649      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     650      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     651      , unit, valid_max, valid_min ) 
    708652 
    709653  END SUBROUTINE xios(is_defined_field_attr) 
    710654 
    711655  SUBROUTINE xios(is_defined_field_attr_hdl)  & 
    712     ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    713     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    714     , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    715     , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     656    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     657    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     658    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     659    , unit, valid_max, valid_min ) 
    716660 
    717661    IMPLICIT NONE 
     
    721665      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 
    722666      LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 
    723       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods 
    724       LOGICAL(KIND=C_BOOL) :: cell_methods_tmp 
    725       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    726       LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
    727667      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    728668      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    735675      LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 
    736676      LOGICAL(KIND=C_BOOL) :: enabled_tmp 
    737       LOGICAL, OPTIONAL, INTENT(OUT) :: expr 
    738       LOGICAL(KIND=C_BOOL) :: expr_tmp 
    739677      LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 
    740678      LOGICAL(KIND=C_BOOL) :: field_ref_tmp 
     
    779717 
    780718      CALL xios(is_defined_field_attr_hdl_)  & 
    781       ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    782       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    783       , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  & 
    784       , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
     719      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  & 
     720      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  & 
     721      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  & 
     722      , unit, valid_max, valid_min ) 
    785723 
    786724  END SUBROUTINE xios(is_defined_field_attr_hdl) 
    787725 
    788726  SUBROUTINE xios(is_defined_field_attr_hdl_)   & 
    789     ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  & 
    790     , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  & 
    791     , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  & 
    792     , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  & 
    793      ) 
     727    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  & 
     728    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  & 
     729    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  & 
     730    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    794731 
    795732    IMPLICIT NONE 
     
    799736      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_ 
    800737      LOGICAL(KIND=C_BOOL) :: axis_ref__tmp 
    801       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_ 
    802       LOGICAL(KIND=C_BOOL) :: cell_methods__tmp 
    803       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
    804       LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp 
    805738      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_ 
    806739      LOGICAL(KIND=C_BOOL) :: compression_level__tmp 
     
    813746      LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_ 
    814747      LOGICAL(KIND=C_BOOL) :: enabled__tmp 
    815       LOGICAL, OPTIONAL, INTENT(OUT) :: expr_ 
    816       LOGICAL(KIND=C_BOOL) :: expr__tmp 
    817748      LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_ 
    818749      LOGICAL(KIND=C_BOOL) :: field_ref__tmp 
     
    868799      ENDIF 
    869800 
    870       IF (PRESENT(cell_methods_)) THEN 
    871         cell_methods__tmp = cxios_is_defined_field_cell_methods & 
    872       (field_hdl%daddr) 
    873         cell_methods_ = cell_methods__tmp 
    874       ENDIF 
    875  
    876       IF (PRESENT(cell_methods_mode_)) THEN 
    877         cell_methods_mode__tmp = cxios_is_defined_field_cell_methods_mode & 
    878       (field_hdl%daddr) 
    879         cell_methods_mode_ = cell_methods_mode__tmp 
    880       ENDIF 
    881  
    882801      IF (PRESENT(compression_level_)) THEN 
    883802        compression_level__tmp = cxios_is_defined_field_compression_level & 
     
    910829      ENDIF 
    911830 
    912       IF (PRESENT(expr_)) THEN 
    913         expr__tmp = cxios_is_defined_field_expr & 
    914       (field_hdl%daddr) 
    915         expr_ = expr__tmp 
    916       ENDIF 
    917  
    918831      IF (PRESENT(field_ref_)) THEN 
    919832        field_ref__tmp = cxios_is_defined_field_field_ref & 
  • XIOS/dev/branch_yushan/src/interface/fortran_attr/ifieldgroup_attr.F90

    r1005 r1037  
    1212 
    1313  SUBROUTINE xios(set_fieldgroup_attr)  & 
    14     ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    15     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    16     , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    17     , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    18      ) 
     14    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     15    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     16    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     17    , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    1918 
    2019    IMPLICIT NONE 
     
    2322      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 
    2423      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 
    25       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    26       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
    2724      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    2825      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    3229      LOGICAL  , OPTIONAL, INTENT(IN) :: enabled 
    3330      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    34       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr 
    3531      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 
    3632      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset 
     
    6157      (fieldgroup_id,fieldgroup_hdl) 
    6258      CALL xios(set_fieldgroup_attr_hdl_)   & 
    63       ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    64       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    65       , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    66       , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    67        ) 
     59      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     60      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     61      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     62      , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    6863 
    6964  END SUBROUTINE xios(set_fieldgroup_attr) 
    7065 
    7166  SUBROUTINE xios(set_fieldgroup_attr_hdl)  & 
    72     ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    73     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    74     , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    75     , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    76      ) 
     67    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     68    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     69    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     70    , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    7771 
    7872    IMPLICIT NONE 
     
    8074      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 
    8175      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 
    82       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    83       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
    8476      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    8577      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    8981      LOGICAL  , OPTIONAL, INTENT(IN) :: enabled 
    9082      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    91       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr 
    9283      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 
    9384      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset 
     
    116107 
    117108      CALL xios(set_fieldgroup_attr_hdl_)  & 
    118       ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    119       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    120       , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    121       , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    122        ) 
     109      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     110      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     111      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     112      , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    123113 
    124114  END SUBROUTINE xios(set_fieldgroup_attr_hdl) 
    125115 
    126116  SUBROUTINE xios(set_fieldgroup_attr_hdl_)   & 
    127     ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  & 
    128     , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  & 
    129     , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  & 
    130     , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  & 
    131     , unit_, valid_max_, valid_min_ ) 
     117    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  & 
     118    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  & 
     119    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  & 
     120    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    132121 
    133122    IMPLICIT NONE 
     
    135124      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_ 
    136125      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_ 
    137       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_ 
    138       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_ 
    139126      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_ 
    140127      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ 
     
    144131      LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_ 
    145132      LOGICAL (KIND=C_BOOL) :: enabled__tmp 
    146       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_ 
    147133      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_ 
    148134      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset_ 
     
    180166      ENDIF 
    181167 
    182       IF (PRESENT(cell_methods_)) THEN 
    183         CALL cxios_set_fieldgroup_cell_methods & 
    184       (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_)) 
    185       ENDIF 
    186  
    187       IF (PRESENT(cell_methods_mode_)) THEN 
    188         CALL cxios_set_fieldgroup_cell_methods_mode & 
    189       (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_)) 
    190       ENDIF 
    191  
    192168      IF (PRESENT(compression_level_)) THEN 
    193169        CALL cxios_set_fieldgroup_compression_level & 
     
    217193      ENDIF 
    218194 
    219       IF (PRESENT(expr_)) THEN 
    220         CALL cxios_set_fieldgroup_expr & 
    221       (fieldgroup_hdl%daddr, expr_, len(expr_)) 
    222       ENDIF 
    223  
    224195      IF (PRESENT(field_ref_)) THEN 
    225196        CALL cxios_set_fieldgroup_field_ref & 
     
    333304 
    334305  SUBROUTINE xios(get_fieldgroup_attr)  & 
    335     ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    336     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    337     , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    338     , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    339      ) 
     306    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     307    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     308    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     309    , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    340310 
    341311    IMPLICIT NONE 
     
    344314      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 
    345315      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 
    346       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    347       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    348316      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    349317      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    353321      LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled 
    354322      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    355       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr 
    356323      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 
    357324      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset 
     
    382349      (fieldgroup_id,fieldgroup_hdl) 
    383350      CALL xios(get_fieldgroup_attr_hdl_)   & 
    384       ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    385       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    386       , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    387       , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    388        ) 
     351      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     352      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     353      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     354      , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    389355 
    390356  END SUBROUTINE xios(get_fieldgroup_attr) 
    391357 
    392358  SUBROUTINE xios(get_fieldgroup_attr_hdl)  & 
    393     ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    394     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    395     , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    396     , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    397      ) 
     359    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     360    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     361    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     362    , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    398363 
    399364    IMPLICIT NONE 
     
    401366      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 
    402367      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 
    403       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    404       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    405368      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    406369      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    410373      LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled 
    411374      LOGICAL (KIND=C_BOOL) :: enabled_tmp 
    412       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr 
    413375      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 
    414376      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset 
     
    437399 
    438400      CALL xios(get_fieldgroup_attr_hdl_)  & 
    439       ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    440       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    441       , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    442       , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    443        ) 
     401      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     402      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     403      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     404      , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    444405 
    445406  END SUBROUTINE xios(get_fieldgroup_attr_hdl) 
    446407 
    447408  SUBROUTINE xios(get_fieldgroup_attr_hdl_)   & 
    448     ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  & 
    449     , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  & 
    450     , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  & 
    451     , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  & 
    452     , unit_, valid_max_, valid_min_ ) 
     409    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  & 
     410    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  & 
     411    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  & 
     412    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    453413 
    454414    IMPLICIT NONE 
     
    456416      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_ 
    457417      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_ 
    458       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_ 
    459       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
    460418      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_ 
    461419      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ 
     
    465423      LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_ 
    466424      LOGICAL (KIND=C_BOOL) :: enabled__tmp 
    467       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_ 
    468425      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_ 
    469426      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset_ 
     
    501458      ENDIF 
    502459 
    503       IF (PRESENT(cell_methods_)) THEN 
    504         CALL cxios_get_fieldgroup_cell_methods & 
    505       (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_)) 
    506       ENDIF 
    507  
    508       IF (PRESENT(cell_methods_mode_)) THEN 
    509         CALL cxios_get_fieldgroup_cell_methods_mode & 
    510       (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_)) 
    511       ENDIF 
    512  
    513460      IF (PRESENT(compression_level_)) THEN 
    514461        CALL cxios_get_fieldgroup_compression_level & 
     
    538485      ENDIF 
    539486 
    540       IF (PRESENT(expr_)) THEN 
    541         CALL cxios_get_fieldgroup_expr & 
    542       (fieldgroup_hdl%daddr, expr_, len(expr_)) 
    543       ENDIF 
    544  
    545487      IF (PRESENT(field_ref_)) THEN 
    546488        CALL cxios_get_fieldgroup_field_ref & 
     
    654596 
    655597  SUBROUTINE xios(is_defined_fieldgroup_attr)  & 
    656     ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    657     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    658     , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    659     , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    660      ) 
     598    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     599    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     600    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     601    , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    661602 
    662603    IMPLICIT NONE 
     
    667608      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 
    668609      LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 
    669       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods 
    670       LOGICAL(KIND=C_BOOL) :: cell_methods_tmp 
    671       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    672       LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
    673610      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    674611      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    681618      LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 
    682619      LOGICAL(KIND=C_BOOL) :: enabled_tmp 
    683       LOGICAL, OPTIONAL, INTENT(OUT) :: expr 
    684       LOGICAL(KIND=C_BOOL) :: expr_tmp 
    685620      LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 
    686621      LOGICAL(KIND=C_BOOL) :: field_ref_tmp 
     
    729664      (fieldgroup_id,fieldgroup_hdl) 
    730665      CALL xios(is_defined_fieldgroup_attr_hdl_)   & 
    731       ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    732       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    733       , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    734       , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    735        ) 
     666      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     667      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     668      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     669      , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    736670 
    737671  END SUBROUTINE xios(is_defined_fieldgroup_attr) 
    738672 
    739673  SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)  & 
    740     ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    741     , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    742     , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    743     , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    744      ) 
     674    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     675    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     676    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     677    , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    745678 
    746679    IMPLICIT NONE 
     
    750683      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 
    751684      LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 
    752       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods 
    753       LOGICAL(KIND=C_BOOL) :: cell_methods_tmp 
    754       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    755       LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
    756685      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    757686      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    764693      LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 
    765694      LOGICAL(KIND=C_BOOL) :: enabled_tmp 
    766       LOGICAL, OPTIONAL, INTENT(OUT) :: expr 
    767       LOGICAL(KIND=C_BOOL) :: expr_tmp 
    768695      LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 
    769696      LOGICAL(KIND=C_BOOL) :: field_ref_tmp 
     
    810737 
    811738      CALL xios(is_defined_fieldgroup_attr_hdl_)  & 
    812       ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  & 
    813       , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  & 
    814       , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    815       , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    816        ) 
     739      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
     740      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  & 
     741      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  & 
     742      , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 
    817743 
    818744  END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) 
    819745 
    820746  SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_)   & 
    821     ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  & 
    822     , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  & 
    823     , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  & 
    824     , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  & 
    825     , unit_, valid_max_, valid_min_ ) 
     747    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  & 
     748    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  & 
     749    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  & 
     750    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    826751 
    827752    IMPLICIT NONE 
     
    831756      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_ 
    832757      LOGICAL(KIND=C_BOOL) :: axis_ref__tmp 
    833       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_ 
    834       LOGICAL(KIND=C_BOOL) :: cell_methods__tmp 
    835       LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
    836       LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp 
    837758      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_ 
    838759      LOGICAL(KIND=C_BOOL) :: compression_level__tmp 
     
    845766      LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_ 
    846767      LOGICAL(KIND=C_BOOL) :: enabled__tmp 
    847       LOGICAL, OPTIONAL, INTENT(OUT) :: expr_ 
    848       LOGICAL(KIND=C_BOOL) :: expr__tmp 
    849768      LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_ 
    850769      LOGICAL(KIND=C_BOOL) :: field_ref__tmp 
     
    902821      ENDIF 
    903822 
    904       IF (PRESENT(cell_methods_)) THEN 
    905         cell_methods__tmp = cxios_is_defined_fieldgroup_cell_methods & 
    906       (fieldgroup_hdl%daddr) 
    907         cell_methods_ = cell_methods__tmp 
    908       ENDIF 
    909  
    910       IF (PRESENT(cell_methods_mode_)) THEN 
    911         cell_methods_mode__tmp = cxios_is_defined_fieldgroup_cell_methods_mode & 
    912       (fieldgroup_hdl%daddr) 
    913         cell_methods_mode_ = cell_methods_mode__tmp 
    914       ENDIF 
    915  
    916823      IF (PRESENT(compression_level_)) THEN 
    917824        compression_level__tmp = cxios_is_defined_fieldgroup_compression_level & 
     
    944851      ENDIF 
    945852 
    946       IF (PRESENT(expr_)) THEN 
    947         expr__tmp = cxios_is_defined_fieldgroup_expr & 
    948       (fieldgroup_hdl%daddr) 
    949         expr_ = expr__tmp 
    950       ENDIF 
    951  
    952853      IF (PRESENT(field_ref_)) THEN 
    953854        field_ref__tmp = cxios_is_defined_fieldgroup_field_ref & 
  • XIOS/dev/branch_yushan/src/interface/fortran_attr/iinterpolate_domain_attr.F90

    r1005 r1037  
    1212 
    1313  SUBROUTINE xios(set_interpolate_domain_attr)  & 
    14     ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight ) 
     14    ( interpolate_domain_id, file, order, renormalize ) 
    1515 
    1616    IMPLICIT NONE 
     
    1818      CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 
    1919      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 
    20       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    2120      INTEGER  , OPTIONAL, INTENT(IN) :: order 
    2221      LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize 
    2322      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
    24       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename 
    25       LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight 
    26       LOGICAL (KIND=C_BOOL) :: write_weight_tmp 
    2723 
    2824      CALL xios(get_interpolate_domain_handle) & 
    2925      (interpolate_domain_id,interpolate_domain_hdl) 
    3026      CALL xios(set_interpolate_domain_attr_hdl_)   & 
    31       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     27      ( interpolate_domain_hdl, file, order, renormalize ) 
    3228 
    3329  END SUBROUTINE xios(set_interpolate_domain_attr) 
    3430 
    3531  SUBROUTINE xios(set_interpolate_domain_attr_hdl)  & 
    36     ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     32    ( interpolate_domain_hdl, file, order, renormalize ) 
    3733 
    3834    IMPLICIT NONE 
    3935      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    4036      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 
    41       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    4237      INTEGER  , OPTIONAL, INTENT(IN) :: order 
    4338      LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize 
    4439      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
    45       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename 
    46       LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight 
    47       LOGICAL (KIND=C_BOOL) :: write_weight_tmp 
    4840 
    4941      CALL xios(set_interpolate_domain_attr_hdl_)  & 
    50       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     42      ( interpolate_domain_hdl, file, order, renormalize ) 
    5143 
    5244  END SUBROUTINE xios(set_interpolate_domain_attr_hdl) 
    5345 
    5446  SUBROUTINE xios(set_interpolate_domain_attr_hdl_)   & 
    55     ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  & 
    56      ) 
     47    ( interpolate_domain_hdl, file_, order_, renormalize_ ) 
    5748 
    5849    IMPLICIT NONE 
    5950      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    6051      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file_ 
    61       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_ 
    6252      INTEGER  , OPTIONAL, INTENT(IN) :: order_ 
    6353      LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize_ 
    6454      LOGICAL (KIND=C_BOOL) :: renormalize__tmp 
    65       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename_ 
    66       LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight_ 
    67       LOGICAL (KIND=C_BOOL) :: write_weight__tmp 
    6855 
    6956      IF (PRESENT(file_)) THEN 
    7057        CALL cxios_set_interpolate_domain_file & 
    7158      (interpolate_domain_hdl%daddr, file_, len(file_)) 
    72       ENDIF 
    73  
    74       IF (PRESENT(mode_)) THEN 
    75         CALL cxios_set_interpolate_domain_mode & 
    76       (interpolate_domain_hdl%daddr, mode_, len(mode_)) 
    7759      ENDIF 
    7860 
     
    8870      ENDIF 
    8971 
    90       IF (PRESENT(weight_filename_)) THEN 
    91         CALL cxios_set_interpolate_domain_weight_filename & 
    92       (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_)) 
    93       ENDIF 
    94  
    95       IF (PRESENT(write_weight_)) THEN 
    96         write_weight__tmp = write_weight_ 
    97         CALL cxios_set_interpolate_domain_write_weight & 
    98       (interpolate_domain_hdl%daddr, write_weight__tmp) 
    99       ENDIF 
    100  
    10172  END SUBROUTINE xios(set_interpolate_domain_attr_hdl_) 
    10273 
    10374  SUBROUTINE xios(get_interpolate_domain_attr)  & 
    104     ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight ) 
     75    ( interpolate_domain_id, file, order, renormalize ) 
    10576 
    10677    IMPLICIT NONE 
     
    10879      CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 
    10980      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 
    110       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    11181      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
    11282      LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize 
    11383      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
    114       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename 
    115       LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight 
    116       LOGICAL (KIND=C_BOOL) :: write_weight_tmp 
    11784 
    11885      CALL xios(get_interpolate_domain_handle) & 
    11986      (interpolate_domain_id,interpolate_domain_hdl) 
    12087      CALL xios(get_interpolate_domain_attr_hdl_)   & 
    121       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     88      ( interpolate_domain_hdl, file, order, renormalize ) 
    12289 
    12390  END SUBROUTINE xios(get_interpolate_domain_attr) 
    12491 
    12592  SUBROUTINE xios(get_interpolate_domain_attr_hdl)  & 
    126     ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     93    ( interpolate_domain_hdl, file, order, renormalize ) 
    12794 
    12895    IMPLICIT NONE 
    12996      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    13097      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 
    131       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    13298      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
    13399      LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize 
    134100      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
    135       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename 
    136       LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight 
    137       LOGICAL (KIND=C_BOOL) :: write_weight_tmp 
    138101 
    139102      CALL xios(get_interpolate_domain_attr_hdl_)  & 
    140       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     103      ( interpolate_domain_hdl, file, order, renormalize ) 
    141104 
    142105  END SUBROUTINE xios(get_interpolate_domain_attr_hdl) 
    143106 
    144107  SUBROUTINE xios(get_interpolate_domain_attr_hdl_)   & 
    145     ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  & 
    146      ) 
     108    ( interpolate_domain_hdl, file_, order_, renormalize_ ) 
    147109 
    148110    IMPLICIT NONE 
    149111      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    150112      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file_ 
    151       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_ 
    152113      INTEGER  , OPTIONAL, INTENT(OUT) :: order_ 
    153114      LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize_ 
    154115      LOGICAL (KIND=C_BOOL) :: renormalize__tmp 
    155       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename_ 
    156       LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight_ 
    157       LOGICAL (KIND=C_BOOL) :: write_weight__tmp 
    158116 
    159117      IF (PRESENT(file_)) THEN 
    160118        CALL cxios_get_interpolate_domain_file & 
    161119      (interpolate_domain_hdl%daddr, file_, len(file_)) 
    162       ENDIF 
    163  
    164       IF (PRESENT(mode_)) THEN 
    165         CALL cxios_get_interpolate_domain_mode & 
    166       (interpolate_domain_hdl%daddr, mode_, len(mode_)) 
    167120      ENDIF 
    168121 
     
    178131      ENDIF 
    179132 
    180       IF (PRESENT(weight_filename_)) THEN 
    181         CALL cxios_get_interpolate_domain_weight_filename & 
    182       (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_)) 
    183       ENDIF 
    184  
    185       IF (PRESENT(write_weight_)) THEN 
    186         CALL cxios_get_interpolate_domain_write_weight & 
    187       (interpolate_domain_hdl%daddr, write_weight__tmp) 
    188         write_weight_ = write_weight__tmp 
    189       ENDIF 
    190  
    191133  END SUBROUTINE xios(get_interpolate_domain_attr_hdl_) 
    192134 
    193135  SUBROUTINE xios(is_defined_interpolate_domain_attr)  & 
    194     ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight ) 
     136    ( interpolate_domain_id, file, order, renormalize ) 
    195137 
    196138    IMPLICIT NONE 
     
    199141      LOGICAL, OPTIONAL, INTENT(OUT) :: file 
    200142      LOGICAL(KIND=C_BOOL) :: file_tmp 
    201       LOGICAL, OPTIONAL, INTENT(OUT) :: mode 
    202       LOGICAL(KIND=C_BOOL) :: mode_tmp 
    203143      LOGICAL, OPTIONAL, INTENT(OUT) :: order 
    204144      LOGICAL(KIND=C_BOOL) :: order_tmp 
    205145      LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize 
    206146      LOGICAL(KIND=C_BOOL) :: renormalize_tmp 
    207       LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename 
    208       LOGICAL(KIND=C_BOOL) :: weight_filename_tmp 
    209       LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight 
    210       LOGICAL(KIND=C_BOOL) :: write_weight_tmp 
    211147 
    212148      CALL xios(get_interpolate_domain_handle) & 
    213149      (interpolate_domain_id,interpolate_domain_hdl) 
    214150      CALL xios(is_defined_interpolate_domain_attr_hdl_)   & 
    215       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     151      ( interpolate_domain_hdl, file, order, renormalize ) 
    216152 
    217153  END SUBROUTINE xios(is_defined_interpolate_domain_attr) 
    218154 
    219155  SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)  & 
    220     ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     156    ( interpolate_domain_hdl, file, order, renormalize ) 
    221157 
    222158    IMPLICIT NONE 
     
    224160      LOGICAL, OPTIONAL, INTENT(OUT) :: file 
    225161      LOGICAL(KIND=C_BOOL) :: file_tmp 
    226       LOGICAL, OPTIONAL, INTENT(OUT) :: mode 
    227       LOGICAL(KIND=C_BOOL) :: mode_tmp 
    228162      LOGICAL, OPTIONAL, INTENT(OUT) :: order 
    229163      LOGICAL(KIND=C_BOOL) :: order_tmp 
    230164      LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize 
    231165      LOGICAL(KIND=C_BOOL) :: renormalize_tmp 
    232       LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename 
    233       LOGICAL(KIND=C_BOOL) :: weight_filename_tmp 
    234       LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight 
    235       LOGICAL(KIND=C_BOOL) :: write_weight_tmp 
    236166 
    237167      CALL xios(is_defined_interpolate_domain_attr_hdl_)  & 
    238       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     168      ( interpolate_domain_hdl, file, order, renormalize ) 
    239169 
    240170  END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) 
    241171 
    242172  SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)   & 
    243     ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  & 
    244      ) 
     173    ( interpolate_domain_hdl, file_, order_, renormalize_ ) 
    245174 
    246175    IMPLICIT NONE 
     
    248177      LOGICAL, OPTIONAL, INTENT(OUT) :: file_ 
    249178      LOGICAL(KIND=C_BOOL) :: file__tmp 
    250       LOGICAL, OPTIONAL, INTENT(OUT) :: mode_ 
    251       LOGICAL(KIND=C_BOOL) :: mode__tmp 
    252179      LOGICAL, OPTIONAL, INTENT(OUT) :: order_ 
    253180      LOGICAL(KIND=C_BOOL) :: order__tmp 
    254181      LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize_ 
    255182      LOGICAL(KIND=C_BOOL) :: renormalize__tmp 
    256       LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename_ 
    257       LOGICAL(KIND=C_BOOL) :: weight_filename__tmp 
    258       LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight_ 
    259       LOGICAL(KIND=C_BOOL) :: write_weight__tmp 
    260183 
    261184      IF (PRESENT(file_)) THEN 
     
    265188      ENDIF 
    266189 
    267       IF (PRESENT(mode_)) THEN 
    268         mode__tmp = cxios_is_defined_interpolate_domain_mode & 
    269       (interpolate_domain_hdl%daddr) 
    270         mode_ = mode__tmp 
    271       ENDIF 
    272  
    273190      IF (PRESENT(order_)) THEN 
    274191        order__tmp = cxios_is_defined_interpolate_domain_order & 
     
    283200      ENDIF 
    284201 
    285       IF (PRESENT(weight_filename_)) THEN 
    286         weight_filename__tmp = cxios_is_defined_interpolate_domain_weight_filename & 
    287       (interpolate_domain_hdl%daddr) 
    288         weight_filename_ = weight_filename__tmp 
    289       ENDIF 
    290  
    291       IF (PRESENT(write_weight_)) THEN 
    292         write_weight__tmp = cxios_is_defined_interpolate_domain_write_weight & 
    293       (interpolate_domain_hdl%daddr) 
    294         write_weight_ = write_weight__tmp 
    295       ENDIF 
    296  
    297202  END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_) 
    298203 
  • XIOS/dev/branch_yushan/src/interface/fortran_attr/interpolate_domain_interface_attr.F90

    r1005 r1037  
    2929      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    3030    END FUNCTION cxios_is_defined_interpolate_domain_file 
    31  
    32  
    33     SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C) 
    34       USE ISO_C_BINDING 
    35       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    36       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode 
    37       INTEGER  (kind = C_INT)     , VALUE        :: mode_size 
    38     END SUBROUTINE cxios_set_interpolate_domain_mode 
    39  
    40     SUBROUTINE cxios_get_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C) 
    41       USE ISO_C_BINDING 
    42       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    43       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode 
    44       INTEGER  (kind = C_INT)     , VALUE        :: mode_size 
    45     END SUBROUTINE cxios_get_interpolate_domain_mode 
    46  
    47     FUNCTION cxios_is_defined_interpolate_domain_mode(interpolate_domain_hdl) BIND(C) 
    48       USE ISO_C_BINDING 
    49       LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_mode 
    50       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    51     END FUNCTION cxios_is_defined_interpolate_domain_mode 
    5231 
    5332 
     
    8968    END FUNCTION cxios_is_defined_interpolate_domain_renormalize 
    9069 
    91  
    92     SUBROUTINE cxios_set_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C) 
    93       USE ISO_C_BINDING 
    94       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    95       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: weight_filename 
    96       INTEGER  (kind = C_INT)     , VALUE        :: weight_filename_size 
    97     END SUBROUTINE cxios_set_interpolate_domain_weight_filename 
    98  
    99     SUBROUTINE cxios_get_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C) 
    100       USE ISO_C_BINDING 
    101       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    102       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: weight_filename 
    103       INTEGER  (kind = C_INT)     , VALUE        :: weight_filename_size 
    104     END SUBROUTINE cxios_get_interpolate_domain_weight_filename 
    105  
    106     FUNCTION cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_hdl) BIND(C) 
    107       USE ISO_C_BINDING 
    108       LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_weight_filename 
    109       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    110     END FUNCTION cxios_is_defined_interpolate_domain_weight_filename 
    111  
    112  
    113     SUBROUTINE cxios_set_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C) 
    114       USE ISO_C_BINDING 
    115       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    116       LOGICAL (KIND=C_BOOL)      , VALUE :: write_weight 
    117     END SUBROUTINE cxios_set_interpolate_domain_write_weight 
    118  
    119     SUBROUTINE cxios_get_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C) 
    120       USE ISO_C_BINDING 
    121       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    122       LOGICAL (KIND=C_BOOL)             :: write_weight 
    123     END SUBROUTINE cxios_get_interpolate_domain_write_weight 
    124  
    125     FUNCTION cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_hdl) BIND(C) 
    126       USE ISO_C_BINDING 
    127       LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_write_weight 
    128       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    129     END FUNCTION cxios_is_defined_interpolate_domain_write_weight 
    130  
    13170  END INTERFACE 
    13271 
  • XIOS/dev/branch_yushan/src/io/nc4_data_output.cpp

    r1012 r1037  
    2121            , filename(filename) 
    2222      { 
    23         SuperClass::type = MULTI_FILE; 
     23    SuperClass::type = MULTI_FILE; 
    2424      } 
    2525 
     
    3333            , isCollective(isCollective) 
    3434      { 
    35         SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 
     35    SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 
    3636      } 
    3737 
     
    14581458      void CNc4DataOutput::writeField_(CField* field) 
    14591459      { 
    1460         CContext* context = CContext::getCurrent() ; 
    1461         CContextServer* server=context->server ; 
    1462  
    1463         std::vector<StdString> dims, coodinates; 
    1464         CGrid* grid = field->grid; 
    1465         if (!grid->doGridHaveDataToWrite()) 
     1460         CContext* context = CContext::getCurrent() ; 
     1461         CContextServer* server=context->server ; 
     1462 
     1463         std::vector<StdString> dims, coodinates; 
     1464         CGrid* grid = field->grid; 
     1465         if (!grid->doGridHaveDataToWrite()) 
    14661466          if (SuperClass::type==MULTI_FILE) return ; 
    14671467 
    1468         CArray<int,1> axisDomainOrder = grid->axis_domain_order; 
    1469         int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 
    1470         std::vector<StdString> domainList = grid->getDomainList(); 
    1471         std::vector<StdString> axisList   = grid->getAxisList(); 
    1472         std::vector<StdString> scalarList = grid->getScalarList();         
    1473  
    1474         StdString timeid  = getTimeCounterName(); 
    1475         StdString dimXid,dimYid; 
    1476         std::deque<StdString> dimIdList, dimCoordList; 
    1477         bool hasArea = false; 
    1478         StdString cellMeasures = "area:"; 
    1479         bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 
    1480  
    1481         for (int i = 0; i < numElement; ++i) 
    1482         { 
    1483           if (2 == axisDomainOrder(i)) 
    1484           { 
    1485             CDomain* domain = CDomain::get(domainList[idxDomain]); 
    1486             StdString domId = domain->getDomainOutputName(); 
    1487             StdString appendDomId  = singleDomain ? "" : "_" + domId ; 
    1488  
    1489             if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 
     1468         CArray<int,1> axisDomainOrder = grid->axis_domain_order; 
     1469         int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 
     1470         std::vector<StdString> domainList = grid->getDomainList(); 
     1471         std::vector<StdString> axisList   = grid->getAxisList(); 
     1472         std::vector<StdString> scalarList = grid->getScalarList(); 
     1473 
     1474         StdString timeid  = getTimeCounterName(); 
     1475         StdString dimXid,dimYid; 
     1476         std::deque<StdString> dimIdList, dimCoordList; 
     1477         bool hasArea = false; 
     1478         StdString cellMeasures = "area:"; 
     1479         bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 
     1480 
     1481         for (int i = 0; i < numElement; ++i) 
     1482         { 
     1483           if (2 == axisDomainOrder(i)) 
     1484           { 
     1485             CDomain* domain = CDomain::get(domainList[idxDomain]); 
     1486             StdString domId = domain->getDomainOutputName(); 
     1487             StdString appendDomId  = singleDomain ? "" : "_" + domId ; 
     1488 
     1489             if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 
     1490             { 
     1491               dimIdList.push_back(domId + "_points"); 
     1492               field->setUseCompressedOutput(); 
     1493             } 
     1494 
     1495             switch (domain->type) 
     1496             { 
     1497               case CDomain::type_attr::curvilinear: 
     1498                 if (!compressedOutput || !domain->isCompressible()) 
     1499                 { 
     1500                   dimXid     = StdString("x").append(appendDomId); 
     1501                   dimIdList.push_back(dimXid); 
     1502                   dimYid     = StdString("y").append(appendDomId); 
     1503                   dimIdList.push_back(dimYid); 
     1504                 } 
     1505                 dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 
     1506                 dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 
     1507                 break ; 
     1508               case CDomain::type_attr::rectilinear: 
     1509                 if (!compressedOutput || !domain->isCompressible()) 
     1510                 { 
     1511                   dimXid     = StdString("lon").append(appendDomId); 
     1512                   dimIdList.push_back(dimXid); 
     1513                   dimYid     = StdString("lat").append(appendDomId); 
     1514                   dimIdList.push_back(dimYid); 
     1515                 } 
     1516                 break ; 
     1517               case CDomain::type_attr::unstructured: 
     1518               { 
     1519           if (SuperClassWriter::useCFConvention) 
     1520           { 
     1521            dimXid     = StdString("cell").append(appendDomId); 
     1522            dimIdList.push_back(dimXid); 
     1523            dimCoordList.push_back(StdString("lon").append(appendDomId)); 
     1524            dimCoordList.push_back(StdString("lat").append(appendDomId)); 
     1525          } 
     1526           else 
     1527           { 
     1528            StdString domainName = domain->name; 
     1529            if (domain->nvertex == 1) 
    14901530            { 
    1491               dimIdList.push_back(domId + "_points"); 
    1492               field->setUseCompressedOutput(); 
     1531              dimXid     = "n" + domainName + "_node"; 
     1532              dimIdList.push_back(dimXid); 
     1533              dimCoordList.push_back(StdString(domainName + "_node_x")); 
     1534              dimCoordList.push_back(StdString(domainName + "_node_y")); 
    14931535            } 
    1494  
    1495             switch (domain->type) 
     1536            else if (domain->nvertex == 2) 
    14961537            { 
    1497               case CDomain::type_attr::curvilinear: 
    1498                 if (!compressedOutput || !domain->isCompressible()) 
    1499                 { 
    1500                   dimXid     = StdString("x").append(appendDomId); 
    1501                   dimIdList.push_back(dimXid); 
    1502                   dimYid     = StdString("y").append(appendDomId); 
    1503                   dimIdList.push_back(dimYid); 
    1504                 } 
    1505                 dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 
    1506                 dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 
    1507               break ; 
    1508               case CDomain::type_attr::rectilinear: 
    1509                 if (!compressedOutput || !domain->isCompressible()) 
    1510                 { 
    1511                   dimXid     = StdString("lon").append(appendDomId); 
    1512                   dimIdList.push_back(dimXid); 
    1513                   dimYid     = StdString("lat").append(appendDomId); 
    1514                   dimIdList.push_back(dimYid); 
    1515                 } 
    1516               break ; 
    1517               case CDomain::type_attr::unstructured: 
    1518               { 
    1519                 if (SuperClassWriter::useCFConvention) 
    1520                 { 
    1521                   dimXid     = StdString("cell").append(appendDomId); 
    1522                   dimIdList.push_back(dimXid); 
    1523                   dimCoordList.push_back(StdString("lon").append(appendDomId)); 
    1524                   dimCoordList.push_back(StdString("lat").append(appendDomId)); 
    1525                 } 
    1526                 else 
    1527                 { 
    1528                   StdString domainName = domain->name; 
    1529                   if (domain->nvertex == 1) 
    1530                   { 
    1531                     dimXid     = "n" + domainName + "_node"; 
    1532                     dimIdList.push_back(dimXid); 
    1533                     dimCoordList.push_back(StdString(domainName + "_node_x")); 
    1534                     dimCoordList.push_back(StdString(domainName + "_node_y")); 
    1535                   } 
    1536                   else if (domain->nvertex == 2) 
    1537                   { 
    1538                     dimXid     = "n" + domainName + "_edge"; 
    1539                     dimIdList.push_back(dimXid); 
    1540                     dimCoordList.push_back(StdString(domainName + "_edge_x")); 
    1541                     dimCoordList.push_back(StdString(domainName + "_edge_y")); 
    1542                   } 
    1543                   else 
    1544                   { 
    1545                     dimXid     = "n" + domainName + "_face"; 
    1546                     dimIdList.push_back(dimXid); 
    1547                     dimCoordList.push_back(StdString(domainName + "_face_x")); 
    1548                     dimCoordList.push_back(StdString(domainName + "_face_y")); 
    1549                   } 
    1550                 }  // ugrid convention 
    1551               }  // case unstructured domain 
    1552             } 
    1553  
    1554             if (domain->hasArea) 
    1555             { 
    1556               hasArea = true; 
    1557               cellMeasures += " area" + appendDomId; 
    1558             } 
    1559             ++idxDomain; 
    1560           } 
    1561           else if (1 == axisDomainOrder(i)) 
    1562           { 
    1563             CAxis* axis = CAxis::get(axisList[idxAxis]); 
    1564             StdString axisId = axis->getAxisOutputName(); 
    1565  
    1566             if (compressedOutput && axis->isCompressible()) 
    1567             { 
    1568               dimIdList.push_back(axisId + "_points"); 
    1569               field->setUseCompressedOutput(); 
     1538              dimXid     = "n" + domainName + "_edge"; 
     1539              dimIdList.push_back(dimXid); 
     1540              dimCoordList.push_back(StdString(domainName + "_edge_x")); 
     1541              dimCoordList.push_back(StdString(domainName + "_edge_y")); 
    15701542            } 
    15711543            else 
    1572               dimIdList.push_back(axisId); 
    1573  
    1574             dimCoordList.push_back(axisId); 
    1575             ++idxAxis; 
    1576           } 
    1577           else // scalar 
    1578           { 
     1544            { 
     1545              dimXid     = "n" + domainName + "_face"; 
     1546              dimIdList.push_back(dimXid); 
     1547              dimCoordList.push_back(StdString(domainName + "_face_x")); 
     1548              dimCoordList.push_back(StdString(domainName + "_face_y")); 
     1549            } 
     1550          }  // ugrid convention 
     1551        }  // case unstructured domain 
     1552             } 
     1553 
     1554             if (domain->hasArea) 
     1555             { 
     1556               hasArea = true; 
     1557               cellMeasures += " area" + appendDomId; 
     1558             } 
     1559             ++idxDomain; 
     1560           } 
     1561           else if (1 == axisDomainOrder(i)) 
     1562           { 
     1563             CAxis* axis = CAxis::get(axisList[idxAxis]); 
     1564             StdString axisId = axis->getAxisOutputName(); 
     1565 
     1566             if (compressedOutput && axis->isCompressible()) 
     1567             { 
     1568               dimIdList.push_back(axisId + "_points"); 
     1569               field->setUseCompressedOutput(); 
     1570             } 
     1571             else 
     1572               dimIdList.push_back(axisId); 
     1573 
     1574             dimCoordList.push_back(axisId); 
     1575             ++idxAxis; 
     1576           } 
     1577           else // scalar 
     1578           { 
    15791579             /* Do nothing here */ 
    1580           } 
    1581         } 
     1580           } 
     1581         } 
    15821582 
    15831583/* 
     
    15891589                             : latid; 
    15901590*/ 
    1591         StdString fieldid = field->getFieldOutputName(); 
    1592  
    1593         nc_type type ; 
    1594         if (field->prec.isEmpty()) type =  NC_FLOAT ; 
    1595         else 
    1596         { 
    1597           if (field->prec==2) type = NC_SHORT ; 
    1598           else if (field->prec==4)  type =  NC_FLOAT ; 
    1599           else if (field->prec==8)   type =  NC_DOUBLE ; 
    1600         } 
    1601  
    1602         bool wtime   = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 
    1603  
    1604         if (wtime) 
    1605         { 
    1606  
    1607           //StdOStringStream oss; 
    1608           // oss << "time_" << field->operation.getValue() 
    1609           //     << "_" << field->getRelFile()->output_freq.getValue(); 
     1591         StdString fieldid = field->getFieldOutputName(); 
     1592 
     1593         nc_type type ; 
     1594         if (field->prec.isEmpty()) type =  NC_FLOAT ; 
     1595         else 
     1596         { 
     1597           if (field->prec==2) type = NC_SHORT ; 
     1598           else if (field->prec==4)  type =  NC_FLOAT ; 
     1599           else if (field->prec==8)   type =  NC_DOUBLE ; 
     1600         } 
     1601 
     1602         bool wtime   = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 
     1603 
     1604         if (wtime) 
     1605         { 
     1606 
     1607            //StdOStringStream oss; 
     1608           // oss << "time_" << field->operation.getValue() 
     1609           //     << "_" << field->getRelFile()->output_freq.getValue(); 
    16101610          //oss 
    1611           if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant")); 
    1612           else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered")); 
    1613           dims.push_back(timeid); 
    1614         } 
    1615  
    1616         if (compressedOutput && grid->isCompressible()) 
    1617         { 
    1618           dims.push_back(grid->getId() + "_points"); 
    1619           field->setUseCompressedOutput(); 
    1620         } 
    1621         else 
    1622         { 
    1623           while (!dimIdList.empty()) 
    1624           { 
    1625             dims.push_back(dimIdList.back()); 
    1626             dimIdList.pop_back(); 
    1627           } 
    1628         } 
    1629  
    1630         while (!dimCoordList.empty()) 
    1631         { 
    1632           coodinates.push_back(dimCoordList.back()); 
    1633           dimCoordList.pop_back(); 
    1634         } 
    1635  
    1636         try 
    1637         { 
     1611            if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant")); 
     1612            else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered")); 
     1613            dims.push_back(timeid); 
     1614         } 
     1615 
     1616         if (compressedOutput && grid->isCompressible()) 
     1617         { 
     1618           dims.push_back(grid->getId() + "_points"); 
     1619           field->setUseCompressedOutput(); 
     1620         } 
     1621         else 
     1622         { 
     1623           while (!dimIdList.empty()) 
     1624           { 
     1625             dims.push_back(dimIdList.back()); 
     1626             dimIdList.pop_back(); 
     1627           } 
     1628         } 
     1629 
     1630         while (!dimCoordList.empty()) 
     1631         { 
     1632           coodinates.push_back(dimCoordList.back()); 
     1633           dimCoordList.pop_back(); 
     1634         } 
     1635 
     1636         try 
     1637         { 
    16381638           SuperClassWriter::addVariable(fieldid, type, dims); 
    16391639 
     
    16501650                 ("units", field->unit.getValue(), &fieldid); 
    16511651 
    1652            // Ugrid field attributes "mesh" and "location" 
    1653            if (!SuperClassWriter::useCFConvention) 
    1654            { 
    1655             if (!domainList.empty()) 
    1656             { 
    1657               CDomain* domain = CDomain::get(domainList[0]); // Suppose that we have only domain 
    1658               StdString mesh = domain->name; 
    1659               SuperClassWriter::addAttribute("mesh", mesh, &fieldid); 
    1660               StdString location; 
    1661               if (domain->nvertex == 1) 
    1662                 location = "node"; 
    1663               else if (domain->nvertex == 2) 
    1664                 location = "edge"; 
    1665               else if (domain->nvertex > 2) 
    1666                 location = "face"; 
    1667               SuperClassWriter::addAttribute("location", location, &fieldid); 
    1668             } 
    1669  
    1670            } 
    1671  
    1672            if (!field->valid_min.isEmpty()) 
     1652            if (!field->valid_min.isEmpty()) 
    16731653              SuperClassWriter::addAttribute 
    16741654                 ("valid_min", field->valid_min.getValue(), &fieldid); 
     
    16941674           vector<CVariable*> listVars = field->getAllVariables() ; 
    16951675           for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ; 
    1696  
    1697            bool alreadyAddCellMethod = false; 
    1698            StdString cellMethodsPrefix(""), cellMethodsSuffix(""); 
    1699            if (!field->cell_methods.isEmpty()) 
    1700            { 
    1701               StdString cellMethodString = field->cell_methods; 
    1702               if (field->cell_methods_mode.isEmpty() || 
    1703                  (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode)) 
    1704               { 
    1705                 SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid); 
    1706                 alreadyAddCellMethod = true; 
    1707               } 
    1708               else 
    1709               { 
    1710                 switch (field->cell_methods_mode) 
    1711                 { 
    1712                   case (CField::cell_methods_mode_attr::prefix): 
    1713                     cellMethodsPrefix = cellMethodString; 
    1714                     cellMethodsPrefix += " "; 
    1715                     break; 
    1716                   case (CField::cell_methods_mode_attr::suffix): 
    1717                     cellMethodsSuffix = " "; 
    1718                     cellMethodsSuffix += cellMethodString; 
    1719                     break; 
    1720                   case (CField::cell_methods_mode_attr::none): 
    1721                     break; 
    1722                   default: 
    1723                     break; 
    1724                 } 
    1725               } 
    1726            } 
    17271676 
    17281677 
     
    17381687              SuperClassWriter::addAttribute("interval_write", freqOut.toStringUDUnits(), &fieldid); 
    17391688 
    1740               StdString cellMethods(cellMethodsPrefix + "time: "); 
     1689              StdString cellMethods = "time: "; 
    17411690              if (field->operation.getValue() == "instant") cellMethods += "point"; 
    17421691              else if (field->operation.getValue() == "average") cellMethods += "mean"; 
     
    17451694              if (freqOp.resolve(*context->calendar) != freqOut.resolve(*context->calendar)) 
    17461695                cellMethods += " (interval: " + freqOpStr + ")"; 
    1747               cellMethods += cellMethodsSuffix; 
    1748               if (!alreadyAddCellMethod) 
    1749                 SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid); 
     1696              SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid); 
    17501697           } 
    17511698 
     
    18131760       if (SuperClassWriter::useCFConvention) 
    18141761             this->writeFileAttributes(filename, description, 
    1815                                        StdString("CF-1.6"), 
     1762                                       StdString("CF-1.5"), 
    18161763                                       StdString("An IPSL model"), 
    18171764                                       this->getTimeStamp()); 
     
    19811928        if (!field->wasWritten()) 
    19821929        { 
    1983           if (appendMode && field->file->record_offset.isEmpty() &&  
    1984               field->getOperationTimeType() != func::CFunctor::once) 
     1930          if (appendMode && field->file->record_offset.isEmpty()) 
    19851931          { 
    19861932            field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1); 
     
    20151961            time_data_bound(1) = lastWrite; 
    20161962          } 
    2017            
    2018           if (field->file->time_counter.isEmpty()) 
    2019             if (field->hasTimeInstant && !field->hasTimeCentered) 
    2020               time_counter(0) = lastWrite; 
    2021             else  
    2022               time_counter(0) = (lastWrite + lastLastWrite) / 2; 
    2023  
    2024           else if (field->file->time_counter == CFile::time_counter_attr::instant) 
     1963 
     1964          if (field->file->time_counter == CFile::time_counter_attr::instant) 
    20251965            time_counter(0) = lastWrite; 
    20261966          else if (field->file->time_counter == CFile::time_counter_attr::centered) 
     
    20301970 
    20311971 
    2032           if (field->file->time_counter.isEmpty()) 
    2033             if (field->hasTimeInstant && !field->hasTimeCentered) 
    2034               time_counter_bound(0) = time_counter_bound(1) = lastWrite; 
    2035             else  
    2036             { 
    2037               time_counter_bound(0) = lastLastWrite; 
    2038               time_counter_bound(1) = lastWrite; 
    2039             }           
    2040           else if (field->file->time_counter == CFile::time_counter_attr::instant) 
     1972          if (field->file->time_counter == CFile::time_counter_attr::instant) 
    20411973            time_counter_bound(0) = time_counter_bound(1) = lastWrite; 
    20421974          else if (field->file->time_counter == CFile::time_counter_attr::centered) 
     
    20872019                   SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
    20882020                   SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
    2089                    if (field->file->time_counter.isEmpty() ||   
    2090                       (field->file->time_counter != CFile::time_counter_attr::none)) 
     2021                   if (field->file->time_counter != CFile::time_counter_attr::none) 
    20912022                   { 
    20922023                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    2093                      if (field->file->time_counter.isEmpty() ||  
    2094                         (field->file->time_counter != CFile::time_counter_attr::record)) 
     2024                     if (field->file->time_counter != CFile::time_counter_attr::record) 
    20952025                       SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
    20962026                   } 
     
    22252155                   SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
    22262156                   SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
    2227                    if (field->file->time_counter.isEmpty() ||  
    2228                       (field->file->time_counter != CFile::time_counter_attr::none)) 
     2157                   if (field->file->time_counter != CFile::time_counter_attr::none) 
    22292158                   { 
    22302159                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1, isRoot); 
    2231                      if (field->file->time_counter.isEmpty() ||   
    2232                         (field->file->time_counter != CFile::time_counter_attr::record)) 
     2160                     if (field->file->time_counter != CFile::time_counter_attr::record) 
    22332161                       SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
    22342162                   } 
     
    22712199         StdString timeid(getTimeCounterName()); 
    22722200         StdString timeBoundId("axis_nbounds"); 
    2273   
     2201 
    22742202         if (field->getOperationTimeType() == func::CFunctor::instant) 
    22752203         { 
    22762204            axisid = "time_instant"; 
    22772205            axisBoundId = "time_instant_bounds"; 
    2278             field->hasTimeInstant = true;                    
    2279          } 
    2280  
    2281          if (field->getOperationTimeType() == func::CFunctor::centered) 
    2282          { 
    2283             field->hasTimeCentered = true;             
    2284          }           
     2206         } 
    22852207 
    22862208         try 
     
    23142236           } 
    23152237 
    2316            if (field->file->time_counter.isEmpty() ||   
    2317               (field->file->time_counter != CFile::time_counter_attr::none)) 
     2238           if (field->file->time_counter != CFile::time_counter_attr::none) 
    23182239           { 
    23192240             // Adding time_counter 
     
    23272248                SuperClassWriter::addAttribute("axis", string("T"), &axisid); 
    23282249 
    2329                 if (field->file->time_counter.isEmpty() ||  
    2330                    (field->file->time_counter != CFile::time_counter_attr::record)) 
     2250                if (field->file->time_counter != CFile::time_counter_attr::record) 
    23312251                { 
    23322252                  CDate timeOrigin = cal->getTimeOrigin(); 
     
    23402260 
    23412261             // Adding time_counter_bound dimension 
    2342              if (field->file->time_counter.isEmpty() ||   
    2343                 (field->file->time_counter != CFile::time_counter_attr::record)) 
     2262             if (field->file->time_counter != CFile::time_counter_attr::record) 
    23442263             { 
    23452264                if (!SuperClassWriter::varExist(axisBoundId)) 
     
    25162435           SuperClassWriter::addAttribute("title"      , description); 
    25172436           SuperClassWriter::addAttribute("Conventions", conventions); 
    2518            // SuperClassWriter::addAttribute("production" , production); 
     2437           SuperClassWriter::addAttribute("production" , production); 
    25192438           SuperClassWriter::addAttribute("timeStamp"  , timeStamp); 
    25202439         } 
  • XIOS/dev/branch_yushan/src/io/netCdfInterface.hpp

    r811 r1037  
    1717 
    1818#include "mpi.hpp" 
     19//#include <mpi.h> 
    1920#include "netcdf.hpp" 
    2021 
  • XIOS/dev/branch_yushan/src/io/onetcdf4.cpp

    r878 r1037  
    33#include "onetcdf4.hpp" 
    44#include "group_template.hpp" 
    5 #include "mpi.hpp" 
     5//#include "mpi_std.hpp" 
    66#include "netcdf.hpp" 
    77#include "netCdfInterface.hpp" 
     
    4848         } 
    4949         wmpi = comm && !multifile; 
     50          
     51         MPI_Info info_null; 
    5052 
    5153         if (wmpi) 
     
    5658         { 
    5759            if (wmpi) 
    58                CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 
     60               CNetCdfInterface::createPar(filename, mode, *comm, info_null, this->ncidp); 
    5961            else 
    6062               CNetCdfInterface::create(filename, mode, this->ncidp); 
     
    6668            mode |= NC_WRITE; 
    6769            if (wmpi) 
    68                CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 
     70               CNetCdfInterface::openPar(filename, mode, *comm, info_null, this->ncidp); 
    6971            else 
    7072               CNetCdfInterface::open(filename, mode, this->ncidp); 
  • XIOS/dev/branch_yushan/src/io/onetcdf4.hpp

    r878 r1037  
    88#include "array_new.hpp" 
    99#include "mpi.hpp" 
     10//#include <mpi.h> 
    1011#include "netcdf.hpp" 
    1112 
  • XIOS/dev/branch_yushan/src/mpi.hpp

    r501 r1037  
    1111#define OMPI_SKIP_MPICXX 
    1212 
    13 #include <mpi.h> 
     13#ifdef _usingEP 
     14  #include "../extern/src_ep/ep_lib.hpp" 
     15  using namespace ep_lib; 
     16#elif _usingMPI 
     17  #include <mpi.h> 
     18#endif 
     19 
    1420 
    1521#endif 
  • XIOS/dev/branch_yushan/src/node/axis.cpp

    r995 r1037  
    264264      isDistributed_ = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 
    265265                       (!this->n.isEmpty() && (this->n != this->n_glo)); 
    266  
    267       // A same stupid condition to make sure that if there is only one client, axis 
    268       // should be considered to be distributed. This should be a temporary solution      
    269       isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize); 
    270266   } 
    271267 
  • XIOS/dev/branch_yushan/src/node/context.cpp

    r1033 r1037  
    339339   } 
    340340 
     341   //! Server side: Put server into a loop in order to listen message from client 
     342   bool CContext::eventLoop(void) 
     343   { 
     344     return server->eventLoop(); 
     345   } 
     346 
    341347   //! Try to send the buffers and receive possible answers 
    342348   bool CContext::checkBuffersAndListen(void) 
    343349   { 
    344350     client->checkBuffers(); 
    345  
    346      bool hasTmpBufferedEvent = client->hasTemporarilyBufferedEvent(); 
    347      if (hasTmpBufferedEvent) 
    348        hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent(); 
    349  
    350      // Don't process events if there is a temporarily buffered event 
    351      return server->eventLoop(!hasTmpBufferedEvent); 
     351     return server->eventLoop(); 
    352352   } 
    353353 
     
    389389   void CContext::closeDefinition(void) 
    390390   { 
     391     int myRank; 
     392     MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     393 
     394     //printf("myRank = %d, hasClient = %d, hasServer = %d\n", myRank, hasClient, hasServer); 
     395 
    391396     // There is nothing client need to send to server 
    392397     if (hasClient) 
    393398     { 
    394399       // After xml is parsed, there are some more works with post processing 
    395        postProcessing(); 
    396      } 
    397      setClientServerBuffer(); 
     400       postProcessing();  
     401       //printf("myRank = %d,                postProcessing OK\n", myRank); 
     402     } 
     403     setClientServerBuffer(); //printf("myRank = %d, setClientServerBuffer OK\n", myRank); 
    398404 
    399405     if (hasClient && !hasServer) 
    400406     { 
    401407      // Send all attributes of current context to server 
    402       this->sendAllAttributesToServer(); 
     408      this->sendAllAttributesToServer(); //printf("myRank = %d, this->sendAllAttributesToServer OK\n", myRank); 
    403409 
    404410      // Send all attributes of current calendar 
    405411      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(); 
     412      //printf("myRank = %d, CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer OK\n", myRank); 
    406413 
    407414      // We have enough information to send to server 
    408415      // First of all, send all enabled files 
    409        sendEnabledFiles(); 
     416       sendEnabledFiles();  //printf("myRank = %d, sendEnabledFiles OK\n", myRank); 
    410417 
    411418      // Then, send all enabled fields 
    412        sendEnabledFields(); 
     419       sendEnabledFields();  //printf("myRank = %d, sendEnabledFields OK\n", myRank); 
    413420 
    414421      // At last, we have all info of domain and axis, then send them 
    415        sendRefDomainsAxis(); 
     422       sendRefDomainsAxis();  //printf("myRank = %d, sendRefDomainsAxis OK\n", myRank); 
    416423 
    417424      // After that, send all grid (if any) 
    418        sendRefGrid(); 
     425       sendRefGrid(); //printf("myRank = %d, sendRefGrid OK\n", myRank); 
    419426    } 
    420427 
    421428    // We have a xml tree on the server side and now, it should be also processed 
    422     if (hasClient && !hasServer) sendPostProcessing(); 
     429    if (hasClient && !hasServer) sendPostProcessing();   
    423430 
    424431    // There are some processings that should be done after all of above. For example: check mask or index 
    425432    if (hasClient) 
    426433    { 
    427       this->buildFilterGraphOfEnabledFields(); 
    428       buildFilterGraphOfFieldsWithReadAccess(); 
    429       this->solveAllRefOfEnabledFields(true); 
     434      this->buildFilterGraphOfEnabledFields();  //printf("myRank = %d, buildFilterGraphOfEnabledFields OK\n", myRank); 
     435      buildFilterGraphOfFieldsWithReadAccess();  //printf("myRank = %d, buildFilterGraphOfFieldsWithReadAccess OK\n", myRank); 
     436      this->solveAllRefOfEnabledFields(true);  //printf("myRank = %d, solveAllRefOfEnabledFields OK\n", myRank); 
    430437    } 
    431438 
     
    434441 
    435442    // Nettoyage de l'arborescence 
    436     if (hasClient && !hasServer) CleanTree(); // Only on client side?? 
     443    if (hasClient && !hasServer) CleanTree(); 
    437444 
    438445    if (hasClient) 
    439446    { 
    440       sendCreateFileHeader(); 
    441  
    442       startPrefetchingOfEnabledReadModeFiles(); 
     447      sendCreateFileHeader();  //printf("myRank = %d, sendCreateFileHeader OK\n", myRank); 
     448 
     449      startPrefetchingOfEnabledReadModeFiles();  //printf("myRank = %d, startPrefetchingOfEnabledReadModeFiles OK\n", myRank); 
    443450    } 
    444451   } 
     
    479486   { 
    480487     int size = this->enabledFiles.size(); 
     488      
    481489     for (int i = 0; i < size; ++i) 
    482490     { 
     
    566574   { 
    567575      const std::vector<CFile*> allFiles = CFile::getAll(); 
    568       const CDate& initDate = calendar->getInitDate(); 
    569576 
    570577      for (unsigned int i = 0; i < allFiles.size(); i++) 
     
    572579         { 
    573580            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
    574             { 
    575               if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
    576               { 
    577                 error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 
    578                     << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 
    579                     <<"\" is less than the time step. File will not be written."<<endl; 
    580               } 
    581               else 
    582581               enabledFiles.push_back(allFiles[i]); 
    583             } 
    584582         } 
    585          else 
    586          { 
    587            if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
    588            { 
    589              error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 
    590                  << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 
    591                  <<"\" is less than the time step. File will not be written."<<endl; 
    592            } 
    593            else 
    594              enabledFiles.push_back(allFiles[i]); // otherwise true by default 
    595          } 
     583         else enabledFiles.push_back(allFiles[i]); // otherwise true by default 
     584 
    596585 
    597586      if (enabledFiles.size() == 0) 
     
    812801   void CContext::postProcessing() 
    813802   { 
     803     int myRank; 
     804     MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     805 
     806     //printf("myRank = %d, in postProcessing, isPostProcessed = %d\n", myRank, isPostProcessed); 
    814807     if (isPostProcessed) return; 
    815808 
     
    820813        ERROR("CContext::postProcessing()", << "A timestep must be defined for the context \"" << getId() << "!\"") 
    821814      // Calendar first update to set the current date equals to the start date 
    822       calendar->update(0); 
     815      calendar->update(0);  //printf("myRank = %d, calendar->update(0) OK\n", myRank); 
    823816 
    824817      // Find all inheritance in xml structure 
    825       this->solveAllInheritance(); 
     818      this->solveAllInheritance();  //printf("myRank = %d, this->solveAllInheritance OK\n", myRank); 
    826819 
    827820      // Check if some axis, domains or grids are eligible to for compressed indexed output. 
    828821      // Warning: This must be done after solving the inheritance and before the rest of post-processing 
    829       checkAxisDomainsGridsEligibilityForCompressedOutput(); 
     822      checkAxisDomainsGridsEligibilityForCompressedOutput();  //printf("myRank = %d, checkAxisDomainsGridsEligibilityForCompressedOutput OK\n", myRank); 
    830823 
    831824      // Check if some automatic time series should be generated 
    832825      // Warning: This must be done after solving the inheritance and before the rest of post-processing 
    833       prepareTimeseries(); 
     826      prepareTimeseries();  //printf("myRank = %d, prepareTimeseries OK\n", myRank); 
    834827 
    835828      //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers à sortir. 
    836       this->findEnabledFiles(); 
    837       this->findEnabledReadModeFiles(); 
     829      this->findEnabledFiles();  //printf("myRank = %d, this->findEnabledFiles OK\n", myRank); 
     830      this->findEnabledReadModeFiles();  //printf("myRank = %d, this->findEnabledReadModeFiles OK\n", myRank); 
    838831 
    839832      // Find all enabled fields of each file 
    840       this->findAllEnabledFields(); 
    841       this->findAllEnabledFieldsInReadModeFiles(); 
     833      this->findAllEnabledFields();  //printf("myRank = %d, this->findAllEnabledFields OK\n", myRank); 
     834      this->findAllEnabledFieldsInReadModeFiles();  //printf("myRank = %d, this->findAllEnabledFieldsInReadModeFiles OK\n", myRank); 
    842835 
    843836     if (hasClient && !hasServer) 
    844837     { 
    845838      // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis) 
    846       this->readAttributesOfEnabledFieldsInReadModeFiles(); 
     839      this->readAttributesOfEnabledFieldsInReadModeFiles();  //printf("myRank = %d, this->readAttributesOfEnabledFieldsInReadModeFiles OK\n", myRank); 
    847840     } 
    848841 
    849842      // Only search and rebuild all reference objects of enable fields, don't transform 
    850       this->solveOnlyRefOfEnabledFields(false); 
     843      this->solveOnlyRefOfEnabledFields(false);  //printf("myRank = %d, this->solveOnlyRefOfEnabledFields(false) OK\n", myRank); 
    851844 
    852845      // Search and rebuild all reference object of enabled fields 
    853       this->solveAllRefOfEnabledFields(false); 
     846      this->solveAllRefOfEnabledFields(false);  //printf("myRank = %d, this->solveAllRefOfEnabledFields(false) OK\n", myRank); 
    854847 
    855848      // Find all fields with read access from the public API 
    856       findFieldsWithReadAccess(); 
     849      findFieldsWithReadAccess();  //printf("myRank = %d, findFieldsWithReadAccess OK\n", myRank); 
    857850      // and solve the all reference for them 
    858       solveAllRefOfFieldsWithReadAccess(); 
     851      solveAllRefOfFieldsWithReadAccess();  //printf("myRank = %d, solveAllRefOfFieldsWithReadAccess OK\n", myRank); 
    859852 
    860853      isPostProcessed = true; 
     
    12401233         event.push(*itRank,1,msg); 
    12411234       client->sendEvent(event); 
    1242      } 
    1243      else client->sendEvent(event); 
     1235    } 
     1236    else client->sendEvent(event); 
    12441237  } 
    12451238 
  • XIOS/dev/branch_yushan/src/node/context.hpp

    r1033 r1037  
    9393 
    9494         // Put sever or client into loop state 
     95         bool eventLoop(void); 
     96 
    9597         bool checkBuffersAndListen(void); 
    9698 
  • XIOS/dev/branch_yushan/src/node/domain.cpp

    r995 r1037  
    698698     computeNGlobDomain(); 
    699699     checkZoom(); 
    700       
     700 
    701701     isDistributed_ = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 
    702702                        (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo)); 
    703  
    704      // A stupid condition to make sure that if there is only one client, domain 
    705      // should be considered to be distributed. This should be a temporary solution      
    706      isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize); 
    707703   } 
    708704 
     
    13071303   void CDomain::checkAttributesOnClientAfterTransformation() 
    13081304   { 
    1309      CContext* context=CContext::getCurrent() ; 
    1310  
     1305     int myRank; 
     1306     MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     1307 
     1308     CContext* context=CContext::getCurrent() ;  //printf("myRank = %d, CContext::getCurrent OK\n", myRank); 
     1309 
     1310     //printf("myRank = %d, this->isClientAfterTransformationChecked = %d\n", myRank, this->isClientAfterTransformationChecked); 
    13111311     if (this->isClientAfterTransformationChecked) return; 
     1312     //printf("myRank = %d, context->hasClient = %d\n", myRank, context->hasClient); 
    13121313     if (context->hasClient) 
    13131314     { 
    1314        this->checkMask(); 
    1315        if (hasLonLat || hasArea || isCompressible_) this->computeConnectedServer(); 
    1316        if (hasLonLat) this->completeLonLatClient(); 
     1315       this->checkMask();  //printf("myRank = %d, this->checkMask OK\n", myRank); 
     1316       //printf("myRank = %d, hasLonLat = %d, hasArea = %d, isCompressible_ = %d\n", myRank, hasLonLat, hasArea, isCompressible_); 
     1317       if (hasLonLat || hasArea || isCompressible_)  
     1318        { 
     1319          //printf("myRank = %d, start this->computeConnectedServer\n", myRank); 
     1320          this->computeConnectedServer(); 
     1321          //printf("myRank = %d, this->computeConnectedServer OK\n", myRank); 
     1322        } 
     1323       //printf("myRank = %d, hasLonLat = %d\n", myRank, hasLonLat); 
     1324       if (hasLonLat)  
     1325        { 
     1326          this->completeLonLatClient(); 
     1327          //printf("myRank = %d, this->completeLonLatClient OK\n", myRank); 
     1328        } 
    13171329     } 
    13181330 
     
    14481460  void CDomain::computeConnectedServer(void) 
    14491461  { 
     1462    int myRank; 
     1463    MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     1464 
    14501465    CContext* context=CContext::getCurrent() ; 
    14511466    CContextClient* client=context->client ; 
     
    15341549      } 
    15351550    } 
     1551     
    15361552 
    15371553    size_t globalSizeIndex = 1, indexBegin, indexEnd; 
     
    15551571      indexEnd = indexBegin + range - 1; 
    15561572    } 
    1557  
     1573     
    15581574    CServerDistributionDescription serverDescription(nGlobDomain_, nbServer); 
    15591575    if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 
    15601576    else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 
    15611577 
     1578    //printf("myRank = %d, check 7 OK\n", myRank); 
     1579 
    15621580    CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), 
    15631581                                                                                client->intraComm); 
    1564     clientServerMap->computeServerIndexMapping(globalIndexDomain); 
     1582    //printf("myRank = %d new OK\n", myRank); 
     1583 
     1584    clientServerMap->computeServerIndexMapping(globalIndexDomain);   
     1585    //printf("myRank = %d, clientServerMap->computeServerIndexMapping(globalIndexDomain) OK\n", myRank); 
     1586     
    15651587    const CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 
     1588    //printf("myRank = %d, clientServerMap->getGlobalIndexOnServer OK\n", myRank); 
     1589     
     1590    //printf("myRank = %d, check 8 OK\n", myRank); 
    15661591 
    15671592    CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(), 
     
    15971622    } 
    15981623 
     1624    //printf("myRank = %d, check 9 OK\n", myRank); 
     1625 
    15991626    connectedServerRank_.clear(); 
    16001627    for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) { 
     
    16051632 
    16061633    delete clientServerMap; 
     1634    //printf("myRank = %d, check 10 OK\n", myRank); 
    16071635  } 
    16081636 
  • XIOS/dev/branch_yushan/src/node/field.cpp

    r1018 r1037  
    3636      , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false) 
    3737      , useCompressedOutput(false) 
    38       , hasTimeInstant(false) 
    39       , hasTimeCentered(false) 
    40       , wasDataAlreadyReceivedFromServer(false) 
    41       , isEOF(false) 
     38      , isReadDataRequestPending(false) 
    4239   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 
    4340 
     
    5047      , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false) 
    5148      , useCompressedOutput(false) 
    52       , hasTimeInstant(false) 
    53       , hasTimeCentered(false) 
    54       , wasDataAlreadyReceivedFromServer(false) 
    55       , isEOF(false) 
     49      , isReadDataRequestPending(false) 
    5650   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 
    5751 
     
    253247  } 
    254248 
    255   bool CField::sendReadDataRequest(const CDate& tsDataRequested) 
     249  void CField::sendReadDataRequest(void) 
    256250  { 
    257251    CContext* context = CContext::getCurrent(); 
    258252    CContextClient* client = context->client; 
    259253 
    260     lastDataRequestedFromServer = tsDataRequested; 
    261  
    262     if (!isEOF) // No need to send the request if we already know we are at EOF 
    263     { 
    264       CEventClient event(getType(), EVENT_ID_READ_DATA); 
    265       if (client->isServerLeader()) 
    266       { 
    267         CMessage msg; 
    268         msg << getId(); 
    269         const std::list<int>& ranks = client->getRanksServerLeader(); 
    270         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    271           event.push(*itRank, 1, msg); 
    272         client->sendEvent(event); 
    273       } 
    274       else client->sendEvent(event); 
    275     } 
    276     else 
    277       serverSourceFilter->signalEndOfStream(tsDataRequested); 
    278  
    279     return !isEOF; 
     254    lastDataRequestedFromServer = context->getCalendar()->getCurrentDate(); 
     255    isReadDataRequestPending = true; 
     256 
     257    CEventClient event(getType(), EVENT_ID_READ_DATA); 
     258    if (client->isServerLeader()) 
     259    { 
     260      CMessage msg; 
     261      msg << getId(); 
     262      const std::list<int>& ranks = client->getRanksServerLeader(); 
     263      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
     264        event.push(*itRank, 1, msg); 
     265      client->sendEvent(event); 
     266    } 
     267    else client->sendEvent(event); 
    280268  } 
    281269 
     
    288276    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate(); 
    289277 
    290     bool dataRequested = false; 
    291  
    292     while (currentDate >= lastDataRequestedFromServer) 
    293     { 
    294       info(20) << "currentDate : " << currentDate << endl ; 
    295       info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ; 
    296       info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ; 
    297       info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 
    298  
    299       dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 
    300     } 
    301  
    302     return dataRequested; 
     278    bool requestData = (currentDate >= lastDataRequestedFromServer + file->output_freq.getValue()); 
     279 
     280    if (requestData) 
     281    { 
     282      cout<<"currentDate : "<<currentDate<<endl ; 
     283      cout<<"lastDataRequestedFromServer : "<<lastDataRequestedFromServer<<endl ; 
     284      cout<<"file->output_freq.getValue() : "<<file->output_freq.getValue()<<endl ; 
     285      cout<<"lastDataRequestedFromServer + file->output_freq.getValue() : "<<lastDataRequestedFromServer + file->output_freq.getValue()<<endl ; 
     286 
     287      sendReadDataRequest(); 
     288    } 
     289 
     290    return requestData; 
    303291  } 
    304292 
     
    322310 
    323311    map<int, CArray<double,1> >::iterator it; 
    324     if (!grid->doGridHaveDataDistributed()) 
    325     { 
    326        if (client->isServerLeader()) 
    327        { 
    328           if (!data_srv.empty()) 
    329           { 
    330             it = data_srv.begin(); 
    331             const std::list<int>& ranks = client->getRanksServerLeader(); 
    332             for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    333             { 
    334               msgs.push_back(CMessage()); 
    335               CMessage& msg = msgs.back(); 
    336               msg << getId(); 
    337               if (hasData) 
    338                 msg << getNStep() - 1 << it->second; 
    339               else 
    340                 msg << int(-1); 
    341               event.push(*itRank, 1, msg); 
    342             } 
    343           } 
    344           client->sendEvent(event); 
    345        }  
    346        else  
    347        { 
    348           // if (!data_srv.empty()) 
    349           // { 
    350           //   it = data_srv.begin(); 
    351           //   const std::list<int>& ranks = client->getRanksServerNotLeader(); 
    352           //   for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    353           //   { 
    354           //     msgs.push_back(CMessage()); 
    355           //     CMessage& msg = msgs.back(); 
    356           //     msg << getId(); 
    357           //     if (hasData) 
    358           //       msg << getNStep() - 1 << it->second; 
    359           //     else 
    360           //       msg << int(-1); 
    361           //     event.push(*itRank, 1, msg); 
    362           //   } 
    363           // } 
    364           client->sendEvent(event); 
    365        } 
    366     } 
    367     else 
    368     { 
    369       for (it = data_srv.begin(); it != data_srv.end(); it++) 
    370       { 
    371         msgs.push_back(CMessage()); 
    372         CMessage& msg = msgs.back(); 
    373         msg << getId(); 
    374         if (hasData) 
    375           msg << getNStep() - 1 << it->second; 
    376         else 
    377           msg << int(-1); 
    378         event.push(it->first, grid->nbSenders[it->first], msg); 
    379       } 
    380       client->sendEvent(event); 
    381     } 
     312    for (it = data_srv.begin(); it != data_srv.end(); it++) 
     313    { 
     314      msgs.push_back(CMessage()); 
     315      CMessage& msg = msgs.back(); 
     316      msg << getId(); 
     317      if (hasData) 
     318        msg << getNStep() - 1 << it->second; 
     319      else 
     320        msg << int(-1); 
     321      event.push(it->first, grid->nbSenders[it->first], msg); 
     322    } 
     323    client->sendEvent(event); 
    382324  } 
    383325 
     
    402344        this->incrementNStep(); 
    403345 
     346 
     347 
    404348        if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) ) 
    405349          return false; 
     
    435379    std::map<int, CArray<double,1> > data; 
    436380 
     381    bool isEOF = false; 
     382 
    437383    for (int i = 0; i < ranks.size(); i++) 
    438384    { 
     
    447393    } 
    448394 
    449     if (wasDataAlreadyReceivedFromServer) 
    450       lastDataReceivedFromServer = lastDataReceivedFromServer + file->output_freq; 
     395    if (isEOF) 
     396      serverSourceFilter->signalEndOfStream(lastDataRequestedFromServer); 
    451397    else 
    452     { 
    453       lastDataReceivedFromServer = context->getCalendar()->getInitDate(); 
    454       wasDataAlreadyReceivedFromServer = true; 
    455     } 
    456  
    457     if (isEOF) 
    458       serverSourceFilter->signalEndOfStream(lastDataReceivedFromServer); 
    459     else 
    460       serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data); 
     398      serverSourceFilter->streamDataFromServer(lastDataRequestedFromServer, data); 
     399 
     400    isReadDataRequestPending = false; 
    461401  } 
    462402 
     
    681621   void CField::solveAllReferenceEnabledField(bool doSending2Server) 
    682622   { 
    683      CContext* context = CContext::getCurrent(); 
    684      solveOnlyReferenceEnabledField(doSending2Server); 
     623     int myRank; 
     624     MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     625 
     626     CContext* context = CContext::getCurrent();  //printf("my_Rank = %d, CContext* context = CContext::getCurrent OK\n", myRank); 
     627     solveOnlyReferenceEnabledField(doSending2Server);  //printf("my_Rank = %d, solveOnlyReferenceEnabledField(doSending2Server) OK\n", myRank); 
    685628 
    686629     if (!areAllReferenceSolved) 
     
    690633        if (context->hasClient) 
    691634        { 
    692           solveRefInheritance(true); 
    693           if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false); 
     635          solveRefInheritance(true);  //printf("my_Rank = %d, solveRefInheritance(true) OK\n", myRank); 
     636          if (hasDirectFieldReference())  
     637          { 
     638            getDirectFieldReference()->solveAllReferenceEnabledField(false);  
     639            //printf("my_Rank = %d, getDirectFieldReference()->solveAllReferenceEnabledField(false) OK\n", myRank); 
     640          } 
    694641        } 
    695642        else if (context->hasServer) 
     643        { 
    696644          solveServerOperation(); 
    697  
    698         solveGridReference(); 
    699      } 
    700  
    701      solveGridDomainAxisRef(doSending2Server); 
     645          //printf("my_Rank = %d, solveServerOperation OK\n", myRank); 
     646        } 
     647 
     648        solveGridReference();  //printf("my_Rank = %d, solveGridReference OK\n", myRank); 
     649     } 
     650 
     651     solveGridDomainAxisRef(doSending2Server);  //printf("my_Rank = %d, solveGridDomainAxisRef(doSending2Server) OK\n", myRank); 
    702652 
    703653     if (context->hasClient) 
    704654     { 
    705        solveTransformedGrid(); 
    706      } 
    707  
    708      solveCheckMaskIndex(doSending2Server); 
     655       solveTransformedGrid();  //printf("my_Rank = %d, solveTransformedGrid OK\n", myRank); 
     656     } 
     657 
     658     solveCheckMaskIndex(doSending2Server);  //printf("FIELD.CPP: my_Rank = %d, solveCheckMaskIndex(doSending2Server) OK\n", myRank); 
    709659   } 
    710660 
     
    783733     { 
    784734       // Check if we have an expression to parse 
    785        if (hasExpression()) 
    786        { 
    787          boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 
    788          boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 
    789  
    790          // Check if a spatial transformation is needed 
    791          if (!field_ref.isEmpty()) 
    792          { 
    793            CGrid* gridRef = CField::get(field_ref)->grid; 
    794  
    795            if (grid && grid != gridRef && grid->hasTransform()) 
    796            { 
    797              bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    798              double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
    799              std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 
    800  
    801              filter->connectOutput(filters.first, 0); 
    802              filter = filters.second; 
    803            } 
    804          } 
    805  
    806          instantDataFilter = filter; 
     735       if (!content.empty()) 
     736       { 
     737         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(content + '\0')); 
     738         instantDataFilter = expr->reduce(gc, *this); 
    807739       } 
    808740       // Check if we have a reference on another field 
     
    811743       // Check if the data is to be read from a file 
    812744       else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
    813          instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    814                                                                                                      freq_offset.isEmpty() ? NoneDu : freq_offset, 
    815                                                                                                      true)); 
     745         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid, 
     746                                                                                                     freq_offset.isEmpty() ? NoneDu : freq_offset)); 
    816747       else // The data might be passed from the model 
    817        { 
    818           bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    819           double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
    820           instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
    821                                                                                                       ignoreMissingValue, defaultValue));       } 
     748         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid)); 
    822749     } 
    823750 
     
    858785     // Check if a spatial transformation is needed 
    859786     if (grid && grid != fieldRef->grid && grid->hasTransform()) 
    860      {        
    861        bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    862        double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);                                 
    863        filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue); 
    864      } 
     787     { 
     788       double defaultValue = 0.0; 
     789       if (!default_value.isEmpty()) defaultValue = this->default_value; 
     790       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue); 
     791     } 
     792 
    865793     else 
    866794       filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
     
    882810   boost::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 
    883811   { 
    884      if (instantDataFilter || !hasExpression()) 
     812     if (instantDataFilter || content.empty()) 
    885813       ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)", 
    886814             "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); 
     
    891819       { 
    892820         if (!serverSourceFilter) 
    893            serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    894                                                                                    freq_offset.isEmpty() ? NoneDu : freq_offset, 
    895                                                                                    true)); 
     821           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid, 
     822                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset)); 
    896823 
    897824         selfReferenceFilter = serverSourceFilter; 
    898825       } 
    899826       else if (!field_ref.isEmpty()) 
    900        { 
    901          CField* fieldRef = CField::get(field_ref); 
    902          fieldRef->buildFilterGraph(gc, false);  
    903          selfReferenceFilter = fieldRef->getInstantDataFilter(); 
    904        } 
     827         selfReferenceFilter = getFieldReference(gc); 
    905828       else 
    906829       { 
    907830         if (!clientSourceFilter) 
    908          { 
    909            bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    910            double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);  
    911            clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
    912                                                                                    ignoreMissingValue, defaultValue)); 
    913          } 
     831           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid)); 
    914832 
    915833         selfReferenceFilter = clientSourceFilter; 
     
    945863 
    946864       const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    947         
     865 
    948866       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    949867                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    957875     return it->second; 
    958876   } 
    959  
    960   /*! 
    961     * Returns the temporal filter corresponding to the field's temporal operation 
    962     * for the specified operation frequency. 
    963     * 
    964     * \param gc the garbage collector to use 
    965     * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed 
    966     * \return the output pin corresponding to the requested temporal filter 
    967     */ 
    968     
    969    boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
    970    { 
    971      if (instantDataFilter || !hasExpression()) 
    972        ERROR("COutputPin* CField::getSelfTemporalDataFilter(CGarbageCollector& gc)", 
    973              "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); 
    974  
    975      if (!selfReferenceFilter) getSelfReference(gc) ; 
    976  
    977      if (serverSourceFilter || clientSourceFilter) 
    978      { 
    979        if (operation.isEmpty()) 
    980          ERROR("void CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)", 
    981                << "An operation must be defined for field \"" << getId() << "\"."); 
    982  
    983        if (freq_op.isEmpty()) freq_op.setValue(TimeStep); 
    984        if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 
    985  
    986        const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    987  
    988        boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    989                                                                              CContext::getCurrent()->getCalendar()->getInitDate(), 
    990                                                                              freq_op, freq_offset, outFreq, 
    991                                                                              ignoreMissingValue, ignoreMissingValue ? default_value : 0.0)); 
    992        selfReferenceFilter->connectOutput(temporalFilter, 0); 
    993        return temporalFilter ; 
    994      } 
    995      else if (!field_ref.isEmpty()) 
    996      { 
    997        CField* fieldRef = CField::get(field_ref); 
    998        fieldRef->buildFilterGraph(gc, false);  
    999        return fieldRef->getTemporalDataFilter(gc, outFreq) ; 
    1000      } 
    1001   } 
    1002877 
    1003878   //---------------------------------------------------------------- 
     
    11531028     else if (grid && grid->hasTransform() && !grid->isTransformed()) 
    11541029     { 
    1155        // Temporarily deactivate the self-transformation of grid 
    1156        //grid->transformGrid(grid); 
     1030       grid->transformGrid(grid); 
    11571031     } 
    11581032   } 
     
    14301304   } 
    14311305 
    1432    /*! 
    1433     * Returns string arithmetic expression associated to the field. 
    1434     * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string. 
    1435     */ 
    1436    const string& CField::getExpression(void) 
    1437    { 
    1438      if (!expr.isEmpty() && content.empty()) 
    1439      { 
    1440        content = expr; 
    1441        expr.reset(); 
    1442      } 
    1443  
    1444      return content; 
    1445    } 
    1446  
    1447    bool CField::hasExpression(void) const 
    1448    { 
    1449      return (!expr.isEmpty() || !content.empty()); 
    1450    } 
    1451  
    14521306   DEFINE_REF_FUNC(Field,field) 
    14531307} // namespace xios 
  • XIOS/dev/branch_yushan/src/node/field.hpp

    r1017 r1037  
    124124         boost::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc); 
    125125         boost::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); 
    126          boost::shared_ptr<COutputPin> getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); 
    127126 
    128127//         virtual void fromBinary(StdIStream& is); 
     
    143142        void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers); 
    144143        void writeField(void); 
    145         bool sendReadDataRequest(const CDate& tsDataRequested); 
     144        void sendReadDataRequest(void); 
    146145        bool sendReadDataRequestIfNeeded(void); 
    147146        static void recvReadDataRequest(CEventServer& event); 
     
    179178        const std::vector<StdString>& getRefDomainAxisIds(); 
    180179 
    181         const string& getExpression(void); 
    182         bool hasExpression(void) const; 
    183  
    184180      public: 
    185181         /// Propriétés privées /// 
     
    195191         bool isEOF; 
    196192         CDate lastlast_Write_srv, last_Write_srv, last_operation_srv; 
    197          CDate lastDataRequestedFromServer, lastDataReceivedFromServer; 
    198          bool wasDataAlreadyReceivedFromServer; 
     193         CDate lastDataRequestedFromServer; 
    199194 
    200195         map<int,boost::shared_ptr<func::CFunctor> > foperation_srv; 
     
    206201         bool isReferenceSolved; 
    207202         std::vector<StdString> domAxisScalarIds_; 
     203         bool isReadDataRequestPending; 
    208204         bool useCompressedOutput; 
    209  
    210          // Two variable to identify the time_counter meta data written in file, which has no time_counter 
    211          bool hasTimeInstant; 
    212          bool hasTimeCentered; 
    213205 
    214206         DECLARE_REF_FUNC(Field,field) 
  • XIOS/dev/branch_yushan/src/node/field_impl.hpp

    r1007 r1037  
    1919  { 
    2020    if (clientSourceFilter) 
     21    { 
    2122      clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 
    22     else if (instantDataFilter) 
     23    } 
     24    else if (!field_ref.isEmpty() || !content.empty()) 
    2325      ERROR("void CField::setData(const CArray<double, N>& _data)", 
    2426            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation."); 
  • XIOS/dev/branch_yushan/src/node/file.cpp

    r1013 r1037  
    1717#include "mpi.hpp" 
    1818 
     19 
    1920namespace xios { 
    2021 
     
    2930     setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 
    3031   } 
     32    
     33 
    3134 
    3235   CFile::CFile(const StdString & id) 
     
    3841      setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 
    3942    } 
     43    
    4044 
    4145   CFile::~CFile(void) 
     
    235239      const int recordOffset = record_offset.isEmpty() ? 0 : record_offset; 
    236240 
    237       // set<CAxis*> setAxis; 
    238       // set<CDomain*> setDomains; 
    239       set<StdString> setAxis; 
    240       set<StdString> setDomains; 
    241        
     241      set<CAxis*> setAxis; 
     242      set<CDomain*> setDomains; 
     243 
    242244      std::vector<CField*>::iterator it, end = this->enabledFields.end(); 
    243245      for (it = this->enabledFields.begin(); it != end; it++) 
     
    247249         std::vector<CAxis*> vecAxis = field->grid->getAxis(); 
    248250         for (size_t i = 0; i < vecAxis.size(); ++i) 
    249             setAxis.insert(vecAxis[i]->getAxisOutputName()); 
    250             // setAxis.insert(vecAxis[i]); 
     251            setAxis.insert(vecAxis[i]); 
    251252         std::vector<CDomain*> vecDomains = field->grid->getDomains(); 
    252253         for (size_t i = 0; i < vecDomains.size(); ++i) 
    253             setDomains.insert(vecDomains[i]->getDomainOutputName()); 
    254             // setDomains.insert(vecDomains[i]); 
     254            setDomains.insert(vecDomains[i]); 
    255255 
    256256         field->resetNStep(recordOffset); 
     
    264264      if (allDomainEmpty) MPI_Comm_free(&fileComm); 
    265265 
    266       // if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 
     266      if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 
    267267      if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    268268    } 
     
    375375         if (pos2!=std::string::npos) 
    376376         { 
    377            middlePart=filename.substr(pos1,pos2-pos1) ;            
     377           middlePart=filename.substr(pos1,pos2-pos1) ; 
     378           cout<<pos2<<endl ; 
    378379           pos2+=strEndDate.size() ; 
    379380           lastPart=filename.substr(pos2,filename.size()-pos2) ; 
     
    580581          this->data_in->closeFile(); 
    581582       } 
     583 
    582584      if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
     585 
    583586   } 
    584587   //---------------------------------------------------------------- 
     
    715718   { 
    716719     int size = this->enabledFields.size(); 
     720      
    717721     for (int i = 0; i < size; ++i) 
    718722     { 
     
    745749     int size = this->enabledFields.size(); 
    746750     for (int i = 0; i < size; ++i) 
    747        this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
     751       this->enabledFields[i]->sendReadDataRequest(); 
    748752   } 
    749753 
  • XIOS/dev/branch_yushan/src/node/file.hpp

    r957 r1037  
    1212#include "attribute_enum_impl.hpp" 
    1313#include "mpi.hpp" 
     14#ifdef _usingEP 
     15#include "ep_declaration.hpp" 
     16#endif 
    1417 
    1518namespace xios { 
  • XIOS/dev/branch_yushan/src/node/grid.cpp

    r1008 r1037  
    166166   void CGrid::checkAttributesAfterTransformation() 
    167167   { 
    168       setAxisList(); 
    169       std::vector<CAxis*> axisListP = this->getAxis(); 
     168      int myRank; 
     169      MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     170 
     171      setAxisList();  //printf("myRank = %d, setAxisList OK\n", myRank); 
     172      std::vector<CAxis*> axisListP = this->getAxis();  //printf("myRank = %d, this->getAxis OK\n", myRank); 
    170173      if (!axisListP.empty()) 
    171174      { 
    172175        int idx = 0; 
    173176        axisPositionInGrid_.resize(0); 
     177         
    174178        for (int i = 0; i < axis_domain_order.numElements(); ++i) 
    175179        { 
     
    179183            axisPositionInGrid_.push_back(idx); 
    180184            ++idx; 
     185            //printf("myRank = %d, axisPositionInGrid_.push_back OK\n", myRank); 
    181186          } 
    182187          else if (2 == elementDimension) idx += 2; 
     
    186191        { 
    187192          axisListP[i]->checkAttributesOnClientAfterTransformation(globalDim_,axisPositionInGrid_[i]); 
    188         } 
    189       } 
    190  
    191       setDomainList(); 
    192       std::vector<CDomain*> domListP = this->getDomains(); 
     193          //printf("myRank = %d, axisListP[%d/%d]->checkAttributesOnClientAfterTransformation OK\n", myRank, i, axisListP.size()); 
     194        } 
     195      } 
     196 
     197      setDomainList(); //printf("myRank = %d, setDomainList OK\n", myRank); 
     198      std::vector<CDomain*> domListP = this->getDomains(); //printf("myRank = %d, this->getDomains OK\n", myRank); 
    193199      if (!domListP.empty()) 
    194200      { 
    195201        for (int i = 0; i < domListP.size(); ++i) 
    196202        { 
     203          //printf("myRank = %d, start domListP[%d]->checkAttributesOnClientAfterTransformation\n", myRank, i); 
    197204          domListP[i]->checkAttributesOnClientAfterTransformation(); 
     205          //printf("myRank = %d, domListP[%d]->checkAttributesOnClientAfterTransformation OK\n", myRank, i); 
    198206        } 
    199207      } 
     
    272280   void CGrid::checkMaskIndex(bool doSendingIndex) 
    273281   { 
    274      CContext* context = CContext::getCurrent(); 
     282     int myRank; 
     283     MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     284 
     285     CContext* context = CContext::getCurrent();  
    275286     CContextClient* client=context->client; 
    276287 
     
    278289     { 
    279290       if (context->hasClient) 
    280           if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; } 
     291          if (this->isChecked && doSendingIndex && !isIndexSent)  
     292            {  
     293              sendIndexScalarGrid();  
     294              this->isIndexSent = true;  
     295            } 
    281296 
    282297       if (this->isChecked) return; 
    283  
    284298       if (context->hasClient) 
    285299       { 
     
    287301       } 
    288302 
    289        if (!(this->hasTransform() && !this->isTransformed())) 
    290         this->isChecked = true; 
     303       this->isChecked = true; 
    291304       return; 
    292305     } 
    293  
     306      
    294307     if (context->hasClient) 
    295       if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndex(); this->isIndexSent = true; } 
     308      if (this->isChecked && doSendingIndex && !isIndexSent)  
     309        { 
     310          sendIndex();  
     311          this->isIndexSent = true; 
     312        } 
    296313 
    297314     if (this->isChecked) return; 
     
    299316     if (context->hasClient) 
    300317     { 
    301         this->checkAttributesAfterTransformation(); 
    302         this->checkMask(); 
    303         this->computeIndex(); 
     318        this->checkAttributesAfterTransformation();  
     319        this->checkMask();   
     320        this->computeIndex();   
    304321     } 
    305  
    306      if (!(this->hasTransform() && !this->isTransformed()))  
    307       this->isChecked = true; 
    308  
    309      if (!(this->hasTransform() && (!this->isGenerated()))) 
    310       this->isChecked = true;  
     322     this->isChecked = true; 
    311323   } 
    312324 
     
    10511063        int rank = *itRank; 
    10521064        int nb = 1; 
    1053         storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));         
     1065        storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb))); 
    10541066        listOutIndex.push_back(CArray<size_t,1>(nb)); 
    10551067 
     
    10631075        } 
    10641076 
    1065         storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
    10661077        listMsg.push_back(CMessage()); 
    10671078        listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back(); 
     
    10721083    } 
    10731084    else 
    1074     { 
    1075       const std::list<int>& ranks = client->getRanksServerNotLeader(); 
    1076       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    1077       { 
    1078         int rank = *itRank; 
    1079         int nb = 1;         
    1080         storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(nb))); 
    1081         CArray<int, 1>& outLocalIndexToServer = storeIndex_fromSrv[rank]; 
    1082         for (int k = 0; k < nb; ++k) 
    1083         {           
    1084           outLocalIndexToServer(k)  = 0; 
    1085         } 
    1086       } 
    10871085      client->sendEvent(event); 
    1088     } 
    10891086  } 
    10901087 
     
    11141111          outLocalIndexToServer(idx) = itIndex->second; 
    11151112        } 
    1116          
     1113 
     1114        //int nbClient = client->clientSize; // This stupid variable signals the servers the number of client connect to them 
    11171115        const std::list<int>& ranks = client->getRanksServerLeader(); 
    11181116        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    11191117        { 
    11201118          storeIndex_toSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
    1121           storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
    11221119          listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer)); 
    11231120 
     
    11291126        client->sendEvent(event); 
    11301127      } 
    1131       else  
    1132       { 
    1133         int indexSize = globalLocalIndexSendToServer.size();         
    1134         CArray<int,1> outLocalIndexToServer(indexSize); 
    1135         for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx) 
    1136         {           
    1137           outLocalIndexToServer(idx) = itIndex->second; 
    1138         } 
    1139          
    1140         const std::list<int>& ranks = client->getRanksServerNotLeader(); 
    1141         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    1142         {           
    1143           storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
    1144         } 
     1128      else 
    11451129        client->sendEvent(event); 
    1146       } 
    11471130    } 
    11481131    else 
     
    11771160          nb = globalIndexTmp[rank].size(); 
    11781161 
    1179         storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb)));         
     1162        storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb))); 
    11801163        listOutIndex.push_back(CArray<size_t,1>(nb)); 
    11811164 
     
    11891172        } 
    11901173 
    1191         storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
    11921174        listMsg.push_back(CMessage()); 
    11931175        listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back(); 
  • XIOS/dev/branch_yushan/src/node/grid.hpp

    r988 r1037  
    221221 
    222222         map<int, CArray<int, 1> > storeIndex_toSrv; 
    223          map<int, CArray<int, 1> > storeIndex_fromSrv; 
    224223         map<int,int> nbSenders; 
    225224 
  • XIOS/dev/branch_yushan/src/node/interpolate_domain.cpp

    r1014 r1037  
    4848    } 
    4949 
    50     if (this->mode.isEmpty()) this->mode.setValue(mode_attr::compute); 
    51     if (this->write_weight.isEmpty()) this->write_weight.setValue(false); 
     50    StdString weightFile = "interpolation_weights_" + domainSrc->getDomainOutputName(); 
    5251 
    53     StdString weightFile; 
    54     switch (this->mode) 
    55     { 
    56       case mode_attr::read: 
    57         if (this->weight_filename.isEmpty()) 
    58         { 
    59           if (!this->write_weight) 
     52    if (!this->mode.isEmpty()) 
     53    {  
     54      if (mode_attr::read == this->mode) 
     55      { 
     56         if (this->file.isEmpty()) 
     57         { 
    6058            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 
    6159                 << "Read mode is activated but there is no file specified." << std::endl 
    6260                 << "Please define a correct file containing interpolation weights with option 'file'. "); 
    63         } 
    64         else 
    65         { 
    66           weightFile = this->weight_filename; 
    67           ifstream f(weightFile.c_str()); 
    68           if (!f.good()) 
    69             ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 
    70                   << "Read mode is activated but file "  << weightFile << " doesn't exist." << std::endl 
    71                   << "Please check this file "); 
    72         } 
    73         break; 
    74       case mode_attr::compute: 
    75         break; 
    76       case mode_attr::read_or_compute: 
    77         if (!this->weight_filename.isEmpty() && !this->write_weight) 
    78         { 
    79           weightFile = this->weight_filename; 
    80           ifstream f(weightFile.c_str()); 
    81           if (!f.good()) 
    82             ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 
    83                   << "read_or_compute mode is activated but file "  << weightFile << " doesn't exist." << std::endl 
    84                   << "Please check this file "); 
    85         } 
    86         break; 
    87       default: 
    88         break; 
     61         } 
     62         else 
     63         { 
     64           weightFile = this->file; 
     65           ifstream f(weightFile.c_str()); 
     66           if (!f.good()) 
     67             ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 
     68                   << "Read mode is activated but file "  << weightFile << " doesn't exist." << std::endl 
     69                   << "Please check this file "); 
     70         } 
     71      } 
     72      else 
     73      { 
     74        if (file.isEmpty()) 
     75          this->file.setValue(weightFile); 
     76      }    
     77    } 
     78    else 
     79    { 
     80      if (!file.isEmpty()) // set mode read 
     81      { 
     82         weightFile = this->file; 
     83         ifstream f(weightFile.c_str()); 
     84         if (!f.good()) // file doesn't exist 
     85           this->mode.setValue(mode_attr::write); 
     86         else 
     87           this->mode.setValue(mode_attr::read); 
     88      } 
     89      else // only calculate weights() Mode set write but there is no file) 
     90      { 
     91        this->mode.setValue(mode_attr::write); 
     92      } 
    8993    } 
    9094 
  • XIOS/dev/branch_yushan/src/node/interpolate_domain.hpp

    r1004 r1037  
    5050      virtual ~CInterpolateDomain(void); 
    5151 
    52       virtual void checkValid(CDomain* domainSource); 
     52      virtual void checkValid(CDomain* axisDest); 
    5353 
    5454      /// Accesseurs statiques /// 
  • XIOS/dev/branch_yushan/src/node/mesh.cpp

    r1002 r1037  
    1111/// ////////////////////// Définitions ////////////////////// /// 
    1212 
    13   CMesh::CMesh(void) :  nbNodesGlo(0), nbEdgesGlo(0) 
    14             ,  node_start(0), node_count(0) 
    15             ,  edge_start(0), edge_count(0) 
    16             ,  nbFaces_(0), nbNodes_(0), nbEdges_(0) 
    17             ,  nodesAreWritten(false), edgesAreWritten(false), facesAreWritten(false) 
     13  CMesh::CMesh(void) :  nbNodesGlo{0}, nbEdgesGlo{0} 
     14            ,  node_start{0}, node_count{0} 
     15            ,  edge_start{0}, edge_count{0} 
     16            ,  nbFaces_{0}, nbNodes_{0}, nbEdges_{0} 
     17            ,  nodesAreWritten{false}, edgesAreWritten{false}, facesAreWritten{false} 
    1818            ,  node_lon(), node_lat() 
    1919            ,  edge_lon(), edge_lat(), edge_nodes() 
    2020            ,  face_lon(), face_lat() 
    2121            ,  face_nodes() 
    22             ,  pNodeGlobalIndex(NULL), pEdgeGlobalIndex(NULL) 
     22            ,  pNodeGlobalIndex{NULL}, pEdgeGlobalIndex{NULL} 
    2323  { 
    2424  } 
     
    9191      seed ^= sizetHash(first) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 
    9292    } 
     93    return seed ; 
     94  } 
     95 
     96///---------------------------------------------------------------- 
     97/*! 
     98 * \fn size_t generateEdgeIndex(size_t first, size_t second, int rank) 
     99 * Generates an edge index. 
     100 * If the same edge is generated by two processes, each process will have its own edge index. 
     101 * \param [in] first Edge node. 
     102 * \param [in] second Edge node. 
     103 * \param [in] rank MPI process rank. 
     104 */ 
     105  size_t generateEdgeIndex(size_t first, size_t second, int rank) 
     106  { 
     107    size_t seed = rank ; 
     108    if (first < second) 
     109    { 
     110      seed = hashPair(seed, first); 
     111      seed = hashPair(seed, second); 
     112    } 
     113    else 
     114    { 
     115      seed = hashPair(seed, second); 
     116      seed = hashPair(seed, first); 
     117    } 
     118 
    93119    return seed ; 
    94120  } 
     
    115141    return seed ; 
    116142  } 
    117  
    118   ///---------------------------------------------------------------- 
    119   /*! 
    120    * \fn size_t generateNodeIndex(vector<size_t>& valList) 
    121    * Generates a node index unique for all processes. 
    122    * \param [in] valList Vector storing four node hashes. 
    123    */ 
    124     size_t generateNodeIndex(vector<size_t>& valList) 
    125     { 
    126       // Sort is needed to avoid problems for nodes with lon = 0 generated by faces in east and west semisphere 
    127       vector<size_t> vec = valList; 
    128       sort (vec.begin(), vec.end()); 
    129       size_t seed = vec[0] ; 
    130       int it = 1; 
    131       for(; it != vec.size(); ++it) 
    132       { 
    133          seed = hashPair(seed, vec[it]); 
    134       } 
    135       return seed ; 
    136     } 
    137  
    138143 
    139144///---------------------------------------------------------------- 
     
    595600        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2Idx; 
    596601        CArray<size_t,1> nodeHashList(nbEdges_*nvertex*4); 
    597         int nbHash = 0; 
    598602        for (int ne = 0; ne < nbEdges_; ++ne) 
    599603        { 
     
    605609              if (nodeHash2Idx[hashValues[nh]].size() == 0) 
    606610              { 
    607                 nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues)); 
     611                nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues, mpiRank)); 
    608612                nodeHash2Idx[hashValues[nh]].push_back(mpiRank); 
    609                 nodeHashList(nbHash) = hashValues[nh]; 
    610                 ++nbHash; 
    611613              } 
    612             } 
    613           } 
    614         } 
    615         nodeHashList.resizeAndPreserve(nbHash); 
     614              nodeHashList((ne*nvertex + nv)*4 + nh) = hashValues[nh]; 
     615            } 
     616          } 
     617        } 
    616618 
    617619        // (2.2) Generating global node indexes 
    618         // The ownership criterion: priority of the process of smaller index 
     620        // The ownership criterion: priority of the process holding the smaller index 
    619621        // Maps generated in this step are: 
    620         // Maps generated in this step are: 
    621          // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 
    622          // nodeIdx2Idx = <idx, <rankOwner, idx>> 
    623  
    624          CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 
    625          dhtNodeHash.computeIndexInfoMapping(nodeHashList); 
    626          CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 
    627  
    628  
    629          CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 
    630          CArray<size_t,1> nodeIdxList(nbEdges_*nvertex*4); 
    631          size_t nIdx = 0; 
    632  
    633          for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 
    634          { 
    635            size_t rankMin = (it->second)[1]; 
    636            size_t idx = (it->second)[0]; 
    637            for (int i = 2; i < (it->second).size();) 
    638            { 
    639              if ( (it->second)[i+1] < rankMin) 
    640              { 
    641                idx = (it->second)[i]; 
    642                rankMin = (it->second)[i+1]; 
    643                (it->second)[i+1] = (it->second)[i-1]; 
    644              } 
    645              i += 2; 
    646            } 
    647            if (nodeIdx2Idx.count(idx) == 0) 
    648            { 
    649              if (mpiRank == rankMin) 
    650              { 
    651                nodeIdx2Idx[idx].push_back(rankMin); 
    652                nodeIdx2Idx[idx].push_back(idx); 
    653              } 
    654              nodeIdxList(nIdx) = idx; 
    655              ++nIdx; 
    656            } 
    657          } 
    658          nodeIdxList.resizeAndPreserve(nIdx); 
    659  
    660          // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 
    661          // Solution: global node indexing by hand. 
    662          // Maps modified in this step: 
    663          // nodeIdx2Idx = <idx, idxGlo> 
    664          int nodeCount = nodeIdx2Idx.size(); 
    665          int nodeStart, nbNodes; 
    666          MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
    667          int nNodes = nodeStart; 
    668          MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
    669          nbNodesGlo = nNodes; 
    670  
    671          nodeStart -= nodeCount; 
    672          node_start = nodeStart; 
    673          node_count = nodeCount; 
    674          CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 
    675          size_t count = 0; 
    676  
    677          for (int ne = 0; ne < nbEdges_; ++ne) 
    678          { 
    679            for (int nv = 0; nv < nvertex; ++nv) 
    680            { 
    681              vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 
    682              size_t nodeIdx = generateNodeIndex(hashValues); 
    683              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 
    684              if (it != nodeIdx2Idx.end()) 
    685              { 
    686                if (dummyMap.count(nodeIdx) == 0) 
    687                { 
    688                  dummyMap[nodeIdx].push_back(nodeIdx); 
    689                  (it->second)[1] = node_start + count; 
    690                  ++count; 
    691                } 
    692              } 
    693            } 
    694          } 
    695  
    696          CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 
    697          dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 
    698          CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
     622        // nodeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
     623        // nodeIdx2IdxMin = <idx, idxMin> 
     624        // nodeIdx2IdxGlo = <idxMin, idxMin> 
     625 
     626        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 
     627        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 
     628        CArray<size_t,1> nodeIdxMinList(nbEdges_*nvertex); 
     629 
     630        CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 
     631        dhtNodeHash.computeIndexInfoMapping(nodeHashList); 
     632        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 
     633        size_t iIdxMin = 0; 
     634 
     635        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 
     636        { 
     637          size_t idx = (it->second)[0]; 
     638          size_t idxMin = (it->second)[0]; 
     639          for (int i = 2; i < (it->second).size();) 
     640          { 
     641            if (mpiRank == (it->second)[i+1]) 
     642            { 
     643              idx = (it->second)[i]; 
     644            } 
     645            if ((it->second)[i] < idxMin) 
     646            { 
     647                idxMin = (it->second)[i]; 
     648                (it->second)[i] = (it->second)[i-2]; 
     649            } 
     650            i += 2; 
     651          } 
     652          (it->second)[0] = idxMin; 
     653          if (nodeIdx2IdxMin.count(idx) == 0) 
     654          { 
     655            nodeIdx2IdxMin[idx].push_back(idxMin); 
     656            if (idx == idxMin) 
     657              nodeIdx2IdxGlo[idxMin].push_back(idxMin); 
     658            nodeIdxMinList(iIdxMin) = idxMin; 
     659            ++iIdxMin; 
     660          } 
     661        } 
     662        nodeIdxMinList.resizeAndPreserve(iIdxMin); 
     663        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 
     664        CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 
     665        dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 
     666        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
     667        // nodeIdx2IdxGlo holds global indexes only for nodes owned by a process 
     668        // nodeIdxMin2IdxGlo holds global indexes for all nodes generated by a process 
    699669 
    700670        // (2.3) Saving variables: node_lon, node_lat, edge_nodes 
    701671        // Creating map nodeHash2IdxGlo <hash, idxGlo> 
    702672        // Creating map edgeHash2IdxGlo <hash, idxGlo> 
    703 //        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
    704 //        node_count = dhtNodeIdxGlo.getIndexCount(); 
    705 //        node_start = dhtNodeIdxGlo.getIndexStart(); 
     673        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
     674        node_count = dhtNodeIdxGlo.getIndexCount(); 
     675        node_start = dhtNodeIdxGlo.getIndexStart(); 
    706676        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2IdxGlo; 
    707677        node_lon.resize(node_count); 
     
    715685          { 
    716686            hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 
    717             size_t myIdx = generateNodeIndex(hashValues); 
    718             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxGlo.find(myIdx); 
    719             idxGlo = (itIdx->second)[1]; 
    720  
    721             if (mpiRank == (itIdx->second)[0]) 
    722             { 
     687            size_t myIdx = generateNodeIndex(hashValues, mpiRank); 
     688            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxMin.find(myIdx); 
     689            size_t ownerIdx = (itIdx->second)[0]; 
     690 
     691            if (myIdx == ownerIdx) 
     692            { 
     693              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdx2IdxGlo.find(myIdx); 
     694              idxGlo = (itIdxGlo->second)[0]; 
    723695//              node_lon(idxGlo - node_start) = (bounds_lon(nv, ne) == 360.) ? (0.) : (bounds_lon(nv, ne)); 
    724696              node_lon(idxGlo - node_start) = bounds_lon(nv, ne); 
    725697              node_lat(idxGlo - node_start) = bounds_lat(nv, ne); 
    726698            } 
     699            else 
     700            { 
     701              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdxMin2IdxGlo.find(ownerIdx); 
     702              idxGlo = (itIdxGlo->second)[0]; 
     703            } 
     704 
    727705            edge_nodes(nv,ne) = idxGlo; 
    728706            for (int nh = 0; nh < 4; ++nh) 
     
    815793        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHash2Rank; 
    816794        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 
    817         CArray<size_t,1> edgeIdxList(nbFaces_*nvertex); 
     795        CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 
    818796        size_t iIdx = 0; 
    819797 
     
    846824              if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 
    847825              { 
    848                 edgeIdxList(iIdx) = edgeIdxGlo; 
     826                edgeIdxGloList(iIdx) = edgeIdxGlo; 
    849827                ++iIdx; 
    850828              } 
    851829              edgeIdxGlo2Face[edgeIdxGlo].push_back(faceIdxGlo); 
     830              edgeHash2Rank[edgeHash].push_back(itEdgeHash->first); 
    852831              edgeHash2Rank[edgeHash].push_back(mpiRank); 
    853               edgeHash2Rank[edgeHash].push_back(itEdgeHash->second[0]); 
    854832            } 
    855833            else 
     
    859837          } 
    860838        } 
    861         edgeIdxList.resizeAndPreserve(iIdx); 
     839        edgeIdxGloList.resizeAndPreserve(iIdx); 
    862840 
    863841        // (1.3) Saving remaining variables edge_faces and face_faces 
     
    868846        dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 
    869847        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 
    870  
    871         // edgeHash2Info = <edgeHash, < rank1, idxGlo, rank2, idxGlo>> 
    872         int edgeCount = 0; 
     848        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHashMin2IdxGlo; 
     849 
     850        // edgeHash2Info = <edgeHash, <idxGlo, rank1, idxGlo, rank2>> 
     851        // edgeHashMin2IdxGlo = <edgeHashMin, idxGlo> 
    873852        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 
    874853        { 
    875854          vector <size_t> edgeInfo = it->second; 
    876           if (edgeInfo[0] == mpiRank) 
    877           { 
    878             ++edgeCount; 
    879           } 
    880         } 
    881  
    882         int edgeStart, nbEdges; 
    883         MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
    884         int nEdges = edgeStart; 
    885         MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
    886         nbEdgesGlo = nEdges; 
    887  
    888         // edges to be splitted equally between procs 
    889         if ( (nbEdgesGlo % mpiSize) == 0) 
    890         { 
    891           edge_count = nbEdgesGlo/mpiSize; 
    892           edge_start = mpiRank*edge_count; 
    893         } 
    894         else 
    895         { 
    896           if (mpiRank == (mpiSize - 1) ) 
    897           { 
    898             edge_count = nbEdgesGlo/mpiSize; 
    899             edge_start = mpiRank*(nbEdgesGlo/mpiSize + 1); 
    900           } 
    901           else 
    902           { 
    903             edge_count = nbEdgesGlo/mpiSize + 1; 
    904             edge_start = mpiRank*edge_count; 
    905           } 
    906         } 
    907         CArray<size_t,1> edgeIdxGloList(edge_count); 
    908         for (int i = 0; i < edge_count; ++i) 
    909         { 
    910           edgeIdxGloList(i) = i + edge_start; 
    911         } 
    912  
    913         CClientClientDHTSizet dhtEdgeIdxGlo2Face (edgeIdxGlo2Face, comm); 
     855          if (edgeInfo.size() == 4)                       // two processes generate the same edge 
     856            if (edgeInfo[1] > edgeInfo[3]) 
     857              edgeInfo[1] = edgeInfo[3]; 
     858          if (edgeInfo[1] == mpiRank) 
     859            edgeHashMin2IdxGlo[it->first].push_back(edgeInfo[0]); 
     860        } 
     861 
     862        CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeHashMin2IdxGlo, comm); 
     863        edge_count = dhtEdgeIdxGlo.getIndexCount(); 
     864        edge_start = dhtEdgeIdxGlo.getIndexStart(); 
     865 
     866        edge_faces.resize(2, edge_count); 
     867        face_faces.resize(nvertex, nbFaces_); 
     868 
    914869        CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm); 
    915         dhtEdgeIdxGlo2Face.computeIndexInfoMapping(edgeIdxGloList); 
    916         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdgeIdxGlo2Face.getInfoIndexMap(); 
    917         dhtEdge2Face.computeIndexInfoMapping(edgeIdxList); 
    918         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 
    919  
    920  
    921         edge_faces.resize(2, edge_count); 
    922         for (int i = 0; i < edge_count; ++i) 
    923         { 
    924           CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdxGlo2FaceIdx.find(i + edge_start); 
    925           int indexGlo = it->first; 
    926           vector<size_t> faces = it->second; 
    927           int face1 = faces[0]; 
    928           edge_faces(0, indexGlo - edge_start) = face1; 
    929           if (faces.size() == 2) 
    930           { 
    931             int face2 = faces[1]; 
    932             edge_faces(1, indexGlo - edge_start) = face2; 
    933           } 
    934           else 
    935           { 
    936             edge_faces(1, indexGlo - edge_start) = -999; 
    937           } 
    938         } 
    939  
    940         size_t tmp; 
    941         vector<size_t> tmpVec; 
    942         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2FaceIdx.begin(); it != edgeIdx2FaceIdx.end(); it++) 
    943         { 
    944           tmp = it->first; 
    945           tmpVec = it->second; 
    946           tmp++; 
    947         } 
    948  
    949         CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2, itIndex; 
    950         face_faces.resize(nvertex, nbFaces_); 
     870        dhtEdge2Face.computeIndexInfoMapping(edgeIdxGloList); 
     871        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 
     872        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2; 
     873 
    951874        for (int nf = 0; nf < nbFaces_; ++nf) 
    952875        { 
     
    973896              size_t faceIdxGlo = nbFacesAccum + nf; 
    974897              size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 
    975               itEdgeHash = edgeHash2Info.find(edgeHash); 
    976               int edgeIdxGlo = (itEdgeHash->second)[1]; 
    977  
    978               if ( (itEdgeHash->second)[0] == mpiRank) 
     898              itEdgeHash = edgeHash2IdxGlo.find(edgeHash); 
     899              if (itEdgeHash != edgeHashMin2IdxGlo.end()) 
    979900              { 
    980                 itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 
     901                int edgeIdxGlo = itEdgeHash->second[0]; 
     902                itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    981903                int face1 = itFace1->second[0]; 
    982904                if (itFace1->second.size() == 1) 
    983905                { 
     906                  edge_faces(0, edgeIdxGlo - edge_start) = face1; 
     907                  edge_faces(1, edgeIdxGlo - edge_start) = -999; 
    984908                  face_faces(nv1, nf) = 999999; 
    985909                } 
     
    987911                { 
    988912                  int face2 = itFace1->second[1]; 
     913                  edge_faces(0, edgeIdxGlo - edge_start) = face1; 
     914                  edge_faces(1, edgeIdxGlo - edge_start) = face2; 
    989915                  face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 
    990916                } 
     
    992918              else 
    993919              { 
    994                 itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 
     920                itEdgeHash = edgeHashMin2IdxGlo.find(edgeHash); 
     921                size_t edgeIdxGlo = itEdgeHash->second[0]; 
     922                itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    995923                int face1 = itFace1->second[0]; 
    996924                int face2 = itFace1->second[1]; 
     
    1029957        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it1, it2; 
    1030958        CArray<size_t,1> edgeHashList(nbFaces_*nvertex); 
    1031         int nEdgeHash = 0; 
    1032959        for (int nf = 0; nf < nbFaces_; ++nf) 
    1033960        { 
     
    1051978            face_nodes(nv1,nf) = it1->second[0]; 
    1052979            size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 
    1053             if (edgeHash2Idx.count(edgeHash) == 0) 
    1054             { 
    1055               edgeHash2Idx[edgeHash].push_back(edgeHash); 
    1056               edgeHash2Idx[edgeHash].push_back(mpiRank); 
    1057               edgeHashList(nEdgeHash) = edgeHash; 
    1058               ++nEdgeHash; 
    1059             } 
    1060           } 
    1061         } 
    1062         edgeHashList.resizeAndPreserve(nEdgeHash); 
    1063  
    1064         // (2.3) Generating global edge indexes 
    1065         // The ownership criterion: priority of the process with smaller rank 
     980            edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(it1->second[0], it2->second[0], mpiRank)); 
     981            edgeHash2Idx[edgeHash].push_back(mpiRank); 
     982            edgeHashList(nf*nvertex + nv1) = edgeHash; 
     983          } 
     984        } 
     985 
     986        // (2.2) Generating global edge indexes 
     987        // The ownership criterion: priority of the process holding the smaller index 
    1066988        // Maps generated in this step are: 
    1067         // edgeIdx2Idx = = <idx, <rankOwner, idx>> 
    1068         // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 
     989        // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
     990        // edgeIdx2IdxMin = = <idx, idxMin> 
     991        // edgeIdx2IdxGlo = <idxMin, idxGlo> 
    1069992 
    1070993        CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); 
    1071994        dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 
    1072995        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 
    1073         // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
    1074  
    1075         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 
     996 
     997        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 
     998        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 
     999        CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 
     1000        size_t iIdxMin = 0; 
    10761001 
    10771002        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 
    10781003        { 
    1079           size_t rankMin = (it->second)[1]; 
     1004          size_t idxMin = (it->second)[0]; 
    10801005          size_t idx = (it->second)[0]; 
    1081  
    10821006          for (int i = 2; i < (it->second).size();) 
    10831007          { 
    1084             if ((it->second)[i+1] < rankMin) 
    1085             { 
    1086               rankMin = (it->second)[i+1]; 
     1008            if (mpiRank == (it->second)[i+1]) 
     1009            { 
    10871010              idx = (it->second)[i]; 
    1088               (it->second)[i+1] = (it->second)[i-1]; 
     1011            } 
     1012            if ((it->second)[i] < idxMin) 
     1013            { 
     1014                idxMin = (it->second)[i]; 
     1015                (it->second)[i] = (it->second)[i-2]; 
    10891016            } 
    10901017            i += 2; 
    10911018          } 
    1092           if (edgeIdx2Idx.count(idx) == 0) 
    1093           { 
    1094             if (mpiRank == rankMin) 
    1095             { 
    1096               edgeIdx2Idx[idx].push_back(rankMin); 
    1097               edgeIdx2Idx[idx].push_back(idx); 
    1098             } 
    1099           } 
    1100         } 
    1101  
    1102         int edgeCount = edgeIdx2Idx.size(); 
    1103         int edgeStart, nbEdges; 
    1104         MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
    1105         int nEdges = edgeStart; 
    1106         MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
    1107         nbEdgesGlo = nEdges; 
    1108  
    1109         edgeStart -= edgeCount; 
    1110         edge_start = edgeStart; 
    1111         edge_count = edgeCount; 
    1112         CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 
    1113         int count = 0; 
     1019          (it->second)[0] = idxMin; 
     1020          if (edgeIdx2IdxMin.count(idx) == 0) 
     1021          { 
     1022            edgeIdx2IdxMin[idx].push_back(idxMin); 
     1023            if (idx == idxMin) 
     1024              edgeIdx2IdxGlo[idxMin].push_back(idxMin); 
     1025            edgeIdxMinList(iIdxMin) = idxMin; 
     1026            ++iIdxMin; 
     1027          } 
     1028        } 
     1029        edgeIdxMinList.resizeAndPreserve(iIdxMin); 
     1030        CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 
     1031        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 
     1032        dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 
     1033        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
     1034        // edgeIdx2IdxGlo holds global indexes only for edges owned by a process 
     1035        // edgeIdxMin2IdxGlo holds global indexes for all edges generated by a process 
     1036 
     1037        // (2.3) Saving variables: edge_lon, edge_lat, face_edges 
     1038        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 
     1039        edge_count = dhtEdgeIdxGlo.getIndexCount(); 
     1040        edge_start = dhtEdgeIdxGlo.getIndexStart(); 
     1041        edge_lon.resize(edge_count); 
     1042        edge_lat.resize(edge_count); 
     1043        edge_nodes.resize(2, edge_count); 
     1044        face_edges.resize(nvertex, nbFaces_); 
     1045 
     1046        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 
     1047        CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 
     1048        size_t iIdx = 0; 
    11141049 
    11151050        for (int nf = 0; nf < nbFaces_; ++nf) 
     
    11331068              it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 
    11341069            } 
    1135             size_t nodeIdxGlo1 = it1->second[0]; 
    1136             size_t nodeIdxGlo2 = it2->second[0]; 
    1137  
    1138             if (nodeIdxGlo1 != nodeIdxGlo2) 
    1139             { 
    1140               size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1141               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 
    1142               if (it != edgeIdx2Idx.end()) 
    1143               { 
    1144                 if (dummyEdgeMap.count(edgeIdx) == 0) 
    1145                 { 
    1146                   dummyEdgeMap[edgeIdx].push_back(edgeIdx); 
    1147                   (it->second)[1] = edge_start + count; 
    1148                   ++count; 
    1149                 } 
    1150               } 
    1151             } 
    1152           } 
    1153         } 
    1154  
    1155         CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 
    1156         dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 
    1157         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
    1158  
    1159         // (2.4) Saving variables: edge_lon, edge_lat, face_edges 
    1160         edge_lon.resize(edge_count); 
    1161         edge_lat.resize(edge_count); 
    1162         edge_nodes.resize(2, edge_count); 
    1163         face_edges.resize(nvertex, nbFaces_); 
    1164  
    1165         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 
    1166         CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 
    1167         size_t iIdx = 0; 
    1168  
    1169         for (int nf = 0; nf < nbFaces_; ++nf) 
    1170         { 
    1171           for (int nv1 = 0; nv1 < nvertex; ++nv1) 
    1172           { 
    1173             // Getting global indexes of edge's nodes 
    1174             int nh1 = 0; 
    1175             int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 
    1176             it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1)); 
    1177             while (it1 == nodeHash2IdxGlo.end()) 
    1178             { 
    1179               ++nh1; 
    1180               it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1)); 
    1181             } 
    1182             int nh2 = 0; 
    1183             it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv2)*4 + nh2)); 
    1184             while (it2 == nodeHash2IdxGlo.end()) 
    1185             { 
    1186               ++nh2; 
    1187               it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 
    1188             } 
    11891070            // Getting edge global index 
    11901071            size_t nodeIdxGlo1 = it1->second[0]; 
    11911072            size_t nodeIdxGlo2 = it2->second[0]; 
    1192             size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
     1073            size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
    11931074            if (nodeIdxGlo1 != nodeIdxGlo2) 
    11941075            { 
    1195               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 
    1196               int edgeIdxGlo = (itIdx->second)[1]; 
     1076              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
     1077              size_t ownerIdx = (itIdx->second)[0]; 
     1078              int edgeIdxGlo = 0; 
    11971079              size_t faceIdxGlo = nbFacesAccum + nf; 
    11981080 
    1199               if (mpiRank == (itIdx->second)[0]) 
     1081              if (myIdx == ownerIdx) 
    12001082              { 
     1083                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
     1084                edgeIdxGlo = (itIdxGlo->second)[0]; 
    12011085                double edgeLon; 
    12021086                double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); 
     
    12121096                edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 
    12131097              } 
     1098              else 
     1099              { 
     1100                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
     1101                edgeIdxGlo = (itIdxGlo->second)[0]; 
     1102              } 
    12141103              face_edges(nv1,nf) = edgeIdxGlo; 
    12151104              if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 
     
    12281117        edgeIdxGloList.resizeAndPreserve(iIdx); 
    12291118 
    1230         // (2.5) Saving remaining variables edge_faces and face_faces 
     1119        // (2.4) Saving remaining variables edge_faces and face_faces 
    12311120        edge_faces.resize(2, edge_count); 
    12321121        face_faces.resize(nvertex, nbFaces_); 
     
    12361125        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 
    12371126        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdxGlo1, itNodeIdxGlo2; 
    1238         CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx; 
    12391127 
    12401128        for (int nf = 0; nf < nbFaces_; ++nf) 
     
    12611149            size_t nodeIdxGlo2 = it2->second[0]; 
    12621150 
    1263             size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1264             itIdx = edgeIdx2IdxGlo.find(myIdx); 
     1151            size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
     1152            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
     1153            size_t ownerIdx = (itIdx->second)[0]; 
    12651154            size_t faceIdxGlo = nbFacesAccum + nf; 
    1266             int edgeIdxGlo = (itIdx->second)[1]; 
    1267  
    1268             if (mpiRank == (itIdx->second)[0]) 
    1269             { 
     1155 
     1156            if (myIdx == ownerIdx) 
     1157            { 
     1158              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
     1159              int edgeIdxGlo = (itIdxGlo->second)[0]; 
    12701160              it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    12711161              int face1 = it1->second[0]; 
     
    12861176            else 
    12871177            { 
     1178              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
     1179              size_t edgeIdxGlo = (itIdxGlo->second)[0]; 
    12881180              it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    12891181              int face1 = it1->second[0]; 
     
    13081200          { 
    13091201            hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 
    1310 //            size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 
    1311             size_t nodeIndex = generateNodeIndex(hashValues); 
     1202            size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 
    13121203            for (int nh = 0; nh < 4; ++nh) 
    13131204            { 
     
    13251216 
    13261217        // (3.2) Generating global node indexes 
    1327         // The ownership criterion: priority of the process with smaller rank. 
    1328         // With any other criterion it is not possible to have consistent node indexing for different number of procs. 
     1218        // The ownership criterion: priority of the process holding the smaller index 
    13291219        // Maps generated in this step are: 
    1330         // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 
    1331         // nodeIdx2Idx = <idx, <rankOwner, idx>> 
     1220        // nodeHash2Info = <hash, [[idxMin, rankMin], [idx1, rank1], [idx3, rank3]..]> 
     1221        // nodeIdx2IdxMin = = <idx, idxMin> 
     1222        // nodeIdx2IdxGlo = <idxMin, idxGlo> 
    13321223 
    13331224        CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 
     
    13351226        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 
    13361227 
    1337         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 
    1338         CArray<size_t,1> nodeIdxList(nbFaces_*nvertex*4); 
    1339         size_t nIdx = 0; 
     1228        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 
     1229        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 
     1230        CArray<size_t,1> nodeIdxMinList(nbFaces_*nvertex*4); 
     1231        size_t iIdxMin = 0; 
    13401232 
    13411233        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 
    13421234        { 
    1343           size_t rankMin = (it->second)[1]; 
     1235          size_t idxMin = (it->second)[0]; 
    13441236          size_t idx = (it->second)[0]; 
    13451237          for (int i = 2; i < (it->second).size();) 
    13461238          { 
    1347             if ( (it->second)[i+1] < rankMin) 
     1239            if (mpiRank == (it->second)[i+1]) 
    13481240            { 
    13491241              idx = (it->second)[i]; 
    1350               rankMin = (it->second)[i+1]; 
    1351               (it->second)[i+1] = (it->second)[i-1]; 
     1242            } 
     1243            if ((it->second)[i] < idxMin) 
     1244            { 
     1245                idxMin = (it->second)[i]; 
     1246                (it->second)[i] = (it->second)[i-2]; 
    13521247            } 
    13531248            i += 2; 
    13541249          } 
    1355           if (nodeIdx2Idx.count(idx) == 0) 
    1356           { 
    1357             if (mpiRank == rankMin) 
    1358             { 
    1359               nodeIdx2Idx[idx].push_back(rankMin); 
    1360               nodeIdx2Idx[idx].push_back(idx); 
    1361             } 
    1362             nodeIdxList(nIdx) = idx; 
    1363             ++nIdx; 
    1364           } 
    1365         } 
    1366  
    1367 //        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm); 
    1368         // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 
    1369         // Solution: global node indexing by hand. 
    1370         // Maps modified in this step: 
    1371         // nodeIdx2Idx = <idx, idxGlo> 
    1372         int nodeCount = nodeIdx2Idx.size(); 
    1373         int nodeStart, nbNodes; 
    1374         MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
    1375         int nNodes = nodeStart; 
    1376         MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
    1377         nbNodesGlo = nNodes; 
    1378  
    1379         nodeStart -= nodeCount; 
    1380         node_start = nodeStart; 
    1381         node_count = nodeCount; 
    1382         CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 
    1383         size_t count = 0; 
    1384  
    1385         for (int nf = 0; nf < nbFaces_; ++nf) 
    1386         { 
    1387           for (int nv = 0; nv < nvertex; ++nv) 
    1388           { 
    1389             vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 
    1390             size_t nodeIdx = generateNodeIndex(hashValues); 
    1391             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 
    1392             if (it != nodeIdx2Idx.end()) 
    1393             { 
    1394               if (dummyMap.count(nodeIdx) == 0) 
    1395               { 
    1396                 dummyMap[nodeIdx].push_back(nodeIdx); 
    1397                 (it->second)[1] = node_start + count; 
    1398                 ++count; 
    1399               } 
    1400             } 
    1401           } 
    1402         } 
    1403         nodeIdxList.resizeAndPreserve(nIdx); 
    1404         CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 
    1405         dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 
    1406         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
     1250          (it->second)[0] = idxMin; 
     1251          if (nodeIdx2IdxMin.count(idx) == 0) 
     1252          { 
     1253            nodeIdx2IdxMin[idx].push_back(idxMin); 
     1254            if (idx == idxMin) 
     1255              nodeIdx2IdxGlo[idxMin].push_back(idxMin); 
     1256            nodeIdxMinList(iIdxMin) = idxMin; 
     1257            ++iIdxMin; 
     1258          } 
     1259        } 
     1260 
     1261        nodeIdxMinList.resizeAndPreserve(iIdxMin); 
     1262        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 
     1263        CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 
     1264        dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 
     1265        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
    14071266 
    14081267        // (3.3) Saving node data: node_lon, node_lat, and face_nodes 
    14091268        // Generating edgeHash2Info = <hash, <idx, rank>> and edgeHashList 
    1410 //        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
    1411 //        node_count = dhtNodeIdxGlo.getIndexCount(); 
    1412 //        node_start = dhtNodeIdxGlo.getIndexStart(); 
     1269        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
     1270        node_count = dhtNodeIdxGlo.getIndexCount(); 
     1271        node_start = dhtNodeIdxGlo.getIndexStart(); 
    14131272        node_lon.resize(node_count); 
    14141273        node_lat.resize(node_count); 
     
    14271286            vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 
    14281287            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    1429             size_t nodeIdx1 = generateNodeIndex(hashValues1); 
    1430             size_t nodeIdx2 = generateNodeIndex(hashValues2); 
    1431             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 
    1432             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 
    1433             size_t ownerRank = (itNodeIdx1->second)[0]; 
    1434             nodeIdxGlo1 = (itNodeIdx1->second)[1]; 
    1435             nodeIdxGlo2 = (itNodeIdx2->second)[1]; 
    1436  
    1437             if (mpiRank == ownerRank) 
    1438             { 
     1288            size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 
     1289            size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 
     1290            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxMin.find(myNodeIdx1); 
     1291            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxMin.find(myNodeIdx2); 
     1292            size_t ownerNodeIdx = (itNodeIdx1->second)[0]; 
     1293 
     1294            if (myNodeIdx1 == ownerNodeIdx) 
     1295            { 
     1296              itNodeIdxGlo1 = nodeIdx2IdxGlo.find(myNodeIdx1); 
     1297              nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
    14391298              node_lon(nodeIdxGlo1 - node_start) = bounds_lon(nv1, nf); 
    14401299              node_lat(nodeIdxGlo1 - node_start) = bounds_lat(nv1, nf); 
    14411300            } 
     1301            else 
     1302            { 
     1303              itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find(ownerNodeIdx); 
     1304              nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
     1305            } 
     1306            itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((itNodeIdx2->second)[0]); 
     1307            nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 
    14421308            if (nodeIdxGlo1 != nodeIdxGlo2) 
    14431309            { 
    14441310              size_t edgeHash = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1445               edgeHash2Idx[edgeHash].push_back(edgeHash); 
     1311              edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank)); 
    14461312              edgeHash2Idx[edgeHash].push_back(mpiRank); 
    14471313              edgeHashList(nEdgeHash) = edgeHash; 
     
    14551321        // (3.4) Generating global edge indexes 
    14561322        // Maps generated in this step are: 
    1457         // edgeIdx2Idx = = <idx, <rankOwner, idx>> 
    1458         // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 
     1323        // edgeIdx2IdxMin = = <idx, idxMin> 
     1324        // edgeIdx2IdxGlo = <idxMin, idxGlo> 
    14591325 
    14601326        CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); 
     
    14631329        // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
    14641330 
    1465         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 
     1331        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 
     1332        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 
     1333        CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 
     1334        iIdxMin = 0; 
    14661335 
    14671336        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 
    14681337        { 
    1469           size_t rankMin = (it->second)[1]; 
     1338          size_t idxMin = (it->second)[0]; 
    14701339          size_t idx = (it->second)[0]; 
    14711340 
    14721341          for (int i = 2; i < (it->second).size();) 
    14731342          { 
    1474             if ((it->second)[i+1] < rankMin) 
    1475             { 
    1476               rankMin = (it->second)[i+1]; 
     1343            if (mpiRank == (it->second)[i+1]) 
     1344            { 
    14771345              idx = (it->second)[i]; 
    1478               (it->second)[i+1] = (it->second)[i-1]; 
     1346            } 
     1347            if ((it->second)[i] < idxMin) 
     1348            { 
     1349                idxMin = (it->second)[i]; 
     1350                (it->second)[i] = (it->second)[i-2]; 
    14791351            } 
    14801352            i += 2; 
    14811353          } 
    1482           if (edgeIdx2Idx.count(idx) == 0) 
    1483           { 
    1484             if (mpiRank == rankMin) 
    1485             { 
    1486               edgeIdx2Idx[idx].push_back(rankMin); 
    1487               edgeIdx2Idx[idx].push_back(idx); 
    1488             } 
    1489           } 
    1490         } 
    1491  
    1492         int edgeCount = edgeIdx2Idx.size(); 
    1493         int edgeStart, nbEdges; 
    1494         MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
    1495         int nEdges = edgeStart; 
    1496         MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
    1497         nbEdgesGlo = nEdges; 
    1498  
    1499         edgeStart -= edgeCount; 
    1500         edge_start = edgeStart; 
    1501         edge_count = edgeCount; 
    1502         CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 
    1503         count = 0; 
    1504  
    1505         for (int nf = 0; nf < nbFaces_; ++nf) 
    1506         { 
    1507           for (int nv1 = 0; nv1 < nvertex; ++nv1) 
    1508           { 
    1509             int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 
    1510             vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 
    1511             vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    1512             size_t nodeIdx1 = generateNodeIndex(hashValues1); 
    1513             size_t nodeIdx2 = generateNodeIndex(hashValues2); 
    1514             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 
    1515             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 
    1516             nodeIdxGlo1 = (itNodeIdx1->second)[1]; 
    1517             nodeIdxGlo2 = (itNodeIdx2->second)[1]; 
    1518  
    1519             if (nodeIdxGlo1 != nodeIdxGlo2) 
    1520             { 
    1521               size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1522               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 
    1523               if (it != edgeIdx2Idx.end()) 
    1524               { 
    1525                 if (dummyEdgeMap.count(edgeIdx) == 0) 
    1526                 { 
    1527                   dummyEdgeMap[edgeIdx].push_back(edgeIdx); 
    1528                   (it->second)[1] = edge_start + count; 
    1529                   ++count; 
    1530                 } 
    1531               } 
    1532             } 
    1533           } 
    1534         } 
    1535         CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 
    1536         dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 
    1537         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
     1354          (it->second)[0] = idxMin; 
     1355          if (edgeIdx2IdxMin.count(idx) == 0) 
     1356          { 
     1357            edgeIdx2IdxMin[idx].push_back(idxMin); 
     1358            if (idx == idxMin) 
     1359              edgeIdx2IdxGlo[idxMin].push_back(idxMin); 
     1360            edgeIdxMinList(iIdxMin) = idxMin; 
     1361            ++iIdxMin; 
     1362          } 
     1363        } 
     1364        edgeIdxMinList.resizeAndPreserve(iIdxMin); 
     1365        CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 
     1366        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 
     1367        dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 
     1368        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
    15381369 
    15391370        // (3.5) Saving variables: edge_lon, edge_lat, face_edges 
    15401371        // Creating map edgeIdxGlo2Face <idxGlo, face> 
    1541 //        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 
    1542 //        edge_count = dhtEdgeIdxGlo.getIndexCount(); 
    1543 //        edge_start = dhtEdgeIdxGlo.getIndexStart(); 
    1544  
     1372 
     1373        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 
     1374        edge_count = dhtEdgeIdxGlo.getIndexCount(); 
     1375        edge_start = dhtEdgeIdxGlo.getIndexStart(); 
    15451376        edge_lon.resize(edge_count); 
    15461377        edge_lat.resize(edge_count); 
     
    15621393            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    15631394 
    1564             size_t nodeIdx1 = generateNodeIndex(hashValues1); 
    1565             size_t nodeIdx2 = generateNodeIndex(hashValues2); 
    1566             it1 = nodeIdx2IdxGlo.find(nodeIdx1); 
    1567             it2 = nodeIdx2IdxGlo.find(nodeIdx2); 
    1568             size_t nodeIdxGlo1 = (it1->second)[1]; 
    1569             size_t nodeIdxGlo2 = (it2->second)[1]; 
     1395            size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 
     1396            size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 
     1397            it1 = nodeIdx2IdxMin.find(myNodeIdx1); 
     1398            it2 = nodeIdx2IdxMin.find(myNodeIdx2); 
     1399            itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 
     1400            itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 
     1401            size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
     1402            size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 
    15701403 
    15711404            if (nodeIdxGlo1 != nodeIdxGlo2) 
    15721405            { 
    1573               size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1574               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 
    1575               int edgeIdxGlo = (itIdx->second)[1]; 
     1406              size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
     1407              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
     1408              size_t ownerIdx = (itIdx->second)[0]; 
     1409              int edgeIdxGlo; 
    15761410              size_t faceIdxGlo = nbFacesAccum + nf; 
    15771411 
    1578               if (mpiRank == (itIdx->second)[0]) 
     1412              if (myIdx == ownerIdx) 
    15791413              { 
     1414                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
     1415                edgeIdxGlo = (itIdxGlo->second)[0]; 
    15801416                double edgeLon; 
    15811417                double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); 
     
    15911427                edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 
    15921428              } 
     1429              else 
     1430              { 
     1431                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
     1432                edgeIdxGlo = (itIdxGlo->second)[0]; 
     1433              } 
    15931434              face_edges(nv1,nf) = edgeIdxGlo; 
    15941435              if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 
     
    16241465            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    16251466 
    1626             size_t myNodeIdx1 = generateNodeIndex(hashValues1); 
    1627             size_t myNodeIdx2 = generateNodeIndex(hashValues2); 
     1467            size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 
     1468            size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 
    16281469            if (myNodeIdx1 != myNodeIdx2) 
    16291470            { 
    1630               it1 = nodeIdx2IdxGlo.find(myNodeIdx1); 
    1631               it2 = nodeIdx2IdxGlo.find(myNodeIdx2); 
    1632               size_t nodeIdxGlo1 = (it1->second)[1]; 
    1633               size_t nodeIdxGlo2 = (it2->second)[1]; 
    1634               size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1635               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 
    1636               int edgeIdxGlo = (itIdx->second)[1]; 
    1637  
     1471              it1 = nodeIdx2IdxMin.find(myNodeIdx1); 
     1472              it2 = nodeIdx2IdxMin.find(myNodeIdx2); 
     1473              itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 
     1474              itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 
     1475              size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
     1476              size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 
     1477 
     1478              size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
     1479              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
     1480              size_t ownerIdx = (itIdx->second)[0]; 
    16381481              size_t faceIdxGlo = nbFacesAccum + nf; 
    16391482 
    1640               if (mpiRank == (itIdx->second)[0]) 
     1483              if (myIdx == ownerIdx) 
    16411484              { 
     1485                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
     1486                int edgeIdxGlo = (itIdxGlo->second)[0]; 
    16421487                it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    16431488                int face1 = it1->second[0]; 
     
    16551500                  face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 
    16561501                } 
    1657               } 
     1502              } // myIdx == ownerIdx 
    16581503              else 
    16591504              { 
     1505                CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
     1506                size_t edgeIdxGlo = (itIdxGlo->second)[0]; 
    16601507                it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    16611508                int face1 = it1->second[0]; 
    16621509                int face2 = it1->second[1]; 
    16631510                face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 
    1664               } 
     1511              } // myIdx != ownerIdx 
    16651512            } // myNodeIdx1 != myNodeIdx2 
    16661513            else 
     
    16681515          } 
    16691516        } 
    1670  
    16711517      } 
    16721518      facesAreWritten = true; 
  • XIOS/dev/branch_yushan/src/parse_expr/filter_expr_node.cpp

    r1001 r1037  
    4040  boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    4141  { 
    42     boost::shared_ptr<COutputPin> outputPin; 
    43  
    44     if (fieldId == "this") 
    45       outputPin = thisField.getSelfTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 
    46     else if (CField::has(fieldId)) 
    47     { 
    48       CField* field = CField::get(fieldId); 
    49       if (field == &thisField) 
    50         ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 
    51               << "The field " << fieldId << " has an invalid reference to itself. " 
    52               << "Use the keyword \"this\" if you want to reference the input data sent to this field."); 
    53  
    54       field->buildFilterGraph(gc, false); 
    55       outputPin = field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 
    56     } 
    57     else 
     42    if (!CField::has(fieldId)) 
    5843      ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 
    5944            << "The field " << fieldId << " does not exist."); 
    6045 
    61     return outputPin; 
     46    CField* field = CField::get(fieldId); 
     47    if (field == &thisField) 
     48      ERROR("boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 
     49            << "The field " << fieldId << " has an invalid reference to itself."); 
     50 
     51    field->buildFilterGraph(gc, false); 
     52    return field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 
    6253  } 
    6354 
  • XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp

    r1019 r1037  
    1010#define YY_FLEX_MAJOR_VERSION 2 
    1111#define YY_FLEX_MINOR_VERSION 5 
    12 #define YY_FLEX_SUBMINOR_VERSION 37 
     12#define YY_FLEX_SUBMINOR_VERSION 39 
    1313#if YY_FLEX_SUBMINOR_VERSION > 0 
    1414#define FLEX_BETA 
     
    143143/* Size of default input buffer. */ 
    144144#ifndef YY_BUF_SIZE 
     145#ifdef __ia64__ 
     146/* On IA-64, the buffer size is 16k, not 8k. 
     147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 
     148 * Ditto for the __ia64__ case accordingly. 
     149 */ 
     150#define YY_BUF_SIZE 32768 
     151#else 
    145152#define YY_BUF_SIZE 16384 
     153#endif /* __ia64__ */ 
    146154#endif 
    147155 
     
    169177 
    170178    #define YY_LESS_LINENO(n) 
     179    #define YY_LINENO_REWIND_TO(ptr) 
    171180     
    172181/* Return all but the first "n" matched characters back to the input stream. */ 
     
    347356extern char *yytext; 
    348357#define yytext_ptr yytext 
     358 
    349359static yyconst flex_int16_t yy_nxt[][128] = 
    350360    { 
     
    564574      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    565575      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    566       -12,   23,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
     576      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    567577      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    568578      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
     
    579589      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    580590      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    581       -13,  -13,  -13,  -13,  -13,  -13,   24,  -13,   25,   25, 
    582        25,   25,   25,   25,   25,   25,   25,   25,  -13,  -13, 
    583       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,   26, 
     591      -13,  -13,  -13,  -13,  -13,  -13,   23,  -13,   24,   24, 
     592       24,   24,   24,   24,   24,   24,   24,   24,  -13,  -13, 
     593      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,   25, 
    584594      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    585595      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    586596      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    587       -13,   26,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
     597      -13,   25,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    588598 
    589599      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
     
    598608      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    599609      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    600       -14,   27,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
     610      -14,   26,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    601611      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    602612 
     
    616626 
    617627      -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
    618       -15,   28,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
     628      -15,   27,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
    619629      -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
    620630      -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
     
    633643      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    634644      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    635       -16,   29,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
     645      -16,   28,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    636646      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    637647      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
     
    650660      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
    651661      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
    652       -17,  -17,  -17,  -17,  -17,   30,   30,   30,   30,   30, 
    653        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    654        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    655  
    656        30,  -17,  -17,  -17,  -17,  -17,  -17,   30,   30,   30, 
    657        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    658        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    659        30,   30,   30,  -17,  -17,  -17,  -17,  -17 
     662      -17,  -17,  -17,  -17,  -17,   29,   29,   29,   29,   29, 
     663       29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
     664       29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
     665 
     666       29,  -17,  -17,  -17,  -17,  -17,  -17,   29,   29,   29, 
     667       29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
     668       29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
     669       29,   29,   29,  -17,  -17,  -17,  -17,  -17 
    660670    }, 
    661671 
     
    665675      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
    666676      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
    667       -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,   31,   31, 
    668        31,   31,   31,   31,   31,   31,   31,   31,  -18,  -18, 
    669  
    670       -18,  -18,  -18,  -18,  -18,   31,   31,   31,   31,   31, 
    671        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    672        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    673        31,  -18,  -18,  -18,  -18,   31,  -18,   31,   31,   31, 
    674        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    675        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    676        31,   31,   31,  -18,  -18,  -18,  -18,  -18 
     677      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,   30,   30, 
     678       30,   30,   30,   30,   30,   30,   30,   30,  -18,  -18, 
     679 
     680      -18,  -18,  -18,  -18,  -18,   30,   30,   30,   30,   30, 
     681       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     682       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     683       30,  -18,  -18,  -18,  -18,   30,  -18,   30,   30,   30, 
     684       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     685       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     686       30,   30,   30,  -18,  -18,  -18,  -18,  -18 
    677687    }, 
    678688 
     
    735745      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
    736746 
    737       -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,   32,   32, 
    738        32,   32,   32,   32,   32,   32,   32,   32,  -22,  -22, 
    739       -22,  -22,  -22,  -22,  -22,   32,   32,   32,   32,   32, 
    740        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    741        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    742        32,  -22,  -22,  -22,  -22,   32,  -22,   32,   32,   32, 
    743        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    744        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    745        32,   32,   32,  -22,  -22,  -22,  -22,  -22 
     747      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,   31,   31, 
     748       31,   31,   31,   31,   31,   31,   31,   31,  -22,  -22, 
     749      -22,  -22,  -22,  -22,  -22,   31,   31,   31,   31,   31, 
     750       31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
     751       31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
     752       31,  -22,  -22,  -22,  -22,   31,  -22,   31,   31,   31, 
     753       31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
     754       31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
     755       31,   31,   31,  -22,  -22,  -22,  -22,  -22 
    746756    }, 
    747757 
     
    749759        3,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    750760 
     761      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     762      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     763      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     764      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,   32,   32, 
     765       32,   32,   32,   32,   32,   32,   32,   32,  -23,  -23, 
    751766      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    752767      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     
    754769      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    755770      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    756       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    757       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    758       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    759       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    760       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    761771 
    762772      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     
    769779      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    770780      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    771       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,   33,   33, 
    772        33,   33,   33,   33,   33,   33,   33,   33,  -24,  -24, 
     781      -24,  -24,  -24,  -24,  -24,  -24,   23,  -24,   24,   24, 
     782       24,   24,   24,   24,   24,   24,   24,   24,  -24,  -24, 
     783      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,   25, 
     784      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
     785 
    773786      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    774787      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    775  
    776       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    777       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    778       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
     788      -24,   25,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    779789      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    780790      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24 
     
    786796      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    787797      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    788       -25,  -25,  -25,  -25,  -25,  -25,   24,  -25,   25,   25, 
    789  
    790        25,   25,   25,   25,   25,   25,   25,   25,  -25,  -25, 
    791       -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,   26, 
     798      -25,  -25,  -25,   33,  -25,   33,  -25,  -25,   34,   34, 
     799 
     800       34,   34,   34,   34,   34,   34,   34,   34,  -25,  -25, 
    792801      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    793802      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    794803      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    795       -25,   26,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
     804      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
     805      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    796806      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    797807      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25 
     
    804814      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    805815      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    806       -26,  -26,  -26,   34,  -26,   34,  -26,  -26,   35,   35, 
    807        35,   35,   35,   35,   35,   35,   35,   35,  -26,  -26, 
     816      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
     817      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    808818      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    809819      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
     
    856866 
    857867      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    858       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    859       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    860       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    861       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    862       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    863       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    864       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    865       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    866       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29 
     868      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,   35,   35, 
     869       35,   35,   35,   35,   35,   35,   35,   35,  -29,  -29, 
     870      -29,  -29,  -29,  -29,  -29,   35,   35,   35,   35,   35, 
     871       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     872       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     873       35,  -29,  -29,  -29,  -29,   35,  -29,   35,   35,   35, 
     874       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     875       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     876       35,   35,   35,  -29,  -29,  -29,  -29,  -29 
    867877 
    868878    }, 
     
    873883      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
    874884      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
    875       -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,   36,   36, 
    876        36,   36,   36,   36,   36,   36,   36,   36,  -30,  -30, 
    877       -30,  -30,  -30,  -30,  -30,   36,   36,   36,   36,   36, 
    878        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    879        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    880        36,  -30,  -30,  -30,  -30,   36,  -30,   36,   36,   36, 
    881  
    882        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    883        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    884        36,   36,   36,  -30,  -30,  -30,  -30,  -30 
     885      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,   30,   30, 
     886       30,   30,   30,   30,   30,   30,   30,   30,  -30,  -30, 
     887      -30,  -30,  -30,  -30,  -30,   30,   30,   30,   30,   30, 
     888       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     889       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     890       30,  -30,  -30,  -30,  -30,   30,  -30,   30,   30,   30, 
     891 
     892       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     893       30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
     894       30,   30,   30,  -30,  -30,  -30,  -30,  -30 
    885895    }, 
    886896 
     
    910920      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   32,   32, 
    911921       32,   32,   32,   32,   32,   32,   32,   32,  -32,  -32, 
    912       -32,  -32,  -32,  -32,  -32,   32,   32,   32,   32,   32, 
    913        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    914        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    915        32,  -32,  -32,  -32,  -32,   32,  -32,   32,   32,   32, 
    916        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    917        32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
    918        32,   32,   32,  -32,  -32,  -32,  -32,  -32 
     922      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   25, 
     923      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
     924      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
     925      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
     926      -32,   25,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
     927      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
     928      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32 
    919929    }, 
    920930 
     
    925935      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    926936      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    927       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   33,   33, 
    928        33,   33,   33,   33,   33,   33,   33,   33,  -33,  -33, 
    929       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   26, 
     937      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   34,   34, 
     938       34,   34,   34,   34,   34,   34,   34,   34,  -33,  -33, 
    930939      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    931940      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    932941      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    933       -33,   26,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
     942      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
     943      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    934944 
    935945      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
     
    942952      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    943953      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    944       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,   35,   35, 
    945        35,   35,   35,   35,   35,   35,   35,   35,  -34,  -34, 
     954      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,   34,   34, 
     955       34,   34,   34,   34,   34,   34,   34,   34,  -34,  -34, 
    946956      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    947957      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
     
    962972 
    963973       35,   35,   35,   35,   35,   35,   35,   35,  -35,  -35, 
    964       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
    965       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
    966       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
    967       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
    968       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
    969       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
    970       -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35 
    971     }, 
    972  
    973     { 
    974         3,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
    975       -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
    976  
    977       -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
    978       -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
    979       -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,   36,   36, 
    980        36,   36,   36,   36,   36,   36,   36,   36,  -36,  -36, 
    981       -36,  -36,  -36,  -36,  -36,   36,   36,   36,   36,   36, 
    982        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    983        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    984        36,  -36,  -36,  -36,  -36,   36,  -36,   36,   36,   36, 
    985        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    986        36,   36,   36,   36,   36,   36,   36,   36,   36,   36, 
    987  
    988        36,   36,   36,  -36,  -36,  -36,  -36,  -36 
     974      -35,  -35,  -35,  -35,  -35,   35,   35,   35,   35,   35, 
     975       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     976       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     977       35,  -35,  -35,  -35,  -35,   35,  -35,   35,   35,   35, 
     978       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     979       35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
     980       35,   35,   35,  -35,  -35,  -35,  -35,  -35 
    989981    }, 
    990982 
     
    1006998        (yy_c_buf_p) = yy_cp; 
    1007999 
    1008 #define YY_NUM_RULES 20 
    1009 #define YY_END_OF_BUFFER 21 
     1000#define YY_NUM_RULES 19 
     1001#define YY_END_OF_BUFFER 20 
    10101002/* This struct is not used in this scanner, 
    10111003   but its presence is necessary. */ 
     
    10151007        flex_int32_t yy_nxt; 
    10161008        }; 
    1017 static yyconst flex_int16_t yy_accept[37] = 
     1009static yyconst flex_int16_t yy_accept[36] = 
    10181010    {   0, 
    1019         0,    0,   21,   20,    1,   20,   17,   18,    8,    6, 
    1020         7,    9,    2,   12,   20,   13,   20,    5,   10,   19, 
    1021         1,    4,   16,    0,    2,    0,   14,   11,   15,    3, 
    1022         5,    4,    2,    0,    2,    3 
     1011        0,    0,   20,   19,    1,   19,   16,   17,    8,    6, 
     1012        7,    9,    2,   12,   19,   13,   19,    5,   10,   18, 
     1013        1,    4,    0,    2,    0,   14,   11,   15,    3,    5, 
     1014        4,    2,    0,    2,    3 
    10231015    } ; 
    10241016 
     
    10261018static char *yy_last_accepting_cpos; 
    10271019 
    1028 static yyconst yy_state_type yy_NUL_trans[37] = 
     1020static yyconst yy_state_type yy_NUL_trans[36] = 
    10291021    {   0, 
    10301022       20,   20,    0,    0,    0,    0,    0,    0,    0,    0, 
    10311023        0,    0,    0,    0,    0,    0,    0,    0,    0,    0, 
    10321024        0,    0,    0,    0,    0,    0,    0,    0,    0,    0, 
    1033         0,    0,    0,    0,    0,    0 
     1025        0,    0,    0,    0,    0 
    10341026    } ; 
    10351027 
     
    10611053#include "yacc_parser.hpp" 
    10621054 
    1063 #line 1064 "lex_parser.cpp" 
     1055#line 1056 "lex_parser.cpp" 
    10641056 
    10651057#define INITIAL 0 
     
    11421134/* Amount of stuff to slurp up with each read. */ 
    11431135#ifndef YY_READ_BUF_SIZE 
     1136#ifdef __ia64__ 
     1137/* On IA-64, the buffer size is 16k, not 8k */ 
     1138#define YY_READ_BUF_SIZE 16384 
     1139#else 
    11441140#define YY_READ_BUF_SIZE 8192 
     1141#endif /* __ia64__ */ 
    11451142#endif 
    11461143 
     
    12271224        register int yy_act; 
    12281225     
    1229 #line 29 "lex_parser.lex" 
    1230  
    1231  
    1232 #line 1233 "lex_parser.cpp" 
    1233  
    12341226        if ( !(yy_init) ) 
    12351227                { 
     
    12571249                yy_load_buffer_state( ); 
    12581250                } 
     1251 
     1252        { 
     1253#line 29 "lex_parser.lex" 
     1254 
     1255 
     1256#line 1257 "lex_parser.cpp" 
    12591257 
    12601258        while ( 1 )             /* loops until end-of-file is reached */ 
     
    13901388case 16: 
    13911389YY_RULE_SETUP 
    1392 #line 67 "lex_parser.lex" 
    1393 return NE; 
     1390#line 68 "lex_parser.lex" 
     1391return LEFT_PARENTHESIS; 
    13941392        YY_BREAK 
    13951393case 17: 
    13961394YY_RULE_SETUP 
    13971395#line 69 "lex_parser.lex" 
    1398 return LEFT_PARENTHESIS; 
     1396return RIGHT_PARENTHESIS; 
    13991397        YY_BREAK 
    14001398case 18: 
    14011399YY_RULE_SETUP 
    1402 #line 70 "lex_parser.lex" 
    1403 return RIGHT_PARENTHESIS; 
     1400#line 71 "lex_parser.lex" 
     1401return END; 
    14041402        YY_BREAK 
    14051403case 19: 
    14061404YY_RULE_SETUP 
    14071405#line 72 "lex_parser.lex" 
    1408 return END; 
    1409         YY_BREAK 
    1410 case 20: 
    1411 YY_RULE_SETUP 
    1412 #line 73 "lex_parser.lex" 
    14131406ECHO; 
    14141407        YY_BREAK 
    1415 #line 1416 "lex_parser.cpp" 
     1408#line 1409 "lex_parser.cpp" 
    14161409case YY_STATE_EOF(INITIAL): 
    14171410        yyterminate(); 
     
    15441537        } /* end of action switch */ 
    15451538                } /* end of scanning one token */ 
     1539        } /* end of user's declarations */ 
    15461540} /* end of yylex */ 
    15471541 
     
    24022396#define YYTABLES_NAME "yytables" 
    24032397 
    2404 #line 73 "lex_parser.lex" 
     2398#line 71 "lex_parser.lex" 
  • XIOS/dev/branch_yushan/src/parse_expr/lex_parser.lex

    r1019 r1037  
    6565"<=" return LE; 
    6666">=" return GE; 
    67 "/=" return NE; 
    6867 
    6968"("  return LEFT_PARENTHESIS; 
  • XIOS/dev/branch_yushan/src/parse_expr/operator_expr.hpp

    r1019 r1037  
    4343      opScalarScalar[string("le")] = le_ss; 
    4444      opScalarScalar[string("ge")] = ge_ss; 
    45       opScalarScalar[string("ne")] = ne_ss; 
    4645 
    4746      opField[string("neg")] = neg_f; 
     
    6463      opFieldField[string("le")] = le_ff; 
    6564      opFieldField[string("ge")] = ge_ff; 
    66       opFieldField[string("ne")] = ne_ff; 
    6765 
    6866      opFieldScalar[string("add")] = add_fs; 
     
    7674      opFieldScalar[string("le")] = le_fs; 
    7775      opFieldScalar[string("ge")] = ge_fs; 
    78       opFieldScalar[string("ne")] = ne_fs; 
    7976 
    8077      opScalarField[string("add")] = add_sf; 
     
    8784      opScalarField[string("le")] = le_sf; 
    8885      opScalarField[string("ge")] = ge_sf; 
    89       opScalarField[string("ne")] = ne_sf; 
    9086    } 
    9187 
     
    164160    static inline double le_ss(double x, double y)    { return x <= y; } 
    165161    static inline double ge_ss(double x, double y)    { return x >= y; } 
    166     static inline double ne_ss(double x, double y)    { return x != y; } 
    167162 
    168163    static inline CArray<double,1> neg_f(const CArray<double,1>& x)   { return Array<double,1>(-x); } 
     
    185180    static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); } 
    186181    static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); } 
    187     static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x != y); } 
    188182 
    189183    static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(x + y); } 
     
    197191    static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x <= y); } 
    198192    static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x >= y); } 
    199     static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x != y); } 
    200193 
    201194    static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x + y); } 
     
    208201    static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); } 
    209202    static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); } 
    210     static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x != y); } 
    211203  }; 
    212204 
  • XIOS/dev/branch_yushan/src/parse_expr/scalar_expr_node.cpp

    r1020 r1037  
    2323  double CScalarVarExprNode::reduce() const 
    2424  { 
    25     // $missing_value will be replaced with NaN 
    26     if (varId == "missing_value") 
    27     { 
    28       return std::numeric_limits<double>::quiet_NaN(); 
    29     } 
    30     else 
    31     { 
    32       if (!CVariable::has(varId))  
    33         ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 
     25    if (!CVariable::has(varId))  
     26      ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 
    3427 
    35       return CVariable::get(varId)->getData<double>(); 
    36     } 
     28    return CVariable::get(varId)->getData<double>(); 
    3729  } 
    3830 
  • XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.cpp

    r1019 r1037  
    1 /* A Bison parser, made by GNU Bison 2.7.  */ 
     1/* A Bison parser, made by GNU Bison 3.0.2.  */ 
    22 
    33/* Bison implementation for Yacc-like parsers in C 
    4     
    5       Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 
    6     
     4 
     5   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 
     6 
    77   This program is free software: you can redistribute it and/or modify 
    88   it under the terms of the GNU General Public License as published by 
    99   the Free Software Foundation, either version 3 of the License, or 
    1010   (at your option) any later version. 
    11     
     11 
    1212   This program is distributed in the hope that it will be useful, 
    1313   but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1414   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1515   GNU General Public License for more details. 
    16     
     16 
    1717   You should have received a copy of the GNU General Public License 
    1818   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */ 
     
    2727   Bison output files to be licensed under the GNU General Public 
    2828   License without this special exception. 
    29     
     29 
    3030   This special exception was added by the Free Software Foundation in 
    3131   version 2.2 of Bison.  */ 
     
    4545 
    4646/* Bison version.  */ 
    47 #define YYBISON_VERSION "2.7" 
     47#define YYBISON_VERSION "3.0.2" 
    4848 
    4949/* Skeleton name.  */ 
     
    6363 
    6464/* Copy the first part of user declarations.  */ 
    65 /* Line 371 of yacc.c  */ 
    66 #line 1 "yacc_parser.yacc" 
     65#line 1 "yacc_parser.yacc" /* yacc.c:339  */ 
    6766 
    6867#include "filter_expr_node.hpp" 
     
    9796  } 
    9897 
    99 /* Line 371 of yacc.c  */ 
    100 #line 101 "yacc_parser.cpp" 
    101  
    102 # ifndef YY_NULL 
     98#line 99 "yacc_parser.cpp" /* yacc.c:339  */ 
     99 
     100# ifndef YY_NULLPTR 
    103101#  if defined __cplusplus && 201103L <= __cplusplus 
    104 #   define YY_NULL nullptr 
     102#   define YY_NULLPTR nullptr 
    105103#  else 
    106 #   define YY_NULL 0 
     104#   define YY_NULLPTR 0 
    107105#  endif 
    108106# endif 
     
    120118#ifndef YY_YY_YACC_PARSER_HPP_INCLUDED 
    121119# define YY_YY_YACC_PARSER_HPP_INCLUDED 
    122 /* Enabling traces.  */ 
     120/* Debug traces.  */ 
    123121#ifndef YYDEBUG 
    124122# define YYDEBUG 0 
     
    128126#endif 
    129127 
    130 /* Tokens.  */ 
     128/* Token type.  */ 
    131129#ifndef YYTOKENTYPE 
    132130# define YYTOKENTYPE 
    133    /* Put the tokens into the symbol table, so that GDB and other debuggers 
    134       know about them.  */ 
    135    enum yytokentype { 
    136      NUMBER = 258, 
    137      VAR = 259, 
    138      ID = 260, 
    139      AVERAGE = 261, 
    140      PLUS = 262, 
    141      MINUS = 263, 
    142      TIMES = 264, 
    143      DIVIDE = 265, 
    144      POWER = 266, 
    145      EQ = 267, 
    146      LT = 268, 
    147      GT = 269, 
    148      LE = 270, 
    149      GE = 271, 
    150      NE = 272, 
    151      LEFT_PARENTHESIS = 273, 
    152      RIGHT_PARENTHESIS = 274, 
    153      END = 275, 
    154      NEG = 276 
    155    }; 
    156 #endif 
    157  
    158  
     131  enum yytokentype 
     132  { 
     133    NUMBER = 258, 
     134    VAR = 259, 
     135    ID = 260, 
     136    AVERAGE = 261, 
     137    PLUS = 262, 
     138    MINUS = 263, 
     139    TIMES = 264, 
     140    DIVIDE = 265, 
     141    POWER = 266, 
     142    EQ = 267, 
     143    LT = 268, 
     144    GT = 269, 
     145    LE = 270, 
     146    GE = 271, 
     147    LEFT_PARENTHESIS = 272, 
     148    RIGHT_PARENTHESIS = 273, 
     149    END = 274, 
     150    NEG = 275 
     151  }; 
     152#endif 
     153 
     154/* Value type.  */ 
    159155#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 
    160 typedef union YYSTYPE 
    161 { 
    162 /* Line 387 of yacc.c  */ 
    163 #line 35 "yacc_parser.yacc" 
     156typedef union YYSTYPE YYSTYPE; 
     157union YYSTYPE 
     158{ 
     159#line 35 "yacc_parser.yacc" /* yacc.c:355  */ 
    164160 
    165161  std::string* str;                /* symbol table index */ 
     
    167163  xios::IFilterExprNode* filterNode; 
    168164 
    169  
    170 /* Line 387 of yacc.c  */ 
    171 #line 172 "yacc_parser.cpp" 
    172 } YYSTYPE; 
     165#line 166 "yacc_parser.cpp" /* yacc.c:355  */ 
     166}; 
    173167# define YYSTYPE_IS_TRIVIAL 1 
    174 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 
    175168# define YYSTYPE_IS_DECLARED 1 
    176169#endif 
    177170 
     171 
    178172extern YYSTYPE yylval; 
    179173 
    180 #ifdef YYPARSE_PARAM 
    181 #if defined __STDC__ || defined __cplusplus 
    182 int yyparse (void *YYPARSE_PARAM); 
    183 #else 
    184 int yyparse (); 
    185 #endif 
    186 #else /* ! YYPARSE_PARAM */ 
    187 #if defined __STDC__ || defined __cplusplus 
    188174int yyparse (void); 
    189 #else 
    190 int yyparse (); 
    191 #endif 
    192 #endif /* ! YYPARSE_PARAM */ 
    193175 
    194176#endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */ 
     
    196178/* Copy the second part of user declarations.  */ 
    197179 
    198 /* Line 390 of yacc.c  */ 
    199 #line 200 "yacc_parser.cpp" 
     180#line 181 "yacc_parser.cpp" /* yacc.c:358  */ 
    200181 
    201182#ifdef short 
     
    211192#ifdef YYTYPE_INT8 
    212193typedef YYTYPE_INT8 yytype_int8; 
    213 #elif (defined __STDC__ || defined __C99__FUNC__ \ 
    214      || defined __cplusplus || defined _MSC_VER) 
     194#else 
    215195typedef signed char yytype_int8; 
    216 #else 
    217 typedef short int yytype_int8; 
    218196#endif 
    219197 
     
    235213# elif defined size_t 
    236214#  define YYSIZE_T size_t 
    237 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 
    238      || defined __cplusplus || defined _MSC_VER) 
     215# elif ! defined YYSIZE_T 
    239216#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 
    240217#  define YYSIZE_T size_t 
     
    258235#endif 
    259236 
     237#ifndef YY_ATTRIBUTE 
     238# if (defined __GNUC__                                               \ 
     239      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \ 
     240     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 
     241#  define YY_ATTRIBUTE(Spec) __attribute__(Spec) 
     242# else 
     243#  define YY_ATTRIBUTE(Spec) /* empty */ 
     244# endif 
     245#endif 
     246 
     247#ifndef YY_ATTRIBUTE_PURE 
     248# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__)) 
     249#endif 
     250 
     251#ifndef YY_ATTRIBUTE_UNUSED 
     252# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 
     253#endif 
     254 
     255#if !defined _Noreturn \ 
     256     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 
     257# if defined _MSC_VER && 1200 <= _MSC_VER 
     258#  define _Noreturn __declspec (noreturn) 
     259# else 
     260#  define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 
     261# endif 
     262#endif 
     263 
    260264/* Suppress unused-variable warnings by "using" E.  */ 
    261265#if ! defined lint || defined __GNUC__ 
     
    265269#endif 
    266270 
    267 /* Identity function, used to suppress warnings about constant conditions.  */ 
    268 #ifndef lint 
    269 # define YYID(N) (N) 
     271#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 
     272/* Suppress an incorrect diagnostic about yylval being uninitialized.  */ 
     273# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 
     274    _Pragma ("GCC diagnostic push") \ 
     275    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 
     276    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 
     277# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 
     278    _Pragma ("GCC diagnostic pop") 
    270279#else 
    271 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    272      || defined __cplusplus || defined _MSC_VER) 
    273 static int 
    274 YYID (int yyi) 
    275 #else 
    276 static int 
    277 YYID (yyi) 
    278     int yyi; 
    279 #endif 
    280 { 
    281   return yyi; 
    282 } 
    283 #endif 
     280# define YY_INITIAL_VALUE(Value) Value 
     281#endif 
     282#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
     283# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
     284# define YY_IGNORE_MAYBE_UNINITIALIZED_END 
     285#endif 
     286#ifndef YY_INITIAL_VALUE 
     287# define YY_INITIAL_VALUE(Value) /* Nothing. */ 
     288#endif 
     289 
    284290 
    285291#if ! defined yyoverflow || YYERROR_VERBOSE 
     
    300306#   else 
    301307#    define YYSTACK_ALLOC alloca 
    302 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 
    303      || defined __cplusplus || defined _MSC_VER) 
     308#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 
    304309#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 
    305310      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */ 
     
    313318 
    314319# ifdef YYSTACK_ALLOC 
    315    /* Pacify GCC's `empty if-body' warning.  */ 
    316 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 
     320   /* Pacify GCC's 'empty if-body' warning.  */ 
     321#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 
    317322#  ifndef YYSTACK_ALLOC_MAXIMUM 
    318323    /* The OS might guarantee only one guard page at the bottom of the stack, 
     
    330335#  if (defined __cplusplus && ! defined EXIT_SUCCESS \ 
    331336       && ! ((defined YYMALLOC || defined malloc) \ 
    332              && (defined YYFREE || defined free))) 
     337             && (defined YYFREE || defined free))) 
    333338#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 
    334339#   ifndef EXIT_SUCCESS 
     
    338343#  ifndef YYMALLOC 
    339344#   define YYMALLOC malloc 
    340 #   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 
    341      || defined __cplusplus || defined _MSC_VER) 
     345#   if ! defined malloc && ! defined EXIT_SUCCESS 
    342346void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 
    343347#   endif 
     
    345349#  ifndef YYFREE 
    346350#   define YYFREE free 
    347 #   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 
    348      || defined __cplusplus || defined _MSC_VER) 
     351#   if ! defined free && ! defined EXIT_SUCCESS 
    349352void free (void *); /* INFRINGES ON USER NAME SPACE */ 
    350353#   endif 
     
    356359#if (! defined yyoverflow \ 
    357360     && (! defined __cplusplus \ 
    358         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 
     361        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 
    359362 
    360363/* A type that is properly aligned for any stack member.  */ 
     
    381384   stack.  Advance YYPTR to a properly aligned location for the next 
    382385   stack.  */ 
    383 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \ 
    384     do                                                                  \ 
    385       {                                                                 \ 
    386         YYSIZE_T yynewbytes;                                            \ 
    387         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \ 
    388         Stack = &yyptr->Stack_alloc;                                    \ 
    389         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 
    390         yyptr += yynewbytes / sizeof (*yyptr);                          \ 
    391       }                                                                 \ 
    392     while (YYID (0)) 
     386# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \ 
     387    do                                                                  \ 
     388      {                                                                 \ 
     389        YYSIZE_T yynewbytes;                                            \ 
     390        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \ 
     391        Stack = &yyptr->Stack_alloc;                                    \ 
     392        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 
     393        yyptr += yynewbytes / sizeof (*yyptr);                          \ 
     394      }                                                                 \ 
     395    while (0) 
    393396 
    394397#endif 
     
    409412            (Dst)[yyi] = (Src)[yyi];            \ 
    410413        }                                       \ 
    411       while (YYID (0)) 
     414      while (0) 
    412415#  endif 
    413416# endif 
     
    417420#define YYFINAL  16 
    418421/* YYLAST -- Last index in YYTABLE.  */ 
    419 #define YYLAST   229 
     422#define YYLAST   204 
    420423 
    421424/* YYNTOKENS -- Number of terminals.  */ 
    422 #define YYNTOKENS  22 
     425#define YYNTOKENS  21 
    423426/* YYNNTS -- Number of nonterminals.  */ 
    424427#define YYNNTS  4 
    425428/* YYNRULES -- Number of rules.  */ 
    426 #define YYNRULES  56 
    427 /* YYNRULES -- Number of states.  */ 
    428 #define YYNSTATES  116 
    429  
    430 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */ 
     429#define YYNRULES  52 
     430/* YYNSTATES -- Number of states.  */ 
     431#define YYNSTATES  108 
     432 
     433/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 
     434   by yylex, with out-of-bounds checking.  */ 
    431435#define YYUNDEFTOK  2 
    432 #define YYMAXUTOK   276 
    433  
    434 #define YYTRANSLATE(YYX)                                                \ 
     436#define YYMAXUTOK   275 
     437 
     438#define YYTRANSLATE(YYX)                                                \ 
    435439  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 
    436440 
    437 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */ 
     441/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 
     442   as returned by yylex, without out-of-bounds checking.  */ 
    438443static const yytype_uint8 yytranslate[] = 
    439444{ 
     
    465470       2,     2,     2,     2,     2,     2,     1,     2,     3,     4, 
    466471       5,     6,     7,     8,     9,    10,    11,    12,    13,    14, 
    467       15,    16,    17,    18,    19,    20,    21 
     472      15,    16,    17,    18,    19,    20 
    468473}; 
    469474 
    470475#if YYDEBUG 
    471 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 
    472    YYRHS.  */ 
    473 static const yytype_uint8 yyprhs[] = 
    474 { 
    475        0,     0,     3,     5,     8,    10,    12,    16,    20,    24, 
    476       28,    31,    35,    39,    43,    47,    51,    55,    59,    63, 
    477       68,    70,    72,    76,    80,    84,    88,    91,    95,    99, 
    478      103,   107,   111,   115,   119,   123,   127,   131,   135,   139, 
    479      143,   147,   151,   155,   159,   163,   167,   171,   175,   179, 
    480      183,   187,   191,   195,   199,   203,   207 
    481 }; 
    482  
    483 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */ 
    484 static const yytype_int8 yyrhs[] = 
    485 { 
    486       23,     0,    -1,    20,    -1,    25,    20,    -1,     3,    -1, 
    487        4,    -1,    24,     7,    24,    -1,    24,     8,    24,    -1, 
    488       24,     9,    24,    -1,    24,    10,    24,    -1,     8,    24, 
    489       -1,    24,    11,    24,    -1,    24,    12,    24,    -1,    24, 
    490       13,    24,    -1,    24,    14,    24,    -1,    24,    15,    24, 
    491       -1,    24,    16,    24,    -1,    24,    17,    24,    -1,    18, 
    492       24,    19,    -1,     5,    18,    24,    19,    -1,     5,    -1, 
    493        6,    -1,    25,     7,    25,    -1,    25,     8,    25,    -1, 
    494       25,     9,    25,    -1,    25,    10,    25,    -1,     8,    25, 
    495       -1,    25,    11,    25,    -1,    25,    12,    25,    -1,    25, 
    496       13,    25,    -1,    25,    14,    25,    -1,    25,    15,    25, 
    497       -1,    25,    16,    25,    -1,    25,    17,    25,    -1,    18, 
    498       25,    19,    -1,    25,     7,    24,    -1,    24,     7,    25, 
    499       -1,    25,     8,    24,    -1,    24,     8,    25,    -1,    25, 
    500        9,    24,    -1,    24,     9,    25,    -1,    25,    10,    24, 
    501       -1,    24,    10,    25,    -1,    25,    11,    24,    -1,    25, 
    502       12,    24,    -1,    24,    12,    25,    -1,    25,    13,    24, 
    503       -1,    24,    13,    25,    -1,    25,    14,    24,    -1,    24, 
    504       14,    25,    -1,    25,    15,    24,    -1,    24,    15,    25, 
    505       -1,    25,    16,    24,    -1,    24,    16,    25,    -1,    25, 
    506       17,    24,    -1,    24,    17,    25,    -1,     5,    18,    25, 
    507       19,    -1 
    508 }; 
    509  
    510 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */ 
     476  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */ 
    511477static const yytype_uint8 yyrline[] = 
    512478{ 
    513479       0,    61,    61,    62,    66,    67,    68,    69,    70,    71, 
    514       72,    73,    74,    75,    76,    77,    78,    79,    80,    81, 
     480      72,    73,    74,    75,    76,    77,    78,    79,    80,    84, 
    515481      85,    86,    87,    88,    89,    90,    91,    92,    93,    94, 
    516482      95,    96,    97,    98,    99,   100,   101,   102,   103,   104, 
    517483     105,   106,   107,   108,   109,   110,   111,   112,   113,   114, 
    518      115,   116,   117,   118,   119,   120,   121 
     484     115,   116,   117 
    519485}; 
    520486#endif 
     
    526492{ 
    527493  "$end", "error", "$undefined", "NUMBER", "VAR", "ID", "AVERAGE", "PLUS", 
    528   "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", "NE", 
     494  "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", 
    529495  "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "END", "NEG", "$accept", "Line", 
    530   "Expression", "Field_expr", YY_NULL 
     496  "Expression", "Field_expr", YY_NULLPTR 
    531497}; 
    532498#endif 
    533499 
    534500# ifdef YYPRINT 
    535 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 
    536    token YYLEX-NUM.  */ 
     501/* YYTOKNUM[NUM] -- (External) token number corresponding to the 
     502   (internal) symbol number NUM (which must be that of a token).  */ 
    537503static const yytype_uint16 yytoknum[] = 
    538504{ 
    539505       0,   256,   257,   258,   259,   260,   261,   262,   263,   264, 
    540506     265,   266,   267,   268,   269,   270,   271,   272,   273,   274, 
    541      275,   276 
     507     275 
    542508}; 
    543509# endif 
    544510 
    545 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */ 
     511#define YYPACT_NINF -13 
     512 
     513#define yypact_value_is_default(Yystate) \ 
     514  (!!((Yystate) == (-13))) 
     515 
     516#define YYTABLE_NINF -1 
     517 
     518#define yytable_value_is_error(Yytable_value) \ 
     519  0 
     520 
     521  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 
     522     STATE-NUM.  */ 
     523static const yytype_int16 yypact[] = 
     524{ 
     525      90,   -13,   -13,   -12,   -13,    35,    35,   -13,    44,   188, 
     526     103,    35,    24,    34,   116,   128,   -13,    35,    35,    35, 
     527      35,    65,    35,    35,    35,    35,    35,    35,    35,    35, 
     528      35,    35,    35,    35,    35,    35,    35,   -13,   140,   152, 
     529     -13,   -13,    -7,    23,    -7,    23,    24,    34,    24,    34, 
     530      54,    65,    65,    24,     0,    67,     0,    67,     0,    67, 
     531       0,    67,     0,    67,    -7,    23,    -7,    23,    24,    34, 
     532      24,    34,    24,    34,     0,    67,     0,    67,     0,    67, 
     533       0,    67,     0,    67,   -13,   -13,    65,    24,   164,    65, 
     534      65,    65,    65,    65,    65,    65,    65,    65,   176,    95, 
     535      95,    24,    24,    92,    92,    92,    92,    92 
     536}; 
     537 
     538  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 
     539     Performed when YYTABLE does not specify something else to do.  Zero 
     540     means the default is an error.  */ 
     541static const yytype_uint8 yydefact[] = 
     542{ 
     543       0,     4,     5,    19,    20,     0,     0,     2,     0,     0, 
     544       0,     0,    10,    25,     0,     0,     1,     0,     0,     0, 
     545       0,     0,     0,     0,     0,     0,     0,     0,     0,     0, 
     546       0,     0,     0,     0,     0,     0,     0,     3,     0,     0, 
     547      17,    32,     6,    34,     7,    36,     8,    38,     9,    40, 
     548       0,     0,     0,    11,    12,    43,    13,    45,    14,    47, 
     549      15,    49,    16,    51,    33,    21,    35,    22,    37,    23, 
     550      39,    24,    41,    26,    42,    27,    44,    28,    46,    29, 
     551      48,    30,    50,    31,    18,    52,     0,    10,     0,     0, 
     552       0,     0,     0,     0,     0,     0,     0,     0,     0,     6, 
     553       7,     8,     9,    12,    13,    14,    15,    16 
     554}; 
     555 
     556  /* YYPGOTO[NTERM-NUM].  */ 
     557static const yytype_int8 yypgoto[] = 
     558{ 
     559     -13,   -13,    -5,    31 
     560}; 
     561 
     562  /* YYDEFGOTO[NTERM-NUM].  */ 
     563static const yytype_int8 yydefgoto[] = 
     564{ 
     565      -1,     8,     9,    10 
     566}; 
     567 
     568  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If 
     569     positive, shift that token.  If negative, reduce the rule whose 
     570     number is the opposite.  If YYTABLE_NINF, syntax error.  */ 
     571static const yytype_uint8 yytable[] = 
     572{ 
     573      12,    14,    19,    20,    21,    11,    38,    17,    18,    19, 
     574      20,    21,    42,    44,    46,    48,    53,    54,    56,    58, 
     575      60,    62,    64,    66,    68,    70,    72,    74,    76,    78, 
     576      80,    82,    29,    30,    31,    21,    13,    15,     1,     2, 
     577       3,     4,    39,     5,    16,    31,    87,    88,    43,    45, 
     578      47,    49,     6,    55,    57,    59,    61,    63,    65,    67, 
     579      69,    71,    73,    75,    77,    79,    81,    83,     1,     2, 
     580      50,    86,     0,    51,    27,    28,    29,    30,    31,     0, 
     581       0,    98,    52,     0,    99,   100,   101,   102,   103,   104, 
     582     105,   106,   107,     1,     2,     3,     4,     0,     5,    89, 
     583      90,    91,    92,    21,    91,    92,    21,     6,     0,     7, 
     584      27,    28,    29,    30,    31,    32,    33,    34,    35,    36, 
     585       0,     0,    37,    17,    18,    19,    20,    21,    22,    23, 
     586      24,    25,    26,     0,    40,    27,    28,    29,    30,    31, 
     587      32,    33,    34,    35,    36,     0,    41,    17,    18,    19, 
     588      20,    21,    22,    23,    24,    25,    26,     0,    84,    27, 
     589      28,    29,    30,    31,    32,    33,    34,    35,    36,     0, 
     590      85,    89,    90,    91,    92,    21,    93,    94,    95,    96, 
     591      97,     0,    40,    89,    90,    91,    92,    21,    93,    94, 
     592      95,    96,    97,     0,    84,    17,    18,    19,    20,    21, 
     593      22,    23,    24,    25,    26 
     594}; 
     595 
     596static const yytype_int8 yycheck[] = 
     597{ 
     598       5,     6,     9,    10,    11,    17,    11,     7,     8,     9, 
     599      10,    11,    17,    18,    19,    20,    21,    22,    23,    24, 
     600      25,    26,    27,    28,    29,    30,    31,    32,    33,    34, 
     601      35,    36,     9,    10,    11,    11,     5,     6,     3,     4, 
     602       5,     6,    11,     8,     0,    11,    51,    52,    17,    18, 
     603      19,    20,    17,    22,    23,    24,    25,    26,    27,    28, 
     604      29,    30,    31,    32,    33,    34,    35,    36,     3,     4, 
     605       5,    17,    -1,     8,     7,     8,     9,    10,    11,    -1, 
     606      -1,    86,    17,    -1,    89,    90,    91,    92,    93,    94, 
     607      95,    96,    97,     3,     4,     5,     6,    -1,     8,     7, 
     608       8,     9,    10,    11,     9,    10,    11,    17,    -1,    19, 
     609       7,     8,     9,    10,    11,    12,    13,    14,    15,    16, 
     610      -1,    -1,    19,     7,     8,     9,    10,    11,    12,    13, 
     611      14,    15,    16,    -1,    18,     7,     8,     9,    10,    11, 
     612      12,    13,    14,    15,    16,    -1,    18,     7,     8,     9, 
     613      10,    11,    12,    13,    14,    15,    16,    -1,    18,     7, 
     614       8,     9,    10,    11,    12,    13,    14,    15,    16,    -1, 
     615      18,     7,     8,     9,    10,    11,    12,    13,    14,    15, 
     616      16,    -1,    18,     7,     8,     9,    10,    11,    12,    13, 
     617      14,    15,    16,    -1,    18,     7,     8,     9,    10,    11, 
     618      12,    13,    14,    15,    16 
     619}; 
     620 
     621  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 
     622     symbol of state STATE-NUM.  */ 
     623static const yytype_uint8 yystos[] = 
     624{ 
     625       0,     3,     4,     5,     6,     8,    17,    19,    22,    23, 
     626      24,    17,    23,    24,    23,    24,     0,     7,     8,     9, 
     627      10,    11,    12,    13,    14,    15,    16,     7,     8,     9, 
     628      10,    11,    12,    13,    14,    15,    16,    19,    23,    24, 
     629      18,    18,    23,    24,    23,    24,    23,    24,    23,    24, 
     630       5,     8,    17,    23,    23,    24,    23,    24,    23,    24, 
     631      23,    24,    23,    24,    23,    24,    23,    24,    23,    24, 
     632      23,    24,    23,    24,    23,    24,    23,    24,    23,    24, 
     633      23,    24,    23,    24,    18,    18,    17,    23,    23,     7, 
     634       8,     9,    10,    12,    13,    14,    15,    16,    23,    23, 
     635      23,    23,    23,    23,    23,    23,    23,    23 
     636}; 
     637 
     638  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */ 
    546639static const yytype_uint8 yyr1[] = 
    547640{ 
    548        0,    22,    23,    23,    24,    24,    24,    24,    24,    24, 
     641       0,    21,    22,    22,    23,    23,    23,    23,    23,    23, 
     642      23,    23,    23,    23,    23,    23,    23,    23,    23,    24, 
    549643      24,    24,    24,    24,    24,    24,    24,    24,    24,    24, 
    550       25,    25,    25,    25,    25,    25,    25,    25,    25,    25, 
    551       25,    25,    25,    25,    25,    25,    25,    25,    25,    25, 
    552       25,    25,    25,    25,    25,    25,    25,    25,    25,    25, 
    553       25,    25,    25,    25,    25,    25,    25 
     644      24,    24,    24,    24,    24,    24,    24,    24,    24,    24, 
     645      24,    24,    24,    24,    24,    24,    24,    24,    24,    24, 
     646      24,    24,    24 
    554647}; 
    555648 
    556 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */ 
     649  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */ 
    557650static const yytype_uint8 yyr2[] = 
    558651{ 
    559652       0,     2,     1,     2,     1,     1,     3,     3,     3,     3, 
    560        2,     3,     3,     3,     3,     3,     3,     3,     3,     4, 
    561        1,     1,     3,     3,     3,     3,     2,     3,     3,     3, 
     653       2,     3,     3,     3,     3,     3,     3,     3,     4,     1, 
     654       1,     3,     3,     3,     3,     2,     3,     3,     3,     3, 
    562655       3,     3,     3,     3,     3,     3,     3,     3,     3,     3, 
    563656       3,     3,     3,     3,     3,     3,     3,     3,     3,     3, 
    564        3,     3,     3,     3,     3,     3,     4 
     657       3,     3,     4 
    565658}; 
    566659 
    567 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 
    568    Performed when YYTABLE doesn't specify something else to do.  Zero 
    569    means the default is an error.  */ 
    570 static const yytype_uint8 yydefact[] = 
    571 { 
    572        0,     4,     5,    20,    21,     0,     0,     2,     0,     0, 
    573        0,     0,    10,    26,     0,     0,     1,     0,     0,     0, 
    574        0,     0,     0,     0,     0,     0,     0,     0,     0,     0, 
    575        0,     0,     0,     0,     0,     0,     0,     0,     0,     3, 
    576        0,     0,    18,    34,     6,    36,     7,    38,     8,    40, 
    577        9,    42,     0,     0,     0,    11,    12,    45,    13,    47, 
    578       14,    49,    15,    51,    16,    53,    17,    55,    35,    22, 
    579       37,    23,    39,    24,    41,    25,    43,    27,    44,    28, 
    580       46,    29,    48,    30,    50,    31,    52,    32,    54,    33, 
    581       19,    56,     0,    10,     0,     0,     0,     0,     0,     0, 
    582        0,     0,     0,     0,     0,     0,     6,     7,     8,     9, 
    583       12,    13,    14,    15,    16,    17 
    584 }; 
    585  
    586 /* YYDEFGOTO[NTERM-NUM].  */ 
    587 static const yytype_int8 yydefgoto[] = 
    588 { 
    589       -1,     8,     9,    10 
    590 }; 
    591  
    592 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 
    593    STATE-NUM.  */ 
    594 #define YYPACT_NINF -14 
    595 static const yytype_int16 yypact[] = 
    596 { 
    597       97,   -14,   -14,   -13,   -14,    70,    70,   -14,    37,   207, 
    598      115,    70,    32,    34,   129,   142,   -14,    70,    70,    70, 
    599       70,   103,    70,    70,    70,    70,    70,    70,    70,    70, 
    600       70,    70,    70,    70,    70,    70,    70,    70,    70,   -14, 
    601      155,   168,   -14,   -14,    -7,    25,    -7,    25,    32,    34, 
    602       32,    34,    28,   103,   103,    32,     0,    72,     0,    72, 
    603        0,    72,     0,    72,     0,    72,     0,    72,    -7,    25, 
    604       -7,    25,    32,    34,    32,    34,    32,    34,     0,    72, 
    605        0,    72,     0,    72,     0,    72,     0,    72,     0,    72, 
    606      -14,   -14,   103,    32,   181,   103,   103,   103,   103,   103, 
    607      103,   103,   103,   103,   103,   194,    31,    31,    32,    32, 
    608      218,   218,   218,   218,   218,   218 
    609 }; 
    610  
    611 /* YYPGOTO[NTERM-NUM].  */ 
    612 static const yytype_int8 yypgoto[] = 
    613 { 
    614      -14,   -14,    -5,    33 
    615 }; 
    616  
    617 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If 
    618    positive, shift that token.  If negative, reduce the rule which 
    619    number is the opposite.  If YYTABLE_NINF, syntax error.  */ 
    620 #define YYTABLE_NINF -1 
    621 static const yytype_uint8 yytable[] = 
    622 { 
    623       12,    14,    19,    20,    21,    11,    40,    17,    18,    19, 
    624       20,    21,    44,    46,    48,    50,    55,    56,    58,    60, 
    625       62,    64,    66,    68,    70,    72,    74,    76,    78,    80, 
    626       82,    84,    86,    88,    30,    31,    32,    16,    13,    15, 
    627       97,    98,    21,    21,    41,    32,    92,     0,    93,    94, 
    628       45,    47,    49,    51,     0,    57,    59,    61,    63,    65, 
    629       67,    69,    71,    73,    75,    77,    79,    81,    83,    85, 
    630       87,    89,     0,     1,     2,     3,     4,     0,     5,    28, 
    631       29,    30,    31,    32,     0,     0,     0,   105,     6,     0, 
    632      106,   107,   108,   109,   110,   111,   112,   113,   114,   115, 
    633        1,     2,     3,     4,     0,     5,     1,     2,    52,     0, 
    634        0,    53,     0,     0,     0,     6,     0,     7,     0,     0, 
    635        0,    54,    28,    29,    30,    31,    32,    33,    34,    35, 
    636       36,    37,    38,     0,     0,    39,    17,    18,    19,    20, 
    637       21,    22,    23,    24,    25,    26,    27,     0,    42,    28, 
    638       29,    30,    31,    32,    33,    34,    35,    36,    37,    38, 
    639        0,    43,    17,    18,    19,    20,    21,    22,    23,    24, 
    640       25,    26,    27,     0,    90,    28,    29,    30,    31,    32, 
    641       33,    34,    35,    36,    37,    38,     0,    91,    95,    96, 
    642       97,    98,    21,    99,   100,   101,   102,   103,   104,     0, 
    643       42,    95,    96,    97,    98,    21,    99,   100,   101,   102, 
    644      103,   104,     0,    90,    17,    18,    19,    20,    21,    22, 
    645       23,    24,    25,    26,    27,    95,    96,    97,    98,    21 
    646 }; 
    647  
    648 #define yypact_value_is_default(Yystate) \ 
    649   (!!((Yystate) == (-14))) 
    650  
    651 #define yytable_value_is_error(Yytable_value) \ 
    652   YYID (0) 
    653  
    654 static const yytype_int8 yycheck[] = 
    655 { 
    656        5,     6,     9,    10,    11,    18,    11,     7,     8,     9, 
    657       10,    11,    17,    18,    19,    20,    21,    22,    23,    24, 
    658       25,    26,    27,    28,    29,    30,    31,    32,    33,    34, 
    659       35,    36,    37,    38,     9,    10,    11,     0,     5,     6, 
    660        9,    10,    11,    11,    11,    11,    18,    -1,    53,    54, 
    661       17,    18,    19,    20,    -1,    22,    23,    24,    25,    26, 
    662       27,    28,    29,    30,    31,    32,    33,    34,    35,    36, 
    663       37,    38,    -1,     3,     4,     5,     6,    -1,     8,     7, 
    664        8,     9,    10,    11,    -1,    -1,    -1,    92,    18,    -1, 
    665       95,    96,    97,    98,    99,   100,   101,   102,   103,   104, 
    666        3,     4,     5,     6,    -1,     8,     3,     4,     5,    -1, 
    667       -1,     8,    -1,    -1,    -1,    18,    -1,    20,    -1,    -1, 
    668       -1,    18,     7,     8,     9,    10,    11,    12,    13,    14, 
    669       15,    16,    17,    -1,    -1,    20,     7,     8,     9,    10, 
    670       11,    12,    13,    14,    15,    16,    17,    -1,    19,     7, 
    671        8,     9,    10,    11,    12,    13,    14,    15,    16,    17, 
    672       -1,    19,     7,     8,     9,    10,    11,    12,    13,    14, 
    673       15,    16,    17,    -1,    19,     7,     8,     9,    10,    11, 
    674       12,    13,    14,    15,    16,    17,    -1,    19,     7,     8, 
    675        9,    10,    11,    12,    13,    14,    15,    16,    17,    -1, 
    676       19,     7,     8,     9,    10,    11,    12,    13,    14,    15, 
    677       16,    17,    -1,    19,     7,     8,     9,    10,    11,    12, 
    678       13,    14,    15,    16,    17,     7,     8,     9,    10,    11 
    679 }; 
    680  
    681 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 
    682    symbol of state STATE-NUM.  */ 
    683 static const yytype_uint8 yystos[] = 
    684 { 
    685        0,     3,     4,     5,     6,     8,    18,    20,    23,    24, 
    686       25,    18,    24,    25,    24,    25,     0,     7,     8,     9, 
    687       10,    11,    12,    13,    14,    15,    16,    17,     7,     8, 
    688        9,    10,    11,    12,    13,    14,    15,    16,    17,    20, 
    689       24,    25,    19,    19,    24,    25,    24,    25,    24,    25, 
    690       24,    25,     5,     8,    18,    24,    24,    25,    24,    25, 
    691       24,    25,    24,    25,    24,    25,    24,    25,    24,    25, 
    692       24,    25,    24,    25,    24,    25,    24,    25,    24,    25, 
    693       24,    25,    24,    25,    24,    25,    24,    25,    24,    25, 
    694       19,    19,    18,    24,    24,     7,     8,     9,    10,    12, 
    695       13,    14,    15,    16,    17,    24,    24,    24,    24,    24, 
    696       24,    24,    24,    24,    24,    24 
    697 }; 
    698  
    699 #define yyerrok         (yyerrstatus = 0) 
    700 #define yyclearin       (yychar = YYEMPTY) 
    701 #define YYEMPTY         (-2) 
    702 #define YYEOF           0 
    703  
    704 #define YYACCEPT        goto yyacceptlab 
    705 #define YYABORT         goto yyabortlab 
    706 #define YYERROR         goto yyerrorlab 
    707  
    708  
    709 /* Like YYERROR except do call yyerror.  This remains here temporarily 
    710    to ease the transition to the new meaning of YYERROR, for GCC. 
    711    Once GCC version 2 has supplanted version 1, this can go.  However, 
    712    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated 
    713    in Bison 2.4.2's NEWS entry, where a plan to phase it out is 
    714    discussed.  */ 
    715  
    716 #define YYFAIL          goto yyerrlab 
    717 #if defined YYFAIL 
    718   /* This is here to suppress warnings from the GCC cpp's 
    719      -Wunused-macros.  Normally we don't worry about that warning, but 
    720      some users do, and we want to make it easy for users to remove 
    721      YYFAIL uses, which will produce warnings from Bison 2.5.  */ 
    722 #endif 
     660 
     661#define yyerrok         (yyerrstatus = 0) 
     662#define yyclearin       (yychar = YYEMPTY) 
     663#define YYEMPTY         (-2) 
     664#define YYEOF           0 
     665 
     666#define YYACCEPT        goto yyacceptlab 
     667#define YYABORT         goto yyabortlab 
     668#define YYERROR         goto yyerrorlab 
     669 
    723670 
    724671#define YYRECOVERING()  (!!yyerrstatus) 
     
    737684    {                                                           \ 
    738685      yyerror (YY_("syntax error: cannot back up")); \ 
    739       YYERROR;                                                  \ 
    740     }                                                           \ 
    741 while (YYID (0)) 
     686      YYERROR;                                                  \ 
     687    }                                                           \ 
     688while (0) 
    742689 
    743690/* Error token number */ 
    744 #define YYTERROR        1 
    745 #define YYERRCODE       256 
    746  
    747  
    748 /* This macro is provided for backward compatibility. */ 
    749 #ifndef YY_LOCATION_PRINT 
    750 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 
    751 #endif 
    752  
    753  
    754 /* YYLEX -- calling `yylex' with the right arguments.  */ 
    755 #ifdef YYLEX_PARAM 
    756 # define YYLEX yylex (YYLEX_PARAM) 
    757 #else 
    758 # define YYLEX yylex () 
    759 #endif 
     691#define YYTERROR        1 
     692#define YYERRCODE       256 
     693 
     694 
    760695 
    761696/* Enable debugging if requested.  */ 
     
    767702# endif 
    768703 
    769 # define YYDPRINTF(Args)                        \ 
    770 do {                                            \ 
    771   if (yydebug)                                  \ 
    772     YYFPRINTF Args;                             \ 
    773 } while (YYID (0)) 
    774  
    775 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \ 
    776 do {                                                                      \ 
    777   if (yydebug)                                                            \ 
    778     {                                                                     \ 
    779       YYFPRINTF (stderr, "%s ", Title);                                   \ 
    780       yy_symbol_print (stderr,                                            \ 
    781                   Type, Value); \ 
    782       YYFPRINTF (stderr, "\n");                                           \ 
    783     }                                                                     \ 
    784 } while (YYID (0)) 
    785  
    786  
    787 /*--------------------------------. 
    788 | Print this symbol on YYOUTPUT.  | 
    789 `--------------------------------*/ 
    790  
    791 /*ARGSUSED*/ 
    792 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    793      || defined __cplusplus || defined _MSC_VER) 
     704# define YYDPRINTF(Args)                        \ 
     705do {                                            \ 
     706  if (yydebug)                                  \ 
     707    YYFPRINTF Args;                             \ 
     708} while (0) 
     709 
     710/* This macro is provided for backward compatibility. */ 
     711#ifndef YY_LOCATION_PRINT 
     712# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 
     713#endif 
     714 
     715 
     716# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \ 
     717do {                                                                      \ 
     718  if (yydebug)                                                            \ 
     719    {                                                                     \ 
     720      YYFPRINTF (stderr, "%s ", Title);                                   \ 
     721      yy_symbol_print (stderr,                                            \ 
     722                  Type, Value); \ 
     723      YYFPRINTF (stderr, "\n");                                           \ 
     724    }                                                                     \ 
     725} while (0) 
     726 
     727 
     728/*----------------------------------------. 
     729| Print this symbol's value on YYOUTPUT.  | 
     730`----------------------------------------*/ 
     731 
    794732static void 
    795733yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 
    796 #else 
    797 static void 
    798 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 
    799     FILE *yyoutput; 
    800     int yytype; 
    801     YYSTYPE const * const yyvaluep; 
    802 #endif 
    803734{ 
    804735  FILE *yyo = yyoutput; 
     
    809740  if (yytype < YYNTOKENS) 
    810741    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 
    811 # else 
    812   YYUSE (yyoutput); 
    813742# endif 
    814   switch (yytype) 
    815     { 
    816       default: 
    817         break; 
    818     } 
     743  YYUSE (yytype); 
    819744} 
    820745 
     
    824749`--------------------------------*/ 
    825750 
    826 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    827      || defined __cplusplus || defined _MSC_VER) 
    828751static void 
    829752yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 
    830 #else 
    831 static void 
    832 yy_symbol_print (yyoutput, yytype, yyvaluep) 
    833     FILE *yyoutput; 
    834     int yytype; 
    835     YYSTYPE const * const yyvaluep; 
    836 #endif 
    837 { 
    838   if (yytype < YYNTOKENS) 
    839     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 
    840   else 
    841     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 
     753{ 
     754  YYFPRINTF (yyoutput, "%s %s (", 
     755             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 
    842756 
    843757  yy_symbol_value_print (yyoutput, yytype, yyvaluep); 
     
    850764`------------------------------------------------------------------*/ 
    851765 
    852 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    853      || defined __cplusplus || defined _MSC_VER) 
    854766static void 
    855767yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 
    856 #else 
    857 static void 
    858 yy_stack_print (yybottom, yytop) 
    859     yytype_int16 *yybottom; 
    860     yytype_int16 *yytop; 
    861 #endif 
    862768{ 
    863769  YYFPRINTF (stderr, "Stack now"); 
     
    870776} 
    871777 
    872 # define YY_STACK_PRINT(Bottom, Top)                            \ 
    873 do {                                                            \ 
    874   if (yydebug)                                                  \ 
    875     yy_stack_print ((Bottom), (Top));                           \ 
    876 } while (YYID (0)) 
     778# define YY_STACK_PRINT(Bottom, Top)                            \ 
     779do {                                                            \ 
     780  if (yydebug)                                                  \ 
     781    yy_stack_print ((Bottom), (Top));                           \ 
     782} while (0) 
    877783 
    878784 
     
    881787`------------------------------------------------*/ 
    882788 
    883 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    884      || defined __cplusplus || defined _MSC_VER) 
    885789static void 
    886 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 
    887 #else 
    888 static void 
    889 yy_reduce_print (yyvsp, yyrule) 
    890     YYSTYPE *yyvsp; 
    891     int yyrule; 
    892 #endif 
    893 { 
     790yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 
     791{ 
     792  unsigned long int yylno = yyrline[yyrule]; 
    894793  int yynrhs = yyr2[yyrule]; 
    895794  int yyi; 
    896   unsigned long int yylno = yyrline[yyrule]; 
    897795  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 
    898              yyrule - 1, yylno); 
     796             yyrule - 1, yylno); 
    899797  /* The symbols being reduced.  */ 
    900798  for (yyi = 0; yyi < yynrhs; yyi++) 
    901799    { 
    902800      YYFPRINTF (stderr, "   $%d = ", yyi + 1); 
    903       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 
    904                        &(yyvsp[(yyi + 1) - (yynrhs)]) 
    905                                        ); 
     801      yy_symbol_print (stderr, 
     802                       yystos[yyssp[yyi + 1 - yynrhs]], 
     803                       &(yyvsp[(yyi + 1) - (yynrhs)]) 
     804                                              ); 
    906805      YYFPRINTF (stderr, "\n"); 
    907806    } 
    908807} 
    909808 
    910 # define YY_REDUCE_PRINT(Rule)          \ 
    911 do {                                    \ 
    912   if (yydebug)                          \ 
    913     yy_reduce_print (yyvsp, Rule); \ 
    914 } while (YYID (0)) 
     809# define YY_REDUCE_PRINT(Rule)          \ 
     810do {                                    \ 
     811  if (yydebug)                          \ 
     812    yy_reduce_print (yyssp, yyvsp, Rule); \ 
     813} while (0) 
    915814 
    916815/* Nonzero means print parse trace.  It is left uninitialized so that 
     
    926825 
    927826/* YYINITDEPTH -- initial size of the parser's stacks.  */ 
    928 #ifndef YYINITDEPTH 
     827#ifndef YYINITDEPTH 
    929828# define YYINITDEPTH 200 
    930829#endif 
     
    949848#  else 
    950849/* Return the length of YYSTR.  */ 
    951 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    952      || defined __cplusplus || defined _MSC_VER) 
    953850static YYSIZE_T 
    954851yystrlen (const char *yystr) 
    955 #else 
    956 static YYSIZE_T 
    957 yystrlen (yystr) 
    958     const char *yystr; 
    959 #endif 
    960852{ 
    961853  YYSIZE_T yylen; 
     
    973865/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 
    974866   YYDEST.  */ 
    975 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    976      || defined __cplusplus || defined _MSC_VER) 
    977867static char * 
    978868yystpcpy (char *yydest, const char *yysrc) 
    979 #else 
    980 static char * 
    981 yystpcpy (yydest, yysrc) 
    982     char *yydest; 
    983     const char *yysrc; 
    984 #endif 
    985869{ 
    986870  char *yyd = yydest; 
     
    1012896 
    1013897      for (;;) 
    1014         switch (*++yyp) 
    1015           { 
    1016           case '\'': 
    1017           case ',': 
    1018             goto do_not_strip_quotes; 
    1019  
    1020           case '\\': 
    1021             if (*++yyp != '\\') 
    1022               goto do_not_strip_quotes; 
    1023             /* Fall through.  */ 
    1024           default: 
    1025             if (yyres) 
    1026               yyres[yyn] = *yyp; 
    1027             yyn++; 
    1028             break; 
    1029  
    1030           case '"': 
    1031             if (yyres) 
    1032               yyres[yyn] = '\0'; 
    1033             return yyn; 
    1034           } 
     898        switch (*++yyp) 
     899          { 
     900          case '\'': 
     901          case ',': 
     902            goto do_not_strip_quotes; 
     903 
     904          case '\\': 
     905            if (*++yyp != '\\') 
     906              goto do_not_strip_quotes; 
     907            /* Fall through.  */ 
     908          default: 
     909            if (yyres) 
     910              yyres[yyn] = *yyp; 
     911            yyn++; 
     912            break; 
     913 
     914          case '"': 
     915            if (yyres) 
     916              yyres[yyn] = '\0'; 
     917            return yyn; 
     918          } 
    1035919    do_not_strip_quotes: ; 
    1036920    } 
     
    1055939                yytype_int16 *yyssp, int yytoken) 
    1056940{ 
    1057   YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); 
     941  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 
    1058942  YYSIZE_T yysize = yysize0; 
    1059943  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 
    1060944  /* Internationalized format string. */ 
    1061   const char *yyformat = YY_NULL; 
     945  const char *yyformat = YY_NULLPTR; 
    1062946  /* Arguments of yyformat. */ 
    1063947  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 
     
    1067951 
    1068952  /* There are many possibilities here to consider: 
    1069      - Assume YYFAIL is not used.  It's too flawed to consider.  See 
    1070        <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 
    1071        for details.  YYERROR is fine as it does not invoke this 
    1072        function. 
    1073953     - If this state is a consistent state with a default action, then 
    1074954       the only way this function was invoked is if the default action 
     
    11201000                yyarg[yycount++] = yytname[yyx]; 
    11211001                { 
    1122                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); 
     1002                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 
    11231003                  if (! (yysize <= yysize1 
    11241004                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 
     
    11871067`-----------------------------------------------*/ 
    11881068 
    1189 /*ARGSUSED*/ 
    1190 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    1191      || defined __cplusplus || defined _MSC_VER) 
    11921069static void 
    11931070yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 
    1194 #else 
    1195 static void 
    1196 yydestruct (yymsg, yytype, yyvaluep) 
    1197     const char *yymsg; 
    1198     int yytype; 
    1199     YYSTYPE *yyvaluep; 
    1200 #endif 
    12011071{ 
    12021072  YYUSE (yyvaluep); 
    1203  
    12041073  if (!yymsg) 
    12051074    yymsg = "Deleting"; 
    12061075  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 
    12071076 
    1208   switch (yytype) 
    1209     { 
    1210  
    1211       default: 
    1212         break; 
    1213     } 
     1077  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
     1078  YYUSE (yytype); 
     1079  YY_IGNORE_MAYBE_UNINITIALIZED_END 
    12141080} 
    12151081 
     
    12201086int yychar; 
    12211087 
    1222  
    1223 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
    1224 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
    1225 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 
    1226 #endif 
    1227 #ifndef YY_INITIAL_VALUE 
    1228 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 
    1229 #endif 
    1230  
    12311088/* The semantic value of the lookahead symbol.  */ 
    1232 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); 
    1233  
     1089YYSTYPE yylval; 
    12341090/* Number of syntax errors so far.  */ 
    12351091int yynerrs; 
     
    12401096`----------*/ 
    12411097 
    1242 #ifdef YYPARSE_PARAM 
    1243 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    1244      || defined __cplusplus || defined _MSC_VER) 
    1245 int 
    1246 yyparse (void *YYPARSE_PARAM) 
    1247 #else 
    1248 int 
    1249 yyparse (YYPARSE_PARAM) 
    1250     void *YYPARSE_PARAM; 
    1251 #endif 
    1252 #else /* ! YYPARSE_PARAM */ 
    1253 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    1254      || defined __cplusplus || defined _MSC_VER) 
    12551098int 
    12561099yyparse (void) 
    1257 #else 
    1258 int 
    1259 yyparse () 
    1260  
    1261 #endif 
    1262 #endif 
    12631100{ 
    12641101    int yystate; 
     
    12671104 
    12681105    /* The stacks and their tools: 
    1269        `yyss': related to states. 
    1270        `yyvs': related to semantic values. 
     1106       'yyss': related to states. 
     1107       'yyvs': related to semantic values. 
    12711108 
    12721109       Refer to the stacks through separate pointers, to allow yyoverflow 
     
    13361173#ifdef yyoverflow 
    13371174      { 
    1338         /* Give user a chance to reallocate the stack.  Use copies of 
    1339            these so that the &'s don't force the real ones into 
    1340            memory.  */ 
    1341         YYSTYPE *yyvs1 = yyvs; 
    1342         yytype_int16 *yyss1 = yyss; 
    1343  
    1344         /* Each stack pointer address is followed by the size of the 
    1345            data in use in that stack, in bytes.  This used to be a 
    1346            conditional around just the two extra args, but that might 
    1347            be undefined if yyoverflow is a macro.  */ 
    1348         yyoverflow (YY_("memory exhausted"), 
    1349                     &yyss1, yysize * sizeof (*yyssp), 
    1350                     &yyvs1, yysize * sizeof (*yyvsp), 
    1351                     &yystacksize); 
    1352  
    1353         yyss = yyss1; 
    1354         yyvs = yyvs1; 
     1175        /* Give user a chance to reallocate the stack.  Use copies of 
     1176           these so that the &'s don't force the real ones into 
     1177           memory.  */ 
     1178        YYSTYPE *yyvs1 = yyvs; 
     1179        yytype_int16 *yyss1 = yyss; 
     1180 
     1181        /* Each stack pointer address is followed by the size of the 
     1182           data in use in that stack, in bytes.  This used to be a 
     1183           conditional around just the two extra args, but that might 
     1184           be undefined if yyoverflow is a macro.  */ 
     1185        yyoverflow (YY_("memory exhausted"), 
     1186                    &yyss1, yysize * sizeof (*yyssp), 
     1187                    &yyvs1, yysize * sizeof (*yyvsp), 
     1188                    &yystacksize); 
     1189 
     1190        yyss = yyss1; 
     1191        yyvs = yyvs1; 
    13551192      } 
    13561193#else /* no yyoverflow */ 
     
    13601197      /* Extend the stack our own way.  */ 
    13611198      if (YYMAXDEPTH <= yystacksize) 
    1362         goto yyexhaustedlab; 
     1199        goto yyexhaustedlab; 
    13631200      yystacksize *= 2; 
    13641201      if (YYMAXDEPTH < yystacksize) 
    1365         yystacksize = YYMAXDEPTH; 
     1202        yystacksize = YYMAXDEPTH; 
    13661203 
    13671204      { 
    1368         yytype_int16 *yyss1 = yyss; 
    1369         union yyalloc *yyptr = 
    1370           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 
    1371         if (! yyptr) 
    1372           goto yyexhaustedlab; 
    1373         YYSTACK_RELOCATE (yyss_alloc, yyss); 
    1374         YYSTACK_RELOCATE (yyvs_alloc, yyvs); 
     1205        yytype_int16 *yyss1 = yyss; 
     1206        union yyalloc *yyptr = 
     1207          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 
     1208        if (! yyptr) 
     1209          goto yyexhaustedlab; 
     1210        YYSTACK_RELOCATE (yyss_alloc, yyss); 
     1211        YYSTACK_RELOCATE (yyvs_alloc, yyvs); 
    13751212#  undef YYSTACK_RELOCATE 
    1376         if (yyss1 != yyssa) 
    1377           YYSTACK_FREE (yyss1); 
     1213        if (yyss1 != yyssa) 
     1214          YYSTACK_FREE (yyss1); 
    13781215      } 
    13791216# endif 
     
    13841221 
    13851222      YYDPRINTF ((stderr, "Stack size increased to %lu\n", 
    1386                   (unsigned long int) yystacksize)); 
     1223                  (unsigned long int) yystacksize)); 
    13871224 
    13881225      if (yyss + yystacksize - 1 <= yyssp) 
    1389         YYABORT; 
     1226        YYABORT; 
    13901227    } 
    13911228 
     
    14161253    { 
    14171254      YYDPRINTF ((stderr, "Reading a token: ")); 
    1418       yychar = YYLEX; 
     1255      yychar = yylex (); 
    14191256    } 
    14201257 
     
    14811318 
    14821319  /* If YYLEN is nonzero, implement the default value of the action: 
    1483      `$$ = $1'. 
     1320     '$$ = $1'. 
    14841321 
    14851322     Otherwise, the following line sets YYVAL to garbage. 
     
    14951332    { 
    14961333        case 2: 
    1497 /* Line 1792 of yacc.c  */ 
    1498 #line 61 "yacc_parser.yacc" 
     1334#line 61 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14991335    { /* Nothing to do */ } 
     1336#line 1337 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15001337    break; 
    15011338 
    15021339  case 3: 
    1503 /* Line 1792 of yacc.c  */ 
    1504 #line 62 "yacc_parser.yacc" 
    1505     { parsed = (yyvsp[(1) - (2)].filterNode); } 
     1340#line 62 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1341    { parsed = (yyvsp[-1].filterNode); } 
     1342#line 1343 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15061343    break; 
    15071344 
    15081345  case 4: 
    1509 /* Line 1792 of yacc.c  */ 
    1510 #line 66 "yacc_parser.yacc" 
    1511     { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 
     1346#line 66 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1347    { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1348#line 1349 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15121349    break; 
    15131350 
    15141351  case 5: 
    1515 /* Line 1792 of yacc.c  */ 
    1516 #line 67 "yacc_parser.yacc" 
    1517     { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 
     1352#line 67 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1353    { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1354#line 1355 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15181355    break; 
    15191356 
    15201357  case 6: 
    1521 /* Line 1792 of yacc.c  */ 
    1522 #line 68 "yacc_parser.yacc" 
    1523     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "add", (yyvsp[(3) - (3)].scalarNode)); } 
     1358#line 68 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1359    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); } 
     1360#line 1361 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15241361    break; 
    15251362 
    15261363  case 7: 
    1527 /* Line 1792 of yacc.c  */ 
    1528 #line 69 "yacc_parser.yacc" 
    1529     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "minus", (yyvsp[(3) - (3)].scalarNode)); } 
     1364#line 69 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1365    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); } 
     1366#line 1367 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15301367    break; 
    15311368 
    15321369  case 8: 
    1533 /* Line 1792 of yacc.c  */ 
    1534 #line 70 "yacc_parser.yacc" 
    1535     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "mult", (yyvsp[(3) - (3)].scalarNode)); } 
     1370#line 70 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1371    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); } 
     1372#line 1373 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15361373    break; 
    15371374 
    15381375  case 9: 
    1539 /* Line 1792 of yacc.c  */ 
    1540 #line 71 "yacc_parser.yacc" 
    1541     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "div", (yyvsp[(3) - (3)].scalarNode)); } 
     1376#line 71 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1377    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); } 
     1378#line 1379 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15421379    break; 
    15431380 
    15441381  case 10: 
    1545 /* Line 1792 of yacc.c  */ 
    1546 #line 72 "yacc_parser.yacc" 
    1547     { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[(2) - (2)].scalarNode)); } 
     1382#line 72 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1383    { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); } 
     1384#line 1385 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15481385    break; 
    15491386 
    15501387  case 11: 
    1551 /* Line 1792 of yacc.c  */ 
    1552 #line 73 "yacc_parser.yacc" 
    1553     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "pow", (yyvsp[(3) - (3)].scalarNode)); } 
     1388#line 73 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1389    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); } 
     1390#line 1391 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15541391    break; 
    15551392 
    15561393  case 12: 
    1557 /* Line 1792 of yacc.c  */ 
    1558 #line 74 "yacc_parser.yacc" 
    1559     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "eq", (yyvsp[(3) - (3)].scalarNode)); } 
     1394#line 74 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1395    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].scalarNode)); } 
     1396#line 1397 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15601397    break; 
    15611398 
    15621399  case 13: 
    1563 /* Line 1792 of yacc.c  */ 
    1564 #line 75 "yacc_parser.yacc" 
    1565     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "lt", (yyvsp[(3) - (3)].scalarNode)); } 
     1400#line 75 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1401    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].scalarNode)); } 
     1402#line 1403 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15661403    break; 
    15671404 
    15681405  case 14: 
    1569 /* Line 1792 of yacc.c  */ 
    1570 #line 76 "yacc_parser.yacc" 
    1571     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "gt", (yyvsp[(3) - (3)].scalarNode)); } 
     1406#line 76 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1407    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].scalarNode)); } 
     1408#line 1409 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15721409    break; 
    15731410 
    15741411  case 15: 
    1575 /* Line 1792 of yacc.c  */ 
    1576 #line 77 "yacc_parser.yacc" 
    1577     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "le", (yyvsp[(3) - (3)].scalarNode)); } 
     1412#line 77 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1413    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].scalarNode)); } 
     1414#line 1415 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15781415    break; 
    15791416 
    15801417  case 16: 
    1581 /* Line 1792 of yacc.c  */ 
    1582 #line 78 "yacc_parser.yacc" 
    1583     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "ge", (yyvsp[(3) - (3)].scalarNode)); } 
     1418#line 78 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1419    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].scalarNode)); } 
     1420#line 1421 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15841421    break; 
    15851422 
    15861423  case 17: 
    1587 /* Line 1792 of yacc.c  */ 
    1588 #line 79 "yacc_parser.yacc" 
    1589     { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "ne", (yyvsp[(3) - (3)].scalarNode)); } 
     1424#line 79 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1425    { (yyval.scalarNode) = (yyvsp[-1].scalarNode); } 
     1426#line 1427 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15901427    break; 
    15911428 
    15921429  case 18: 
    1593 /* Line 1792 of yacc.c  */ 
    1594 #line 80 "yacc_parser.yacc" 
    1595     { (yyval.scalarNode) = (yyvsp[(2) - (3)].scalarNode); } 
     1430#line 80 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1431    { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); } 
     1432#line 1433 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15961433    break; 
    15971434 
    15981435  case 19: 
    1599 /* Line 1792 of yacc.c  */ 
    1600 #line 81 "yacc_parser.yacc" 
    1601     { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].scalarNode)); delete (yyvsp[(1) - (4)].str); } 
     1436#line 84 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1437    { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1438#line 1439 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16021439    break; 
    16031440 
    16041441  case 20: 
    1605 /* Line 1792 of yacc.c  */ 
    1606 #line 85 "yacc_parser.yacc" 
    1607     { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 
     1442#line 85 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1443    { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1444#line 1445 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16081445    break; 
    16091446 
    16101447  case 21: 
    1611 /* Line 1792 of yacc.c  */ 
    1612 #line 86 "yacc_parser.yacc" 
    1613     { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 
     1448#line 86 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1449    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); } 
     1450#line 1451 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16141451    break; 
    16151452 
    16161453  case 22: 
    1617 /* Line 1792 of yacc.c  */ 
    1618 #line 87 "yacc_parser.yacc" 
    1619     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "add", (yyvsp[(3) - (3)].filterNode)); } 
     1454#line 87 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1455    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); } 
     1456#line 1457 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16201457    break; 
    16211458 
    16221459  case 23: 
    1623 /* Line 1792 of yacc.c  */ 
    1624 #line 88 "yacc_parser.yacc" 
    1625     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "minus", (yyvsp[(3) - (3)].filterNode)); } 
     1460#line 88 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1461    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); } 
     1462#line 1463 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16261463    break; 
    16271464 
    16281465  case 24: 
    1629 /* Line 1792 of yacc.c  */ 
    1630 #line 89 "yacc_parser.yacc" 
    1631     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "mult", (yyvsp[(3) - (3)].filterNode)); } 
     1466#line 89 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1467    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); } 
     1468#line 1469 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16321469    break; 
    16331470 
    16341471  case 25: 
    1635 /* Line 1792 of yacc.c  */ 
    1636 #line 90 "yacc_parser.yacc" 
    1637     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "div", (yyvsp[(3) - (3)].filterNode)); } 
     1472#line 90 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1473    { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); } 
     1474#line 1475 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16381475    break; 
    16391476 
    16401477  case 26: 
    1641 /* Line 1792 of yacc.c  */ 
    1642 #line 91 "yacc_parser.yacc" 
    1643     { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[(2) - (2)].filterNode)); } 
     1478#line 91 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1479    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); } 
     1480#line 1481 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16441481    break; 
    16451482 
    16461483  case 27: 
    1647 /* Line 1792 of yacc.c  */ 
    1648 #line 92 "yacc_parser.yacc" 
    1649     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "pow", (yyvsp[(3) - (3)].filterNode)); } 
     1484#line 92 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1485    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].filterNode)); } 
     1486#line 1487 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16501487    break; 
    16511488 
    16521489  case 28: 
    1653 /* Line 1792 of yacc.c  */ 
    1654 #line 93 "yacc_parser.yacc" 
    1655     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "eq", (yyvsp[(3) - (3)].filterNode)); } 
     1490#line 93 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1491    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].filterNode)); } 
     1492#line 1493 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16561493    break; 
    16571494 
    16581495  case 29: 
    1659 /* Line 1792 of yacc.c  */ 
    1660 #line 94 "yacc_parser.yacc" 
    1661     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "lt", (yyvsp[(3) - (3)].filterNode)); } 
     1496#line 94 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1497    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].filterNode)); } 
     1498#line 1499 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16621499    break; 
    16631500 
    16641501  case 30: 
    1665 /* Line 1792 of yacc.c  */ 
    1666 #line 95 "yacc_parser.yacc" 
    1667     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "gt", (yyvsp[(3) - (3)].filterNode)); } 
     1502#line 95 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1503    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].filterNode)); } 
     1504#line 1505 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16681505    break; 
    16691506 
    16701507  case 31: 
    1671 /* Line 1792 of yacc.c  */ 
    1672 #line 96 "yacc_parser.yacc" 
    1673     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "le", (yyvsp[(3) - (3)].filterNode)); } 
     1508#line 96 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1509    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].filterNode)); } 
     1510#line 1511 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16741511    break; 
    16751512 
    16761513  case 32: 
    1677 /* Line 1792 of yacc.c  */ 
    1678 #line 97 "yacc_parser.yacc" 
    1679     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "ge", (yyvsp[(3) - (3)].filterNode)); } 
     1514#line 97 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1515    { (yyval.filterNode) = (yyvsp[-1].filterNode); } 
     1516#line 1517 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16801517    break; 
    16811518 
    16821519  case 33: 
    1683 /* Line 1792 of yacc.c  */ 
    1684 #line 98 "yacc_parser.yacc" 
    1685     { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "ne", (yyvsp[(3) - (3)].filterNode)); } 
     1520#line 98 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1521    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); } 
     1522#line 1523 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16861523    break; 
    16871524 
    16881525  case 34: 
    1689 /* Line 1792 of yacc.c  */ 
    1690 #line 99 "yacc_parser.yacc" 
    1691     { (yyval.filterNode) = (yyvsp[(2) - (3)].filterNode); } 
     1526#line 99 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1527    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); } 
     1528#line 1529 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16921529    break; 
    16931530 
    16941531  case 35: 
    1695 /* Line 1792 of yacc.c  */ 
    1696 #line 100 "yacc_parser.yacc" 
    1697     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "add", (yyvsp[(3) - (3)].scalarNode)); } 
     1532#line 100 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1533    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); } 
     1534#line 1535 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16981535    break; 
    16991536 
    17001537  case 36: 
    1701 /* Line 1792 of yacc.c  */ 
    1702 #line 101 "yacc_parser.yacc" 
    1703     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "add", (yyvsp[(3) - (3)].filterNode)); } 
     1538#line 101 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1539    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); } 
     1540#line 1541 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17041541    break; 
    17051542 
    17061543  case 37: 
    1707 /* Line 1792 of yacc.c  */ 
    1708 #line 102 "yacc_parser.yacc" 
    1709     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "minus", (yyvsp[(3) - (3)].scalarNode)); } 
     1544#line 102 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1545    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); } 
     1546#line 1547 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17101547    break; 
    17111548 
    17121549  case 38: 
    1713 /* Line 1792 of yacc.c  */ 
    1714 #line 103 "yacc_parser.yacc" 
    1715     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "minus", (yyvsp[(3) - (3)].filterNode)); } 
     1550#line 103 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1551    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); } 
     1552#line 1553 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17161553    break; 
    17171554 
    17181555  case 39: 
    1719 /* Line 1792 of yacc.c  */ 
    1720 #line 104 "yacc_parser.yacc" 
    1721     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "mult", (yyvsp[(3) - (3)].scalarNode)); } 
     1556#line 104 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1557    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); } 
     1558#line 1559 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17221559    break; 
    17231560 
    17241561  case 40: 
    1725 /* Line 1792 of yacc.c  */ 
    1726 #line 105 "yacc_parser.yacc" 
    1727     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "mult", (yyvsp[(3) - (3)].filterNode)); } 
     1562#line 105 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1563    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); } 
     1564#line 1565 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17281565    break; 
    17291566 
    17301567  case 41: 
    1731 /* Line 1792 of yacc.c  */ 
    1732 #line 106 "yacc_parser.yacc" 
    1733     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "div", (yyvsp[(3) - (3)].scalarNode)); } 
     1568#line 106 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1569    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); } 
     1570#line 1571 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17341571    break; 
    17351572 
    17361573  case 42: 
    1737 /* Line 1792 of yacc.c  */ 
    1738 #line 107 "yacc_parser.yacc" 
    1739     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "div", (yyvsp[(3) - (3)].filterNode)); } 
     1574#line 107 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1575    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].scalarNode)); } 
     1576#line 1577 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17401577    break; 
    17411578 
    17421579  case 43: 
    1743 /* Line 1792 of yacc.c  */ 
    1744 #line 108 "yacc_parser.yacc" 
    1745     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "pow", (yyvsp[(3) - (3)].scalarNode)); } 
     1580#line 108 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1581    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].filterNode)); } 
     1582#line 1583 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17461583    break; 
    17471584 
    17481585  case 44: 
    1749 /* Line 1792 of yacc.c  */ 
    1750 #line 109 "yacc_parser.yacc" 
    1751     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "eq", (yyvsp[(3) - (3)].scalarNode)); } 
     1586#line 109 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1587    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].scalarNode)); } 
     1588#line 1589 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17521589    break; 
    17531590 
    17541591  case 45: 
    1755 /* Line 1792 of yacc.c  */ 
    1756 #line 110 "yacc_parser.yacc" 
    1757     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "eq", (yyvsp[(3) - (3)].filterNode)); } 
     1592#line 110 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1593    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].filterNode)); } 
     1594#line 1595 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17581595    break; 
    17591596 
    17601597  case 46: 
    1761 /* Line 1792 of yacc.c  */ 
    1762 #line 111 "yacc_parser.yacc" 
    1763     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "lt", (yyvsp[(3) - (3)].scalarNode)); } 
     1598#line 111 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1599    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].scalarNode)); } 
     1600#line 1601 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17641601    break; 
    17651602 
    17661603  case 47: 
    1767 /* Line 1792 of yacc.c  */ 
    1768 #line 112 "yacc_parser.yacc" 
    1769     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "lt", (yyvsp[(3) - (3)].filterNode)); } 
     1604#line 112 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1605    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].filterNode)); } 
     1606#line 1607 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17701607    break; 
    17711608 
    17721609  case 48: 
    1773 /* Line 1792 of yacc.c  */ 
    1774 #line 113 "yacc_parser.yacc" 
    1775     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "gt", (yyvsp[(3) - (3)].scalarNode)); } 
     1610#line 113 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1611    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].scalarNode)); } 
     1612#line 1613 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17761613    break; 
    17771614 
    17781615  case 49: 
    1779 /* Line 1792 of yacc.c  */ 
    1780 #line 114 "yacc_parser.yacc" 
    1781     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "gt", (yyvsp[(3) - (3)].filterNode)); } 
     1616#line 114 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1617    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].filterNode)); } 
     1618#line 1619 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17821619    break; 
    17831620 
    17841621  case 50: 
    1785 /* Line 1792 of yacc.c  */ 
    1786 #line 115 "yacc_parser.yacc" 
    1787     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "le", (yyvsp[(3) - (3)].scalarNode)); } 
     1622#line 115 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1623    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].scalarNode)); } 
     1624#line 1625 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17881625    break; 
    17891626 
    17901627  case 51: 
    1791 /* Line 1792 of yacc.c  */ 
    1792 #line 116 "yacc_parser.yacc" 
    1793     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "le", (yyvsp[(3) - (3)].filterNode)); } 
     1628#line 116 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1629    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].filterNode)); } 
     1630#line 1631 "yacc_parser.cpp" /* yacc.c:1646  */ 
    17941631    break; 
    17951632 
    17961633  case 52: 
    1797 /* Line 1792 of yacc.c  */ 
    1798 #line 117 "yacc_parser.yacc" 
    1799     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "ge", (yyvsp[(3) - (3)].scalarNode)); } 
    1800     break; 
    1801  
    1802   case 53: 
    1803 /* Line 1792 of yacc.c  */ 
    1804 #line 118 "yacc_parser.yacc" 
    1805     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "ge", (yyvsp[(3) - (3)].filterNode)); } 
    1806     break; 
    1807  
    1808   case 54: 
    1809 /* Line 1792 of yacc.c  */ 
    1810 #line 119 "yacc_parser.yacc" 
    1811     { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "ne", (yyvsp[(3) - (3)].scalarNode)); } 
    1812     break; 
    1813  
    1814   case 55: 
    1815 /* Line 1792 of yacc.c  */ 
    1816 #line 120 "yacc_parser.yacc" 
    1817     { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "ne", (yyvsp[(3) - (3)].filterNode)); } 
    1818     break; 
    1819  
    1820   case 56: 
    1821 /* Line 1792 of yacc.c  */ 
    1822 #line 121 "yacc_parser.yacc" 
    1823     { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].filterNode)); delete (yyvsp[(1) - (4)].str); } 
    1824     break; 
    1825  
    1826  
    1827 /* Line 1792 of yacc.c  */ 
    1828 #line 1829 "yacc_parser.cpp" 
     1634#line 117 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1635    { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); } 
     1636#line 1637 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1637    break; 
     1638 
     1639 
     1640#line 1641 "yacc_parser.cpp" /* yacc.c:1646  */ 
    18291641      default: break; 
    18301642    } 
     
    18481660  *++yyvsp = yyval; 
    18491661 
    1850   /* Now `shift' the result of the reduction.  Determine what state 
     1662  /* Now 'shift' the result of the reduction.  Determine what state 
    18511663     that goes to, based on the state we popped back to and the rule 
    18521664     number reduced by.  */ 
     
    18631675 
    18641676 
    1865 /*------------------------------------. 
    1866 | yyerrlab -- here on detecting error | 
    1867 `------------------------------------*/ 
     1677/*--------------------------------------. 
     1678| yyerrlab -- here on detecting error. | 
     1679`--------------------------------------*/ 
    18681680yyerrlab: 
    18691681  /* Make sure we have latest lookahead translation.  See comments at 
     
    19161728    { 
    19171729      /* If just tried and failed to reuse lookahead token after an 
    1918         error, discard it.  */ 
     1730        error, discard it.  */ 
    19191731 
    19201732      if (yychar <= YYEOF) 
    1921         { 
    1922           /* Return failure if at end of input.  */ 
    1923           if (yychar == YYEOF) 
    1924             YYABORT; 
    1925         } 
     1733        { 
     1734          /* Return failure if at end of input.  */ 
     1735          if (yychar == YYEOF) 
     1736            YYABORT; 
     1737        } 
    19261738      else 
    1927         { 
    1928           yydestruct ("Error: discarding", 
    1929                       yytoken, &yylval); 
    1930           yychar = YYEMPTY; 
    1931         } 
     1739        { 
     1740          yydestruct ("Error: discarding", 
     1741                      yytoken, &yylval); 
     1742          yychar = YYEMPTY; 
     1743        } 
    19321744    } 
    19331745 
     
    19481760     goto yyerrorlab; 
    19491761 
    1950   /* Do not reclaim the symbols of the rule which action triggered 
     1762  /* Do not reclaim the symbols of the rule whose action triggered 
    19511763     this YYERROR.  */ 
    19521764  YYPOPSTACK (yylen); 
     
    19611773`-------------------------------------------------------------*/ 
    19621774yyerrlab1: 
    1963   yyerrstatus = 3;      /* Each real token shifted decrements this.  */ 
     1775  yyerrstatus = 3;      /* Each real token shifted decrements this.  */ 
    19641776 
    19651777  for (;;) 
     
    19671779      yyn = yypact[yystate]; 
    19681780      if (!yypact_value_is_default (yyn)) 
    1969         { 
    1970           yyn += YYTERROR; 
    1971           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 
    1972             { 
    1973               yyn = yytable[yyn]; 
    1974               if (0 < yyn) 
    1975                 break; 
    1976             } 
    1977         } 
     1781        { 
     1782          yyn += YYTERROR; 
     1783          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 
     1784            { 
     1785              yyn = yytable[yyn]; 
     1786              if (0 < yyn) 
     1787                break; 
     1788            } 
     1789        } 
    19781790 
    19791791      /* Pop the current state because it cannot handle the error token.  */ 
    19801792      if (yyssp == yyss) 
    1981         YYABORT; 
     1793        YYABORT; 
    19821794 
    19831795 
    19841796      yydestruct ("Error: popping", 
    1985                   yystos[yystate], yyvsp); 
     1797                  yystos[yystate], yyvsp); 
    19861798      YYPOPSTACK (1); 
    19871799      yystate = *yyssp; 
     
    20341846                  yytoken, &yylval); 
    20351847    } 
    2036   /* Do not reclaim the symbols of the rule which action triggered 
     1848  /* Do not reclaim the symbols of the rule whose action triggered 
    20371849     this YYABORT or YYACCEPT.  */ 
    20381850  YYPOPSTACK (yylen); 
     
    20411853    { 
    20421854      yydestruct ("Cleanup: popping", 
    2043                   yystos[*yyssp], yyvsp); 
     1855                  yystos[*yyssp], yyvsp); 
    20441856      YYPOPSTACK (1); 
    20451857    } 
     
    20521864    YYSTACK_FREE (yymsg); 
    20531865#endif 
    2054   /* Make sure YYID is used.  */ 
    2055   return YYID (yyresult); 
     1866  return yyresult; 
    20561867} 
    2057  
    2058  
    2059 /* Line 2055 of yacc.c  */ 
    2060 #line 123 "yacc_parser.yacc" 
     1868#line 119 "yacc_parser.yacc" /* yacc.c:1906  */ 
    20611869 
    20621870 
  • XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.hpp

    r1019 r1037  
    1 /* A Bison parser, made by GNU Bison 2.7.  */ 
     1/* A Bison parser, made by GNU Bison 3.0.2.  */ 
    22 
    33/* Bison interface for Yacc-like parsers in C 
    4     
    5       Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 
    6     
     4 
     5   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 
     6 
    77   This program is free software: you can redistribute it and/or modify 
    88   it under the terms of the GNU General Public License as published by 
    99   the Free Software Foundation, either version 3 of the License, or 
    1010   (at your option) any later version. 
    11     
     11 
    1212   This program is distributed in the hope that it will be useful, 
    1313   but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1414   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1515   GNU General Public License for more details. 
    16     
     16 
    1717   You should have received a copy of the GNU General Public License 
    1818   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */ 
     
    2727   Bison output files to be licensed under the GNU General Public 
    2828   License without this special exception. 
    29     
     29 
    3030   This special exception was added by the Free Software Foundation in 
    3131   version 2.2 of Bison.  */ 
     
    3333#ifndef YY_YY_YACC_PARSER_HPP_INCLUDED 
    3434# define YY_YY_YACC_PARSER_HPP_INCLUDED 
    35 /* Enabling traces.  */ 
     35/* Debug traces.  */ 
    3636#ifndef YYDEBUG 
    3737# define YYDEBUG 0 
     
    4141#endif 
    4242 
    43 /* Tokens.  */ 
     43/* Token type.  */ 
    4444#ifndef YYTOKENTYPE 
    4545# define YYTOKENTYPE 
    46    /* Put the tokens into the symbol table, so that GDB and other debuggers 
    47       know about them.  */ 
    48    enum yytokentype { 
    49      NUMBER = 258, 
    50      VAR = 259, 
    51      ID = 260, 
    52      AVERAGE = 261, 
    53      PLUS = 262, 
    54      MINUS = 263, 
    55      TIMES = 264, 
    56      DIVIDE = 265, 
    57      POWER = 266, 
    58      EQ = 267, 
    59      LT = 268, 
    60      GT = 269, 
    61      LE = 270, 
    62      GE = 271, 
    63      NE = 272, 
    64      LEFT_PARENTHESIS = 273, 
    65      RIGHT_PARENTHESIS = 274, 
    66      END = 275, 
    67      NEG = 276 
    68    }; 
     46  enum yytokentype 
     47  { 
     48    NUMBER = 258, 
     49    VAR = 259, 
     50    ID = 260, 
     51    AVERAGE = 261, 
     52    PLUS = 262, 
     53    MINUS = 263, 
     54    TIMES = 264, 
     55    DIVIDE = 265, 
     56    POWER = 266, 
     57    EQ = 267, 
     58    LT = 268, 
     59    GT = 269, 
     60    LE = 270, 
     61    GE = 271, 
     62    LEFT_PARENTHESIS = 272, 
     63    RIGHT_PARENTHESIS = 273, 
     64    END = 274, 
     65    NEG = 275 
     66  }; 
    6967#endif 
    7068 
    71  
     69/* Value type.  */ 
    7270#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 
    73 typedef union YYSTYPE 
     71typedef union YYSTYPE YYSTYPE; 
     72union YYSTYPE 
    7473{ 
    75 /* Line 2058 of yacc.c  */ 
    76 #line 35 "yacc_parser.yacc" 
     74#line 35 "yacc_parser.yacc" /* yacc.c:1909  */ 
    7775 
    7876  std::string* str;                /* symbol table index */ 
     
    8078  xios::IFilterExprNode* filterNode; 
    8179 
    82  
    83 /* Line 2058 of yacc.c  */ 
    84 #line 85 "yacc_parser.hpp" 
    85 } YYSTYPE; 
     80#line 81 "yacc_parser.hpp" /* yacc.c:1909  */ 
     81}; 
    8682# define YYSTYPE_IS_TRIVIAL 1 
    87 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 
    8883# define YYSTYPE_IS_DECLARED 1 
    8984#endif 
    9085 
     86 
    9187extern YYSTYPE yylval; 
    9288 
    93 #ifdef YYPARSE_PARAM 
    94 #if defined __STDC__ || defined __cplusplus 
    95 int yyparse (void *YYPARSE_PARAM); 
    96 #else 
    97 int yyparse (); 
    98 #endif 
    99 #else /* ! YYPARSE_PARAM */ 
    100 #if defined __STDC__ || defined __cplusplus 
    10189int yyparse (void); 
    102 #else 
    103 int yyparse (); 
    104 #endif 
    105 #endif /* ! YYPARSE_PARAM */ 
    10690 
    10791#endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */ 
  • XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.yacc

    r1019 r1037  
    4242%token <str> VAR ID AVERAGE 
    4343%token PLUS MINUS TIMES DIVIDE POWER 
    44 %token EQ LT GT LE GE NE 
     44%token EQ LT GT LE GE 
    4545%token LEFT_PARENTHESIS RIGHT_PARENTHESIS 
    4646%token <str> END 
    4747 
    48 %left EQ LT GT LE GE NE 
     48%left EQ LT GT LE GE 
    4949%left PLUS MINUS 
    5050%left TIMES DIVIDE 
     
    7777          | Expression LE Expression  { $$ = new CScalarBinaryOpExprNode($1, "le", $3); } 
    7878          | Expression GE Expression  { $$ = new CScalarBinaryOpExprNode($1, "ge", $3); } 
    79           | Expression NE Expression  { $$ = new CScalarBinaryOpExprNode($1, "ne", $3); } 
    8079          | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS    { $$ = $2; } 
    8180          | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = new CScalarUnaryOpExprNode(*$1, $3); delete $1; } 
     
    9695          | Field_expr LE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "le", $3); } 
    9796          | Field_expr GE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ge", $3); } 
    98           | Field_expr NE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ne", $3); } 
    9997          | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS       { $$ = $2; } 
    10098          | Field_expr PLUS Expression   { $$ = new CFilterFieldScalarOpExprNode($1, "add", $3); } 
     
    117115          | Field_expr GE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ge", $3); } 
    118116          | Expression GE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ge", $3); } 
    119           | Field_expr NE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ne", $3); } 
    120           | Expression NE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ne", $3); } 
    121117          | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = new CFilterUnaryOpExprNode(*$1, $3); delete $1; } 
    122118          ; 
  • XIOS/dev/branch_yushan/src/registry.cpp

    r696 r1037  
    44#include <fstream> 
    55#include <sstream> 
     6 
    67 
    78namespace xios 
     
    221222 
    222223    int* sizes=new int[mpiSize] ; 
    223     CBufferOut localBuffer(this->size()) ; 
     224    size_t st = this->size(); 
     225    CBufferOut localBuffer(st) ; 
    224226    this->toBuffer(localBuffer) ; 
    225227    int localSize=localBuffer.count() ; 
    226     MPI_Gather(&localSize,1,MPI_INT,sizes,1,MPI_INT,0,comm) ; 
     228    MPI_Gather(&localSize,1,MPI_INT,sizes,1,MPI_INT,0,comm) ;     
    227229 
    228230    char* globalBuffer ; 
     
    252254    } 
    253255    else  MPI_Gatherv(localBuffer.start(),localSize,MPI_CHAR,globalBuffer,sizes,displs,MPI_CHAR,0,comm) ;    
     256     
    254257    delete[] sizes ; 
    255258     
     
    258261  void CRegistry::hierarchicalGatherRegistry(void) 
    259262  { 
    260     hierarchicalGatherRegistry(communicator) ; 
     263    //hierarchicalGatherRegistry(communicator) ; 
    261264  } 
    262265 
  • XIOS/dev/branch_yushan/src/registry.hpp

    r700 r1037  
    66#include "mpi.hpp" 
    77#include "message.hpp" 
     8#ifdef _usingEP 
     9#include "ep_declaration.hpp" 
     10#endif 
     11 
    812 
    913// Those two headers can be replaced by the C++11 equivalent in the future 
     
    2327 
    2428/** Constructor, the communicator is used for bcast or gather operation between MPI processes */ 
     29      
    2530      CRegistry(const MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {} 
    26  
     31       
     32      
     33       
    2734/** Copy constructor */ 
    2835      CRegistry(const CRegistry& reg) ; 
  • XIOS/dev/branch_yushan/src/server.cpp

    r1032 r1037  
    99#include <boost/functional/hash.hpp> 
    1010#include <boost/algorithm/string.hpp> 
    11 #include "mpi.hpp" 
     11//#include "mpi.hpp" 
    1212#include "tracer.hpp" 
    1313#include "timer.hpp" 
     
    2626    bool CServer::finished=false ; 
    2727    bool CServer::is_MPI_Initialized ; 
     28 
     29     
    2830    CEventScheduler* CServer::eventScheduler = 0; 
    2931    
    3032    void CServer::initialize(void) 
    3133    { 
    32       int initialized ; 
    33       MPI_Initialized(&initialized) ; 
    34       if (initialized) is_MPI_Initialized=true ; 
    35       else is_MPI_Initialized=false ; 
    36  
    3734      // Not using OASIS 
    3835      if (!CXios::usingOasis) 
    3936      { 
    4037 
    41         if (!is_MPI_Initialized) 
    42         { 
    43           MPI_Init(NULL, NULL); 
    44         } 
    4538        CTimer::get("XIOS").resume() ; 
    4639 
     
    5043        unsigned long* hashAll ; 
    5144 
    52 //        int rank ; 
     45 
    5346        int size ; 
    5447        int myColor ; 
     
    7770 
    7871        myColor=colors[hashServer] ; 
    79         MPI_Comm_split(MPI_COMM_WORLD,myColor,rank,&intraComm) ; 
    80  
     72 
     73 
     74        MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ; 
     75 
     76         
    8177        int serverLeader=leaders[hashServer] ; 
    8278        int clientLeader; 
     
    9692             MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ; 
    9793             interComm.push_back(newComm) ; 
     94             printf("after inter create, interComm.size = %lu\n", interComm.size()); 
    9895           } 
    9996         } 
     
    104101      else 
    105102      { 
    106 //        int rank ,size; 
    107103        int size; 
    108104        if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId); 
     
    148144      
    149145      delete eventScheduler ; 
     146       
     147       
    150148 
    151149      for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++) 
    152150        MPI_Comm_free(&(*it)); 
     151 
    153152      for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++) 
    154153        MPI_Comm_free(&(*it)); 
     154 
    155155      MPI_Comm_free(&intraComm); 
    156156 
     
    158158      { 
    159159        if (CXios::usingOasis) oasis_finalize(); 
    160         else MPI_Finalize() ; 
     160        else  {MPI_Finalize() ; printf("CServer::finalize called MPI_finalize\n");} 
    161161      } 
     162 
     163       
    162164      report(0)<<"Performance report : Time spent for XIOS : "<<CTimer::get("XIOS server").getCumulatedTime()<<endl  ; 
    163165      report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl  ; 
     
    174176         if (isRoot) 
    175177         { 
    176            listenContext(); 
    177            if (!finished) listenFinalize() ; 
     178           listenContext();  
     179           if (!finished) listenFinalize() ;  
    178180         } 
    179181         else 
    180182         { 
    181            listenRootContext(); 
    182            if (!finished) listenRootFinalize() ; 
    183          } 
    184  
     183           listenRootContext();  
     184           if (!finished)  
     185           { 
     186             listenRootFinalize() ;  
     187           } 
     188         } 
     189          
    185190         contextEventLoop() ; 
    186191         if (finished && contextList.empty()) stop=true ; 
     192          
    187193         eventScheduler->checkEvent() ; 
    188194       } 
     195        
     196        
    189197       CTimer::get("XIOS server").suspend() ; 
    190198     } 
     
    195203        int msg ; 
    196204        int flag ; 
     205         
    197206 
    198207        for(it=interComm.begin();it!=interComm.end();it++) 
     
    205214           { 
    206215              MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ; 
     216              printf(" CServer : Receive client finalize\n"); 
    207217              info(20)<<" CServer : Receive client finalize"<<endl ; 
     218 
    208219              MPI_Comm_free(&(*it)); 
    209220              interComm.erase(it) ; 
     
    234245        MPI_Status status ; 
    235246        int msg ; 
    236  
     247         
    237248        traceOff() ; 
    238249        MPI_Iprobe(0,4,intraComm, &flag, &status) ; 
     
    249260 
    250261       MPI_Status status ; 
    251        int flag ; 
    252        static char* buffer ; 
     262       int flag = false ; 
     263       static void* buffer ; 
    253264       static MPI_Request request ; 
    254265       static bool recept=false ; 
    255266       int rank ; 
    256        int count ; 
     267       int count ;  
    257268 
    258269       if (recept==false) 
    259        { 
     270       {       
    260271         traceOff() ; 
    261272         MPI_Iprobe(MPI_ANY_SOURCE,1,CXios::globalComm, &flag, &status) ; 
    262273         traceOn() ; 
     274          
    263275         if (flag==true) 
    264276         { 
     277           #ifdef _usingMPI 
    265278           rank=status.MPI_SOURCE ; 
     279           #elif _usingEP 
     280           rank= status.ep_src ; 
     281           #endif 
    266282           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    267283           buffer=new char[count] ; 
    268            MPI_Irecv((void*)buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ; 
     284           MPI_Irecv(buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ; 
    269285           recept=true ; 
    270286         } 
     287           
    271288       } 
    272289       else 
     
    277294         if (flag==true) 
    278295         { 
     296           #ifdef _usingMPI 
    279297           rank=status.MPI_SOURCE ; 
     298           #elif _usingEP 
     299           rank= status.ep_src ; 
     300           #endif 
    280301           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    281            recvContextMessage((void*)buffer,count) ; 
     302           recvContextMessage(buffer,count) ; 
     303           printf("listerContext register context OK, interComm size = %lu\n", interComm.size()); 
     304            
    282305           delete [] buffer ; 
    283306           recept=false ; 
     
    322345         MPI_Waitall(size-1,requests,status) ; 
    323346         registerContext(buff,count,it->second.leaderRank) ; 
     347         printf("recvContextMessage register context OK\n"); 
    324348 
    325349         recvContextId.erase(it) ; 
     
    335359       MPI_Status status ; 
    336360       int flag ; 
    337        static char* buffer ; 
     361       static void* buffer ; 
    338362       static MPI_Request request ; 
    339363       static bool recept=false ; 
     
    341365       int count ; 
    342366       const int root=0 ; 
     367        
    343368 
    344369       if (recept==false) 
     
    351376           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    352377           buffer=new char[count] ; 
    353            MPI_Irecv((void*)buffer,count,MPI_CHAR,root,2,intraComm,&request) ; 
     378           MPI_Irecv(buffer,count,MPI_CHAR,root,2,intraComm,&request) ; 
    354379           recept=true ; 
    355380         } 
     
    361386         { 
    362387           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    363            registerContext((void*)buffer,count) ; 
     388           registerContext(buffer,count) ; 
     389           printf("listenRootContext register context OK, interComm size = %lu\n", interComm.size()); 
    364390           delete [] buffer ; 
    365391           recept=false ; 
     
    381407 
    382408       MPI_Comm contextIntercomm; 
     409        
    383410       MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm); 
    384411 
     
    386413       MPI_Intercomm_merge(contextIntercomm,1,&inter); 
    387414       MPI_Barrier(inter); 
     415        
    388416 
    389417       CContext* context=CContext::create(contextId); 
    390418       contextList[contextId]=context; 
    391419       context->initServer(intraComm,contextIntercomm); 
     420        
     421        
    392422 
    393423       contextInterComms.push_back(contextIntercomm); 
     424        
     425        
    394426       MPI_Comm_free(&inter); 
     427        
     428       printf(" ****   server: register context OK\n"); 
    395429     } 
    396430 
  • XIOS/dev/branch_yushan/src/server.hpp

    r697 r1037  
    77#include "mpi.hpp" 
    88#include "event_scheduler.hpp" 
     9 
     10#ifdef _usingEP 
     11#include "ep_declaration.hpp" 
     12#endif 
    913 
    1014namespace xios 
  • XIOS/dev/branch_yushan/src/test/test_client.f90

    r794 r1037  
    3535 
    3636  CALL MPI_INIT(ierr) 
    37  
    3837  CALL init_wait 
    39  
    40 !!! XIOS Initialization (get the local communicator) 
    41  
     38   
    4239  CALL xios_initialize(id,return_comm=comm) 
     40   
     41  print*, "test_client xios_initialize OK" 
    4342 
    4443  CALL MPI_COMM_RANK(comm,rank,ierr) 
     44  print*, "test_client MPI_COMM_RANK OK" 
    4545  CALL MPI_COMM_SIZE(comm,size,ierr) 
     46   
    4647 
    4748  DO j=1,nj_glo 
     
    7071  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
    7172  field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
     73   
     74  CALL xios_context_initialize("test",comm) 
    7275 
    73   CALL xios_context_initialize("test",comm) 
    7476  CALL xios_get_handle("test",ctx_hdl) 
     77  print*, "Client xios_get_handle OK" 
    7578  CALL xios_set_current_context(ctx_hdl) 
    76  
     79  print*, "Client xios_set_current_handle OK"   
     80   
     81   
     82   
     83   
    7784  CALL xios_get_calendar_type(calendar_type) 
    7885  PRINT *, "calendar_type = ", calendar_type 
     
    9198  CALL xios_add_child(file_hdl,field_hdl) 
    9299  CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
    93  
     100   
    94101  dtime%second = 3600 
    95102  CALL xios_set_timestep(dtime) 
     103  print*, "Client xios_set_timestep OK"   
    96104 
    97105  ! The calendar is created as soon as the calendar type is defined. This way 
     
    119127  ni=0 ; lonvalue(:,:)=0; 
    120128  CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 
    121  
    122129  print *,"ni",ni 
    123   print *,"lonvalue",lonvalue; 
     130  !print *,"lonvalue",lonvalue; 
    124131 
    125132  CALL xios_is_defined_field_attr("field_A",enabled=ok) 
    126133  PRINT *,"field_A : attribute enabled is defined ? ",ok 
     134   
    127135  CALL xios_close_context_definition() 
     136  print*, "xios_close_context_definition OK"   
    128137 
    129138  PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
    130   DO ts=1,24*10 
     139  !DO ts=1,24*10 
     140  DO ts=1,24 
    131141    CALL xios_update_calendar(ts) 
     142    print*, "xios_update_calendar OK, ts = ", ts 
    132143    CALL xios_send_field("field_A",field_A) 
    133     CALL wait_us(5000) ; 
     144    print*, "xios_send_field OK, ts = ", ts 
     145    CALL wait_us(5000) 
    134146  ENDDO 
     147   
    135148 
    136149  CALL xios_context_finalize() 
     150  print*, "xios_context_finalize OK"   
    137151 
    138152  DEALLOCATE(lon, lat, field_A, lonvalue) 
  • XIOS/dev/branch_yushan/src/test/test_regular.f90

    r1002 r1037  
    1818  INTEGER :: comm   
    1919  INTEGER :: ierr 
    20   INTEGER :: sizeComm, rank    ! SIZE is a fortran function 
     20  INTEGER :: size, rank 
    2121 
    2222  INTEGER :: nlon = 100  
     
    9494 
    9595  CALL MPI_COMM_RANK(comm,rank,ierr) 
    96   CALL MPI_COMM_SIZE(comm,sizeComm,ierr) 
     96  CALL MPI_COMM_SIZE(comm,size,ierr) 
    9797 
    98   IF (MOD(ncell, sizeComm) == 0) THEN 
    99     ni = ncell/sizeComm 
     98  IF (MOD(ncell, size) == 0) THEN 
     99    ni = ncell/size 
    100100    ibegin = rank*ni 
    101101  ELSE 
    102     IF (rank < MOD(ncell, sizeComm)) THEN 
    103       ni = ncell/sizeComm + 1 
    104       ibegin = rank*(ncell/sizeComm + 1) 
     102    IF (rank < MOD(ncell, size)) THEN 
     103      ni = ncell/size + 1 
     104      ibegin = rank*(ncell/size + 1) 
    105105    ELSE 
    106       ni = ncell/sizeComm 
    107       IF (rank == MOD(ncell, sizeComm)) THEN 
    108         ibegin = rank*(ncell/sizeComm + 1) 
     106      ni = ncell/size 
     107      IF (rank == MOD(ncell, size)) THEN 
     108        ibegin = rank*(ncell/size + 1) 
    109109      ELSE 
    110         ibegin = MOD(ncell,sizeComm)*(ncell/sizeComm + 1) + (rank-MOD(ncell,sizeComm))*ncell/sizeComm 
     110        ibegin = MOD(ncell,size)*(ncell/size + 1) + (rank-MOD(ncell,size))*ncell/size 
    111111      END IF 
    112112    END IF 
     
    118118  ALLOCATE(bounds_lat(4,ni)) 
    119119  ALLOCATE(field_temp(ni,ntime))  
    120   lon = lon_glo(1+ibegin:ibegin+ni) 
    121   lat = lat_glo(1+ibegin:ibegin+ni) 
    122   bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:ibegin+ni) 
    123   bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:ibegin+ni) 
     120  lon = lon_glo(1+ibegin:1+ibegin+ni) 
     121  lat = lat_glo(1+ibegin:1+ibegin+ni) 
     122  bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:1+ibegin+ni) 
     123  bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:1+ibegin+ni) 
    124124  field_temp(:,:) = rank 
    125125 
  • XIOS/dev/branch_yushan/src/test/test_remap.f90

    r1018 r1037  
    9191    IF (MOD(i,10)==0) THEN 
    9292      src_mask_2D(i)=.FALSE. 
    93       src_field_2D(i) = 100000 
    9493    ELSE 
    95       src_mask_2D(i)=.TRUE.       
     94      src_mask_2D(i)=.TRUE. 
    9695    ENDIF 
    9796  ENDDO 
     
    10099    lval(i) = i*100 
    101100    src_field_pression(:,i) = i * 100 
    102     IF (MOD(i,3)==0) THEN 
    103       ! src_field_pression(:,i) = 100000 
    104       src_field_3D(:,i) = 100000 
    105     ELSE 
    106       ! src_field_pression(:,i) = i * 100 
    107       src_field_3D(:,i) = src_field_3D(:,i) + i * 10  
    108     ENDIF 
    109     ! src_field_3D(:,i) = src_field_3D(:,i) + i * 10     
     101    src_field_3D(:,i) = src_field_3D(:,i) + i * 10     
    110102  ENDDO 
    111103 
    112104  DO i=1,llm2 
    113     src_field_4D(:,:,i) = src_field_3D(:,:) + i * 100 
     105    src_field_4D(:,:,i) = src_field_3D(:,:) 
    114106  ENDDO 
    115107 
     
    192184    CALL xios_send_field("src_field_2D_clone",src_field_2D) 
    193185    CALL xios_send_field("src_field_3D",src_field_3D) 
    194     CALL xios_send_field("src_field_3D_clone",src_field_3D) 
    195186    CALL xios_send_field("src_field_4D",src_field_4D) 
    196187    CALL xios_send_field("src_field_3D_pression",src_field_pression) 
  • XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.cpp

    r1018 r1037  
    33   \author Ha NGUYEN 
    44   \since 8 Sep 2016 
    5    \date 9 Jan 2017 
     5   \date 8 Sep 2016 
    66 
    77   \brief average reduction 
    88 */ 
    99#include "average_reduction.hpp" 
    10 #include "utils.hpp" 
    1110 
    1211namespace xios { 
     
    3029                                       const double* dataInput, 
    3130                                       CArray<double,1>& dataOut, 
    32                                        std::vector<bool>& flagInitial, 
    33                                        const double& defaultValue) 
     31                                       std::vector<bool>& flagInitial) 
    3432{ 
    3533  if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; } 
    36   bool hasMissingValue = NumTraits<double>::isnan(defaultValue); 
    3734 
    38   if (hasMissingValue) 
     35  int nbLocalIndex = localIndex.size(); 
     36  int currentlocalIndex = 0; 
     37  double currentWeight  = 0.0; 
     38  for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3939  { 
    40     int nbLocalIndex = localIndex.size(); 
    41     int currentlocalIndex = 0; 
    42     double currentWeight  = 0.0; 
    43     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     40    currentlocalIndex = localIndex[idx].first; 
     41    currentWeight     = localIndex[idx].second; 
     42 
     43    if (flagInitial[currentlocalIndex]) 
    4444    { 
    45       currentlocalIndex = localIndex[idx].first; 
    46       currentWeight     = localIndex[idx].second; 
    47       if (!NumTraits<double>::isnan(*(dataInput + idx))) 
    48       { 
    49         if (flagInitial[currentlocalIndex]) 
    50         { 
    51           dataOut(currentlocalIndex) = *(dataInput + idx); 
    52           flagInitial[currentlocalIndex] = false; 
    53         } 
    54         else 
    55         { 
    56           dataOut(currentlocalIndex)  += *(dataInput + idx); 
    57           weights_(currentlocalIndex) += 1.0; 
    58         } 
    59       } 
     45      dataOut(currentlocalIndex) = *(dataInput + idx); 
     46      flagInitial[currentlocalIndex] = false; 
    6047    } 
    61   } 
    62   else 
    63   { 
    64     int nbLocalIndex = localIndex.size(); 
    65     int currentlocalIndex = 0; 
    66     double currentWeight  = 0.0; 
    67     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     48    else 
    6849    { 
    69       currentlocalIndex = localIndex[idx].first; 
    70       currentWeight     = localIndex[idx].second; 
    71  
    72       if (flagInitial[currentlocalIndex]) 
    73       { 
    74         dataOut(currentlocalIndex) = *(dataInput + idx); 
    75         flagInitial[currentlocalIndex] = false; 
    76       } 
    77       else 
    78       { 
    79         dataOut(currentlocalIndex)  += *(dataInput + idx); 
    80         weights_(currentlocalIndex) += 1.0; 
    81       } 
     50      dataOut(currentlocalIndex)  += *(dataInput + idx); 
     51      weights_(currentlocalIndex) += 1.0; 
    8252    } 
    8353  } 
  • XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.hpp

    r1018 r1037  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial, 
    29                      const double& defaultValue); 
     28                     std::vector<bool>& flagInitial); 
    3029 
    3130  virtual void updateData(CArray<double,1>& dataOut); 
  • XIOS/dev/branch_yushan/src/transformation/Functions/extract.cpp

    r1018 r1037  
    2929                                       const double* dataInput, 
    3030                                       CArray<double,1>& dataOut, 
    31                                        std::vector<bool>& flagInitial, 
    32                                        const double& defaultValue) 
     31                                       std::vector<bool>& flagInitial) 
    3332{ 
    3433  int nbLocalIndex = localIndex.size(); 
  • XIOS/dev/branch_yushan/src/transformation/Functions/extract.hpp

    r1018 r1037  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial, 
    29                      const double& defaultValue); 
     28                     std::vector<bool>& flagInitial); 
    3029 
    3130  virtual ~CExtractReductionAlgorithm() {} 
  • XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.cpp

    r1018 r1037  
    88 */ 
    99#include "max_reduction.hpp" 
    10 #include "utils.hpp" 
    1110 
    1211namespace xios { 
     
    3029                                   const double* dataInput, 
    3130                                   CArray<double,1>& dataOut, 
    32                                    std::vector<bool>& flagInitial, 
    33                                    const double& defaultValue) 
     31                                   std::vector<bool>& flagInitial) 
    3432{ 
    35   bool hasMissingValue = NumTraits<double>::isnan(defaultValue); 
    36  
    37   if (hasMissingValue) 
     33  int nbLocalIndex = localIndex.size(); 
     34  int currentlocalIndex = 0; 
     35  double currentWeight  = 0.0; 
     36  for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3837  { 
    39     int nbLocalIndex = localIndex.size(); 
    40     int currentlocalIndex = 0;     
    41     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     38    currentlocalIndex = localIndex[idx].first; 
     39    currentWeight     = localIndex[idx].second; 
     40    if (flagInitial[currentlocalIndex]) 
    4241    { 
    43       currentlocalIndex = localIndex[idx].first;       
    44       if (!NumTraits<double>::isnan(*(dataInput + idx))) 
    45       { 
    46         if (flagInitial[currentlocalIndex]) 
    47         { 
    48           dataOut(currentlocalIndex) = *(dataInput + idx); 
    49           flagInitial[currentlocalIndex] = false; 
    50         } 
    51         else 
    52         { 
    53           dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
    54         } 
    55       } 
     42      dataOut(currentlocalIndex) = *(dataInput + idx); 
     43      flagInitial[currentlocalIndex] = false; 
    5644    } 
    57   } 
    58   else 
    59   { 
    60     int nbLocalIndex = localIndex.size(); 
    61     int currentlocalIndex = 0;     
    62     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     45    else 
    6346    { 
    64       currentlocalIndex = localIndex[idx].first;       
    65       if (flagInitial[currentlocalIndex]) 
    66       { 
    67         dataOut(currentlocalIndex) = *(dataInput + idx); 
    68         flagInitial[currentlocalIndex] = false; 
    69       } 
    70       else 
    71       { 
    72         dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
    73       } 
     47      dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
    7448    } 
    7549  } 
  • XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.hpp

    r1018 r1037  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial, 
    29                      const double& defaultValue); 
     28                     std::vector<bool>& flagInitial); 
    3029 
    3130  virtual ~CMaxReductionAlgorithm() {} 
  • XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.cpp

    r1018 r1037  
    33   \author Ha NGUYEN 
    44   \since 27 June 2016 
    5    \date 9 Jan 2017 
     5   \date 27 June 2016 
    66 
    77   \brief min reduction 
    88 */ 
    99#include "min_reduction.hpp" 
    10 #include "utils.hpp" 
    1110 
    1211namespace xios { 
     
    3029                                   const double* dataInput, 
    3130                                   CArray<double,1>& dataOut, 
    32                                    std::vector<bool>& flagInitial, 
    33                                    const double& defaultValue) 
     31                                   std::vector<bool>& flagInitial) 
    3432{ 
    35   bool hasMissingValue = NumTraits<double>::isnan(defaultValue); 
    36  
    37   if (hasMissingValue) 
     33  int nbLocalIndex = localIndex.size(); 
     34  int currentlocalIndex = 0; 
     35  for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3836  { 
    39     int nbLocalIndex = localIndex.size(); 
    40     int currentlocalIndex = 0; 
    41     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     37    currentlocalIndex = localIndex[idx].first; 
     38    if (flagInitial[currentlocalIndex]) 
    4239    { 
    43       currentlocalIndex = localIndex[idx].first; 
    44       if (!NumTraits<double>::isnan(*(dataInput + idx))) 
    45       { 
    46         if (flagInitial[currentlocalIndex]) 
    47         { 
    48           dataOut(currentlocalIndex) = *(dataInput + idx); 
    49           flagInitial[currentlocalIndex] = false; 
    50         } 
    51         else 
    52         { 
    53           dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
    54         } 
    55       } 
     40      dataOut(currentlocalIndex) = *(dataInput + idx); 
     41      flagInitial[currentlocalIndex] = false; 
    5642    } 
    57   } 
    58   else 
    59   { 
    60     int nbLocalIndex = localIndex.size(); 
    61     int currentlocalIndex = 0; 
    62     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     43    else 
    6344    { 
    64       currentlocalIndex = localIndex[idx].first; 
    65       if (flagInitial[currentlocalIndex]) 
    66       { 
    67         dataOut(currentlocalIndex) = *(dataInput + idx); 
    68         flagInitial[currentlocalIndex] = false; 
    69       } 
    70       else 
    71       { 
    72         dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
    73       } 
     45      dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
    7446    } 
    7547  } 
  • XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.hpp

    r1018 r1037  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial, 
    29                      const double& defaultValue); 
     28                     std::vector<bool>& flagInitial); 
    3029 
    3130  virtual ~CMinReductionAlgorithm() {} 
  • XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp

    r1018 r1037  
    4545                     const double* dataInput, 
    4646                     CArray<double,1>& dataOut, 
    47                      std::vector<bool>& flagInitial, 
    48                      const double& defaultValue) = 0; 
     47                     std::vector<bool>& flagInitial) = 0; 
    4948  /*! 
    5049    Update local data  
  • XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.cpp

    r1018 r1037  
    33   \author Ha NGUYEN 
    44   \since 27 June 2016 
    5    \date 9 Jan 2017 
     5   \date 27 June 2016 
    66 
    77   \brief sum reduction 
    88 */ 
    99#include "sum_reduction.hpp" 
    10 #include "utils.hpp" 
    1110 
    1211namespace xios { 
     
    3029                                   const double* dataInput, 
    3130                                   CArray<double,1>& dataOut, 
    32                                    std::vector<bool>& flagInitial, 
    33                                    const double& defaultValue) 
     31                                   std::vector<bool>& flagInitial) 
    3432{ 
    35   bool hasMissingValue = NumTraits<double>::isnan(defaultValue); 
    36   if (hasMissingValue) 
     33  int nbLocalIndex = localIndex.size(); 
     34  int currentlocalIndex = 0; 
     35  double currentWeight  = 0.0; 
     36  for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3737  { 
    38     int nbLocalIndex = localIndex.size(); 
    39     int currentlocalIndex = 0;     
    40     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     38    currentlocalIndex = localIndex[idx].first; 
     39    currentWeight     = localIndex[idx].second; 
     40    if (flagInitial[currentlocalIndex]) 
    4141    { 
    42       currentlocalIndex = localIndex[idx].first;    
    43       if (!NumTraits<double>::isnan(*(dataInput + idx))) 
    44       {    
    45         if (flagInitial[currentlocalIndex]) 
    46         { 
    47           dataOut(currentlocalIndex) = *(dataInput + idx); 
    48           flagInitial[currentlocalIndex] = false; 
    49         } 
    50         else 
    51         { 
    52           dataOut(currentlocalIndex) += *(dataInput + idx); 
    53         } 
    54       } 
    55     }     
    56   } 
    57   else 
    58   { 
    59     int nbLocalIndex = localIndex.size(); 
    60     int currentlocalIndex = 0;     
    61     for (int idx = 0; idx < nbLocalIndex; ++idx) 
     42      dataOut(currentlocalIndex) = *(dataInput + idx); 
     43      flagInitial[currentlocalIndex] = false; 
     44    } 
     45    else 
    6246    { 
    63       currentlocalIndex = localIndex[idx].first;       
    64       if (flagInitial[currentlocalIndex]) 
    65       { 
    66         dataOut(currentlocalIndex) = *(dataInput + idx); 
    67         flagInitial[currentlocalIndex] = false; 
    68       } 
    69       else 
    70       { 
    71         dataOut(currentlocalIndex) += *(dataInput + idx); 
    72       } 
     47      dataOut(currentlocalIndex) += *(dataInput + idx); 
    7348    } 
    7449  } 
  • XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.hpp

    r1018 r1037  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial, 
    29                      const double& defaultValue); 
     28                     std::vector<bool>& flagInitial); 
    3029 
    3130  virtual ~CSumReductionAlgorithm() {} 
  • XIOS/dev/branch_yushan/src/transformation/axis_algorithm_extract_domain.cpp

    r1018 r1037  
    7171                                        const double& defaultValue) 
    7272{ 
    73   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue); 
     73  reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
    7474} 
    7575 
  • XIOS/dev/branch_yushan/src/transformation/axis_algorithm_inverse.cpp

    r936 r1037  
    211211 
    212212  status.resize(requests.size()); 
     213  //printf("(%d) src/transformation/axis_algorithm_inverse 1st waitall\n", clientRank); 
    213214  MPI_Waitall(requests.size(), &requests[0], &status[0]); 
    214  
     215  //printf("(%d) src/transformation/axis_algorithm_inverse 1st waitall OK\n", clientRank); 
    215216 
    216217  std::vector<MPI_Request>().swap(requests); 
     
    245246  } 
    246247  status.resize(requests.size()); 
     248  //printf("(%d) src/transformation/axis_algorithm_inverse 2nd waitall\n", clientRank); 
     249 
    247250  MPI_Waitall(requests.size(), &requests[0], &status[0]); 
    248  
     251  //printf("(%d) src/transformation/axis_algorithm_inverse 2nd waitall OK\n", clientRank); 
    249252 
    250253  size_t nGloAxisDest = axisDest_->n_glo.getValue() - 1; 
  • XIOS/dev/branch_yushan/src/transformation/axis_algorithm_reduce_domain.cpp

    r1018 r1037  
    7979                                       const double& defaultValue) 
    8080{ 
    81   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue); 
     81  reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
    8282} 
    8383 
  • XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.cpp

    r1014 r1037  
    4848 
    4949CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 
    50 : CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 
    51 { 
    52   CContext* context = CContext::getCurrent(); 
     50: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false) 
     51{ 
    5352  interpDomain_->checkValid(domainSource); 
    54   fileToReadWrite_ = "xios_interpolation_weights_"; 
    55  
    56   if (interpDomain_->weight_filename.isEmpty()) 
    57   { 
    58     fileToReadWrite_ += context->getId() + "_" +  
    59                     domainSource->getDomainOutputName() + "_" +  
    60                     domainDestination->getDomainOutputName() + ".nc";     
    61   } 
    62   else  
    63     fileToReadWrite_ = interpDomain_->weight_filename; 
    64  
    65   ifstream f(fileToReadWrite_.c_str());   
    66   switch (interpDomain_->mode) 
    67   { 
    68     case CInterpolateDomain::mode_attr::read: 
    69       readFromFile_ = true;       
    70       break; 
    71     case CInterpolateDomain::mode_attr::compute: 
    72       readFromFile_ = false; 
    73       break; 
    74     case CInterpolateDomain::mode_attr::read_or_compute:       
    75       if (!f.good()) 
    76         readFromFile_ = false; 
    77       else 
    78         readFromFile_ = true; 
    79       break; 
    80     default: 
    81       break; 
    82   }  
    83  
    84   writeToFile_ = interpDomain_->write_weight;   
    85      
     53  if ((CInterpolateDomain::mode_attr::write == interpDomain_->mode) && 
     54      (!interpDomain_->file.isEmpty())) 
     55    writeToFile_ = true; 
    8656} 
    8757 
     
    384354  } 
    385355 
    386   if (writeToFile_ && !readFromFile_) 
     356  if (writeToFile_) 
    387357     writeRemapInfo(interpMapValue); 
    388358  exchangeRemapInfo(interpMapValue); 
     
    469439void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    470440{ 
    471   if (readFromFile_ && !writeToFile_ 
     441  if (CInterpolateDomain::mode_attr::read == interpDomain_->mode 
    472442    readRemapInfo(); 
    473443  else 
     
    478448 
    479449void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
    480  
    481   writeInterpolationInfo(fileToReadWrite_, interpMapValue); 
     450{ 
     451  std::string filename = interpDomain_->file.getValue(); 
     452  writeInterpolationInfo(filename, interpMapValue); 
    482453} 
    483454 
    484455void CDomainAlgorithmInterpolate::readRemapInfo() 
    485  
     456{ 
     457  std::string filename = interpDomain_->file.getValue(); 
    486458  std::map<int,std::vector<std::pair<int,double> > > interpMapValue; 
    487   readInterpolationInfo(fileToReadWrite_, interpMapValue); 
     459  readInterpolationInfo(filename, interpMapValue); 
    488460 
    489461  exchangeRemapInfo(interpMapValue); 
     
    636608    int countBuff = 0; 
    637609    MPI_Get_count(&recvStatus, MPI_INT, &countBuff); 
     610    #ifdef _usingMPI 
    638611    clientSrcRank = recvStatus.MPI_SOURCE; 
    639  
     612    #elif _usingEP 
     613    clientSrcRank = recvStatus.ep_src; 
     614    #endif 
    640615    MPI_Recv((recvIndexSrcBuff + receivedSize), 
    641616             recvBuffSize, 
     
    681656                                                                const StdSize size) 
    682657{ 
    683   return CONetCDF4::addDimension(name, size);   
     658  CONetCDF4::addDimension(name, size);   
    684659} 
    685660 
     
    687662                                                               const std::vector<StdString>& dim) 
    688663{ 
    689   return CONetCDF4::addVariable(name, type, dim); 
    690 } 
    691  
    692 void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 
    693 { 
    694   CONetCDF4::definition_end(); 
     664  CONetCDF4::addVariable(name, type, dim); 
    695665} 
    696666 
     
    756726  MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm); 
    757727   
    758   if (0 == globalNbWeight) 
    759   { 
    760     info << "There is no interpolation weights calculated between " 
    761          << "domain source: " << domainSrc_->getDomainOutputName() 
    762          << " and domain destination: " << domainDest_->getDomainOutputName() 
    763          << std::endl; 
    764     return; 
    765   } 
    766  
    767728  std::vector<StdSize> start(1, startIndex - localNbWeight); 
    768729  std::vector<StdSize> count(1, localNbWeight); 
    769    
    770   WriteNetCdf netCdfWriter(filename, client->intraComm);   
     730 
     731  WriteNetCdf netCdfWriter(filename, client->intraComm); 
     732 
     733  // netCdfWriter = CONetCDF4(filename, false, false, true, client->intraComm, false); 
    771734 
    772735  // Define some dimensions 
     
    782745  netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims); 
    783746 
    784   // End of definition 
    785   netCdfWriter.endDefinition(); 
    786  
    787747  // // Write variables 
    788   if (0 != localNbWeight) 
    789   { 
    790     netCdfWriter.writeDataIndex(src_idx, "src_idx", false, 0, &start, &count); 
    791     netCdfWriter.writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count); 
    792     netCdfWriter.writeDataIndex(weights, "weight", false, 0, &start, &count); 
    793   } 
     748  netCdfWriter.writeDataIndex(src_idx, "src_idx", true, 0, &start, &count); 
     749  netCdfWriter.writeDataIndex(dst_idx, "dst_idx", true, 0, &start, &count); 
     750  netCdfWriter.writeDataIndex(weights, "weight", true, 0, &start, &count); 
    794751 
    795752  netCdfWriter.closeFile(); 
  • XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.hpp

    r1014 r1037  
    4848  CInterpolateDomain* interpDomain_; 
    4949  bool writeToFile_; 
    50   bool readFromFile_; 
    51   StdString fileToReadWrite_; 
    5250 
    5351  // class WriteNetCdf; 
     
    5957    int addVariableWrite(const StdString& name, nc_type type, 
    6058                         const std::vector<StdString>& dim); 
    61     void endDefinition(); 
    6259    void writeDataIndex(const CArray<int,1>& data, const StdString& name, 
    6360                        bool collective, StdSize record, 
  • XIOS/dev/branch_yushan/src/transformation/generic_algorithm_transformation.cpp

    r1018 r1037  
    1111#include "context_client.hpp" 
    1212#include "client_client_dht_template.hpp" 
    13 #include "utils.hpp" 
    1413 
    1514namespace xios { 
     
    3231                                            const double& defaultValue) 
    3332{ 
    34   int nbLocalIndex = localIndex.size();   
    35   bool hasMissingValue = NumTraits<double>::isnan(defaultValue);   
     33  int nbLocalIndex = localIndex.size(); 
     34  bool hasMissingValue = (0.0 != defaultValue) ? true : false; 
    3635  if (hasMissingValue) 
    3736  { 
    3837    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3938    { 
    40       if (NumTraits<double>::isnan(*(dataInput + idx))) 
     39      if (defaultValue == *(dataInput + idx)) 
    4140      { 
    4241        flagInitial[localIndex[idx].first] = false; 
  • XIOS/dev/branch_yushan/src/transformation/grid_transformation.cpp

    r978 r1037  
    531531 
    532532  status.resize(requests.size()); 
     533  //printf("(%d) src/transformation/grid_transformation 1st waitall\n", clientRank); 
    533534  MPI_Waitall(requests.size(), &requests[0], &status[0]); 
     535  //printf("(%d) src/transformation/grid_transformation 1st waitall OK\n", clientRank); 
    534536 
    535537  // 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 
     
    583585  } 
    584586  status.resize(requests.size()); 
     587  //printf("(%d) src/transformation/grid_transformation 2nd waitall\n", clientRank); 
    585588  MPI_Waitall(requests.size(), &requests[0], &status[0]); 
     589  //printf("(%d) src/transformation/grid_transformation 2nd waitall OK\n", clientRank); 
    586590 
    587591  // Cool, now we can fill in local index of grid destination (counted for masked index) 
  • XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_extract_axis.cpp

    r1018 r1037  
    5858                                         const double& defaultValue) 
    5959{ 
    60   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue); 
     60  reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
    6161} 
    6262 
  • XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_axis.cpp

    r1018 r1037  
    9090                                         const double& defaultValue) 
    9191{ 
    92   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue); 
     92  reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
    9393} 
    9494 
  • XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_domain.cpp

    r1018 r1037  
    8484                                         const double& defaultValue) 
    8585{ 
    86   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, defaultValue); 
     86  reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
    8787} 
    8888 
  • XIOS/dev/branch_yushan/src/utils.hpp

    r1018 r1037  
    257257    return 1e-12; 
    258258  } 
    259   static inline bool isnan(const Scalar& v) { 
    260     return (v != v); 
    261   } 
    262259}; 
    263260 
  • XIOS/dev/branch_yushan/src/xml_parser.cpp

    r1031 r1037  
    7070                  CContext::setCurrent(attributes["id"]) ; 
    7171 
     72                  bool hasctxt = CContext::has(attributes["id"]); 
     73 
     74                  if(hasctxt) 
     75                  { 
     76                     DEBUG("The context will not be processed because it exist an other context with the same id" ); 
     77                     continue; 
     78                  } 
    7279 
    7380                  if (isParseAll) 
    7481                  { 
    7582                    CContext* context = CContext::create(attributes["id"]); 
     83//                  if (!hasctxt)  group_context->addChild(context); 
    7684                    context->parse(node); 
    7785 
     
    8492                    { 
    8593                      CContext* context = CContext::create(*it); 
     94  //                  if (!hasctxt)  group_context->addChild(context); 
    8695                      context->parse(node); 
    8796 
Note: See TracChangeset for help on using the changeset viewer.