Ignore:
Timestamp:
09/10/20 13:51:02 (4 years ago)
Author:
ymipsl
Message:

Big update on on going work related to data distribution and transfer between clients and servers.
Revisite of the source and store filter using "connectors".

YM

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  
    3232     * \return a deep copy of the packet 
    3333     */ 
    34     CDataPacket* copy() const { 
     34    CDataPacket* copy() const  
     35    { 
    3536      CDataPacket* p = new CDataPacket; 
    3637      p->data.resize(data.shape()); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/source_filter.cpp

    r1918 r1930  
    4040      packet->data = defaultValue; 
    4141      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      } 
    4254    } 
    4355    else 
    4456    { 
    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  
    5460      { 
    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 
    5764      } 
    5865    } 
Note: See TracChangeset for help on using the changeset viewer.