Ignore:
Timestamp:
08/25/15 16:52:45 (9 years ago)
Author:
rlacroix
Message:

Add support for indexed output.

If the new field attribute "indexed_output" is set to true and a mask is defined (either at grid, domain or axis level), the indexed data will be outputed instead of the full data with missing values.

See http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html#compression-by-gathering for more information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r651 r676  
    3535      , hasOutputFile(false) 
    3636      , domAxisIds_("", ""), areAllReferenceSolved(false) 
     37      , useCompressedOutput(false) 
    3738      , isReadDataRequestPending(false) 
    3839   { setVirtualVariableGroup(); } 
     
    4546      , hasOutputFile(false) 
    4647      , domAxisIds_("", ""), areAllReferenceSolved(false) 
     48      , useCompressedOutput(false) 
    4749      , isReadDataRequestPending(false) 
    4850   { setVirtualVariableGroup(); } 
     
    455457   { 
    456458      return !this->refObject.empty(); 
     459   } 
     460 
     461   //---------------------------------------------------------------- 
     462 
     463   bool CField::getUseCompressedOutput() const 
     464   { 
     465     return useCompressedOutput; 
     466   } 
     467 
     468   void CField::setUseCompressedOutput() 
     469   { 
     470     useCompressedOutput = true; 
    457471   } 
    458472 
     
    814828      for(it=data_srv.begin();it!=data_srv.end();it++) 
    815829      { 
    816          grid->outputField(it->first, it->second, fieldOut.dataFirst()) ; 
     830         grid->outputField(it->first, it->second, fieldOut.dataFirst()); 
    817831      } 
    818832   } 
     
    824838      for (it = data_srv.begin(); it != data_srv.end(); it++) 
    825839      { 
    826          grid->outputField(it->first, it->second, fieldOut.dataFirst()) ; 
     840         grid->outputField(it->first, it->second, fieldOut.dataFirst()); 
    827841      } 
    828842   } 
     
    852866      { 
    853867         grid->inputField(it->first, fieldOut.dataFirst(), it->second); 
     868      } 
     869   } 
     870 
     871   void CField::outputCompressedField(CArray<double,1>& fieldOut) 
     872   { 
     873      map<int, CArray<double,1> >::iterator it; 
     874 
     875      for (it = data_srv.begin(); it != data_srv.end(); it++) 
     876      { 
     877         grid->outputCompressedField(it->first, it->second, fieldOut.dataFirst()); 
    854878      } 
    855879   } 
Note: See TracChangeset for help on using the changeset viewer.