Ignore:
Timestamp:
12/16/14 17:09:58 (10 years ago)
Author:
rlacroix
Message:

Fix: The conversion of a date to a number of seconds since the time origin was wrong.

Remove the work around in nc4_data_output.cpp which hid this bug.

Also backport this fix in XIOS 1.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/output/nc4_data_output.cpp

    r540 r544  
    961961        if (wtime) 
    962962        { 
    963           time_counter(0)= (Time(*field->last_Write_srv)+Time(*field->lastlast_Write_srv))/2 -Time(context->calendar->getTimeOrigin()); 
     963          time_counter(0)= (Time(*field->last_Write_srv) + Time(*field->lastlast_Write_srv)) / 2; 
    964964          if (field->foperation->timeType() == func::CFunctor::instant) 
    965             time_data(0) = Time(*field->last_Write_srv)-Time(context->calendar->getTimeOrigin()); 
     965            time_data(0) = Time(*field->last_Write_srv); 
    966966          else if (field->foperation->timeType() == func::CFunctor::centered) time_data(0) = time_counter(0); 
    967967 
    968           time_counter_bound(0) = Time(*field->lastlast_Write_srv) - Time(context->calendar->getTimeOrigin()); 
    969           time_counter_bound(1) = Time(*field->last_Write_srv) - Time(context->calendar->getTimeOrigin()); 
     968          time_counter_bound(0) = Time(*field->lastlast_Write_srv); 
     969          time_counter_bound(1) = Time(*field->last_Write_srv); 
    970970          if (field->foperation->timeType() == func::CFunctor::instant) 
    971             time_data_bound(0) = time_data_bound(1) = Time(*field->last_Write_srv)-Time(context->calendar->getTimeOrigin()); 
     971            time_data_bound(0) = time_data_bound(1) = Time(*field->last_Write_srv); 
    972972          else if (field->foperation->timeType() == func::CFunctor::centered) 
    973973          { 
Note: See TracChangeset for help on using the changeset viewer.