Ignore:
Timestamp:
05/24/11 17:47:01 (13 years ago)
Author:
hozdoba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp

    r201 r202  
    55 
    66#include "file.hpp" 
     7#include "calendar.hpp" 
    78 
    89namespace xmlioserver 
     
    231232                         ( field->operation.getValue().compare("once") == 0)); 
    232233                          
    233          if (wtime) dims.push_back(timeid); 
     234         if (wtime) 
     235         { 
     236            StdOStringStream oss; 
     237            oss << "time_" << field->operation.getValue() 
     238                << "_" << field->getRelFile()->output_freq.getValue(); 
     239 
     240            coodinates.push_back(oss.str()); 
     241            dims.push_back(timeid); 
     242         } 
    234243 
    235244         if (!grid->axis_ref.isEmpty()) 
     
    385394 
    386395      //--------------------------------------------------------------- 
     396 
     397      void CNc4DataOutput::writeTimeAxis_ 
     398                  (const boost::shared_ptr<tree::CField>    field, 
     399                   const boost::shared_ptr<date::CCalendar> cal) 
     400      { 
     401         StdOStringStream oss; 
     402         oss << "time_" << field->operation.getValue() 
     403             << "_" << field->getRelFile()->output_freq.getValue(); 
     404 
     405         std::vector<StdString> dims; 
     406         StdString axisid = oss.str(); 
     407         StdString timeid = StdString("time_counter"); 
     408 
     409         dims.push_back(timeid); 
     410         if (!SuperClassWriter::varExist(axisid)) 
     411         { 
     412            SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims); 
     413            this->writeTimeAxisAttributes(axisid, 
     414                                         cal->getId(), 
     415                                         "lol", 
     416                                         "lol"); 
     417         } 
     418 
     419      } 
     420 
     421      //--------------------------------------------------------------- 
     422       
     423      void CNc4DataOutput::writeTimeAxisAttributes(const StdString & axis_name, 
     424                                                   const StdString & calendar, 
     425                                                   const StdString & units, 
     426                                                   const StdString & time_origin, 
     427                                                   const StdString & standard_name, 
     428                                                   const StdString & long_name, 
     429                                                   const StdString & title) 
     430      { 
     431         SuperClassWriter::addAttribute("standard_name", standard_name, &axis_name); 
     432         SuperClassWriter::addAttribute("long_name",     long_name    , &axis_name); 
     433         SuperClassWriter::addAttribute("title",         title        , &axis_name); 
     434         SuperClassWriter::addAttribute("calendar",      calendar     , &axis_name); 
     435         SuperClassWriter::addAttribute("units",         units        , &axis_name); 
     436         SuperClassWriter::addAttribute("time_origin",   time_origin  , &axis_name); 
     437      } 
     438       
     439      //--------------------------------------------------------------- 
     440 
    387441      void CNc4DataOutput::writeAxisAttributes(const StdString & axis_name, 
    388442                                               const StdString & axis, 
Note: See TracChangeset for help on using the changeset viewer.