Changeset 1307 for XIOS/trunk


Ignore:
Timestamp:
10/13/17 17:45:39 (7 years ago)
Author:
oabramkina
Message:

Backporting r1306 and r1292 to trunk: changes concerned default values of freq_op and freq_offset.

File:
1 edited

Legend:

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

    r1286 r1307  
    954954               << "An operation must be defined for field \"" << getId() << "\"."); 
    955955 
    956        if (freq_op.isEmpty()) 
    957          freq_op.setValue(TimeStep); 
    958        if (freq_offset.isEmpty()) 
    959          freq_offset.setValue(NoneDu); 
    960  
    961956       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    962         
     957       checkAttributes() ; 
    963958       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    964959                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    996991               << "An operation must be defined for field \"" << getId() << "\"."); 
    997992 
    998        if (freq_op.isEmpty()) freq_op.setValue(TimeStep); 
    999        if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 
    1000  
    1001993       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    1002  
     994       checkAttributes(); 
    1003995       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    1004996                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    14521444     if (freq_op.isEmpty()) 
    14531445     { 
    1454        if (!freq_offset.isEmpty()) 
    1455          ERROR("CField::checkAttributes(void)", 
    1456                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    1457                << "Attribute freq_offset cannot be defined if attribute freq_op is not defined. " 
    1458                << "Please define freq_op.") 
     1446       if (operation.getValue()=="instant") 
     1447         freq_op.setValue(file->output_freq.getValue()); 
    14591448       else 
    1460        { 
    1461          if (operation.getValue()=="instant") 
    1462          { 
    1463            freq_op.setValue(file->output_freq.getValue()); 
    1464            freq_offset.setValue(file->output_freq.getValue()-TimeStep); 
    1465          } 
    1466          else 
    1467          { 
    1468            freq_op.setValue(TimeStep); 
    1469            freq_offset.setValue(freq_op.getValue()-TimeStep); 
    1470          } 
    1471        } 
    1472      } 
    1473      else 
    1474      { 
    1475        if (freq_offset.isEmpty()) 
    1476          freq_offset.setValue(freq_op.getValue()-TimeStep); 
    1477      } 
     1449         freq_op.setValue(TimeStep); 
     1450     } 
     1451     if (freq_offset.isEmpty()) 
     1452       freq_offset.setValue(freq_op.getValue()-TimeStep); 
    14781453   } 
    14791454 
Note: See TracChangeset for help on using the changeset viewer.