Index: XIOS/dev/dev_olga/src/parse_expr/operator_expr.hpp
===================================================================
--- XIOS/dev/dev_olga/src/parse_expr/operator_expr.hpp	(revision 983)
+++ XIOS/dev/dev_olga/src/parse_expr/operator_expr.hpp	(revision 1158)
@@ -17,9 +17,17 @@
     typedef double (*functionScalar)(double);
     typedef double (*functionScalarScalar)(double, double);
+    typedef double (*functionScalarScalarScalar)(double, double,double);
     typedef CArray<double,1> (*functionField)(const CArray<double,1>&);
     typedef CArray<double,1> (*functionFieldField)(const CArray<double,1>&, const CArray<double,1>&);
     typedef CArray<double,1> (*functionFieldScalar)(const CArray<double,1>&, double);
     typedef CArray<double,1> (*functionScalarField)(double, const CArray<double,1>&);
-
+    typedef CArray<double,1> (*functionScalarScalarField)(double, double, const CArray<double,1>&);
+    typedef CArray<double,1> (*functionScalarFieldScalar)(double, const CArray<double,1>&, double);
+    typedef CArray<double,1> (*functionScalarFieldField)(double, const CArray<double,1>&, const CArray<double,1>&);
+    typedef CArray<double,1> (*functionFieldScalarScalar)(const CArray<double,1>&, double, double);
+    typedef CArray<double,1> (*functionFieldScalarField)(const CArray<double,1>&, double, const CArray<double,1>&);
+    typedef CArray<double,1> (*functionFieldFieldScalar)(const CArray<double,1>&,  const CArray<double,1>&, double);
+    typedef CArray<double,1> (*functionFieldFieldField)(const CArray<double,1>&,  const CArray<double,1>&, const CArray<double,1>&);
+    
     COperatorExpr(void)
     {
@@ -43,5 +51,7 @@
       opScalarScalar[string("le")] = le_ss;
       opScalarScalar[string("ge")] = ge_ss;
-
+      opScalarScalar[string("ne")] = ne_ss;
+      opScalarScalarScalar[string("cond")] = cond_sss;
+      
       opField[string("neg")] = neg_f;
       opField[string("cos")] = cos_f;
@@ -63,4 +73,5 @@
       opFieldField[string("le")] = le_ff;
       opFieldField[string("ge")] = ge_ff;
+      opFieldField[string("ne")] = ne_ff;
 
       opFieldScalar[string("add")] = add_fs;
@@ -74,4 +85,5 @@
       opFieldScalar[string("le")] = le_fs;
       opFieldScalar[string("ge")] = ge_fs;
+      opFieldScalar[string("ne")] = ne_fs;
 
       opScalarField[string("add")] = add_sf;
@@ -84,4 +96,15 @@
       opScalarField[string("le")] = le_sf;
       opScalarField[string("ge")] = ge_sf;
+      opScalarField[string("ne")] = ne_sf;
+
+      opScalarScalarField[string("cond")] = cond_ssf;
+      opScalarFieldScalar[string("cond")] = cond_sfs;
+      opScalarFieldField[string("cond")] = cond_sff;
+      opFieldScalarScalar[string("cond")] = cond_fss;
+      opFieldScalarField[string("cond")] = cond_fsf;
+      opFieldFieldScalar[string("cond")] = cond_ffs;
+      opFieldFieldField[string("cond")] = cond_fff;
+
+
     }
 
@@ -102,4 +125,12 @@
     }
 
+    functionScalarScalarScalar getOpScalarScalarScalar(const string& id)
+    {
+      map<string,double (*)(double,double,double)>::iterator it;
+      it = opScalarScalarScalar.find(id);
+      if (it == opScalarScalarScalar.end()) ERROR("functionScalarScalarScalar getOpScalarScalarScalar(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
     functionField getOpField(const string& id)
     {
@@ -134,10 +165,77 @@
     }
 
+    functionScalarScalarField getOpScalarScalarField(const string& id)
+    {
+      map<string,functionScalarScalarField>::iterator it;
+      it = opScalarScalarField.find(id);
+      if (it == opScalarScalarField.end()) ERROR("functionScalarScalarField getOpScalarScalarField(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
+    functionScalarFieldScalar getOpScalarFieldScalar(const string& id)
+    {
+      map<string,functionScalarFieldScalar>::iterator it;
+      it = opScalarFieldScalar.find(id);
+      if (it == opScalarFieldScalar.end()) ERROR("functionScalarFieldScalar getOpScalarScalarField(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
+    functionScalarFieldField getOpScalarFieldField(const string& id)
+    {
+      map<string,functionScalarFieldField>::iterator it;
+      it = opScalarFieldField.find(id);
+      if (it == opScalarFieldField.end()) ERROR("functionScalarFieldField getOpScalarFieldField(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
+    functionFieldScalarScalar getOpFieldScalarScalar(const string& id)
+    {
+      map<string,functionFieldScalarScalar>::iterator it;
+      it = opFieldScalarScalar.find(id);
+      if (it == opFieldScalarScalar.end()) ERROR("functionFieldScalarScalar getOpFieldScalarScalar(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
+    functionFieldScalarField getOpFieldScalarField(const string& id)
+    {
+      map<string,functionFieldScalarField>::iterator it;
+      it = opFieldScalarField.find(id);
+      if (it == opFieldScalarField.end()) ERROR("functionFieldScalarField getOpFieldScalarField(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
+    functionFieldFieldScalar getOpFieldFieldScalar(const string& id)
+    {
+      map<string,functionFieldFieldScalar>::iterator it;
+      it = opFieldFieldScalar.find(id);
+      if (it == opFieldFieldScalar.end()) ERROR("functionFieldFieldScalar getOpFieldFieldScalar(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+
+    functionFieldFieldField getOpFieldFieldField(const string& id)
+    {
+      map<string,functionFieldFieldField>::iterator it;
+      it = opFieldFieldField.find(id);
+      if (it == opFieldFieldField.end()) ERROR("functionFieldFieldField getOpFieldFieldField(const string& id)", << "unknown operator : " << id)
+      return it->second;
+    }
+    
+    
     map<string,functionScalar> opScalar;
     map<string,functionScalarScalar> opScalarScalar;
+    map<string,functionScalarScalarScalar> opScalarScalarScalar;
     map<string,functionField> opField;
     map<string,functionFieldField> opFieldField;
     map<string,functionFieldScalar> opFieldScalar;
     map<string,functionScalarField> opScalarField;
+    map<string,functionScalarScalarField> opScalarScalarField;
+    map<string,functionScalarFieldScalar> opScalarFieldScalar;
+    map<string,functionScalarFieldField> opScalarFieldField;
+    map<string,functionFieldScalarScalar> opFieldScalarScalar;
+    map<string,functionFieldScalarField> opFieldScalarField;
+    map<string,functionFieldFieldScalar> opFieldFieldScalar;
+    map<string,functionFieldFieldField> opFieldFieldField;
+
+
 
     static inline double neg_s(double x)   { return -x; }
@@ -160,4 +258,5 @@
     static inline double le_ss(double x, double y)    { return x <= y; }
     static inline double ge_ss(double x, double y)    { return x >= y; }
+    static inline double ne_ss(double x, double y)    { return x != y; }
 
     static inline CArray<double,1> neg_f(const CArray<double,1>& x)   { return Array<double,1>(-x); }
@@ -180,4 +279,5 @@
     static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); }
+    static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x != y); }
 
     static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(x + y); }
@@ -191,4 +291,5 @@
     static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x >= y); }
+    static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x != y); }
 
     static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x + y); }
@@ -201,4 +302,70 @@
     static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); }
+    static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x != y); }
+
+
+    static inline double cond_sss(double x, double y, double z)   { return (x==0) ? z : y ; }
+
+    static inline CArray<double,1> cond_ssf(double x, double y, const CArray<double,1>& z)
+    {
+      CArray<double,1> ret(z.numElements()) ;
+      if (x==0) ret=z ;
+      else ret=y ;
+      return ret ;
+    }
+
+    static inline CArray<double,1> cond_sfs(double x, const CArray<double,1>& y, double z)
+    {
+      CArray<double,1> ret(y.numElements()) ;
+     if (x==0) ret=z ;
+      else ret=y ;
+      return ret ;
+    }
+
+    static inline CArray<double,1> cond_sff(double x, const CArray<double,1>& y, const CArray<double,1>& z)
+    {
+      CArray<double,1> ret(y.numElements()) ;
+      if (x==0) ret=z ;
+      else ret=y ;
+      return ret ;
+    }
+    
+    static inline CArray<double,1> cond_fss(const CArray<double,1>& x, double y, double z)
+    {
+      CArray<double,1> ret(x.numElements()) ;
+      Array<double,1>::const_iterator itx=x.begin(),itxe=x.end();
+      Array<double,1>::iterator itret=ret.begin() ;
+      
+      for(;itx!=itxe;++itx,++itret) *itret=( (*itx==0)?z:y) ;
+      return ret ;
+    }
+
+    static inline CArray<double,1> cond_fsf(const CArray<double,1>& x, double y, const CArray<double,1>& z)
+    {
+      CArray<double,1> ret(x.numElements()) ;
+      Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), itz=z.begin();
+      Array<double,1>::iterator itret=ret.begin() ;
+      for(;itx!=itxe;++itx,++itz,++itret) *itret=( (*itx==0)?*itz:y) ;
+      return ret ;
+    }
+
+    static inline CArray<double,1> cond_ffs(const CArray<double,1>& x, const CArray<double,1>& y, double z)
+    {
+      CArray<double,1> ret(x.numElements()) ;
+      Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), ity=y.begin() ;
+      Array<double,1>::iterator itret=ret.begin() ;
+      for(;itx!=itxe;++itx,++ity,++itret) *itret=( (*itx==0)?z:*ity) ;
+      return ret ;
+    }
+
+    static inline CArray<double,1> cond_fff(const CArray<double,1>& x, const CArray<double,1>& y, const CArray<double,1>&  z)
+    {
+      CArray<double,1> ret(x.numElements()) ;
+      Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), ity=y.begin(), itz=z.begin() ;
+      Array<double,1>::iterator itret=ret.begin() ;
+      for(;itx!=itxe;++itx,++ity,++itz,++itret) *itret=( (*itx==0)?*itz:*ity) ;
+      return ret ;
+    }
+
   };
 
