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

File:
1 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  
Note: See TracChangeset for help on using the changeset viewer.