Changeset 334 for XIOS/trunk/src/node


Ignore:
Timestamp:
03/27/12 10:49:42 (12 years ago)
Author:
ymipsl
Message:
  • Add new attribut : time_origin for time axis origin which appear in nectdf file
  • centered time averaging for time axis
  • correct bug in calendar due to call of virtual function in the constructor

YM

Location:
XIOS/trunk/src/node
Files:
3 edited

Legend:

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

    r321 r334  
    8787               << "Impossible de définir un calendrier (un attribut est manquant)."); 
    8888 
    89 #define DECLARE_CALENDAR(MType  , mtype)                            \ 
    90    if (calendar_type.getValue().compare(#mtype) == 0)               \ 
    91    {                                                                \ 
    92       this->calendar =  boost::shared_ptr<date::CCalendar>          \ 
    93          (new date::C##MType##Calendar(start_date.getValue()));     \ 
    94       if (!this->timestep.isEmpty())                                \ 
    95        this->calendar->setTimeStep                                  \ 
    96           (date::CDuration::FromString(this->timestep.getValue())); \ 
    97       return;                                                       \ 
     89#define DECLARE_CALENDAR(MType  , mtype)                              \ 
     90   if (calendar_type.getValue().compare(#mtype) == 0)                 \ 
     91   {                                                                  \ 
     92      if (time_origin.isEmpty())                                       \ 
     93        this->calendar =  boost::shared_ptr<date::CCalendar>          \ 
     94           (new date::C##MType##Calendar(start_date.getValue()));     \ 
     95      else this->calendar =  boost::shared_ptr<date::CCalendar>       \ 
     96           (new date::C##MType##Calendar(start_date.getValue(),time_origin.getValue()));     \ 
     97      if (!this->timestep.isEmpty())                                  \ 
     98       this->calendar->setTimeStep                                    \ 
     99          (date::CDuration::FromString(this->timestep.getValue()));   \ 
     100      return;                                                         \ 
    98101   } 
    99102#include "calendar_type.conf" 
     
    535538   void CContext::updateCalendar(int step) 
    536539   { 
     540      info(50)<<"updateCalendar : before : "<<calendar->getCurrentDate()<<endl ; 
    537541      calendar->update(step) ; 
     542      info(50)<<"updateCalendar : after : "<<calendar->getCurrentDate()<<endl ; 
    538543   } 
    539544  
  • XIOS/trunk/src/node/field.cpp

    r321 r334  
    178178      *last_Write_srv = writeDate; 
    179179      writeField() ; 
     180      *lastlast_Write_srv=*last_Write_srv; 
    180181    } 
    181182  } 
     
    384385         this->freq_write_srv     = 
    385386             CDuration::FromString(this->file->output_freq.getValue()); 
     387         this->lastlast_Write_srv     = boost::shared_ptr<xmlioserver::date::CDate> 
     388                        (new date::CDate(context->getCalendar()->getInitDate())); 
    386389         this->last_Write_srv     = boost::shared_ptr<xmlioserver::date::CDate> 
    387390                        (new date::CDate(context->getCalendar()->getInitDate())); 
  • XIOS/trunk/src/node/field.hpp

    r327 r334  
    141141         StdSize nstep; 
    142142         boost::shared_ptr<date::CDate>    last_Write, last_operation; 
    143          boost::shared_ptr<date::CDate>    last_Write_srv, last_operation_srv; 
     143         boost::shared_ptr<date::CDate>    lastlast_Write_srv,last_Write_srv, last_operation_srv; 
    144144          
    145145         boost::shared_ptr<func::CFunctor> foperation; 
Note: See TracChangeset for help on using the changeset viewer.