Changeset 1930 for XIOS/dev/dev_ym/XIOS_COUPLING/src/filter
- Timestamp:
- 09/10/20 13:51:02 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/filter
- Files:
-
- 12 added
- 4 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/data_packet.hpp
r1542 r1930 32 32 * \return a deep copy of the packet 33 33 */ 34 CDataPacket* copy() const { 34 CDataPacket* copy() const 35 { 35 36 CDataPacket* p = new CDataPacket; 36 37 p->data.resize(data.shape()); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/source_filter.cpp
r1918 r1930 40 40 packet->data = defaultValue; 41 41 grid->uncompressField(data, packet->data); 42 43 // Convert missing values to NaN 44 if (hasMissingValue) // probably to removed later 45 { 46 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 47 const size_t nbData = packet->data.numElements(); 48 for (size_t idx = 0; idx < nbData; ++idx) 49 { 50 if (defaultValue == packet->data(idx)) 51 packet->data(idx) = nanValue; 52 } 53 } 42 54 } 43 55 else 44 56 { 45 if (mask) grid->maskField(data, packet->data); 46 else grid->inputField(data, packet->data); 47 } 48 // Convert missing values to NaN 49 if (hasMissingValue) 50 { 51 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 52 const size_t nbData = packet->data.numElements(); 53 for (size_t idx = 0; idx < nbData; ++idx) 57 if (mask) grid->maskField(data, packet->data); // => ie coming from model 58 //else grid->inputField(data, packet->data); 59 else 54 60 { 55 if (defaultValue == packet->data(idx)) 56 packet->data(idx) = nanValue; 61 packet->data.resize(data.numElements()) ; // temporary solution, create own source filter for data coming from client 62 CArray<double,1> tmp( (double*)data.dataFirst(),shape(data.numElements()),duplicateData) ; 63 packet->data.reference(tmp) ; // nothing to do if coming from client to server => workflow view 57 64 } 58 65 }
Note: See TracChangeset
for help on using the changeset viewer.