Changeset 1205


Ignore:
Timestamp:
07/10/17 18:17:04 (3 years ago)
Author:
yushan
Message:

branch merged with trunk @1200

Location:
XIOS/dev/branch_yushan_merged
Files:
77 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/extern/remap/src/clipper.cpp

    r1146 r1205  
    10471047 
    10481048  //create a new edge array ... 
    1049   TEdge *edges = new TEdge[highI+1]; 
     1049  TEdge *edges = new TEdge [highI +1]; 
    10501050 
    10511051  bool IsFlat = true; 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/gridRemap.hpp

    r1155 r1205  
    1414Coord readPole(std::istream&); 
    1515 
    16  
     16extern CRemapGrid srcGrid; 
     17extern CRemapGrid tgtGrid; 
    1718 
    1819} 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/intersect.cpp

    r1155 r1205  
    1717using namespace std; 
    1818 
    19 extern CRemapGrid srcGrid; 
    20 #pragma omp threadprivate(srcGrid) 
    21  
    22 extern CRemapGrid tgtGrid; 
    23 #pragma omp threadprivate(tgtGrid) 
    24  
    2519/** returns index of edge of a that is shared with b, 
    2620    or NOT_FOUND if a and b do not share an edge */ 
     
    6256    for (int j = 0; j < b.n; j++) 
    6357    { 
    64       // share a full edge ? be carefull at the orientation 
    65        
    66       //if(squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 || 
    67       //   squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ) 
    68       //{       
    69         //printf("A : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e  %d\n",  
    70         //        i, j, squaredist(a.vertex[i], b.vertex[j]),  
    71         //        squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ? true : false); 
    72         //printf("B : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e  %d\n",  
    73         //        (i+1)%a.n, (j+1)%b.n, squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]), 
    74         //        squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ? true : false); 
    75  
    76         assert(squaredist(a.vertex[ i       ], b.vertex[ j       ]) > 1e-10*1e-10 || 
    77                squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10); 
    78          
    79       //} 
    80  
     58// share a full edge ? be carefull at the orientation 
     59      assert(squaredist(a.vertex[ i       ], b.vertex[ j       ]) > 1e-10*1e-10 || 
     60             squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10); 
    8161      if (   squaredist(a.vertex[ i       ], b.vertex[ j           ]) < 1e-10*1e-10 && 
    8262             squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+b.n-1)%b.n]) < 1e-10*1e-10) 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/intersection_ym.cpp

    r1155 r1205  
    1616using namespace std; 
    1717using namespace ClipperLib ; 
    18  
    19 extern CRemapGrid srcGrid; 
    20 #pragma omp threadprivate(srcGrid) 
    21  
    22 extern CRemapGrid tgtGrid; 
    23 #pragma omp threadprivate(tgtGrid) 
    2418 
    2519double intersect_ym(Elt *a, Elt *b) 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/libmapper.cpp

    r1176 r1205  
    1414#include "mapper.hpp" 
    1515#include "cputime.hpp" // cputime 
    16 #include "gridRemap.hpp" 
    17  
    1816#include <stdio.h> 
    1917 
    2018using namespace sphereRemap ; 
    21  
    22 //extern CRemapGrid srcGrid; 
    23 //#pragma omp threadprivate(srcGrid) 
    24  
    25 //extern CRemapGrid tgtGrid; 
    26 //#pragma omp threadprivate(tgtGrid) 
    27  
    2819 
    2920/* mapper is a ponter to a global class instance whoes members are allocated in the first step (finding the sizes of the weight arrays) 
     
    4233                     int order, int* n_weights) 
    4334{ 
    44   printf("libmapper callded : remap_get_num_weights\n"); 
    4535  assert(src_bounds_lon); 
    4636  assert(src_bounds_lat); 
     
    125115                     double* centre_lon, double* centre_lat, double* areas) 
    126116{ 
    127   printf("libmapper callded : remap_get_barycentres_and_areas\n"); 
    128117        for (int i = 0; i < n_cell; i++) 
    129118        { 
     
    149138extern "C" void remap_get_weights(double* weights, int* src_indices, int* dst_indices) 
    150139{ 
    151   printf("libmapper callded : remap_get_weights\n"); 
    152140        memcpy(weights, mapper->remapMatrix, mapper->nWeights*sizeof(double)); 
    153141        memcpy(src_indices, mapper->srcAddress, mapper->nWeights*sizeof(int)); 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp

    r1159 r1205  
    1515namespace sphereRemap { 
    1616 
    17 extern CRemapGrid srcGrid; 
    18 #pragma omp threadprivate(srcGrid) 
    19  
    20 extern CRemapGrid tgtGrid; 
    21 #pragma omp threadprivate(tgtGrid) 
    22  
    2317/* A subdivition of an array into N sub-arays 
    2418   can be represented by the length of the N arrays 
     
    275269 
    276270    MPI_Status *status = new MPI_Status[4*mpiSize]; 
    277      
     271 
     272    MPI_Waitall(nbSendRequest, sendRequest, status); 
    278273    MPI_Waitall(nbRecvRequest, recvRequest, status); 
    279     MPI_Waitall(nbSendRequest, sendRequest, status); 
    280      
    281274 
    282275    /* for all indices that have been received from requesting ranks: pack values and gradients, then send */ 
     
    629622    MPI_Waitall(nbRecvRequest, recvRequest, status); 
    630623    MPI_Waitall(nbSendRequest, sendRequest, status); 
    631   
     624 
    632625    int nbNeighbourNodes = 0; 
    633626    for (int rank = 0; rank < mpiSize; rank++) 
     
    699692        } 
    700693 
    701         /* 
    702            for (int i = 0; i < elt->n; i++) 
    703            { 
    704            if (elt->neighbour[i] == NOT_FOUND) 
    705            error_exit("neighbour not found"); 
    706            } 
    707            */ 
    708694    } 
    709695} 
     
    810796        } 
    811797    } 
    812   
     798 
    813799    MPI_Waitall(nbRecvRequest, recvRequest, status); 
    814800    MPI_Waitall(nbSendRequest, sendRequest, status); 
    815      
    816      
     801 
    817802    char **sendBuffer2 = new char*[mpiSize]; 
    818803    char **recvBuffer2 = new char*[mpiSize]; 
     
    838823                    Elt *elt2 = (Elt *) ((*it)->data); 
    839824                    /* recvElt is target, elt2 is source */ 
    840                     //                                  intersect(&recvElt[j], elt2); 
    841                     intersect_ym(&recvElt[j], elt2); 
     825                    intersect(&recvElt[j], elt2); 
     826                    //intersect_ym(&recvElt[j], elt2); 
    842827                } 
    843  
    844828                if (recvElt[j].is.size() > 0) sentMessageSize[rank] += packIntersectionSize(recvElt[j]); 
    845829 
     
    860844            } 
    861845            delete [] recvElt; 
    862  
    863846        } 
    864847    } 
     
    898881    MPI_Waitall(nbRecvRequest, recvRequest, status); 
    899882    MPI_Waitall(nbSendRequest, sendRequest, status); 
    900     
    901     
    902883 
    903884    delete [] sendRequest; 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/node.cpp

    r1172 r1205  
    472472        q->child.resize(MAX_NODE_SZ/2 + 1); 
    473473        assert(thIs->child.size() == MAX_NODE_SZ+1); 
    474         if(thIs->closest(thIs->child, FARTHEST) == 0)  
    475           thIs->tree->ref = thIs->closest(thIs->child, FARTHEST); // farthest from centre 
    476            
    477         thIs->tree->ref = thIs->closest(thIs->child, FARTHEST); // farthest from centre 
    478          
    479            
     474        thIs->tree->ref = thIs->closest(thIs->child, FARTHEST); // farthest from centre 
    480475        std::sort(thIs->child.begin(), thIs->child.end(), compareDist); 
    481476        for (int i = 0; i < MAX_NODE_SZ+1; i++) 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/parallel_tree.cpp

    r1172 r1205  
    1616 
    1717static const int assignLevel = 2; 
    18  
    19 extern CRemapGrid srcGrid; 
    20 #pragma omp threadprivate(srcGrid) 
    21  
    22 extern CRemapGrid tgtGrid; 
    23 #pragma omp threadprivate(tgtGrid) 
    2418 
    2519// only the circle is packed, rest of node will be initialized on unpacking 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/polyg.cpp

    r1176 r1205  
    33#include <cassert> 
    44#include <iostream> 
    5 #include <stdio.h> 
    65#include "elt.hpp" 
    76#include "errhandle.hpp" 
     
    175174                t[2] = x[ii]; 
    176175                double sc=scalarprod(crossprod(t[1] - t[0], t[2] - t[0]), t[0]) ; 
    177                 //assert(sc >= -1e-10); // Error: tri a l'env (wrong orientation) 
    178                 if(sc < -1e-10) 
    179                 { 
    180                   printf("N=%d, sc = %f, t[0]=(%f,%f,%f), t[1]=(%f,%f,%f), t[2]=(%f,%f,%f)\n", N, sc, 
    181                                                                                          t[0].x, t[0].y, t[0].z,  
    182                                                                                          t[1].x, t[1].y, t[1].z, 
    183                                                                                          t[2].x, t[2].y, t[2].z); 
    184                   assert(sc >= -1e-10); 
    185                 } 
     176                assert(sc >= -1e-10); // Error: tri a l'env (wrong orientation) 
    186177                double area_gc = triarea(t[0], t[1], t[2]); 
    187178                double area_sc_gc_moon = 0; 
  • XIOS/dev/branch_yushan_merged/extern/remap/src/triple.cpp

    r1176 r1205  
    33namespace sphereRemap { 
    44 
    5 const Coord ORIGIN(0.0, 0.0, 0.0); 
     5extern const Coord ORIGIN(0.0, 0.0, 0.0); 
    66 
    77std::ostream& operator<<(std::ostream& os, const Coord& c) { 
  • XIOS/dev/branch_yushan_merged/src/attribute.cpp

    r1134 r1205  
    5454      ///-------------------------------------------------------------- 
    5555 
    56  
    5756      CMessage& operator<<(CMessage& msg,CAttribute& type) 
    5857      { 
  • XIOS/dev/branch_yushan_merged/src/buffer_client.cpp

    r1179 r1205  
    1212  size_t CClientBuffer::maxRequestSize = 0; 
    1313 
    14   CClientBuffer::CClientBuffer(MPI_Comm interComm, int serverRank, StdSize bufferSize, StdSize maxBufferedEvents) 
     14  CClientBuffer::CClientBuffer(MPI_Comm interComm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents) 
    1515    : interComm(interComm) 
    1616    , serverRank(serverRank) 
    1717    , bufferSize(bufferSize) 
     18    , estimatedMaxEventSize(estimatedMaxEventSize) 
     19    , maxEventSize(0) 
    1820    , current(0) 
    1921    , count(0) 
     
    4345  bool CClientBuffer::isBufferFree(int size) 
    4446  { 
    45     if (size > maxRequestSize) maxRequestSize = size; 
    46  
    4747    if (size > bufferSize) 
    4848      ERROR("bool CClientBuffer::isBufferFree(int size)", 
    4949            << "The requested size (" << size << " bytes) is too big to fit the buffer (" << bufferSize << " bytes), please increase the client buffer size." << endl); 
     50 
     51    if (size > maxEventSize) 
     52    { 
     53      maxEventSize = size; 
     54 
     55      if (size > estimatedMaxEventSize) 
     56        error(0) << "WARNING: Unexpected event of size " << size << " for server " << serverRank 
     57                 << " (estimated max event size = " << estimatedMaxEventSize << ")" << std::endl; 
     58 
     59      if (size > maxRequestSize) maxRequestSize = size; 
     60    } 
     61 
    5062 
    5163    return (size <= remain() && bufferedEvents < maxBufferedEvents); 
  • XIOS/dev/branch_yushan_merged/src/buffer_client.hpp

    r1134 r1205  
    1818      #pragma omp threadprivate(maxRequestSize) 
    1919 
    20       CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize maxBufferedEvents); 
     20      CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents); 
    2121      ~CClientBuffer(); 
    2222 
     
    3333      int count; 
    3434      int bufferedEvents; 
     35      int maxEventSize; 
    3536      const int maxBufferedEvents; 
    3637      const int bufferSize; 
     38      const int estimatedMaxEventSize; 
    3739      const int serverRank; 
    3840      bool pending; 
  • XIOS/dev/branch_yushan_merged/src/client.cpp

    r1196 r1205  
    5252          } 
    5353          CTimer::get("XIOS").resume() ; 
    54           CTimer::get("XIOS init").resume() ; 
     54          CTimer::get("XIOS init/finalize").resume() ; 
    5555          boost::hash<string> hashString ; 
    5656 
     
    151151 
    152152        CTimer::get("XIOS").resume() ; 
    153         CTimer::get("XIOS init").resume() ; 
     153        CTimer::get("XIOS init/finalize").resume() ; 
    154154 
    155155        if (CXios::usingServer) 
     
    269269      MPI_Comm_free(&intraComm); 
    270270 
    271       CTimer::get("XIOS finalize").suspend() ; 
     271      CTimer::get("XIOS init/finalize").suspend() ; 
    272272      CTimer::get("XIOS").suspend() ; 
    273273 
     
    281281      info(20) << "Client "<<rank<<" : Client side context is finalized "<< endl ; 
    282282 
    283   /*    #pragma omp critical (_output) 
    284       { 
    285          report(0) <<"     Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 
    286          report(0)<< "     Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 
    287          report(0)<< "     Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS").getCumulatedTime()*100.<<" %"<<endl ; 
    288          report(0)<< "     Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 
    289          report(0)<< "     Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 
    290          report(0)<< "     Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 
    291          report(0)<< "     Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 
    292        }       
    293 */ 
     283   /*#pragma omp critical (_output) 
     284   { 
     285      report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 
     286      report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 
     287      report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 
     288      report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS init/finalize").getCumulatedTime()*100.<<" %"<<endl ; 
     289      report(0)<< " Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 
     290//      report(0)<< " Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 
     291      report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 
     292      report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 
     293      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
     294   }*/ 
     295    
    294296   } 
    295297 
  • XIOS/dev/branch_yushan_merged/src/config/axis_attribute_private.conf

    r821 r1205  
    11DECLARE_ATTRIBUTE_PRIVATE(int, global_zoom_begin) 
    22DECLARE_ATTRIBUTE_PRIVATE(int, global_zoom_n) 
     3DECLARE_ARRAY_PRIVATE(int,  1, global_zoom_index) 
  • XIOS/dev/branch_yushan_merged/src/config/field_attribute.conf

    r998 r1205  
    1616DECLARE_ATTRIBUTE(bool,      read_access) 
    1717DECLARE_ATTRIBUTE(bool,      indexed_output) 
     18DECLARE_ATTRIBUTE(bool,      check_if_active) 
    1819 
    1920DECLARE_ATTRIBUTE(StdString, domain_ref) 
  • XIOS/dev/branch_yushan_merged/src/config/file_attribute.conf

    r1160 r1205  
    1010DECLARE_ATTRIBUTE(CDuration, split_freq) 
    1111DECLARE_ATTRIBUTE(StdString, split_freq_format) 
     12DECLARE_ATTRIBUTE(CDuration, split_start_offset) 
     13DECLARE_ATTRIBUTE(CDuration, split_end_offset) 
     14DECLARE_ATTRIBUTE(string,     split_last_date) 
    1215DECLARE_ATTRIBUTE(bool,      enabled) 
    1316DECLARE_ENUM2(type,          one_file, multiple_file) 
    1417DECLARE_ENUM2(format,        netcdf4, netcdf4_classic) 
    1518DECLARE_ENUM2(convention,    CF, UGRID) 
     19DECLARE_ATTRIBUTE(StdString, convention_str) 
    1620DECLARE_ENUM2(par_access,    collective, independent) 
    1721DECLARE_ATTRIBUTE(bool,      append) 
  • XIOS/dev/branch_yushan_merged/src/config/zoom_axis_attribute.conf

    r787 r1205  
    22DECLARE_ATTRIBUTE(int,       begin) 
    33DECLARE_ATTRIBUTE(int,       n) 
     4DECLARE_ARRAY(int    ,1    , index) 
  • XIOS/dev/branch_yushan_merged/src/context_client.cpp

    r1134 r1205  
    234234        error(0) << "WARNING: Unexpected request for buffer to communicate with server " << rank << std::endl; 
    235235        mapBufferSize_[rank] = CXios::minBufferSize; 
    236       } 
    237       CClientBuffer* buffer = buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank], maxBufferedEvents); 
     236        maxEventSizes[rank] = CXios::minBufferSize; 
     237      } 
     238      CClientBuffer* buffer = buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank], maxEventSizes[rank], maxBufferedEvents); 
    238239      // Notify the server 
    239240      CBufferOut* bufOut = buffer->getBuffer(sizeof(StdSize)); 
     
    283284   { 
    284285     mapBufferSize_ = mapSize; 
     286     maxEventSizes = maxEventSize; 
    285287 
    286288     // Compute the maximum number of events that can be safely buffered. 
     
    298300      
    299301     if (minBufferSizeEventSizeRatio < 1.0) 
     302     { 
    300303       ERROR("void CContextClient::setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize)", 
    301304             << "The buffer sizes and the maximum events sizes are incoherent."); 
     305     } 
     306     else if (minBufferSizeEventSizeRatio == std::numeric_limits<double>::max()) 
     307       minBufferSizeEventSizeRatio = 1.0; // In this case, maxBufferedEvents will never be used but we want to avoid any floating point exception 
    302308 
    303309     maxBufferedEvents = size_t(2 * minBufferSizeEventSizeRatio) // there is room for two local buffers on the server 
  • XIOS/dev/branch_yushan_merged/src/context_client.hpp

    r1134 r1205  
    7676      //! Mapping of server and buffer size for each connection to server 
    7777      std::map<int,StdSize> mapBufferSize_; 
     78      //! Maximum event sizes estimated for each connection to server 
     79      std::map<int,StdSize> maxEventSizes; 
    7880      //! Maximum number of events that can be buffered 
    7981      StdSize maxBufferedEvents; 
  • XIOS/dev/branch_yushan_merged/src/cxios.cpp

    r1161 r1205  
    163163       delete globalRegistry ; 
    164164     } 
    165      CClient::closeInfoStream(); 
    166    
    167165 
    168166#ifdef XIOS_MEMTRACK 
     
    177175     MemTrack::TrackDumpBlocks(); 
    178176#endif 
     177 
     178     CClient::closeInfoStream(); 
    179179 
    180180#endif 
     
    237237       delete globalRegistry ; 
    238238     } 
    239  
    240239    CServer::finalize(); 
    241          
     240 
     241#ifdef XIOS_MEMTRACK 
     242 
     243#ifdef XIOS_MEMTRACK_LIGHT 
     244       report(10) << " Memory report : current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 
     245       report(10) << " Memory report : maximum memory used by XIOS : "<<  MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 
     246#endif 
     247 
     248#ifdef XIOS_MEMTRACK_FULL 
     249     MemTrack::TrackListMemoryUsage() ; 
     250     MemTrack::TrackDumpBlocks(); 
     251#endif 
     252#endif 
    242253    CServer::closeInfoStream(); 
    243254  } 
  • XIOS/dev/branch_yushan_merged/src/data_output.cpp

    r1176 r1205  
    77namespace xios 
    88{ 
    9       /// ////////////////////// Dfinitions ////////////////////// /// 
     9      /// ////////////////////// Définitions ////////////////////// /// 
    1010 
    1111      CDataOutput::~CDataOutput(void) 
  • XIOS/dev/branch_yushan_merged/src/distribution_server.cpp

    r930 r1205  
    3434} 
    3535 
     36CDistributionServer::CDistributionServer(int rank,  
     37                                        const std::vector<CArray<int,1> >& globalIndexElements, 
     38                                        const CArray<int,1>& elementOrder, 
     39                                        const std::vector<int>& nZoomBeginServer, 
     40                                        const std::vector<int>& nZoomSizeServer, 
     41                                        const std::vector<int>& nZoomBeginGlobal, 
     42                                        const std::vector<int>& nGlobal) 
     43  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomBeginGlobal_(nZoomBeginGlobal), 
     44    nZoomSize_(nZoomSizeServer), nZoomBegin_(nZoomBeginServer), globalLocalIndexMap_() 
     45{ 
     46  createGlobalIndex(globalIndexElements, elementOrder); 
     47} 
     48 
    3649CDistributionServer::~CDistributionServer() 
    3750{ 
     
    89102 
    90103/*! 
     104  Create global index on server side 
     105  Like the similar function on client side, this function serves on creating global index 
     106for data written by the server. The global index is used to calculating local index of data 
     107written on each server 
     108  \param[in] globalIndexElement global index on server side of each element of grid (scalar, axis, domain) 
     109  \param[in] elementOrder the order of elements of grid (e.x: domain->axis or domain->scalar) 
     110*/ 
     111void CDistributionServer::createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements, 
     112                                            const CArray<int,1>& elementOrder) 
     113{ 
     114  int numElement = elementOrder.numElements(), elementIdx = 0;   
     115  std::vector<int> indexMap(numElement); 
     116  for (int i = 0; i < numElement; ++i) 
     117  { 
     118    indexMap[i] = elementIdx; 
     119    if (2 == elementOrder(i)) 
     120    {       
     121      elementIdx += 2; 
     122    } 
     123    else 
     124      ++elementIdx; 
     125  } 
     126 
     127  std::vector<size_t> elementGlobalSize(numElement); 
     128  size_t globalSize = 1; 
     129  for (int i = 0; i < numElement; ++i) 
     130  { 
     131    int elementType = elementOrder(i); 
     132    elementGlobalSize[i] = globalSize; 
     133    if (2 == elementType) // domain 
     134    { 
     135      globalSize *= nGlobal_[indexMap[i]+1] * nGlobal_[indexMap[i]]; 
     136    } 
     137    else // axis or scalar 
     138    { 
     139      globalSize *= nGlobal_[indexMap[i]]; 
     140    } 
     141  }  
     142 
     143  size_t ssize = 1; 
     144  for (int i = 0; i < globalIndexElements.size(); ++i) ssize *= globalIndexElements[i].numElements(); 
     145  this->globalIndex_.resize(ssize); 
     146  globalLocalIndexMap_.rehash(std::ceil(ssize/globalLocalIndexMap_.max_load_factor())); 
     147 
     148  std::vector<int> idxLoop(numElement,0); 
     149  std::vector<int> currentIndex(numElement); 
     150  int innerLoopSize = globalIndexElements[0].numElements(); 
     151 
     152  size_t idx = 0; 
     153  while (idx<ssize) 
     154  { 
     155    for (int i = 0; i < numElement-1; ++i) 
     156    { 
     157      if (idxLoop[i] == globalIndexElements[i].numElements()) 
     158      { 
     159        idxLoop[i] = 0; 
     160        ++idxLoop[i+1]; 
     161      } 
     162    } 
     163 
     164    for (int i = 1; i < numElement; ++i)  currentIndex[i] = globalIndexElements[i](idxLoop[i]); 
     165 
     166    size_t mulDim, globalIndex; 
     167    for (int i = 0; i < innerLoopSize; ++i) 
     168    {       
     169      globalIndex = 0; 
     170      currentIndex[0] = globalIndexElements[0](i); 
     171 
     172      for (int k = 0; k < numElement; ++k) 
     173      {      
     174        globalIndex += (currentIndex[k])*elementGlobalSize[k]; 
     175      } 
     176      globalLocalIndexMap_[globalIndex] = idx; 
     177      this->globalIndex_(idx) = globalIndex; 
     178      ++idx; 
     179    } 
     180    idxLoop[0] += innerLoopSize; 
     181  } 
     182} 
     183 
     184/*! 
    91185  Compute local index for writing data on server 
    92186  \param [in] globalIndex global index received from client 
  • XIOS/dev/branch_yushan_merged/src/distribution_server.hpp

    r930 r1205  
    3131                        const std::vector<int>& nGlobal); 
    3232 
     33    CDistributionServer(int rank,  
     34                        const std::vector<CArray<int,1> >& globalIndexElements, 
     35                        const CArray<int,1>& elementOrder, 
     36                        const std::vector<int>& nZoomBeginServer, 
     37                        const std::vector<int>& nZoomSizeServer, 
     38                        const std::vector<int>& nZoomBeginGlobal, 
     39                        const std::vector<int>& nGlobal); 
     40 
    3341    /** Default destructor */ 
    3442    virtual ~CDistributionServer(); 
     
    4452  protected: 
    4553    virtual void createGlobalIndex(); 
     54    void createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements, 
     55                           const CArray<int,1>& elementOrder); 
    4656 
    4757  protected: 
  • XIOS/dev/branch_yushan_merged/src/filter/file_writer_filter.cpp

    r1119 r1205  
    1717  void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    1818  { 
    19     bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() &&  
    20                                !field->default_value.isEmpty() &&  
    21                                field->detect_missing_value == true); 
    22     if (ignoreMissingValue) 
     19    CDataPacketPtr packet = data[0]; 
     20 
     21    const bool detectMissingValue = (!field->detect_missing_value.isEmpty() 
     22                                      && !field->default_value.isEmpty() 
     23                                      && field->detect_missing_value == true); 
     24    if (detectMissingValue) 
    2325    { 
    24       double missingValue = field->default_value; 
    25       size_t nbData = data[0]->data.numElements(); 
     26      const double missingValue = field->default_value; 
     27      const size_t nbData = packet->data.numElements(); 
    2628      for (size_t idx = 0; idx < nbData; ++idx) 
    2729      { 
    28         if (NumTraits<double>::isnan(data[0]->data(idx))) 
    29           data[0]->data(idx) = missingValue; 
     30        if (NumTraits<double>::isnan(packet->data(idx))) 
     31          packet->data(idx) = missingValue; 
    3032      } 
    31     }     
     33    } 
    3234 
    33     field->sendUpdateData(data[0]->data); 
     35    field->sendUpdateData(packet->data); 
    3436  } 
    3537 
  • XIOS/dev/branch_yushan_merged/src/filter/source_filter.cpp

    r1018 r1205  
    3737    if (hasMissingValue) 
    3838    { 
    39       double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    40       size_t nbData = packet->data.numElements(); 
     39      const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
     40      const size_t nbData = packet->data.numElements(); 
    4141      for (size_t idx = 0; idx < nbData; ++idx) 
    4242      { 
     
    8282    } 
    8383 
     84    // Convert missing values to NaN 
     85    if (hasMissingValue) 
     86    { 
     87      const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
     88      const size_t nbData = packet->data.numElements(); 
     89      for (size_t idx = 0; idx < nbData; ++idx) 
     90      { 
     91        if (defaultValue == packet->data(idx)) 
     92          packet->data(idx) = nanValue; 
     93      } 
     94    } 
     95 
    8496    onOutputReady(packet); 
    8597  } 
  • XIOS/dev/branch_yushan_merged/src/filter/source_filter.hpp

    r1018 r1205  
    6262      CGrid* grid; //!< The grid attached to the data the filter can accept 
    6363      const CDuration offset; //!< The offset applied to the timestamp of all packets 
    64       bool hasMissingValue; 
    65       double defaultValue; 
     64      const bool hasMissingValue; 
     65      const double defaultValue; 
    6666  }; // class CSourceFilter 
    6767} // namespace xios 
  • XIOS/dev/branch_yushan_merged/src/filter/store_filter.cpp

    r1119 r1205  
    66namespace xios 
    77{ 
    8   CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid) 
     8  CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid, 
     9                             bool detectMissingValues /*= false*/, double missingValue /*= 0.0*/) 
    910    : CInputPin(gc, 1) 
    1011    , gc(gc) 
    1112    , context(context) 
    1213    , grid(grid) 
     14    , detectMissingValues(detectMissingValues) 
     15    , missingValue(missingValue) 
    1316  { 
    1417    if (!context) 
     
    7578  void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    7679  { 
    77     packets.insert(std::make_pair(data[0]->timestamp, data[0])); 
     80    CDataPacketPtr packet = data[0]; 
     81 
     82    packets.insert(std::make_pair(packet->timestamp, packet)); 
    7883    // The packet is always destroyed by the garbage collector 
    7984    // so we register but never unregister 
    80     gc.registerObject(this, data[0]->timestamp); 
     85    gc.registerObject(this, packet->timestamp); 
     86 
     87    if (detectMissingValues) 
     88    { 
     89      const size_t nbData = packet->data.numElements(); 
     90      for (size_t idx = 0; idx < nbData; ++idx) 
     91      { 
     92        if (NumTraits<double>::isnan(packet->data(idx))) 
     93          packet->data(idx) = missingValue; 
     94      } 
     95    } 
    8196  } 
    8297 
  • XIOS/dev/branch_yushan_merged/src/filter/store_filter.hpp

    r1119 r1205  
    2222       * \param context the context to which the data belongs 
    2323       * \param grid the grid to which the data is attached 
     24       * \param detectMissingValues whether missing values should be detected 
     25       * \param missingValue the value to use to replace missing values 
    2426       */ 
    25       CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid); 
     27      CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid, 
     28                   bool detectMissingValues = false, double missingValue = 0.0); 
    2629 
    2730      /*! 
     
    7578      CContext* context; //!< The context to which the data belongs 
    7679      CGrid* grid; //!< The grid attached to the data the filter can accept 
     80      const bool detectMissingValues; //!< Whether missing values should be detected 
     81      const double missingValue; //!< The value to use to replace missing values 
    7782      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
    7883  }; // class CStoreFilter 
  • XIOS/dev/branch_yushan_merged/src/filter/temporal_filter.hpp

    r1124 r1205  
    4848 
    4949    private: 
     50      // Warning the declaration order matters here, double-check the constructor before changing it 
     51      CArray<double, 1> tmpData; //!< The array of data used for temporary storage 
    5052      const boost::scoped_ptr<func::CFunctor> functor; //!< The functor corresponding to the temporal operation 
    51       CArray<double, 1> tmpData; //!< The array of data used for temporary storage 
     53      const bool isOnceOperation; //!< True if the operation should be computed just once 
     54      const bool isInstantOperation; //!< True if the operation is instant 
    5255      const CDuration samplingFreq; //!< The sampling frequency, i.e. the frequency at which the input data will be used 
    5356      const CDuration samplingOffset; //!< The sampling offset, i.e. the offset after which the input data will be used 
     
    5659      CDate nextOperationDate; //!< The date of the next operation 
    5760      bool isFirstOperation; //!< True before the first operation was been computed 
    58       const bool isOnceOperation; //!< True if the operation should be computed just once 
    59       const bool isInstantOperation; //!< True if the operation is instant 
    6061  }; // class CTemporalFilter 
    6162} // namespace xios 
  • XIOS/dev/branch_yushan_merged/src/interface/c/icdata.cpp

    r1134 r1205  
    119119     CTimer::get("XIOS close definition").resume(); 
    120120     CContext* context = CContext::getCurrent(); 
    121       
    122121     context->closeDefinition(); 
    123       
    124122     CTimer::get("XIOS close definition").suspend(); 
    125123     CTimer::get("XIOS").suspend(); 
     
    130128     CTimer::get("XIOS").resume(); 
    131129     CTimer::get("XIOS context finalize").resume(); 
    132       
    133       
    134       
    135130     CContext* context = CContext::getCurrent(); 
    136131     context->finalize(); 
  • XIOS/dev/branch_yushan_merged/src/interface/c_attr/icfield_attr.cpp

    r1005 r1205  
    119119 
    120120 
     121  void cxios_set_field_check_if_active(field_Ptr field_hdl, bool check_if_active) 
     122  { 
     123    CTimer::get("XIOS").resume(); 
     124    field_hdl->check_if_active.setValue(check_if_active); 
     125    CTimer::get("XIOS").suspend(); 
     126  } 
     127 
     128  void cxios_get_field_check_if_active(field_Ptr field_hdl, bool* check_if_active) 
     129  { 
     130    CTimer::get("XIOS").resume(); 
     131    *check_if_active = field_hdl->check_if_active.getInheritedValue(); 
     132    CTimer::get("XIOS").suspend(); 
     133  } 
     134 
     135  bool cxios_is_defined_field_check_if_active(field_Ptr field_hdl) 
     136  { 
     137     CTimer::get("XIOS").resume(); 
     138     bool isDefined = field_hdl->check_if_active.hasInheritedValue(); 
     139     CTimer::get("XIOS").suspend(); 
     140     return isDefined; 
     141  } 
     142 
     143 
    121144  void cxios_set_field_compression_level(field_Ptr field_hdl, int compression_level) 
    122145  { 
  • XIOS/dev/branch_yushan_merged/src/interface/c_attr/icfieldgroup_attr.cpp

    r1005 r1205  
    119119 
    120120 
     121  void cxios_set_fieldgroup_check_if_active(fieldgroup_Ptr fieldgroup_hdl, bool check_if_active) 
     122  { 
     123    CTimer::get("XIOS").resume(); 
     124    fieldgroup_hdl->check_if_active.setValue(check_if_active); 
     125    CTimer::get("XIOS").suspend(); 
     126  } 
     127 
     128  void cxios_get_fieldgroup_check_if_active(fieldgroup_Ptr fieldgroup_hdl, bool* check_if_active) 
     129  { 
     130    CTimer::get("XIOS").resume(); 
     131    *check_if_active = fieldgroup_hdl->check_if_active.getInheritedValue(); 
     132    CTimer::get("XIOS").suspend(); 
     133  } 
     134 
     135  bool cxios_is_defined_fieldgroup_check_if_active(fieldgroup_Ptr fieldgroup_hdl) 
     136  { 
     137     CTimer::get("XIOS").resume(); 
     138     bool isDefined = fieldgroup_hdl->check_if_active.hasInheritedValue(); 
     139     CTimer::get("XIOS").suspend(); 
     140     return isDefined; 
     141  } 
     142 
     143 
    121144  void cxios_set_fieldgroup_compression_level(fieldgroup_Ptr fieldgroup_hdl, int compression_level) 
    122145  { 
  • XIOS/dev/branch_yushan_merged/src/interface/c_attr/icfile_attr.cpp

    r1052 r1205  
    9090 
    9191 
     92  void cxios_set_file_convention_str(file_Ptr file_hdl, const char * convention_str, int convention_str_size) 
     93  { 
     94    std::string convention_str_str; 
     95    if (!cstr2string(convention_str, convention_str_size, convention_str_str)) return; 
     96    CTimer::get("XIOS").resume(); 
     97    file_hdl->convention_str.setValue(convention_str_str); 
     98    CTimer::get("XIOS").suspend(); 
     99  } 
     100 
     101  void cxios_get_file_convention_str(file_Ptr file_hdl, char * convention_str, int convention_str_size) 
     102  { 
     103    CTimer::get("XIOS").resume(); 
     104    if (!string_copy(file_hdl->convention_str.getInheritedValue(), convention_str, convention_str_size)) 
     105      ERROR("void cxios_get_file_convention_str(file_Ptr file_hdl, char * convention_str, int convention_str_size)", << "Input string is too short"); 
     106    CTimer::get("XIOS").suspend(); 
     107  } 
     108 
     109  bool cxios_is_defined_file_convention_str(file_Ptr file_hdl) 
     110  { 
     111     CTimer::get("XIOS").resume(); 
     112     bool isDefined = file_hdl->convention_str.hasInheritedValue(); 
     113     CTimer::get("XIOS").suspend(); 
     114     return isDefined; 
     115  } 
     116 
     117 
    92118  void cxios_set_file_cyclic(file_Ptr file_hdl, bool cyclic) 
    93119  { 
  • XIOS/dev/branch_yushan_merged/src/interface/c_attr/icfilegroup_attr.cpp

    r1052 r1205  
    9090 
    9191 
     92  void cxios_set_filegroup_convention_str(filegroup_Ptr filegroup_hdl, const char * convention_str, int convention_str_size) 
     93  { 
     94    std::string convention_str_str; 
     95    if (!cstr2string(convention_str, convention_str_size, convention_str_str)) return; 
     96    CTimer::get("XIOS").resume(); 
     97    filegroup_hdl->convention_str.setValue(convention_str_str); 
     98    CTimer::get("XIOS").suspend(); 
     99  } 
     100 
     101  void cxios_get_filegroup_convention_str(filegroup_Ptr filegroup_hdl, char * convention_str, int convention_str_size) 
     102  { 
     103    CTimer::get("XIOS").resume(); 
     104    if (!string_copy(filegroup_hdl->convention_str.getInheritedValue(), convention_str, convention_str_size)) 
     105      ERROR("void cxios_get_filegroup_convention_str(filegroup_Ptr filegroup_hdl, char * convention_str, int convention_str_size)", << "Input string is too short"); 
     106    CTimer::get("XIOS").suspend(); 
     107  } 
     108 
     109  bool cxios_is_defined_filegroup_convention_str(filegroup_Ptr filegroup_hdl) 
     110  { 
     111     CTimer::get("XIOS").resume(); 
     112     bool isDefined = filegroup_hdl->convention_str.hasInheritedValue(); 
     113     CTimer::get("XIOS").suspend(); 
     114     return isDefined; 
     115  } 
     116 
     117 
    92118  void cxios_set_filegroup_cyclic(filegroup_Ptr filegroup_hdl, bool cyclic) 
    93119  { 
  • XIOS/dev/branch_yushan_merged/src/interface/c_attr/icinterpolate_domain_attr.cpp

    r1014 r1205  
    6262     CTimer::get("XIOS").resume(); 
    6363     bool isDefined = interpolate_domain_hdl->order.hasInheritedValue(); 
     64     CTimer::get("XIOS").suspend(); 
     65     return isDefined; 
     66  } 
     67 
     68 
     69  void cxios_set_interpolate_domain_quantity(interpolate_domain_Ptr interpolate_domain_hdl, bool quantity) 
     70  { 
     71    CTimer::get("XIOS").resume(); 
     72    interpolate_domain_hdl->quantity.setValue(quantity); 
     73    CTimer::get("XIOS").suspend(); 
     74  } 
     75 
     76  void cxios_get_interpolate_domain_quantity(interpolate_domain_Ptr interpolate_domain_hdl, bool* quantity) 
     77  { 
     78    CTimer::get("XIOS").resume(); 
     79    *quantity = interpolate_domain_hdl->quantity.getInheritedValue(); 
     80    CTimer::get("XIOS").suspend(); 
     81  } 
     82 
     83  bool cxios_is_defined_interpolate_domain_quantity(interpolate_domain_Ptr interpolate_domain_hdl) 
     84  { 
     85     CTimer::get("XIOS").resume(); 
     86     bool isDefined = interpolate_domain_hdl->quantity.hasInheritedValue(); 
    6487     CTimer::get("XIOS").suspend(); 
    6588     return isDefined; 
  • XIOS/dev/branch_yushan_merged/src/interface/c_attr/iczoom_axis_attr.cpp

    r787 r1205  
    4141 
    4242 
     43  void cxios_set_zoom_axis_index(zoom_axis_Ptr zoom_axis_hdl, int* index, int* extent) 
     44  { 
     45    CTimer::get("XIOS").resume(); 
     46    CArray<int,1> tmp(index, shape(extent[0]), neverDeleteData); 
     47    zoom_axis_hdl->index.reference(tmp.copy()); 
     48     CTimer::get("XIOS").suspend(); 
     49  } 
     50 
     51  void cxios_get_zoom_axis_index(zoom_axis_Ptr zoom_axis_hdl, int* index, int* extent) 
     52  { 
     53    CTimer::get("XIOS").resume(); 
     54    CArray<int,1> tmp(index, shape(extent[0]), neverDeleteData); 
     55    tmp=zoom_axis_hdl->index.getInheritedValue(); 
     56     CTimer::get("XIOS").suspend(); 
     57  } 
     58 
     59  bool cxios_is_defined_zoom_axis_index(zoom_axis_Ptr zoom_axis_hdl) 
     60  { 
     61     CTimer::get("XIOS").resume(); 
     62     bool isDefined = zoom_axis_hdl->index.hasInheritedValue(); 
     63     CTimer::get("XIOS").suspend(); 
     64     return isDefined; 
     65  } 
     66 
     67 
    4368  void cxios_set_zoom_axis_n(zoom_axis_Ptr zoom_axis_hdl, int n) 
    4469  { 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran/idata.F90

    r1134 r1205  
    465465   INTEGER :: f_return_comm 
    466466 
    467  
    468467      IF (PRESENT(local_comm)) THEN 
    469468        f_local_comm=local_comm 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/field_interface_attr.F90

    r1005 r1205  
    9292 
    9393 
     94    SUBROUTINE cxios_set_field_check_if_active(field_hdl, check_if_active) BIND(C) 
     95      USE ISO_C_BINDING 
     96      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
     97      LOGICAL (KIND=C_BOOL)      , VALUE :: check_if_active 
     98    END SUBROUTINE cxios_set_field_check_if_active 
     99 
     100    SUBROUTINE cxios_get_field_check_if_active(field_hdl, check_if_active) BIND(C) 
     101      USE ISO_C_BINDING 
     102      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
     103      LOGICAL (KIND=C_BOOL)             :: check_if_active 
     104    END SUBROUTINE cxios_get_field_check_if_active 
     105 
     106    FUNCTION cxios_is_defined_field_check_if_active(field_hdl) BIND(C) 
     107      USE ISO_C_BINDING 
     108      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_check_if_active 
     109      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 
     110    END FUNCTION cxios_is_defined_field_check_if_active 
     111 
     112 
    94113    SUBROUTINE cxios_set_field_compression_level(field_hdl, compression_level) BIND(C) 
    95114      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/fieldgroup_interface_attr.F90

    r1005 r1205  
    9292 
    9393 
     94    SUBROUTINE cxios_set_fieldgroup_check_if_active(fieldgroup_hdl, check_if_active) BIND(C) 
     95      USE ISO_C_BINDING 
     96      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
     97      LOGICAL (KIND=C_BOOL)      , VALUE :: check_if_active 
     98    END SUBROUTINE cxios_set_fieldgroup_check_if_active 
     99 
     100    SUBROUTINE cxios_get_fieldgroup_check_if_active(fieldgroup_hdl, check_if_active) BIND(C) 
     101      USE ISO_C_BINDING 
     102      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
     103      LOGICAL (KIND=C_BOOL)             :: check_if_active 
     104    END SUBROUTINE cxios_get_fieldgroup_check_if_active 
     105 
     106    FUNCTION cxios_is_defined_fieldgroup_check_if_active(fieldgroup_hdl) BIND(C) 
     107      USE ISO_C_BINDING 
     108      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_check_if_active 
     109      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
     110    END FUNCTION cxios_is_defined_fieldgroup_check_if_active 
     111 
     112 
    94113    SUBROUTINE cxios_set_fieldgroup_compression_level(fieldgroup_hdl, compression_level) BIND(C) 
    95114      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/file_interface_attr.F90

    r1052 r1205  
    6969 
    7070 
     71    SUBROUTINE cxios_set_file_convention_str(file_hdl, convention_str, convention_str_size) BIND(C) 
     72      USE ISO_C_BINDING 
     73      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     74      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: convention_str 
     75      INTEGER  (kind = C_INT)     , VALUE        :: convention_str_size 
     76    END SUBROUTINE cxios_set_file_convention_str 
     77 
     78    SUBROUTINE cxios_get_file_convention_str(file_hdl, convention_str, convention_str_size) BIND(C) 
     79      USE ISO_C_BINDING 
     80      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     81      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: convention_str 
     82      INTEGER  (kind = C_INT)     , VALUE        :: convention_str_size 
     83    END SUBROUTINE cxios_get_file_convention_str 
     84 
     85    FUNCTION cxios_is_defined_file_convention_str(file_hdl) BIND(C) 
     86      USE ISO_C_BINDING 
     87      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_convention_str 
     88      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     89    END FUNCTION cxios_is_defined_file_convention_str 
     90 
     91 
    7192    SUBROUTINE cxios_set_file_cyclic(file_hdl, cyclic) BIND(C) 
    7293      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/filegroup_interface_attr.F90

    r1052 r1205  
    6969 
    7070 
     71    SUBROUTINE cxios_set_filegroup_convention_str(filegroup_hdl, convention_str, convention_str_size) BIND(C) 
     72      USE ISO_C_BINDING 
     73      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     74      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: convention_str 
     75      INTEGER  (kind = C_INT)     , VALUE        :: convention_str_size 
     76    END SUBROUTINE cxios_set_filegroup_convention_str 
     77 
     78    SUBROUTINE cxios_get_filegroup_convention_str(filegroup_hdl, convention_str, convention_str_size) BIND(C) 
     79      USE ISO_C_BINDING 
     80      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     81      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: convention_str 
     82      INTEGER  (kind = C_INT)     , VALUE        :: convention_str_size 
     83    END SUBROUTINE cxios_get_filegroup_convention_str 
     84 
     85    FUNCTION cxios_is_defined_filegroup_convention_str(filegroup_hdl) BIND(C) 
     86      USE ISO_C_BINDING 
     87      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_convention_str 
     88      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     89    END FUNCTION cxios_is_defined_filegroup_convention_str 
     90 
     91 
    7192    SUBROUTINE cxios_set_filegroup_cyclic(filegroup_hdl, cyclic) BIND(C) 
    7293      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/ifield_attr.F90

    r1005 r1205  
    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, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     15    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     16    , grid_path, grid_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     ) 
    1819 
    1920    IMPLICIT NONE 
     
    2425      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    2526      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
     27      LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active 
     28      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    2629      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    2730      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    5962      (field_id,field_hdl) 
    6063      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 ) 
     64      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     65      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     66      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     67      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     68       ) 
    6569 
    6670  END SUBROUTINE xios(set_field_attr) 
    6771 
    6872  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 ) 
     73    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     74    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     75    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     76    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     77     ) 
    7378 
    7479    IMPLICIT NONE 
     
    7883      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    7984      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
     85      LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active 
     86      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    8087      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    8188      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    111118 
    112119      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 ) 
     120      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     121      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     122      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     123      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     124       ) 
    117125 
    118126  END SUBROUTINE xios(set_field_attr_hdl) 
    119127 
    120128  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     ) 
     129    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  & 
     130    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  & 
     131    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  & 
     132    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  & 
     133    , valid_max_, valid_min_ ) 
    126134 
    127135    IMPLICIT NONE 
     
    131139      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_ 
    132140      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_ 
     141      LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active_ 
     142      LOGICAL (KIND=C_BOOL) :: check_if_active__tmp 
    133143      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_ 
    134144      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ 
     
    183193      ENDIF 
    184194 
     195      IF (PRESENT(check_if_active_)) THEN 
     196        check_if_active__tmp = check_if_active_ 
     197        CALL cxios_set_field_check_if_active & 
     198      (field_hdl%daddr, check_if_active__tmp) 
     199      ENDIF 
     200 
    185201      IF (PRESENT(compression_level_)) THEN 
    186202        CALL cxios_set_field_compression_level & 
     
    321337 
    322338  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 ) 
     339    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     340    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     341    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     342    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     343     ) 
    327344 
    328345    IMPLICIT NONE 
     
    333350      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    334351      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
     352      LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active 
     353      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    335354      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    336355      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    368387      (field_id,field_hdl) 
    369388      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 ) 
     389      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     390      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     391      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     392      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     393       ) 
    374394 
    375395  END SUBROUTINE xios(get_field_attr) 
    376396 
    377397  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 ) 
     398    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     399    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     400    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     401    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     402     ) 
    382403 
    383404    IMPLICIT NONE 
     
    387408      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    388409      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
     410      LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active 
     411      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    389412      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    390413      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    420443 
    421444      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 ) 
     445      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     446      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     447      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     448      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     449       ) 
    426450 
    427451  END SUBROUTINE xios(get_field_attr_hdl) 
    428452 
    429453  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     ) 
     454    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  & 
     455    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  & 
     456    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  & 
     457    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  & 
     458    , valid_max_, valid_min_ ) 
    435459 
    436460    IMPLICIT NONE 
     
    440464      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_ 
    441465      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
     466      LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active_ 
     467      LOGICAL (KIND=C_BOOL) :: check_if_active__tmp 
    442468      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_ 
    443469      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ 
     
    492518      ENDIF 
    493519 
     520      IF (PRESENT(check_if_active_)) THEN 
     521        CALL cxios_get_field_check_if_active & 
     522      (field_hdl%daddr, check_if_active__tmp) 
     523        check_if_active_ = check_if_active__tmp 
     524      ENDIF 
     525 
    494526      IF (PRESENT(compression_level_)) THEN 
    495527        CALL cxios_get_field_compression_level & 
     
    630662 
    631663  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 ) 
     664    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     665    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     666    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     667    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     668     ) 
    636669 
    637670    IMPLICIT NONE 
     
    646679      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    647680      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
     681      LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active 
     682      LOGICAL(KIND=C_BOOL) :: check_if_active_tmp 
    648683      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    649684      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    702737      (field_id,field_hdl) 
    703738      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 ) 
     739      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     740      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     741      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     742      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     743       ) 
    708744 
    709745  END SUBROUTINE xios(is_defined_field_attr) 
    710746 
    711747  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 ) 
     748    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     749    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     750    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     751    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     752     ) 
    716753 
    717754    IMPLICIT NONE 
     
    725762      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    726763      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
     764      LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active 
     765      LOGICAL(KIND=C_BOOL) :: check_if_active_tmp 
    727766      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    728767      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    779818 
    780819      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 ) 
     820      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     821      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     822      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
     823      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
     824       ) 
    785825 
    786826  END SUBROUTINE xios(is_defined_field_attr_hdl) 
    787827 
    788828  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     ) 
     829    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  & 
     830    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  & 
     831    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  & 
     832    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  & 
     833    , valid_max_, valid_min_ ) 
    794834 
    795835    IMPLICIT NONE 
     
    803843      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
    804844      LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp 
     845      LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active_ 
     846      LOGICAL(KIND=C_BOOL) :: check_if_active__tmp 
    805847      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_ 
    806848      LOGICAL(KIND=C_BOOL) :: compression_level__tmp 
     
    880922      ENDIF 
    881923 
     924      IF (PRESENT(check_if_active_)) THEN 
     925        check_if_active__tmp = cxios_is_defined_field_check_if_active & 
     926      (field_hdl%daddr) 
     927        check_if_active_ = check_if_active__tmp 
     928      ENDIF 
     929 
    882930      IF (PRESENT(compression_level_)) THEN 
    883931        compression_level__tmp = cxios_is_defined_field_compression_level & 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/ifieldgroup_attr.F90

    r1005 r1205  
    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  & 
     14    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     15    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     16    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    1717    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    1818     ) 
     
    2525      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    2626      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
     27      LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active 
     28      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    2729      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    2830      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    6163      (fieldgroup_id,fieldgroup_hdl) 
    6264      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  & 
     65      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     66      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     67      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    6668      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    6769       ) 
     
    7072 
    7173  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  & 
     74    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     75    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     76    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    7577    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    7678     ) 
     
    8284      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods 
    8385      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode 
     86      LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active 
     87      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    8488      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    8589      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 
     
    116120 
    117121      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  & 
     122      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     123      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     124      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    121125      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    122126       ) 
     
    125129 
    126130  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_ ) 
     131    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_  & 
     132    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  & 
     133    , freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_  & 
     134    , name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_  & 
     135    , ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    132136 
    133137    IMPLICIT NONE 
     
    137141      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_ 
    138142      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_ 
     143      LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active_ 
     144      LOGICAL (KIND=C_BOOL) :: check_if_active__tmp 
    139145      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_ 
    140146      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ 
     
    190196      ENDIF 
    191197 
     198      IF (PRESENT(check_if_active_)) THEN 
     199        check_if_active__tmp = check_if_active_ 
     200        CALL cxios_set_fieldgroup_check_if_active & 
     201      (fieldgroup_hdl%daddr, check_if_active__tmp) 
     202      ENDIF 
     203 
    192204      IF (PRESENT(compression_level_)) THEN 
    193205        CALL cxios_set_fieldgroup_compression_level & 
     
    333345 
    334346  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  & 
     347    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     348    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     349    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    338350    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    339351     ) 
     
    346358      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    347359      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
     360      LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active 
     361      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    348362      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    349363      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    382396      (fieldgroup_id,fieldgroup_hdl) 
    383397      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  & 
     398      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     399      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     400      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    387401      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    388402       ) 
     
    391405 
    392406  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  & 
     407    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     408    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     409    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    396410    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    397411     ) 
     
    403417      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods 
    404418      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode 
     419      LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active 
     420      LOGICAL (KIND=C_BOOL) :: check_if_active_tmp 
    405421      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    406422      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 
     
    437453 
    438454      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  & 
     455      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     456      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     457      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    442458      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    443459       ) 
     
    446462 
    447463  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_ ) 
     464    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_  & 
     465    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  & 
     466    , freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_  & 
     467    , name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_  & 
     468    , ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    453469 
    454470    IMPLICIT NONE 
     
    458474      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_ 
    459475      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
     476      LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active_ 
     477      LOGICAL (KIND=C_BOOL) :: check_if_active__tmp 
    460478      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_ 
    461479      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ 
     
    511529      ENDIF 
    512530 
     531      IF (PRESENT(check_if_active_)) THEN 
     532        CALL cxios_get_fieldgroup_check_if_active & 
     533      (fieldgroup_hdl%daddr, check_if_active__tmp) 
     534        check_if_active_ = check_if_active__tmp 
     535      ENDIF 
     536 
    513537      IF (PRESENT(compression_level_)) THEN 
    514538        CALL cxios_get_fieldgroup_compression_level & 
     
    654678 
    655679  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  & 
     680    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     681    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     682    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    659683    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    660684     ) 
     
    671695      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    672696      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
     697      LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active 
     698      LOGICAL(KIND=C_BOOL) :: check_if_active_tmp 
    673699      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    674700      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    729755      (fieldgroup_id,fieldgroup_hdl) 
    730756      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  & 
     757      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     758      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     759      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    734760      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    735761       ) 
     
    738764 
    739765  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  & 
     766    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     767    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     768    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    743769    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    744770     ) 
     
    754780      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode 
    755781      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp 
     782      LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active 
     783      LOGICAL(KIND=C_BOOL) :: check_if_active_tmp 
    756784      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 
    757785      LOGICAL(KIND=C_BOOL) :: compression_level_tmp 
     
    810838 
    811839      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  & 
     840      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  & 
     841      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  & 
     842      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  & 
    815843      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  & 
    816844       ) 
     
    819847 
    820848  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_ ) 
     849    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_  & 
     850    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  & 
     851    , freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_  & 
     852    , name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_  & 
     853    , ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    826854 
    827855    IMPLICIT NONE 
     
    835863      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_ 
    836864      LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp 
     865      LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active_ 
     866      LOGICAL(KIND=C_BOOL) :: check_if_active__tmp 
    837867      LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_ 
    838868      LOGICAL(KIND=C_BOOL) :: compression_level__tmp 
     
    914944      ENDIF 
    915945 
     946      IF (PRESENT(check_if_active_)) THEN 
     947        check_if_active__tmp = cxios_is_defined_fieldgroup_check_if_active & 
     948      (fieldgroup_hdl%daddr) 
     949        check_if_active_ = check_if_active__tmp 
     950      ENDIF 
     951 
    916952      IF (PRESENT(compression_level_)) THEN 
    917953        compression_level__tmp = cxios_is_defined_fieldgroup_compression_level & 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/ifile_attr.F90

    r1052 r1205  
    1212 
    1313  SUBROUTINE xios(set_file_attr)  & 
    14     ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    15     , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    16     , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    17     , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     14    ( file_id, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     15    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     16    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     17    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    1818 
    1919    IMPLICIT NONE 
     
    2424      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    2525      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention 
     26      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_str 
    2627      LOGICAL  , OPTIONAL, INTENT(IN) :: cyclic 
    2728      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    5556      (file_id,file_hdl) 
    5657      CALL xios(set_file_attr_hdl_)   & 
    57       ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    58       , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    59       , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    60       , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     58      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     59      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     60      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     61      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    6162 
    6263  END SUBROUTINE xios(set_file_attr) 
    6364 
    6465  SUBROUTINE xios(set_file_attr_hdl)  & 
    65     ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    66     , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    67     , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    68     , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     66    ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     67    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     68    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     69    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    6970 
    7071    IMPLICIT NONE 
     
    7475      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    7576      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention 
     77      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_str 
    7678      LOGICAL  , OPTIONAL, INTENT(IN) :: cyclic 
    7779      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    103105 
    104106      CALL xios(set_file_attr_hdl_)  & 
    105       ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    106       , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    107       , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    108       , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     107      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     108      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     109      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     110      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    109111 
    110112  END SUBROUTINE xios(set_file_attr_hdl) 
    111113 
    112114  SUBROUTINE xios(set_file_attr_hdl_)   & 
    113     ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    114     , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_  & 
    115     , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_  & 
    116     , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 
     115    ( file_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  & 
     116    , enabled_, format_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
     117    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
     118    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
     119    , uuid_name_ ) 
    117120 
    118121    IMPLICIT NONE 
     
    122125      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_ 
    123126      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_ 
     127      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_str_ 
    124128      LOGICAL  , OPTIONAL, INTENT(IN) :: cyclic_ 
    125129      LOGICAL (KIND=C_BOOL) :: cyclic__tmp 
     
    166170      ENDIF 
    167171 
     172      IF (PRESENT(convention_str_)) THEN 
     173        CALL cxios_set_file_convention_str & 
     174      (file_hdl%daddr, convention_str_, len(convention_str_)) 
     175      ENDIF 
     176 
    168177      IF (PRESENT(cyclic_)) THEN 
    169178        cyclic__tmp = cyclic_ 
     
    296305 
    297306  SUBROUTINE xios(get_file_attr)  & 
    298     ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    299     , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    300     , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    301     , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     307    ( file_id, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     308    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     309    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     310    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    302311 
    303312    IMPLICIT NONE 
     
    308317      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    309318      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention 
     319      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_str 
    310320      LOGICAL  , OPTIONAL, INTENT(OUT) :: cyclic 
    311321      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    339349      (file_id,file_hdl) 
    340350      CALL xios(get_file_attr_hdl_)   & 
    341       ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    342       , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    343       , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    344       , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     351      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     352      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     353      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     354      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    345355 
    346356  END SUBROUTINE xios(get_file_attr) 
    347357 
    348358  SUBROUTINE xios(get_file_attr_hdl)  & 
    349     ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    350     , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    351     , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    352     , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     359    ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     360    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     361    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     362    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    353363 
    354364    IMPLICIT NONE 
     
    358368      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    359369      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention 
     370      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_str 
    360371      LOGICAL  , OPTIONAL, INTENT(OUT) :: cyclic 
    361372      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    387398 
    388399      CALL xios(get_file_attr_hdl_)  & 
    389       ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    390       , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    391       , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    392       , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     400      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     401      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     402      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     403      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    393404 
    394405  END SUBROUTINE xios(get_file_attr_hdl) 
    395406 
    396407  SUBROUTINE xios(get_file_attr_hdl_)   & 
    397     ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    398     , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_  & 
    399     , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_  & 
    400     , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 
     408    ( file_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  & 
     409    , enabled_, format_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
     410    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
     411    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
     412    , uuid_name_ ) 
    401413 
    402414    IMPLICIT NONE 
     
    406418      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_ 
    407419      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_ 
     420      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_str_ 
    408421      LOGICAL  , OPTIONAL, INTENT(OUT) :: cyclic_ 
    409422      LOGICAL (KIND=C_BOOL) :: cyclic__tmp 
     
    450463      ENDIF 
    451464 
     465      IF (PRESENT(convention_str_)) THEN 
     466        CALL cxios_get_file_convention_str & 
     467      (file_hdl%daddr, convention_str_, len(convention_str_)) 
     468      ENDIF 
     469 
    452470      IF (PRESENT(cyclic_)) THEN 
    453471        CALL cxios_get_file_cyclic & 
     
    580598 
    581599  SUBROUTINE xios(is_defined_file_attr)  & 
    582     ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    583     , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    584     , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    585     , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     600    ( file_id, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     601    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     602    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     603    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    586604 
    587605    IMPLICIT NONE 
     
    594612      LOGICAL, OPTIONAL, INTENT(OUT) :: convention 
    595613      LOGICAL(KIND=C_BOOL) :: convention_tmp 
     614      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_str 
     615      LOGICAL(KIND=C_BOOL) :: convention_str_tmp 
    596616      LOGICAL, OPTIONAL, INTENT(OUT) :: cyclic 
    597617      LOGICAL(KIND=C_BOOL) :: cyclic_tmp 
     
    648668      (file_id,file_hdl) 
    649669      CALL xios(is_defined_file_attr_hdl_)   & 
    650       ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    651       , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    652       , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    653       , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     670      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     671      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     672      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     673      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    654674 
    655675  END SUBROUTINE xios(is_defined_file_attr) 
    656676 
    657677  SUBROUTINE xios(is_defined_file_attr_hdl)  & 
    658     ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    659     , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    660     , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    661     , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     678    ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     679    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     680    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     681    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    662682 
    663683    IMPLICIT NONE 
     
    669689      LOGICAL, OPTIONAL, INTENT(OUT) :: convention 
    670690      LOGICAL(KIND=C_BOOL) :: convention_tmp 
     691      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_str 
     692      LOGICAL(KIND=C_BOOL) :: convention_str_tmp 
    671693      LOGICAL, OPTIONAL, INTENT(OUT) :: cyclic 
    672694      LOGICAL(KIND=C_BOOL) :: cyclic_tmp 
     
    721743 
    722744      CALL xios(is_defined_file_attr_hdl_)  & 
    723       ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    724       , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    725       , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
    726       , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     745      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     746      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
     747      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     748      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    727749 
    728750  END SUBROUTINE xios(is_defined_file_attr_hdl) 
    729751 
    730752  SUBROUTINE xios(is_defined_file_attr_hdl_)   & 
    731     ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    732     , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_  & 
    733     , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_  & 
    734     , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 
     753    ( file_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  & 
     754    , enabled_, format_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
     755    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
     756    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
     757    , uuid_name_ ) 
    735758 
    736759    IMPLICIT NONE 
     
    742765      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_ 
    743766      LOGICAL(KIND=C_BOOL) :: convention__tmp 
     767      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_str_ 
     768      LOGICAL(KIND=C_BOOL) :: convention_str__tmp 
    744769      LOGICAL, OPTIONAL, INTENT(OUT) :: cyclic_ 
    745770      LOGICAL(KIND=C_BOOL) :: cyclic__tmp 
     
    811836      ENDIF 
    812837 
     838      IF (PRESENT(convention_str_)) THEN 
     839        convention_str__tmp = cxios_is_defined_file_convention_str & 
     840      (file_hdl%daddr) 
     841        convention_str_ = convention_str__tmp 
     842      ENDIF 
     843 
    813844      IF (PRESENT(cyclic_)) THEN 
    814845        cyclic__tmp = cxios_is_defined_file_cyclic & 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/ifilegroup_attr.F90

    r1052 r1205  
    1212 
    1313  SUBROUTINE xios(set_filegroup_attr)  & 
    14     ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format  & 
    15     , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    16     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     14    ( filegroup_id, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     15    , format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  & 
     16    , record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    1717    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    1818 
     
    2424      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    2525      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention 
     26      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_str 
    2627      LOGICAL  , OPTIONAL, INTENT(IN) :: cyclic 
    2728      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    5657      (filegroup_id,filegroup_hdl) 
    5758      CALL xios(set_filegroup_attr_hdl_)   & 
    58       ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    59       , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    60       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    61       , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     59      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     60      , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     61      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     62      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     63       ) 
    6264 
    6365  END SUBROUTINE xios(set_filegroup_attr) 
    6466 
    6567  SUBROUTINE xios(set_filegroup_attr_hdl)  & 
    66     ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    67     , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    68     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    69     , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     68    ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     69    , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     70    , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     71    , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     72     ) 
    7073 
    7174    IMPLICIT NONE 
     
    7578      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level 
    7679      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention 
     80      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_str 
    7781      LOGICAL  , OPTIONAL, INTENT(IN) :: cyclic 
    7882      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    105109 
    106110      CALL xios(set_filegroup_attr_hdl_)  & 
    107       ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    108       , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    109       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    110       , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     111      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     112      , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     113      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     114      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     115       ) 
    111116 
    112117  END SUBROUTINE xios(set_filegroup_attr_hdl) 
    113118 
    114119  SUBROUTINE xios(set_filegroup_attr_hdl_)   & 
    115     ( filegroup_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    116     , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
    117     , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
     120    ( filegroup_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  & 
     121    , enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_  & 
     122    , par_access_, record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
    118123    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
    119124    , uuid_name_ ) 
     
    125130      INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_ 
    126131      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_ 
     132      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_str_ 
    127133      LOGICAL  , OPTIONAL, INTENT(IN) :: cyclic_ 
    128134      LOGICAL (KIND=C_BOOL) :: cyclic__tmp 
     
    170176      ENDIF 
    171177 
     178      IF (PRESENT(convention_str_)) THEN 
     179        CALL cxios_set_filegroup_convention_str & 
     180      (filegroup_hdl%daddr, convention_str_, len(convention_str_)) 
     181      ENDIF 
     182 
    172183      IF (PRESENT(cyclic_)) THEN 
    173184        cyclic__tmp = cyclic_ 
     
    305316 
    306317  SUBROUTINE xios(get_filegroup_attr)  & 
    307     ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format  & 
    308     , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    309     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     318    ( filegroup_id, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     319    , format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  & 
     320    , record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    310321    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    311322 
     
    317328      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    318329      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention 
     330      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_str 
    319331      LOGICAL  , OPTIONAL, INTENT(OUT) :: cyclic 
    320332      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    349361      (filegroup_id,filegroup_hdl) 
    350362      CALL xios(get_filegroup_attr_hdl_)   & 
    351       ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    352       , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    353       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    354       , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     363      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     364      , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     365      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     366      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     367       ) 
    355368 
    356369  END SUBROUTINE xios(get_filegroup_attr) 
    357370 
    358371  SUBROUTINE xios(get_filegroup_attr_hdl)  & 
    359     ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    360     , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    361     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    362     , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     372    ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     373    , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     374    , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     375    , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     376     ) 
    363377 
    364378    IMPLICIT NONE 
     
    368382      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level 
    369383      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention 
     384      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_str 
    370385      LOGICAL  , OPTIONAL, INTENT(OUT) :: cyclic 
    371386      LOGICAL (KIND=C_BOOL) :: cyclic_tmp 
     
    398413 
    399414      CALL xios(get_filegroup_attr_hdl_)  & 
    400       ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    401       , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    402       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    403       , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     415      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     416      , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     417      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     418      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     419       ) 
    404420 
    405421  END SUBROUTINE xios(get_filegroup_attr_hdl) 
    406422 
    407423  SUBROUTINE xios(get_filegroup_attr_hdl_)   & 
    408     ( filegroup_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    409     , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
    410     , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
     424    ( filegroup_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  & 
     425    , enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_  & 
     426    , par_access_, record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
    411427    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
    412428    , uuid_name_ ) 
     
    418434      INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_ 
    419435      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_ 
     436      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_str_ 
    420437      LOGICAL  , OPTIONAL, INTENT(OUT) :: cyclic_ 
    421438      LOGICAL (KIND=C_BOOL) :: cyclic__tmp 
     
    463480      ENDIF 
    464481 
     482      IF (PRESENT(convention_str_)) THEN 
     483        CALL cxios_get_filegroup_convention_str & 
     484      (filegroup_hdl%daddr, convention_str_, len(convention_str_)) 
     485      ENDIF 
     486 
    465487      IF (PRESENT(cyclic_)) THEN 
    466488        CALL cxios_get_filegroup_cyclic & 
     
    598620 
    599621  SUBROUTINE xios(is_defined_filegroup_attr)  & 
    600     ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format  & 
    601     , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    602     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     622    ( filegroup_id, append, compression_level, convention, convention_str, cyclic, description, enabled  & 
     623    , format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  & 
     624    , record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    603625    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    604626 
     
    612634      LOGICAL, OPTIONAL, INTENT(OUT) :: convention 
    613635      LOGICAL(KIND=C_BOOL) :: convention_tmp 
     636      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_str 
     637      LOGICAL(KIND=C_BOOL) :: convention_str_tmp 
    614638      LOGICAL, OPTIONAL, INTENT(OUT) :: cyclic 
    615639      LOGICAL(KIND=C_BOOL) :: cyclic_tmp 
     
    668692      (filegroup_id,filegroup_hdl) 
    669693      CALL xios(is_defined_filegroup_attr_hdl_)   & 
    670       ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    671       , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    672       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    673       , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     694      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     695      , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     696      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     697      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     698       ) 
    674699 
    675700  END SUBROUTINE xios(is_defined_filegroup_attr) 
    676701 
    677702  SUBROUTINE xios(is_defined_filegroup_attr_hdl)  & 
    678     ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    679     , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    680     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    681     , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     703    ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     704    , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     705    , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     706    , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     707     ) 
    682708 
    683709    IMPLICIT NONE 
     
    689715      LOGICAL, OPTIONAL, INTENT(OUT) :: convention 
    690716      LOGICAL(KIND=C_BOOL) :: convention_tmp 
     717      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_str 
     718      LOGICAL(KIND=C_BOOL) :: convention_str_tmp 
    691719      LOGICAL, OPTIONAL, INTENT(OUT) :: cyclic 
    692720      LOGICAL(KIND=C_BOOL) :: cyclic_tmp 
     
    743771 
    744772      CALL xios(is_defined_filegroup_attr_hdl_)  & 
    745       ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    746       , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    747       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
    748       , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
     773      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  & 
     774      , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  & 
     775      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  & 
     776      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  & 
     777       ) 
    749778 
    750779  END SUBROUTINE xios(is_defined_filegroup_attr_hdl) 
    751780 
    752781  SUBROUTINE xios(is_defined_filegroup_attr_hdl_)   & 
    753     ( filegroup_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    754     , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
    755     , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
     782    ( filegroup_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  & 
     783    , enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_  & 
     784    , par_access_, record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
    756785    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
    757786    , uuid_name_ ) 
     
    765794      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_ 
    766795      LOGICAL(KIND=C_BOOL) :: convention__tmp 
     796      LOGICAL, OPTIONAL, INTENT(OUT) :: convention_str_ 
     797      LOGICAL(KIND=C_BOOL) :: convention_str__tmp 
    767798      LOGICAL, OPTIONAL, INTENT(OUT) :: cyclic_ 
    768799      LOGICAL(KIND=C_BOOL) :: cyclic__tmp 
     
    836867      ENDIF 
    837868 
     869      IF (PRESENT(convention_str_)) THEN 
     870        convention_str__tmp = cxios_is_defined_filegroup_convention_str & 
     871      (filegroup_hdl%daddr) 
     872        convention_str_ = convention_str__tmp 
     873      ENDIF 
     874 
    838875      IF (PRESENT(cyclic_)) THEN 
    839876        cyclic__tmp = cxios_is_defined_filegroup_cyclic & 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/iinterpolate_domain_attr.F90

    r1040 r1205  
    1212 
    1313  SUBROUTINE xios(set_interpolate_domain_attr)  & 
    14     ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 
     14    ( interpolate_domain_id, mode, order, quantity, renormalize, weight_filename, write_weight ) 
    1515 
    1616    IMPLICIT NONE 
     
    1919      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    2020      INTEGER  , OPTIONAL, INTENT(IN) :: order 
     21      LOGICAL  , OPTIONAL, INTENT(IN) :: quantity 
     22      LOGICAL (KIND=C_BOOL) :: quantity_tmp 
    2123      LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize 
    2224      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
     
    2830      (interpolate_domain_id,interpolate_domain_hdl) 
    2931      CALL xios(set_interpolate_domain_attr_hdl_)   & 
    30       ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     32      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     33       ) 
    3134 
    3235  END SUBROUTINE xios(set_interpolate_domain_attr) 
    3336 
    3437  SUBROUTINE xios(set_interpolate_domain_attr_hdl)  & 
    35     ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     38    ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     39     ) 
    3640 
    3741    IMPLICIT NONE 
     
    3943      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    4044      INTEGER  , OPTIONAL, INTENT(IN) :: order 
     45      LOGICAL  , OPTIONAL, INTENT(IN) :: quantity 
     46      LOGICAL (KIND=C_BOOL) :: quantity_tmp 
    4147      LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize 
    4248      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
     
    4652 
    4753      CALL xios(set_interpolate_domain_attr_hdl_)  & 
    48       ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     54      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     55       ) 
    4956 
    5057  END SUBROUTINE xios(set_interpolate_domain_attr_hdl) 
    5158 
    5259  SUBROUTINE xios(set_interpolate_domain_attr_hdl_)   & 
    53     ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 
     60    ( interpolate_domain_hdl, mode_, order_, quantity_, renormalize_, weight_filename_, write_weight_  & 
     61     ) 
    5462 
    5563    IMPLICIT NONE 
     
    5765      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_ 
    5866      INTEGER  , OPTIONAL, INTENT(IN) :: order_ 
     67      LOGICAL  , OPTIONAL, INTENT(IN) :: quantity_ 
     68      LOGICAL (KIND=C_BOOL) :: quantity__tmp 
    5969      LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize_ 
    6070      LOGICAL (KIND=C_BOOL) :: renormalize__tmp 
     
    7383      ENDIF 
    7484 
     85      IF (PRESENT(quantity_)) THEN 
     86        quantity__tmp = quantity_ 
     87        CALL cxios_set_interpolate_domain_quantity & 
     88      (interpolate_domain_hdl%daddr, quantity__tmp) 
     89      ENDIF 
     90 
    7591      IF (PRESENT(renormalize_)) THEN 
    7692        renormalize__tmp = renormalize_ 
     
    93109 
    94110  SUBROUTINE xios(get_interpolate_domain_attr)  & 
    95     ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 
     111    ( interpolate_domain_id, mode, order, quantity, renormalize, weight_filename, write_weight ) 
    96112 
    97113    IMPLICIT NONE 
     
    100116      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    101117      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
     118      LOGICAL  , OPTIONAL, INTENT(OUT) :: quantity 
     119      LOGICAL (KIND=C_BOOL) :: quantity_tmp 
    102120      LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize 
    103121      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
     
    109127      (interpolate_domain_id,interpolate_domain_hdl) 
    110128      CALL xios(get_interpolate_domain_attr_hdl_)   & 
    111       ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     129      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     130       ) 
    112131 
    113132  END SUBROUTINE xios(get_interpolate_domain_attr) 
    114133 
    115134  SUBROUTINE xios(get_interpolate_domain_attr_hdl)  & 
    116     ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     135    ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     136     ) 
    117137 
    118138    IMPLICIT NONE 
     
    120140      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    121141      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
     142      LOGICAL  , OPTIONAL, INTENT(OUT) :: quantity 
     143      LOGICAL (KIND=C_BOOL) :: quantity_tmp 
    122144      LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize 
    123145      LOGICAL (KIND=C_BOOL) :: renormalize_tmp 
     
    127149 
    128150      CALL xios(get_interpolate_domain_attr_hdl_)  & 
    129       ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     151      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     152       ) 
    130153 
    131154  END SUBROUTINE xios(get_interpolate_domain_attr_hdl) 
    132155 
    133156  SUBROUTINE xios(get_interpolate_domain_attr_hdl_)   & 
    134     ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 
     157    ( interpolate_domain_hdl, mode_, order_, quantity_, renormalize_, weight_filename_, write_weight_  & 
     158     ) 
    135159 
    136160    IMPLICIT NONE 
     
    138162      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_ 
    139163      INTEGER  , OPTIONAL, INTENT(OUT) :: order_ 
     164      LOGICAL  , OPTIONAL, INTENT(OUT) :: quantity_ 
     165      LOGICAL (KIND=C_BOOL) :: quantity__tmp 
    140166      LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize_ 
    141167      LOGICAL (KIND=C_BOOL) :: renormalize__tmp 
     
    154180      ENDIF 
    155181 
     182      IF (PRESENT(quantity_)) THEN 
     183        CALL cxios_get_interpolate_domain_quantity & 
     184      (interpolate_domain_hdl%daddr, quantity__tmp) 
     185        quantity_ = quantity__tmp 
     186      ENDIF 
     187 
    156188      IF (PRESENT(renormalize_)) THEN 
    157189        CALL cxios_get_interpolate_domain_renormalize & 
     
    174206 
    175207  SUBROUTINE xios(is_defined_interpolate_domain_attr)  & 
    176     ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 
     208    ( interpolate_domain_id, mode, order, quantity, renormalize, weight_filename, write_weight ) 
    177209 
    178210    IMPLICIT NONE 
     
    183215      LOGICAL, OPTIONAL, INTENT(OUT) :: order 
    184216      LOGICAL(KIND=C_BOOL) :: order_tmp 
     217      LOGICAL, OPTIONAL, INTENT(OUT) :: quantity 
     218      LOGICAL(KIND=C_BOOL) :: quantity_tmp 
    185219      LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize 
    186220      LOGICAL(KIND=C_BOOL) :: renormalize_tmp 
     
    193227      (interpolate_domain_id,interpolate_domain_hdl) 
    194228      CALL xios(is_defined_interpolate_domain_attr_hdl_)   & 
    195       ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     229      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     230       ) 
    196231 
    197232  END SUBROUTINE xios(is_defined_interpolate_domain_attr) 
    198233 
    199234  SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)  & 
    200     ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     235    ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     236     ) 
    201237 
    202238    IMPLICIT NONE 
     
    206242      LOGICAL, OPTIONAL, INTENT(OUT) :: order 
    207243      LOGICAL(KIND=C_BOOL) :: order_tmp 
     244      LOGICAL, OPTIONAL, INTENT(OUT) :: quantity 
     245      LOGICAL(KIND=C_BOOL) :: quantity_tmp 
    208246      LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize 
    209247      LOGICAL(KIND=C_BOOL) :: renormalize_tmp 
     
    214252 
    215253      CALL xios(is_defined_interpolate_domain_attr_hdl_)  & 
    216       ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     254      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  & 
     255       ) 
    217256 
    218257  END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) 
    219258 
    220259  SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)   & 
    221     ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 
     260    ( interpolate_domain_hdl, mode_, order_, quantity_, renormalize_, weight_filename_, write_weight_  & 
     261     ) 
    222262 
    223263    IMPLICIT NONE 
     
    227267      LOGICAL, OPTIONAL, INTENT(OUT) :: order_ 
    228268      LOGICAL(KIND=C_BOOL) :: order__tmp 
     269      LOGICAL, OPTIONAL, INTENT(OUT) :: quantity_ 
     270      LOGICAL(KIND=C_BOOL) :: quantity__tmp 
    229271      LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize_ 
    230272      LOGICAL(KIND=C_BOOL) :: renormalize__tmp 
     
    246288      ENDIF 
    247289 
     290      IF (PRESENT(quantity_)) THEN 
     291        quantity__tmp = cxios_is_defined_interpolate_domain_quantity & 
     292      (interpolate_domain_hdl%daddr) 
     293        quantity_ = quantity__tmp 
     294      ENDIF 
     295 
    248296      IF (PRESENT(renormalize_)) THEN 
    249297        renormalize__tmp = cxios_is_defined_interpolate_domain_renormalize & 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/interpolate_domain_interface_attr.F90

    r1040 r1205  
    4848      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    4949    END FUNCTION cxios_is_defined_interpolate_domain_order 
     50 
     51 
     52    SUBROUTINE cxios_set_interpolate_domain_quantity(interpolate_domain_hdl, quantity) BIND(C) 
     53      USE ISO_C_BINDING 
     54      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
     55      LOGICAL (KIND=C_BOOL)      , VALUE :: quantity 
     56    END SUBROUTINE cxios_set_interpolate_domain_quantity 
     57 
     58    SUBROUTINE cxios_get_interpolate_domain_quantity(interpolate_domain_hdl, quantity) BIND(C) 
     59      USE ISO_C_BINDING 
     60      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
     61      LOGICAL (KIND=C_BOOL)             :: quantity 
     62    END SUBROUTINE cxios_get_interpolate_domain_quantity 
     63 
     64    FUNCTION cxios_is_defined_interpolate_domain_quantity(interpolate_domain_hdl) BIND(C) 
     65      USE ISO_C_BINDING 
     66      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_quantity 
     67      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
     68    END FUNCTION cxios_is_defined_interpolate_domain_quantity 
    5069 
    5170 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/izoom_axis_attr.F90

    r966 r1205  
    1212 
    1313  SUBROUTINE xios(set_zoom_axis_attr)  & 
    14     ( zoom_axis_id, begin, n ) 
     14    ( zoom_axis_id, begin, index, n ) 
    1515 
    1616    IMPLICIT NONE 
     
    1818      CHARACTER(LEN=*), INTENT(IN) ::zoom_axis_id 
    1919      INTEGER  , OPTIONAL, INTENT(IN) :: begin 
     20      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
    2021      INTEGER  , OPTIONAL, INTENT(IN) :: n 
    2122 
     
    2324      (zoom_axis_id,zoom_axis_hdl) 
    2425      CALL xios(set_zoom_axis_attr_hdl_)   & 
    25       ( zoom_axis_hdl, begin, n ) 
     26      ( zoom_axis_hdl, begin, index, n ) 
    2627 
    2728  END SUBROUTINE xios(set_zoom_axis_attr) 
    2829 
    2930  SUBROUTINE xios(set_zoom_axis_attr_hdl)  & 
    30     ( zoom_axis_hdl, begin, n ) 
     31    ( zoom_axis_hdl, begin, index, n ) 
    3132 
    3233    IMPLICIT NONE 
    3334      TYPE(txios(zoom_axis)) , INTENT(IN) :: zoom_axis_hdl 
    3435      INTEGER  , OPTIONAL, INTENT(IN) :: begin 
     36      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
    3537      INTEGER  , OPTIONAL, INTENT(IN) :: n 
    3638 
    3739      CALL xios(set_zoom_axis_attr_hdl_)  & 
    38       ( zoom_axis_hdl, begin, n ) 
     40      ( zoom_axis_hdl, begin, index, n ) 
    3941 
    4042  END SUBROUTINE xios(set_zoom_axis_attr_hdl) 
    4143 
    4244  SUBROUTINE xios(set_zoom_axis_attr_hdl_)   & 
    43     ( zoom_axis_hdl, begin_, n_ ) 
     45    ( zoom_axis_hdl, begin_, index_, n_ ) 
    4446 
    4547    IMPLICIT NONE 
    4648      TYPE(txios(zoom_axis)) , INTENT(IN) :: zoom_axis_hdl 
    4749      INTEGER  , OPTIONAL, INTENT(IN) :: begin_ 
     50      INTEGER  , OPTIONAL, INTENT(IN) :: index_(:) 
    4851      INTEGER  , OPTIONAL, INTENT(IN) :: n_ 
    4952 
     
    5154        CALL cxios_set_zoom_axis_begin & 
    5255      (zoom_axis_hdl%daddr, begin_) 
     56      ENDIF 
     57 
     58      IF (PRESENT(index_)) THEN 
     59        CALL cxios_set_zoom_axis_index & 
     60      (zoom_axis_hdl%daddr, index_, SHAPE(index_)) 
    5361      ENDIF 
    5462 
     
    6169 
    6270  SUBROUTINE xios(get_zoom_axis_attr)  & 
    63     ( zoom_axis_id, begin, n ) 
     71    ( zoom_axis_id, begin, index, n ) 
    6472 
    6573    IMPLICIT NONE 
     
    6775      CHARACTER(LEN=*), INTENT(IN) ::zoom_axis_id 
    6876      INTEGER  , OPTIONAL, INTENT(OUT) :: begin 
     77      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
    6978      INTEGER  , OPTIONAL, INTENT(OUT) :: n 
    7079 
     
    7281      (zoom_axis_id,zoom_axis_hdl) 
    7382      CALL xios(get_zoom_axis_attr_hdl_)   & 
    74       ( zoom_axis_hdl, begin, n ) 
     83      ( zoom_axis_hdl, begin, index, n ) 
    7584 
    7685  END SUBROUTINE xios(get_zoom_axis_attr) 
    7786 
    7887  SUBROUTINE xios(get_zoom_axis_attr_hdl)  & 
    79     ( zoom_axis_hdl, begin, n ) 
     88    ( zoom_axis_hdl, begin, index, n ) 
    8089 
    8190    IMPLICIT NONE 
    8291      TYPE(txios(zoom_axis)) , INTENT(IN) :: zoom_axis_hdl 
    8392      INTEGER  , OPTIONAL, INTENT(OUT) :: begin 
     93      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
    8494      INTEGER  , OPTIONAL, INTENT(OUT) :: n 
    8595 
    8696      CALL xios(get_zoom_axis_attr_hdl_)  & 
    87       ( zoom_axis_hdl, begin, n ) 
     97      ( zoom_axis_hdl, begin, index, n ) 
    8898 
    8999  END SUBROUTINE xios(get_zoom_axis_attr_hdl) 
    90100 
    91101  SUBROUTINE xios(get_zoom_axis_attr_hdl_)   & 
    92     ( zoom_axis_hdl, begin_, n_ ) 
     102    ( zoom_axis_hdl, begin_, index_, n_ ) 
    93103 
    94104    IMPLICIT NONE 
    95105      TYPE(txios(zoom_axis)) , INTENT(IN) :: zoom_axis_hdl 
    96106      INTEGER  , OPTIONAL, INTENT(OUT) :: begin_ 
     107      INTEGER  , OPTIONAL, INTENT(OUT) :: index_(:) 
    97108      INTEGER  , OPTIONAL, INTENT(OUT) :: n_ 
    98109 
     
    100111        CALL cxios_get_zoom_axis_begin & 
    101112      (zoom_axis_hdl%daddr, begin_) 
     113      ENDIF 
     114 
     115      IF (PRESENT(index_)) THEN 
     116        CALL cxios_get_zoom_axis_index & 
     117      (zoom_axis_hdl%daddr, index_, SHAPE(index_)) 
    102118      ENDIF 
    103119 
     
    110126 
    111127  SUBROUTINE xios(is_defined_zoom_axis_attr)  & 
    112     ( zoom_axis_id, begin, n ) 
     128    ( zoom_axis_id, begin, index, n ) 
    113129 
    114130    IMPLICIT NONE 
     
    117133      LOGICAL, OPTIONAL, INTENT(OUT) :: begin 
    118134      LOGICAL(KIND=C_BOOL) :: begin_tmp 
     135      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
     136      LOGICAL(KIND=C_BOOL) :: index_tmp 
    119137      LOGICAL, OPTIONAL, INTENT(OUT) :: n 
    120138      LOGICAL(KIND=C_BOOL) :: n_tmp 
     
    123141      (zoom_axis_id,zoom_axis_hdl) 
    124142      CALL xios(is_defined_zoom_axis_attr_hdl_)   & 
    125       ( zoom_axis_hdl, begin, n ) 
     143      ( zoom_axis_hdl, begin, index, n ) 
    126144 
    127145  END SUBROUTINE xios(is_defined_zoom_axis_attr) 
    128146 
    129147  SUBROUTINE xios(is_defined_zoom_axis_attr_hdl)  & 
    130     ( zoom_axis_hdl, begin, n ) 
     148    ( zoom_axis_hdl, begin, index, n ) 
    131149 
    132150    IMPLICIT NONE 
     
    134152      LOGICAL, OPTIONAL, INTENT(OUT) :: begin 
    135153      LOGICAL(KIND=C_BOOL) :: begin_tmp 
     154      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
     155      LOGICAL(KIND=C_BOOL) :: index_tmp 
    136156      LOGICAL, OPTIONAL, INTENT(OUT) :: n 
    137157      LOGICAL(KIND=C_BOOL) :: n_tmp 
    138158 
    139159      CALL xios(is_defined_zoom_axis_attr_hdl_)  & 
    140       ( zoom_axis_hdl, begin, n ) 
     160      ( zoom_axis_hdl, begin, index, n ) 
    141161 
    142162  END SUBROUTINE xios(is_defined_zoom_axis_attr_hdl) 
    143163 
    144164  SUBROUTINE xios(is_defined_zoom_axis_attr_hdl_)   & 
    145     ( zoom_axis_hdl, begin_, n_ ) 
     165    ( zoom_axis_hdl, begin_, index_, n_ ) 
    146166 
    147167    IMPLICIT NONE 
     
    149169      LOGICAL, OPTIONAL, INTENT(OUT) :: begin_ 
    150170      LOGICAL(KIND=C_BOOL) :: begin__tmp 
     171      LOGICAL, OPTIONAL, INTENT(OUT) :: index_ 
     172      LOGICAL(KIND=C_BOOL) :: index__tmp 
    151173      LOGICAL, OPTIONAL, INTENT(OUT) :: n_ 
    152174      LOGICAL(KIND=C_BOOL) :: n__tmp 
     
    156178      (zoom_axis_hdl%daddr) 
    157179        begin_ = begin__tmp 
     180      ENDIF 
     181 
     182      IF (PRESENT(index_)) THEN 
     183        index__tmp = cxios_is_defined_zoom_axis_index & 
     184      (zoom_axis_hdl%daddr) 
     185        index_ = index__tmp 
    158186      ENDIF 
    159187 
  • XIOS/dev/branch_yushan_merged/src/interface/fortran_attr/zoom_axis_interface_attr.F90

    r787 r1205  
    2929 
    3030 
     31    SUBROUTINE cxios_set_zoom_axis_index(zoom_axis_hdl, index, extent) BIND(C) 
     32      USE ISO_C_BINDING 
     33      INTEGER (kind = C_INTPTR_T), VALUE       :: zoom_axis_hdl 
     34      INTEGER (KIND=C_INT)     , DIMENSION(*) :: index 
     35      INTEGER (kind = C_INT), DIMENSION(*)     :: extent 
     36    END SUBROUTINE cxios_set_zoom_axis_index 
     37 
     38    SUBROUTINE cxios_get_zoom_axis_index(zoom_axis_hdl, index, extent) BIND(C) 
     39      USE ISO_C_BINDING 
     40      INTEGER (kind = C_INTPTR_T), VALUE       :: zoom_axis_hdl 
     41      INTEGER (KIND=C_INT)     , DIMENSION(*) :: index 
     42      INTEGER (kind = C_INT), DIMENSION(*)     :: extent 
     43    END SUBROUTINE cxios_get_zoom_axis_index 
     44 
     45    FUNCTION cxios_is_defined_zoom_axis_index(zoom_axis_hdl) BIND(C) 
     46      USE ISO_C_BINDING 
     47      LOGICAL(kind=C_BOOL) :: cxios_is_defined_zoom_axis_index 
     48      INTEGER (kind = C_INTPTR_T), VALUE :: zoom_axis_hdl 
     49    END FUNCTION cxios_is_defined_zoom_axis_index 
     50 
     51 
    3152    SUBROUTINE cxios_set_zoom_axis_n(zoom_axis_hdl, n) BIND(C) 
    3253      USE ISO_C_BINDING 
  • XIOS/dev/branch_yushan_merged/src/io/nc4_data_output.cpp

    r1176 r1205  
    1111#include "netCdfException.hpp" 
    1212#include "exception.hpp" 
     13#include "timer.hpp" 
    1314#include "uuid.hpp" 
    1415// mpi.hpp 
     
    7980 
    8081 
    81          StdString dimXid, dimYid ; 
     82        StdString dimXid, dimYid ; 
    8283 
    8384        nc_type typePrec ; 
     
    10451046        int zoom_begin_srv = axis->zoom_begin_srv; 
    10461047        int zoom_size  = (MULTI_FILE == SuperClass::type) ? zoom_size_srv 
    1047                                                               : axis->global_zoom_n; 
    1048         int zoom_begin = (MULTI_FILE == SuperClass::type) ? zoom_begin_srv 
    1049                                                               : axis->global_zoom_begin; 
     1048                                                          : axis->global_zoom_size_srv; 
    10501049 
    10511050        if ((0 == zoom_size_srv) && (MULTI_FILE == SuperClass::type)) return; 
     
    11021101 
    11031102            SuperClassWriter::definition_end(); 
    1104             printf("SuperClass::type = %d, typePrec = %d\n", SuperClass::type, typePrec); 
     1103 
    11051104            switch (SuperClass::type) 
    11061105            { 
     
    11261125                std::vector<StdSize> start(1), startBounds(2) ; 
    11271126                std::vector<StdSize> count(1), countBounds(2) ; 
    1128                 start[0] = startBounds[0] = zoom_begin_srv-axis->global_zoom_begin; 
     1127                start[0] = startBounds[0] = zoom_begin_srv-axis->global_zoom_begin_srv; 
    11291128                count[0] = countBounds[0] = zoom_size_srv; 
    11301129                startBounds[1] = 0; 
     
    18321831 
    18331832         singleDomain = (file->nbDomains == 1); 
     1833 
     1834         StdString conv_str ; 
     1835         if (file->convention_str.isEmpty()) 
     1836         { 
     1837            if (SuperClassWriter::useCFConvention) conv_str="CF-1.6" ; 
     1838            else conv_str="UGRID" ; 
     1839         } 
     1840         else conv_str=file->convention_str ; 
     1841            
    18341842         try 
    18351843         { 
    1836        if (SuperClassWriter::useCFConvention) 
    1837              this->writeFileAttributes(filename, description, 
    1838                                        StdString("CF-1.6"), 
    1839                                        StdString("An IPSL model"), 
    1840                                        this->getTimeStamp()); 
    1841            else 
    1842              this->writeFileAttributes(filename, description, 
    1843                                        StdString("UGRID"), 
    1844                                        StdString("An IPSL model"), 
    1845                                        this->getTimeStamp()); 
    1846  
     1844           this->writeFileAttributes(filename, description, 
     1845                                      conv_str, 
     1846                                      StdString("An IPSL model"), 
     1847                                      this->getTimeStamp()); 
    18471848 
    18481849           if (!appendMode) 
     
    19891990        CGrid* grid = field->grid; 
    19901991 
    1991         if (field->getNStep()<1) return ; 
     1992        if (field->getNStep()<1)  
     1993        { 
     1994          return; 
     1995        } 
    19921996         
    19931997        if (!grid->doGridHaveDataToWrite()) 
    1994           if (SuperClass::type == MULTI_FILE || !isCollective) return; 
    1995  
     1998          if (SuperClass::type == MULTI_FILE || !isCollective) 
     1999          { 
     2000            return; 
     2001          } 
     2002 
     2003           
    19962004        StdString fieldid = field->getFieldOutputName(); 
    19972005 
     
    21182126              case (MULTI_FILE) : 
    21192127              { 
     2128                 CTimer::get("Files : writing data").resume(); 
    21202129                 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 
     2130                 CTimer::get("Files : writing data").suspend(); 
    21212131                 if (wtime) 
    21222132                 { 
     2133                   CTimer::get("Files : writing time axis").resume(); 
    21232134                   if ( wtimeData) 
    21242135                   { 
    2125                      SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
    2126                      SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
    2127                    } 
     2136//                     SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
     2137//                     SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
     2138                       SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
     2139                       SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
     2140                  } 
    21282141                   if (wtimeCounter) 
    21292142                   { 
    2130                      SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    2131                      if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2143//                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
     2144//                     if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2145                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 
     2146                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
    21322147                   } 
     2148                   CTimer::get("Files : writing time axis").suspend(); 
    21332149                 } 
    21342150                 break; 
     
    22562272                } 
    22572273 
     2274 
     2275                CTimer::get("Files : writing data").resume(); 
    22582276                SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 
     2277                CTimer::get("Files : writing data").suspend(); 
     2278 
    22592279                 if (wtime) 
    22602280                 { 
     2281                   CTimer::get("Files : writing time axis").resume(); 
    22612282                   if ( wtimeData) 
    22622283                   { 
    2263                      SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
    2264                      SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
     2284//                     SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
     2285//                     SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
     2286                     SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
     2287                     SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
    22652288                   } 
    22662289                   if (wtimeCounter) 
    22672290                   { 
    2268                      SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    2269                      if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2291//                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
     2292//                     if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2293                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 
     2294                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
     2295 
    22702296                   } 
     2297                   CTimer::get("Files : writing time axis").suspend();   
    22712298                 } 
    22722299 
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4.cpp

    r1160 r1205  
    66#include "netCdfInterface.hpp" 
    77#include "netCdfException.hpp" 
    8 // mpi_std.hpp 
     8#include "timer.hpp" 
    99 
    1010namespace xios 
     
    5454         if (!append || !std::ifstream(filename.c_str())) 
    5555         { 
     56            CTimer::get("Files : create").resume(); 
    5657            if (wmpi) 
    5758               CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL_STD, this->ncidp); 
    5859            else 
    5960               CNetCdfInterface::create(filename, mode, this->ncidp); 
    60  
     61            CTimer::get("Files : create").suspend(); 
     62  
    6163            this->appendMode = false; 
    6264         } 
     
    6466         { 
    6567            mode |= NC_WRITE; 
     68            CTimer::get("Files : open").resume(); 
    6669            if (wmpi) 
    67                //CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp); 
    6870               CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL_STD, this->ncidp); 
    6971            else 
    7072               CNetCdfInterface::open(filename, mode, this->ncidp); 
    71  
     73            CTimer::get("Files : open").suspend(); 
    7274            this->appendMode = true; 
    7375         } 
     
    8385      void CONetCDF4::close() 
    8486      { 
     87        CTimer::get("Files : close").resume(); 
    8588        CNetCdfInterface::close(this->ncidp); 
     89        CTimer::get("Files : close").suspend(); 
    8690      } 
    8791 
     
    558562 
    559563         this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL); 
     564 
    560565         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
     566 
    561567      } 
    562568 
     
    584590 
    585591         this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL); 
    586          if (using_netcdf_internal) 
    587          { 
    588            if (!isRoot) 
    589            { 
    590              sstart[0] = sstart[0] + 1; 
    591              scount[0] = 0; 
    592            } 
    593          } 
    594592         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    595593       } 
    596594 
     595      void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name, 
     596                                        bool collective, StdSize record, bool isRoot) 
     597      { 
     598         int grpid = this->getCurrentGroup(); 
     599         int varid = this->getVariable(name); 
     600 
     601         map<int,size_t>::iterator it=timeAxis.find(varid); 
     602         if (it == timeAxis.end()) timeAxis[varid] = record; 
     603         else 
     604         { 
     605           if (it->second >= record) return; 
     606           else it->second =record; 
     607         } 
     608 
     609         StdSize array_size = 1; 
     610         std::vector<StdSize> sstart, scount; 
     611 
     612         if (this->wmpi && collective) 
     613            CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 
     614         if (this->wmpi && !collective) 
     615            CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
     616 
     617         this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL); 
     618         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
     619       } 
     620 
     621 
    597622      //--------------------------------------------------------------- 
    598623 
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4.hpp

    r1160 r1205  
    7373            void writeTimeAxisData(const CArray<double,1>& data, const StdString& name, 
    7474                                   bool collective, StdSize record, bool Isroot); 
     75            void writeTimeAxisDataBounds(const CArray<double,1>& data, const StdString& name, 
     76                                   bool collective, StdSize record, bool Isroot); 
    7577            /// Accesseur /// 
    7678            const CONetCDF4Path& getCurrentPath(void) const; 
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4_impl.hpp

    r1160 r1205  
    2525    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    2626 
     27    CTimer::get("Files : get data infos").resume(); 
    2728    this->getWriteDataInfos 
    2829    (name, record, array_size,  sstart, scount, start, count); 
     30    CTimer::get("Files : get data infos").suspend(); 
     31 
    2932    if (data.numElements() != array_size) 
    3033    { 
     
    5457    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    5558 
    56     this->getWriteDataInfos 
    57     (name, record, array_size,  sstart, scount, start, count); 
     59    CTimer::get("CONetCDF4::writeData getWriteDataInfos").resume(); 
     60    this->getWriteDataInfos(name, record, array_size,  sstart, scount, start, count); 
     61    CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 
     62  
    5863    if (data.numElements()*stringArrayLen != array_size) 
    5964    { 
     
    7277      PtrArrayStr[it->size()]='\0' ; 
    7378    } 
     79    CTimer::get("CONetCDF4::writeData writeData_").resume(); 
    7480    this->writeData_(grpid, varid, sstart, scount, ArrayStr); 
     81    CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
    7582    delete [] ArrayStr ; 
    7683  } 
  • XIOS/dev/branch_yushan_merged/src/memtrack.cpp

    r1160 r1205  
    5252{ 
    5353  void addr2line(const char *file_name, char** addr, int naddr) ; 
     54#ifdef XIOS_MEMTRACK_LIGHT 
     55  void addr2line(const char *file_name, char** addr, int naddr) {}  
     56#endif 
    5457} 
    5558/* ------------------------------------------------------------ */ 
     
    5962namespace MemTrack 
    6063{ 
     64    size_t currentMemorySize=0 ; 
     65    size_t maxMemorySize=0 ;  
     66 
     67    size_t getCurrentMemorySize(void) {return currentMemorySize; } 
     68    size_t getMaxMemorySize(void) {return maxMemorySize ; } 
    6169 
    6270    /* ------------------------------------------------------------ */ 
     
    376384        // Get the offset to the user chunk and return it. 
    377385        UserChunk *pUser = GetUserAddress(pProlog); 
     386 
     387        currentMemorySize += size ; 
     388        if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ; 
    378389         
    379390        return pUser; 
     
    401412        // Unlink the block header from the list and destroy it. 
    402413        BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 
     414        currentMemorySize-=pBlockHeader->GetRequestedSize(); 
    403415        BlockHeader::RemoveNode(pBlockHeader); 
    404416        pBlockHeader->~BlockHeader(); 
  • XIOS/dev/branch_yushan_merged/src/memtrack.hpp

    r1160 r1205  
    6161    void TrackDumpBlocks(); 
    6262    void TrackListMemoryUsage(); 
    63  
     63    size_t getCurrentMemorySize(void) ; 
     64    size_t getMaxMemorySize(void) ; 
    6465    /* ---------------------------------------- operator * (MemStamp, ptr) */ 
    6566 
  • XIOS/dev/branch_yushan_merged/src/node/axis.cpp

    r1134 r1205  
    367367    // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    368368    isCompressible_ = !mask.isEmpty(); 
     369  } 
     370 
     371  bool CAxis::zoomByIndex() 
     372  { 
     373    return (!global_zoom_index.isEmpty() && (0 != global_zoom_index.numElements())); 
    369374  } 
    370375 
     
    463468    size_t nZoomCount = 0; 
    464469    size_t nbIndex = index.numElements(); 
    465     for (size_t idx = 0; idx < nbIndex; ++idx) 
     470 
     471    int end = (0 == n) ? begin : begin + n - 1; 
     472    int zoom_size = zoomByIndex() ? global_zoom_index.numElements() : global_zoom_n; 
     473    int minInd = min(index); 
     474    int maxInd = max(index); 
     475    for (size_t idx = 0; idx < zoom_size; ++idx) 
     476    { 
     477      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 
     478      if (globalZoomIndex >= minInd && globalZoomIndex <= maxInd) ++nZoomCount; 
     479    } 
     480 
     481/*    for (size_t idx = 0; idx < nbIndex; ++idx) 
    466482    { 
    467483      size_t globalIndex = index(idx); 
    468484      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount; 
    469     } 
    470  
     485    }*/ 
     486     
    471487    CArray<size_t,1> globalIndexAxis(nbIndex); 
     488    for (size_t idx = 0; idx < nbIndex; ++idx) 
     489    {       
     490      globalIndexAxis(idx) = (size_t)index(idx); 
     491    } 
     492 
    472493    std::vector<size_t> globalAxisZoom(nZoomCount); 
    473494    nZoomCount = 0; 
    474     for (size_t idx = 0; idx < nbIndex; ++idx) 
    475     { 
    476       size_t globalIndex = index(idx); 
    477       globalIndexAxis(idx) = globalIndex; 
    478       if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) 
    479       { 
    480         globalAxisZoom[nZoomCount] = globalIndex; 
     495    for (size_t idx = 0; idx < zoom_size; ++idx) 
     496    { 
     497      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 
     498      if (globalZoomIndex >= minInd && globalZoomIndex <= maxInd) 
     499      { 
     500        globalAxisZoom[nZoomCount] = globalZoomIndex; 
    481501        ++nZoomCount; 
    482502      } 
     
    598618    int zoom_end = global_zoom_begin + global_zoom_n - 1; 
    599619    int nb = 0; 
    600     for (size_t idx = 0; idx < n; ++idx) 
     620/*    for (size_t idx = 0; idx < n; ++idx) 
    601621    { 
    602622      size_t globalIndex = begin + idx; 
    603623      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nb; 
     624    }*/ 
     625 
     626    int end = (0 == n) ? begin : begin + n - 1; 
     627    int zoom_size = zoomByIndex() ? global_zoom_index.numElements() : global_zoom_n; 
     628    for (size_t idx = 0; idx < zoom_size; ++idx) 
     629    { 
     630      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 
     631      if (globalZoomIndex >= begin && globalZoomIndex <= end) ++nb; 
    604632    } 
    605633 
     
    622650    CArray<double,1> val(nb); 
    623651    nb = 0; 
    624     for (size_t idx = 0; idx < n; ++idx) 
     652/*    for (size_t idx = 0; idx < n; ++idx) 
    625653    { 
    626654      size_t globalIndex = begin + idx; 
     
    628656      { 
    629657        val(nb) = value(idx); 
     658        ++nb; 
     659      } 
     660    }*/ 
     661 
     662    for (size_t idx = 0; idx < zoom_size; ++idx) 
     663    { 
     664      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 
     665      if (globalZoomIndex >= begin && globalZoomIndex <= end) 
     666      { 
     667        val(nb) = value(globalZoomIndex-begin); 
    630668        ++nb; 
    631669      } 
     
    933971        const int ni    = serverDimensionSizes[*itRank][orderPositionInGrid]; 
    934972        const int end   = begin + ni - 1; 
     973        const bool zoomIndex = zoomByIndex(); 
    935974 
    936975        msgs.push_back(CMessage()); 
     
    940979        msg << global_zoom_begin.getValue() << global_zoom_n.getValue(); 
    941980        msg << isCompressible_; 
     981        msg << zoomIndex; 
     982        if (zoomIndex) 
     983          msg << global_zoom_index.getValue(); 
    942984 
    943985        event.push(*itRank,1,msg); 
     
    9591001  { 
    9601002    int ni_srv, begin_srv, end_srv, global_zoom_begin_tmp, global_zoom_n_tmp; 
     1003    bool zoomIndex;     
     1004    CArray<int,1> zoom_index_recv; 
     1005    std::vector<int> zoom_index_tmp; 
     1006    std::vector<int>::iterator itZoomBeginSrv, itZoomEndSrv, itZoomSrv; 
    9611007 
    9621008    buffer >> ni_srv >> begin_srv >> end_srv; 
    9631009    buffer >> global_zoom_begin_tmp >> global_zoom_n_tmp; 
    9641010    buffer >> isCompressible_; 
     1011    buffer >> zoomIndex; 
     1012    if (zoomIndex) 
     1013    { 
     1014      buffer >> zoom_index_recv; 
     1015      global_zoom_index.reference(zoom_index_recv); 
     1016      zoom_index_tmp.resize(global_zoom_index.numElements()); 
     1017      std::copy(global_zoom_index.begin(), global_zoom_index.end(), zoom_index_tmp.begin()); 
     1018      std::sort(zoom_index_tmp.begin(), zoom_index_tmp.end()); 
     1019      itZoomBeginSrv = std::lower_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), begin_srv); 
     1020      itZoomEndSrv   = std::upper_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), end_srv);       
     1021      int sz = std::distance(itZoomBeginSrv, itZoomEndSrv); 
     1022      zoom_index_srv.resize(sz); 
     1023      itZoomSrv = itZoomBeginSrv; 
     1024      for (int i = 0; i < sz; ++i, ++itZoomSrv) 
     1025      { 
     1026        zoom_index_srv(i) = *(itZoomSrv); 
     1027      } 
     1028    } 
     1029 
    9651030    global_zoom_begin = global_zoom_begin_tmp; 
    9661031    global_zoom_n  = global_zoom_n_tmp; 
    9671032    int global_zoom_end = global_zoom_begin + global_zoom_n - 1; 
    9681033 
    969     zoom_begin_srv = global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ; 
    970     zoom_end_srv   = global_zoom_end < end_srv ? global_zoom_end : end_srv ; 
     1034    zoom_begin_srv = zoomIndex ? std::distance(itZoomBeginSrv, zoom_index_tmp.begin()) 
     1035                                 : global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ; 
     1036    zoom_end_srv   = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomEndSrv) - 1  
     1037                                 : global_zoom_end < end_srv ? global_zoom_end : end_srv ; 
    9711038    zoom_size_srv  = zoom_end_srv - zoom_begin_srv + 1; 
     1039      
     1040    global_zoom_begin_srv = zoomIndex ? 0 : global_zoom_begin ; 
     1041    global_zoom_size_srv  = zoomIndex ? zoom_index_tmp.size() : global_zoom_n; 
    9721042 
    9731043    if (zoom_size_srv<=0) 
     
    9781048    if (n_glo == n) 
    9791049    { 
    980       zoom_begin_srv = global_zoom_begin; 
    981       zoom_end_srv   = global_zoom_end; //zoom_end; 
    982       zoom_size_srv  = zoom_end_srv - zoom_begin_srv + 1; 
     1050      zoom_begin_srv = zoomIndex ? std::distance(itZoomBeginSrv, zoom_index_tmp.begin()) 
     1051                                   : global_zoom_begin;       
     1052      zoom_size_srv  = zoomIndex ? zoom_index_tmp.size() 
     1053                                   : global_zoom_n; 
    9831054    } 
    9841055    if (hasValue) 
     
    10431114  } 
    10441115 
    1045  
    1046  
    10471116  void CAxis::duplicateTransformation(CAxis* src) 
    10481117  { 
  • XIOS/dev/branch_yushan_merged/src/node/axis.hpp

    r1134 r1205  
    122122        int zoom_begin_srv, zoom_end_srv, zoom_size_srv; 
    123123        int ni_srv, begin_srv, end_srv; 
     124        int global_zoom_begin_srv, global_zoom_end_srv, global_zoom_size_srv; 
    124125        CArray<double,1> value_srv; 
    125126        CArray<double,2> bound_srv; 
    126127        CArray<StdString,1> label_srv; 
     128        CArray<int,1> zoom_index_srv; 
    127129        bool hasValue; 
    128130 
     
    138140         void sendDistributedValue(); 
    139141         void sendNonDistributedValue(); 
     142         bool zoomByIndex(); 
    140143 
    141144         static void recvIndex(CEventServer& event); 
  • XIOS/dev/branch_yushan_merged/src/node/context.cpp

    r1160 r1205  
    1414#include "type.hpp" 
    1515#include "xios_spl.hpp" 
     16#include "timer.hpp" 
     17#include "memtrack.hpp" 
     18 
    1619 
    1720namespace xios { 
     
    278281   void CContext::setClientServerBuffer() 
    279282   { 
    280      size_t minBufferSize = CXios::minBufferSize; 
     283     // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 
     284     const size_t minEventSize = CEventClient::headerSize + getIdServer().size() + 10 * sizeof(int); 
     285     // Ensure there is at least some room for 20 of such events in the buffers 
     286     size_t minBufferSize = std::max(CXios::minBufferSize, 20 * minEventSize); 
    281287#define DECLARE_NODE(Name_, name_)    \ 
    282288     if (minBufferSize < sizeof(C##Name_##Definition)) minBufferSize = sizeof(C##Name_##Definition); 
     
    286292#undef DECLARE_NODE_PAR 
    287293 
     294     // Compute the buffer sizes needed to send the attributes and data corresponding to fields 
    288295     std::map<int, StdSize> maxEventSize; 
    289296     std::map<int, StdSize> bufferSize = getAttributesBufferSize(maxEventSize); 
     
    294301       if (it->second > bufferSize[it->first]) bufferSize[it->first] = it->second; 
    295302 
     303     // Apply the buffer size factor and check that we are above the minimum buffer size 
    296304     ite = bufferSize.end(); 
    297305     for (it = bufferSize.begin(); it != ite; ++it) 
     
    301309     } 
    302310 
    303      // We consider that the minimum buffer size is also the minimum event size 
    304      ite = maxEventSize.end(); 
    305      for (it = maxEventSize.begin(); it != ite; ++it) 
    306        if (it->second < minBufferSize) it->second = minBufferSize; 
    307  
     311     // Leaders will have to send some control events so ensure there is some room for those in the buffers 
    308312     if (client->isServerLeader()) 
    309313     { 
    310314       const std::list<int>& ranks = client->getRanksServerLeader(); 
    311315       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    312          if (!bufferSize.count(*itRank)) bufferSize[*itRank] = maxEventSize[*itRank] = minBufferSize; 
     316       { 
     317         if (!bufferSize.count(*itRank)) 
     318         { 
     319           bufferSize[*itRank] = minBufferSize; 
     320           maxEventSize[*itRank] = minEventSize; 
     321         } 
     322       } 
    313323     } 
    314324 
     
    401411   void CContext::closeDefinition(void) 
    402412   { 
     413     CTimer::get("Context : close definition").resume() ; 
    403414     // There is nothing client need to send to server 
    404415     if (hasClient) 
     
    454465      startPrefetchingOfEnabledReadModeFiles(); 
    455466    } 
     467    CTimer::get("Context : close definition").suspend() ; 
    456468   } 
    457469 
     
    12061218   void CContext::updateCalendar(int step) 
    12071219   { 
     1220      #pragma omp critical (_output) 
     1221      {info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl;} 
    12081222      calendar->update(step); 
    1209  
    1210  
     1223      #pragma omp critical (_output) 
     1224      {info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl;} 
     1225#ifdef XIOS_MEMTRACK_LIGHT 
     1226      #pragma omp critical (_output) 
     1227      {info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ;} 
     1228#endif 
    12111229      if (hasClient) 
    12121230      { 
     
    12551273    CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 
    12561274    getRoot(); 
    1257     //if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
    12581275    if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared()); 
    12591276 
  • XIOS/dev/branch_yushan_merged/src/node/field.cpp

    r1203 r1205  
    2626namespace xios{ 
    2727 
    28    /// ////////////////////// Dfinitions ////////////////////// /// 
     28   /// ////////////////////// Définitions ////////////////////// /// 
    2929 
    3030   CField::CField(void) 
     
    125125  void CField::sendUpdateData(const CArray<double,1>& data) 
    126126  { 
    127     CTimer::get("XIOS Send Data").resume(); 
     127    CTimer::get("Field : send data").resume(); 
    128128 
    129129    CContext* context = CContext::getCurrent(); 
     
    177177    } 
    178178 
    179     CTimer::get("XIOS Send Data").suspend(); 
     179    CTimer::get("Field : send data").suspend(); 
    180180  } 
    181181 
     
    187187    list<CEventServer::SSubEvent>::iterator it; 
    188188    string fieldId; 
    189  
     189    CTimer::get("Field : recv data").resume(); 
    190190    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it) 
    191191    { 
     
    197197    } 
    198198    get(fieldId)->recvUpdateData(ranks,buffers); 
     199    CTimer::get("Field : recv data").suspend(); 
    199200  } 
    200201 
     
    794795     if (!areAllReferenceSolved) solveAllReferenceEnabledField(false); 
    795796 
     797     const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     798     const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
     799 
    796800     // Start by building a filter which can provide the field's instant data 
    797801     if (!instantDataFilter) 
     
    810814           if (grid && grid != gridRef && grid->hasTransform()) 
    811815           { 
    812              bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    813              double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
    814              std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 
     816             std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue); 
    815817 
    816818             filter->connectOutput(filters.first, 0); 
     
    828830         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    829831                                                                                                     freq_offset.isEmpty() ? NoneDu : freq_offset, 
    830                                                                                                      true)); 
     832                                                                                                     true, 
     833                                                                                                     detectMissingValues, defaultValue)); 
    831834       else // The data might be passed from the model 
    832835       { 
    833           bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    834           double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
     836          if (check_if_active.isEmpty()) check_if_active = false; 
    835837          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
    836                                                                                                       ignoreMissingValue, defaultValue));       } 
     838                                                                                                      detectMissingValues, defaultValue)); 
     839       } 
    837840     } 
    838841 
     
    842845       if (!read_access.isEmpty() && read_access) 
    843846       { 
    844          storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 
     847         storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid, 
     848                                                                        detectMissingValues, defaultValue)); 
    845849         instantDataFilter->connectOutput(storeFilter, 0); 
    846850       } 
     
    903907     if (!selfReferenceFilter) 
    904908     { 
     909       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     910       const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
     911 
    905912       if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
    906913       { 
     
    908915           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    909916                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset, 
    910                                                                                    true)); 
     917                                                                                   true, 
     918                                                                                   detectMissingValues, defaultValue)); 
    911919 
    912920         selfReferenceFilter = serverSourceFilter; 
     
    922930         if (!clientSourceFilter) 
    923931         { 
    924            bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    925            double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);  
     932           if (check_if_active.isEmpty()) check_if_active = false; 
    926933           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
    927                                                                                    ignoreMissingValue, defaultValue)); 
     934                                                                                   detectMissingValues, defaultValue)); 
    928935         } 
    929936 
     
    959966         freq_offset.setValue(NoneDu); 
    960967 
    961        const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    962  
     968       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     969        
    963970       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    964971                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
    965972                                                                             freq_op, freq_offset, outFreq, 
    966                                                                              ignoreMissingValue, ignoreMissingValue ? default_value : 0.0)); 
     973                                                                             detectMissingValues, detectMissingValues ? default_value : 0.0)); 
    967974       instantDataFilter->connectOutput(temporalFilter, 0); 
    968975 
     
    9991006       if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 
    10001007 
    1001        const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     1008       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    10021009 
    10031010       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    10041011                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
    10051012                                                                             freq_op, freq_offset, outFreq, 
    1006                                                                              ignoreMissingValue, ignoreMissingValue ? default_value : 0.0)); 
     1013                                                                             detectMissingValues, detectMissingValues ? default_value : 0.0)); 
    10071014       selfReferenceFilter->connectOutput(temporalFilter, 0); 
    10081015       return temporalFilter ; 
  • XIOS/dev/branch_yushan_merged/src/node/field_impl.hpp

    r1007 r1205  
    1919  { 
    2020    if (clientSourceFilter) 
    21       clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 
     21    { 
     22      if (!check_if_active || isActive(true)) 
     23        clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 
     24    } 
    2225    else if (instantDataFilter) 
    2326      ERROR("void CField::setData(const CArray<double, N>& _data)", 
  • XIOS/dev/branch_yushan_merged/src/node/file.cpp

    r1172 r1205  
    1616#include "context_client.hpp" 
    1717#include "mpi.hpp" 
     18#include "timer.hpp" 
    1819 
    1920namespace xios { 
     
    274275      if (mode.isEmpty() || mode.getValue() == mode_attr::write) 
    275276      { 
     277        CTimer::get("Files : create headers").resume(); 
    276278        if (!isOpen) createHeader(); 
     279        CTimer::get("Files : create headers").suspend(); 
    277280        checkSync(); 
    278281      } 
    279282      else 
    280283      { 
     284        CTimer::get("Files : open headers").resume(); 
    281285        if (!isOpen) openInReadMode(); 
     286        CTimer::get("Files : open headers").suspend(); 
    282287      } 
    283288      checkSplit(); 
     
    395400         if (!split_freq.isEmpty()) 
    396401         { 
    397            CDate splitEnd = lastSplit + split_freq - 1 * Second; 
     402           CDate split_start ; 
     403           CDate splitEnd ; 
     404           if (!split_start_offset.isEmpty()) split_start=lastSplit + split_start_offset ; 
     405           else split_start=lastSplit ; 
     406 
     407           splitEnd = lastSplit + split_freq ; 
     408           if (!split_last_date.isEmpty()) 
     409           { 
     410             CDate splitLastDate=CDate::FromString(split_last_date,*CContext::getCurrent()->getCalendar()) ; 
     411             if( splitLastDate < splitEnd)  splitEnd=splitLastDate ; 
     412           } 
     413             
     414           if (!split_end_offset.isEmpty()) splitEnd = splitEnd + split_end_offset; 
     415           else splitEnd = splitEnd - 1 * Second; 
    398416 
    399417           string splitFormat; 
     
    410428 
    411429           oss << firstPart ; 
    412            if (hasStartDate) oss << lastSplit.getStr(splitFormat) ; 
     430           if (hasStartDate) oss << split_start.getStr(splitFormat) ; 
    413431           oss << middlePart ; 
    414432           if (hasEndDate) oss << splitEnd.getStr(splitFormat); 
  • XIOS/dev/branch_yushan_merged/src/node/grid.cpp

    r1134 r1205  
    12531253        std::vector<CAxis*> axisList = getAxis(); 
    12541254        std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize); 
     1255        std::vector<CArray<int,1> > globalZoomIndex(numElement); 
    12551256        for (int i = 0; i < numElement; ++i) 
    12561257        { 
     
    12661267            nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin; 
    12671268            nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo; 
     1269 
     1270            { 
     1271              int count = 0; 
     1272              globalZoomIndex[i].resize(nZoomSize[indexMap[i]]*nZoomSize[indexMap[i]+1]); 
     1273              for (int jdx = 0; jdx < nZoomSize[indexMap[i]+1]; ++jdx) 
     1274                for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)                 
     1275                { 
     1276                  globalZoomIndex[i](count) = (nZoomBegin[indexMap[i]] + idx) + (nZoomBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]]; 
     1277                  ++count; 
     1278                } 
     1279            } 
    12681280            ++domainId; 
    12691281          } 
     
    12721284            nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv; 
    12731285            nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_size_srv; 
    1274             nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin; 
     1286            nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin_srv; 
    12751287            nGlob[indexMap[i]] = axisList[axisId]->n_glo; 
     1288            if (!axisList[axisId]->global_zoom_index.isEmpty()) 
     1289            { 
     1290              globalZoomIndex[i].reference(axisList[axisId]->zoom_index_srv);                 
     1291            } 
     1292            else 
     1293            { 
     1294              globalZoomIndex[i].resize(nZoomSize[indexMap[i]]); 
     1295              for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx) 
     1296                globalZoomIndex[i](idx) = nZoomBegin[indexMap[i]] + idx; 
     1297            } 
     1298             
    12761299            ++axisId; 
    12771300          } 
     
    12821305            nZoomBeginGlobal[indexMap[i]] = 0; 
    12831306            nGlob[indexMap[i]] = 1; 
     1307            globalZoomIndex[i].resize(1); 
     1308            globalZoomIndex[i](0) = 0; 
    12841309            ++scalarId; 
    12851310          } 
     
    12891314          dataSize *= nZoomSize[i]; 
    12901315 
    1291         serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize, 
    1292                                                       nZoomBeginGlobal, nGlob); 
     1316/*        serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize, 
     1317                                                      nZoomBeginGlobal, nGlob);*/ 
     1318        serverDistribution_ = new CDistributionServer(server->intraCommRank,  
     1319                                                      globalZoomIndex, axis_domain_order, 
     1320                                                      nZoomBegin, nZoomSize, nZoomBeginGlobal, nGlob); 
    12931321      } 
    12941322 
  • XIOS/dev/branch_yushan_merged/src/node/zoom_axis.cpp

    r836 r1205  
    4646    axisGlobalSize   = axisDest->n_glo.getValue(); 
    4747 
    48     begin = (this->begin.isEmpty()) ?  0 : this->begin.getValue(); 
    49     n     = (this->n.isEmpty()) ?  axisGlobalSize : this->n.getValue(); 
    50     end   = begin+n-1; 
     48    bool zoomByIndex = !this->index.isEmpty() && (0 != this->index.numElements()); 
     49 
     50    if (zoomByIndex) 
     51    { 
     52      begin = min(this->index); 
     53      end   = max(this->index); 
     54      n     = end - begin + 1; 
     55    } 
     56    else 
     57    { 
     58      begin = (this->begin.isEmpty()) ?  0 : this->begin.getValue(); 
     59      n     = (this->n.isEmpty()) ?  axisGlobalSize : this->n.getValue(); 
     60      end   = begin+n-1; 
     61    } 
    5162 
    5263    if (begin < 0 || begin > axisGlobalSize - 1 || end < 0 || end > axisGlobalSize - 1 
     
    5566            << "One or more attributes among 'begin' (" << begin << "), 'end' (" << end << "), 'n' (" << n << ") " 
    5667            << "of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
     68     
     69    if (zoomByIndex && (!this->begin.isEmpty() || !this->n.isEmpty())) 
     70      ERROR("CZoomAxis::checkValid(CAxis* axisDest)", 
     71            << "Only one type of zoom is accepted. Define zoom by index with global_zoom_index or define zoom with begin and n. " 
     72            << "Axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
    5773 
    5874    this->begin.setValue(begin); 
  • XIOS/dev/branch_yushan_merged/src/server.cpp

    r1196 r1205  
    164164      report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl  ; 
    165165      report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl  ; 
     166      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
    166167    } 
    167168 
  • XIOS/dev/branch_yushan_merged/src/timer.cpp

    r1160 r1205  
    33#include <string> 
    44#include <map> 
    5 #include "tracer.hpp" 
    65#include <iostream> 
    76#include <sstream> 
     7#include "tracer.hpp" 
    88 
    99namespace xios 
     
    6969  } 
    7070 
     71  string CTimer::getAllCumulatedTime(void) 
     72  { 
     73    std::ostringstream strOut ; 
     74    for(std::map<std::string,CTimer>::iterator it=allTimer.begin();it!=allTimer.end();++it) 
     75      strOut<<"Timer : "<<it->first<<"    -->   cumulated time : "<<it->second.getCumulatedTime()<<std::endl ; 
     76    return strOut.str() ; 
     77  } 
    7178} 
  • XIOS/dev/branch_yushan_merged/src/timer.hpp

    r1160 r1205  
    2727      static double getTime(void); 
    2828      static CTimer& get(std::string name); 
     29      static std::string getAllCumulatedTime(void) ; 
    2930  }; 
    3031} 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp

    r1160 r1205  
    3939    int nbLocalIndex = localIndex.size(); 
    4040    int currentlocalIndex = 0; 
    41     double currentWeight  = 0.0; 
    42  
    43     dataOut=std::numeric_limits<double>::quiet_NaN(); 
     41    double currentWeight  = 0.0;     
    4442 
    4543    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     
    5957          weights_(currentlocalIndex) += 1.0; 
    6058        } 
     59      } 
     60      else 
     61      { 
     62        if (flagInitial[currentlocalIndex])  
     63          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    6164      } 
    6265    } 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp

    r1160 r1205  
    3636  { 
    3737    int nbLocalIndex = localIndex.size(); 
    38     int currentlocalIndex = 0; 
    39     dataOut=std::numeric_limits<double>::quiet_NaN();     
     38    int currentlocalIndex = 0;     
    4039    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4140    { 
     
    5251          dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
    5352        } 
     53      } 
     54      else 
     55      { 
     56        if (flagInitial[currentlocalIndex])  
     57          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    5458      } 
    5559    } 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp

    r1160 r1205  
    3636  { 
    3737    int nbLocalIndex = localIndex.size(); 
    38     int currentlocalIndex = 0; 
    39     dataOut=std::numeric_limits<double>::quiet_NaN(); 
     38    int currentlocalIndex = 0;     
    4039    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4140    { 
     
    5251          dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
    5352        } 
     53      } 
     54      else 
     55      { 
     56        if (flagInitial[currentlocalIndex])  
     57          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    5458      } 
    5559    } 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp

    r1160 r1205  
    3636  { 
    3737    int nbLocalIndex = localIndex.size(); 
    38     int currentlocalIndex = 0; 
    39  
    40     dataOut=std::numeric_limits<double>::quiet_NaN(); 
     38    int currentlocalIndex = 0;     
    4139   
    4240    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     
    5452          dataOut(currentlocalIndex) += *(dataInput + idx); 
    5553        } 
     54      } 
     55      else 
     56      { 
     57        if (flagInitial[currentlocalIndex])  
     58          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    5659      } 
    5760    }     
  • XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_interpolate.cpp

    r937 r1205  
    148148      while (it < iteRange) 
    149149      { 
    150         while (((*itsecond -*it) < precision) && itsecond < ite) 
     150        while (itsecond < ite && ((*itsecond -*it) < precision)) 
    151151        { ++itsecond; ++it; } 
    152152        int index = std::distance(itb, it); 
  • XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_zoom.cpp

    r933 r1205  
    5353           << "Zoom size is " << zoomSize_ ); 
    5454  } 
     55 
     56  if (!zoomAxis->index.isEmpty()) 
     57  { 
     58    int sz = zoomAxis->index.numElements(); 
     59    zoomIndex_.resize(sz); 
     60    for (int i = 0; i < sz; ++i) 
     61      zoomIndex_[i] = zoomAxis->index(i); 
     62 
     63    std::sort(zoomIndex_.begin(), zoomIndex_.end()); 
     64  } 
    5565} 
    5666 
     
    6070void CAxisAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    6171{ 
     72  this->transformationMapping_.resize(1); 
     73  this->transformationWeight_.resize(1); 
     74 
     75  TransformationIndexMap& transMap = this->transformationMapping_[0]; 
     76  TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     77 
    6278  StdSize niSource = axisSrc_->n.getValue(); 
    6379  StdSize ibeginSource = axisSrc_->begin.getValue(); 
     
    6985  if (iend < ibegin) ni = 0; 
    7086 
    71   this->transformationMapping_.resize(1); 
    72   this->transformationWeight_.resize(1); 
    73  
    74   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    75   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    76  
    77   for (StdSize idx = 0; idx < ni; ++idx) 
     87  if (!zoomIndex_.empty()) 
    7888  { 
    79     transMap[ibegin+idx].push_back(ibegin+idx); 
    80     transWeight[ibegin+idx].push_back(1.0); 
     89    std::vector<int>::iterator itZoomBegin, itZoomEnd; 
     90    itZoomBegin = std::lower_bound(zoomIndex_.begin(), zoomIndex_.end(), ibeginSource); 
     91    itZoomEnd   = std::upper_bound(zoomIndex_.begin(), zoomIndex_.end(), iendSource);             
     92    for (; itZoomBegin != itZoomEnd; ++itZoomBegin) 
     93    { 
     94      transMap[*itZoomBegin].push_back(*itZoomBegin); 
     95      transWeight[*itZoomBegin].push_back(1.0); 
     96    } 
     97  } 
     98  else 
     99  { 
     100    for (StdSize idx = 0; idx < ni; ++idx) 
     101    { 
     102      transMap[ibegin+idx].push_back(ibegin+idx); 
     103      transWeight[ibegin+idx].push_back(1.0); 
     104    } 
    81105  } 
    82106 
     
    92116  axisDest_->global_zoom_begin = zoomBegin_; 
    93117  axisDest_->global_zoom_n  = zoomSize_; 
     118  if (!zoomIndex_.empty()) 
     119  { 
     120    axisDest_->global_zoom_index.resize(zoomIndex_.size()); 
     121    std::copy(zoomIndex_.begin(), zoomIndex_.end(), axisDest_->global_zoom_index.begin()); 
     122  } 
    94123} 
    95124 
  • XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_zoom.hpp

    r933 r1205  
    4848  StdSize zoomSize_; 
    4949 
     50  std::vector<int> zoomIndex_; 
     51 
    5052private: 
    5153 
  • XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.cpp

    r1155 r1205  
    111111  const int constNVertex = 4; // Value by default number of vertex for rectangular domain 
    112112  int nVertexSrc, nVertexDest; 
    113   nVertexSrc = constNVertex; 
    114   nVertexDest = constNVertex; 
     113  nVertexSrc = nVertexDest = constNVertex; 
    115114 
    116115  // First of all, try to retrieve the boundary values of domain source and domain destination 
     
    389388  } 
    390389 
    391   if (writeToFile_ && !readFromFile_) 
    392      writeRemapInfo(interpMapValue); 
    393   exchangeRemapInfo(interpMapValue); 
     390  if (writeToFile_ && !readFromFile_) writeRemapInfo(interpMapValue); 
     391//  exchangeRemapInfo(interpMapValue); 
     392  convertRemapInfo(interpMapValue) ; 
    394393 
    395394  delete [] globalSrc; 
     
    498497} 
    499498 
     499void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     500{ 
     501  CContext* context = CContext::getCurrent(); 
     502  CContextClient* client=context->client; 
     503  int clientRank = client->clientRank; 
     504 
     505  this->transformationMapping_.resize(1); 
     506  this->transformationWeight_.resize(1); 
     507 
     508  TransformationIndexMap& transMap = this->transformationMapping_[0]; 
     509  TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     510 
     511  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it, 
     512                                                                     ite = interpMapValue.end(); 
     513   
     514  for (it = itb; it != ite; ++it) 
     515  {     
     516    const std::vector<std::pair<int,double> >& tmp = it->second; 
     517    for (int i = 0; i < tmp.size(); ++i) 
     518    { 
     519      transMap[it->first].push_back(tmp[i].first); 
     520      transWeight[it->first].push_back(tmp[i].second); 
     521    }       
     522  }       
     523} 
    500524 
    501525/*! 
  • XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.hpp

    r1134 r1205  
    4747  void writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >&); 
    4848  void exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue); 
     49  void convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue); 
    4950 
    5051private: 
  • XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp

    r1160 r1205  
    4545      { 
    4646        dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
    47       } 
    48     } 
    49  
    50     // for (int idx = 0; idx < nbLocalIndex; ++idx) 
    51     // { 
    52     //   if (!flagInitial[localIndex[idx].first]) 
    53     //     dataOut(localIndex[idx].first) = defaultValue; 
    54     // } 
     47        flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan 
     48      } 
     49    } 
     50 
     51    // If all data source are nan then data destination must be nan 
     52    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     53    { 
     54      if (!flagInitial[localIndex[idx].first]) 
     55        dataOut(localIndex[idx].first) = defaultValue; 
     56    } 
    5557  } 
    5658  else 
Note: See TracChangeset for help on using the changeset viewer.