Changeset 1037


Ignore:
Timestamp:
01/25/17 16:25:17 (4 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