Changeset 1292 for XIOS


Ignore:
Timestamp:
10/04/17 23:16:30 (7 years ago)
Author:
ymipsl
Message:

Fix problems when checking field temporal attributes.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1280 r1292  
    11451145 
    11461146       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    1147         
     1147       checkAttributes() ;    
    11481148       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    11491149                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    11831183 
    11841184       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    1185  
     1185       checkAttributes() ;    
    11861186       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    11871187                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    15651565     if (freq_op.isEmpty()) 
    15661566     { 
     1567/* 
    15671568       if (!freq_offset.isEmpty()) 
    15681569         ERROR("CField::checkAttributes(void)", 
    15691570               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    15701571               << "Attribute freq_offset cannot be defined if attribute freq_op is not defined. " 
    1571                << "Please define freq_op.") 
     1572               << "Please define freq_op.") */ 
     1573       if (operation.getValue()=="instant") 
     1574       { 
     1575         freq_op.setValue(file->output_freq.getValue()); 
     1576         if (freq_offset.isEmpty()) freq_offset.setValue(file->output_freq.getValue()-TimeStep); 
     1577       } 
    15721578       else 
    15731579       { 
    1574          if (operation.getValue()=="instant") 
    1575          { 
    1576            freq_op.setValue(file->output_freq.getValue()); 
    1577            freq_offset.setValue(file->output_freq.getValue()-TimeStep); 
    1578          } 
    1579          else 
    1580          { 
    1581            freq_op.setValue(TimeStep); 
    1582            freq_offset.setValue(freq_op.getValue()-TimeStep); 
    1583          } 
     1580         freq_op.setValue(TimeStep); 
     1581         if (freq_offset.isEmpty()) freq_offset.setValue(freq_op.getValue()-TimeStep); 
    15841582       } 
    15851583     } 
Note: See TracChangeset for help on using the changeset viewer.