Ignore:
Timestamp:
01/10/17 14:36:29 (7 years ago)
Author:
oabramkina
Message:

Intermeadiate version for merging with new server functionalities.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/io/nc4_data_output.cpp

    r973 r1021  
    16751675           for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ; 
    16761676 
     1677           bool alreadyAddCellMethod = false; 
     1678           StdString cellMethodsPrefix(""), cellMethodsSuffix(""); 
     1679           if (!field->cell_methods.isEmpty()) 
     1680           { 
     1681             StdString cellMethodString = field->cell_methods; 
     1682             if (field->cell_methods_mode.isEmpty() || 
     1683                 (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode)) 
     1684             { 
     1685               SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid); 
     1686               alreadyAddCellMethod = true; 
     1687             } 
     1688             else 
     1689             { 
     1690               switch (field->cell_methods_mode) 
     1691               { 
     1692               case (CField::cell_methods_mode_attr::prefix): 
     1693                 cellMethodsPrefix = cellMethodString; 
     1694                 cellMethodsPrefix += " "; 
     1695                 break; 
     1696               case (CField::cell_methods_mode_attr::suffix): 
     1697                 cellMethodsSuffix = " "; 
     1698                 cellMethodsSuffix += cellMethodString; 
     1699                 break; 
     1700               case (CField::cell_methods_mode_attr::none): 
     1701                 break; 
     1702               default: 
     1703                 break; 
     1704               } 
     1705             } 
     1706           } 
     1707 
    16771708 
    16781709           if (wtime) 
     
    16871718              SuperClassWriter::addAttribute("interval_write", freqOut.toStringUDUnits(), &fieldid); 
    16881719 
    1689               StdString cellMethods = "time: "; 
     1720              StdString cellMethods(cellMethodsPrefix + "time: "); 
    16901721              if (field->operation.getValue() == "instant") cellMethods += "point"; 
    16911722              else if (field->operation.getValue() == "average") cellMethods += "mean"; 
     
    16941725              if (freqOp.resolve(*context->calendar) != freqOut.resolve(*context->calendar)) 
    16951726                cellMethods += " (interval: " + freqOpStr + ")"; 
    1696               SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid); 
     1727              cellMethods += cellMethodsSuffix; 
     1728              if (!alreadyAddCellMethod) 
     1729                SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid); 
    16971730           } 
    16981731 
     
    19281961        if (!field->wasWritten()) 
    19291962        { 
    1930           if (appendMode && field->file->record_offset.isEmpty()) 
     1963          if (appendMode && field->file->record_offset.isEmpty() && 
     1964               field->getOperationTimeType() != func::CFunctor::once) 
    19311965          { 
    19321966            field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1); 
Note: See TracChangeset for help on using the changeset viewer.