Changeset 1020


Ignore:
Timestamp:
01/10/17 13:53:06 (5 years ago)
Author:
mhnguyen
Message:

Adding new predefined variable: $missing_value
which is equal to NaN

Test
+) On Curie
+) Work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/parse_expr/scalar_expr_node.cpp

    r642 r1020  
    2323  double CScalarVarExprNode::reduce() const 
    2424  { 
    25     if (!CVariable::has(varId))  
    26       ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 
     25    // $missing_value will be replaced with NaN 
     26    if (varId == "missing_value") 
     27    { 
     28      return std::numeric_limits<double>::quiet_NaN(); 
     29    } 
     30    else 
     31    { 
     32      if (!CVariable::has(varId))  
     33        ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 
    2734 
    28     return CVariable::get(varId)->getData<double>(); 
     35      return CVariable::get(varId)->getData<double>(); 
     36    } 
    2937  } 
    3038 
Note: See TracChangeset for help on using the changeset viewer.