Changeset 534


Ignore:
Timestamp:
12/11/14 11:24:54 (9 years ago)
Author:
rlacroix
Message:

Add an error message when the timestep was not configured by the user.

Previously no error message was displayed but the output file(s) was not written.

Also improve the error message when the calendar type or the start date is missing.

File:
1 edited

Legend:

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

    r532 r534  
    8282   { 
    8383      if (this->calendar.get() != NULL) return; 
    84       if (calendar_type.isEmpty() || start_date.isEmpty()) 
     84      if (calendar_type.isEmpty()) 
    8585         ERROR(" CContext::solveCalendar(void)", 
    8686               << "[ context id = " << this->getId() << " ] " 
    87                << "Impossible to define a calendar (an attribute is missing)."); 
     87               << "Impossible to define a calendar: the calendar type is missing."); 
     88      if (start_date.isEmpty()) 
     89         ERROR(" CContext::solveCalendar(void)", 
     90               << "[ context id = " << this->getId() << " ] " 
     91               << "Impossible to define a calendar: the start date is missing."); 
     92      if (timestep.isEmpty()) 
     93         ERROR(" CContext::solveCalendar(void)", 
     94               << "[ context id = " << this->getId() << " ] " 
     95               << "Impossible to define a calendar: the timestep is missing."); 
    8896 
    8997#define DECLARE_CALENDAR(MType, eType)                                             \ 
     
    103111            "time_origin: Bad format or date not conform to the calendar");        \ 
    104112                                                                                   \ 
    105     if (!this->timestep.isEmpty())                                                 \ 
    106       this->calendar->setTimeStep                                                  \ 
     113    this->calendar->setTimeStep                                                    \ 
    107114          (CDuration::FromString(this->timestep.getValue()));                      \ 
    108115    return;                                                                        \ 
Note: See TracChangeset for help on using the changeset viewer.