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/data_output.cpp

    r540 r676  
    1414      //---------------------------------------------------------------- 
    1515 
    16       void CDataOutput::writeGrid(CGrid* grid) 
     16      void CDataOutput::writeGrid(CGrid* grid, bool allowCompressedOutput /*= false*/) 
    1717      { 
    18 //         if (grid->domain_ref.isEmpty()) 
    19 //            ERROR("CDataOutput::writeGrid(grid)", 
    20 //                   << " domain is not defined !"); 
    21 // 
    22 //         if (grid->axis_ref.isEmpty()) 
    23 //         { 
    24 //            this->writeGrid(CDomain::get(grid->domain_ref.getValue())); 
    25 //         } 
    26 //         else 
    27 //         { 
    28 //            this->writeGrid(CDomain::get(grid->domain_ref.getValue()), 
    29 //                            CAxis::get(grid->axis_ref.getValue())); 
    30 //         } 
    31 //        this->writeGrid(grid->domain, grid->axis); 
    3218        this->writeGrid(grid->getDomains(), grid->getAxis()); 
     19 
     20        if (allowCompressedOutput) 
     21          writeGridCompressed_(grid); 
    3322      } 
    3423 
     
    5746      //---------------------------------------------------------------- 
    5847 
    59       void CDataOutput::writeGrid(CDomain* domain,CAxis* axis) 
     48      void CDataOutput::writeGrid(CDomain* domain, CAxis* axis) 
    6049      { 
    6150         this->writeDomain_(domain); 
     
    9887      void CDataOutput::writeFieldGrid(CField* field) 
    9988      { 
    100          this->writeGrid(field->getRelGrid()); 
     89         this->writeGrid(field->getRelGrid(), 
     90                         !field->indexed_output.isEmpty() && field->indexed_output); 
    10191      } 
    10292 
Note: See TracChangeset for help on using the changeset viewer.