Ignore:
Timestamp:
03/22/18 10:43:20 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with XIOS_DEV_CMIP6@1459

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/filter/source_filter.cpp

    r1328 r1460  
    77namespace xios 
    88{ 
    9   CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
     9  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, bool compression,  
    1010                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 
    1111                               bool hasMissingValue /*= false*/, 
     
    1313    : COutputPin(gc, manualTrigger) 
    1414    , grid(grid) 
     15    , compression(compression) 
    1516    , offset(offset) 
    1617    , hasMissingValue(hasMissingValue), defaultValue(defaultValue) 
     
    3132    packet->status = CDataPacket::NO_ERROR; 
    3233 
    33     packet->data.resize(grid->storeIndex_client.numElements()); 
    34     grid->inputField(data, packet->data); 
     34    packet->data.resize(grid->storeIndex_client.numElements());     
     35     
     36    if (compression) 
     37    { 
     38      packet->data = defaultValue; 
     39      grid->uncompressField(data, packet->data);     
     40    } 
     41    else 
     42      grid->inputField(data, packet->data); 
    3543 
     44     
     45     
     46    // if (compression) grid->inputField(data, packet->data) ; 
     47    // else 
     48    // { 
     49    //   // just make a flat copy 
     50    //   CArray<double, N> data_tmp(data.copy()) ; // supress const attribute 
     51    //   CArray<double,1> dataTmp2(data_tmp.dataFirst(),shape(data.numElements()),neverDeleteData) ; 
     52    //   packet->data = dataTmp2 ; 
     53    // } 
    3654    // Convert missing values to NaN 
    3755    if (hasMissingValue) 
     
    6583    packet->timestamp = date; 
    6684    packet->status = CDataPacket::NO_ERROR; 
    67  
    68     // if (data.size() != grid->storeIndex_toSrv.size()) 
     85     
    6986    if (data.size() != grid->storeIndex_fromSrv.size()) 
    7087      ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)", 
     
    7592    std::map<int, CArray<double, 1> >::const_iterator it, itEnd = data.end(); 
    7693    for (it = data.begin(); it != itEnd; it++) 
    77     { 
    78       // CArray<int,1>& index = grid->storeIndex_toSrv[it->first]; 
     94    {       
    7995      CArray<int,1>& index = grid->storeIndex_fromSrv[it->first]; 
    8096      for (int n = 0; n < index.numElements(); n++) 
Note: See TracChangeset for help on using the changeset viewer.