Changeset 1460 for XIOS/dev/branch_openmp/src/filter/source_filter.cpp
- Timestamp:
- 03/22/18 10:43:20 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/filter/source_filter.cpp
r1328 r1460 7 7 namespace xios 8 8 { 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, bool compression, 10 10 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 11 11 bool hasMissingValue /*= false*/, … … 13 13 : COutputPin(gc, manualTrigger) 14 14 , grid(grid) 15 , compression(compression) 15 16 , offset(offset) 16 17 , hasMissingValue(hasMissingValue), defaultValue(defaultValue) … … 31 32 packet->status = CDataPacket::NO_ERROR; 32 33 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); 35 43 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 // } 36 54 // Convert missing values to NaN 37 55 if (hasMissingValue) … … 65 83 packet->timestamp = date; 66 84 packet->status = CDataPacket::NO_ERROR; 67 68 // if (data.size() != grid->storeIndex_toSrv.size()) 85 69 86 if (data.size() != grid->storeIndex_fromSrv.size()) 70 87 ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)", … … 75 92 std::map<int, CArray<double, 1> >::const_iterator it, itEnd = data.end(); 76 93 for (it = data.begin(); it != itEnd; it++) 77 { 78 // CArray<int,1>& index = grid->storeIndex_toSrv[it->first]; 94 { 79 95 CArray<int,1>& index = grid->storeIndex_fromSrv[it->first]; 80 96 for (int n = 0; n < index.numElements(); n++)
Note: See TracChangeset
for help on using the changeset viewer.