Changeset 1158 for XIOS/dev


Ignore:
Timestamp:
06/06/17 17:58:16 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

Location:
XIOS/dev/dev_olga
Files:
202 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/extern/remap/src/elt.hpp

    r923 r1158  
    105105        } 
    106106 
     107  void insert_vertex(int i, const Coord& v) 
     108  { 
     109    for(int j=n; j > i ; j--) 
     110    { 
     111      vertex[j]=vertex[j-1] ; 
     112      edge[j]=edge[j-1] ; 
     113      d[j]=d[j-1] ; 
     114      neighbour[j]=neighbour[j-1] ; 
     115    } 
     116    vertex[i+1]=v ; 
     117    n++ ; 
     118  } 
     119   
    107120        int neighbour[NMAX]; 
    108121        double d[NMAX]; /**< distance of centre of small circle to origin, zero if great circle */ 
  • XIOS/dev/dev_olga/extern/remap/src/intersect.cpp

    r688 r1158  
    3737} 
    3838 
     39/** New methods to find an insert a neighbour in a cell of the source mesh. 
     40 *  return true/false if cell b is a neighbour of a. if "insert" is true, then b will be inserted as a neighbour 
     41 * in cell a . This is needed for 2 order interpolation that need neighboround for gradient computing. 
     42 * A cell is a neighbour if : 
     43 *  - it shares 2 countiguous vertex (ie an edge) with a 
     44 *  - A vertex of b is located on one of an edge of a. 
     45 **/ 
     46bool insertNeighbour( Elt& a, const Elt& b, bool insert ) 
     47{ 
     48  // for now suppose pole -> Oz 
     49  Coord pole(0,0,1) ; 
     50  Coord O, Oa1, Oa2,Ob1,Ob2,V1,V2 ; 
     51  double da,db,alpha,alpha1,alpha2,delta ; 
     52   
     53     
     54  for (int i = 0; i < a.n; i++) 
     55  { 
     56    for (int j = 0; j < b.n; j++) 
     57    { 
     58// share a full edge ? be carefull at the orientation 
     59      assert(squaredist(a.vertex[ i       ], b.vertex[ j       ]) > 1e-10*1e-10 || 
     60             squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10); 
     61      if (   squaredist(a.vertex[ i       ], b.vertex[ j           ]) < 1e-10*1e-10 && 
     62             squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+b.n-1)%b.n]) < 1e-10*1e-10) 
     63      { 
     64        if (insert) a.neighbour[i] = b.id.ind ; 
     65        return true; 
     66      } 
     67       
     68 
     69// 1 or 2 vertices of b is located on an edge of a 
     70       da=a.d[i] ; 
     71       if (scalarprod(a.edge[i], pole) < 0) da=-da ; 
     72       db=b.d[(j+b.n-1)%b.n] ; 
     73       if (scalarprod(b.edge[(j+b.n-1)%b.n], pole) < 0) db=-db ; 
     74       
     75      if ( fabs(da-db)<1e-10 )  
     76      { 
     77        O=pole*da ; 
     78        Oa1=a.vertex[i]-O ; 
     79        Oa2=a.vertex[(i+1)%a.n]-O ;  
     80        Ob1=b.vertex[j]-O ; 
     81        Ob2=b.vertex[(j+b.n-1)%b.n]-O ; 
     82        V1=crossprod(Oa1,Oa2) ; 
     83        V2=crossprod(Ob1,Ob2) ; 
     84        if (norm(crossprod(V1,V2))/(norm(V1)*norm(V2)) < 1e-10) 
     85        { 
     86          alpha = vectAngle(Oa1,Oa2,V1) ; 
     87          alpha1= vectAngle(Oa1,Ob1,V1) ; 
     88          alpha2= vectAngle(Oa1,Ob2,V1) ; 
     89          delta= alpha2-alpha1 ; 
     90          if (delta >= M_PI) delta=2*M_PI-delta ; 
     91          else if (delta <= -M_PI) delta=2*M_PI+delta ; 
     92           
     93          if (alpha >= 0) 
     94          { 
     95            if (alpha1 > 1e-10 && alpha1 < alpha-1e-10) 
     96            { 
     97              if (alpha2 > 1e-10 && alpha2 < alpha-1e-10) 
     98              { 
     99                assert(delta > 0) ; 
     100                if (insert) 
     101                { 
     102                // insert both 
     103                  a.insert_vertex(i,b.vertex[(j+b.n-1)%b.n]); 
     104                  a.insert_vertex(i,b.vertex[j]); 
     105                  a.neighbour[i+1] = b.id.ind ; 
     106                } 
     107                return true ; 
     108              } 
     109              else 
     110              { 
     111                assert( delta > 0 ) ; 
     112                if (insert) 
     113                { 
     114                //insert alpha1 
     115                  a.insert_vertex(i,b.vertex[j]); 
     116                  a.neighbour[i+1] = b.id.ind ; 
     117                } 
     118                return true ; 
     119              } 
     120            } 
     121            else if (alpha2 > 1e-10 && alpha2 < alpha-1e-10) 
     122            { 
     123              assert( delta > 0 ) ; 
     124              if (insert) 
     125              { 
     126              // insert alpha2 
     127                a.insert_vertex(i,b.vertex[(j+b.n-1)%b.n]); 
     128                a.neighbour[i] = b.id.ind ; 
     129              } 
     130              return true ; 
     131            } 
     132            else 
     133            { 
     134              // nothing to do 
     135            }  
     136 
     137          } 
     138          else  // alpha < 0 
     139          { 
     140            if (alpha1 < -1e-10 && alpha1 > alpha+1e-10) 
     141            { 
     142              if (alpha2 < -1e-10 && alpha2 > alpha+1e-10) 
     143              { 
     144                assert(delta < 0) ; 
     145                if (insert) 
     146                { 
     147                // insert both 
     148                  a.insert_vertex(i,b.vertex[(j+b.n-1)%b.n]); 
     149                  a.insert_vertex(i,b.vertex[j]); 
     150                  a.neighbour[i+1] = b.id.ind ; 
     151                } 
     152                return true ; 
     153              } 
     154              else 
     155              { 
     156                assert(delta < 0) ; 
     157                if (insert) 
     158                { 
     159                //insert alpha1 
     160                  a.insert_vertex(i,b.vertex[j]); 
     161                  a.neighbour[i+1] = b.id.ind ; 
     162                } 
     163                return true ; 
     164              } 
     165            } 
     166            else if (alpha2 < -1e-10 && alpha2 > alpha+1e-10) 
     167            { 
     168              assert(delta < 0) ; 
     169              if (insert) 
     170              { 
     171              // insert alpha2 
     172                a.insert_vertex(i,b.vertex[(j+b.n-1)%b.n]); 
     173                a.neighbour[i] = b.id.ind ; 
     174              } 
     175              return true ; 
     176            } 
     177            else 
     178            { 
     179               // nothing to do 
     180            } 
     181          } 
     182        } 
     183      } 
     184    } 
     185  } 
     186  return false; 
     187} 
    39188 
    40189/** 
     
    44193void set_neighbour(Elt& a, const Elt& b) 
    45194{ 
    46         if (b.id.ind == a.id.ind) return; 
    47         int idx = neighbour_idx(a, b); 
    48         if (idx != NOT_FOUND) 
    49                 a.neighbour[idx] = b.id.ind; 
     195  if (b.id.ind == a.id.ind) return; 
     196/* 
     197  int idx = neighbour_idx(a, b); 
     198  if (idx != NOT_FOUND) 
     199  a.neighbour[idx] = b.id.ind; 
     200*/ 
     201  insertNeighbour(a,b,true) ;  
    50202} 
    51203 
    52204/** return true if `a` and `b` share an edge */ 
    53 bool isNeighbour(const Elt& a, const Elt& b) 
    54 { 
    55         return neighbour_idx(a, b) != NOT_FOUND; 
     205bool isNeighbour(Elt& a, const Elt& b) 
     206{ 
     207        // return neighbour_idx(a, b) != NOT_FOUND; 
     208  return insertNeighbour(a,b,false) ; 
    56209} 
    57210 
  • XIOS/dev/dev_olga/extern/remap/src/intersect.hpp

    r688 r1158  
    22 
    33void set_neighbour(Elt& elt, const Elt& elt2); 
    4 bool isNeighbour(const Elt& elt, const Elt& elt2); 
     4bool isNeighbour(Elt& elt, const Elt& elt2); 
    55 
    66void intersect(Elt *a, Elt *b); 
  • XIOS/dev/dev_olga/extern/remap/src/mapper.cpp

    r923 r1158  
    109109} 
    110110 
    111 vector<double> Mapper::computeWeights(int interpOrder, bool renormalize) 
     111vector<double> Mapper::computeWeights(int interpOrder, bool renormalize, bool quantity) 
    112112{ 
    113113        vector<double> timings; 
     
    152152        if (mpiRank == 0 && verbose) cout << "Remapping..." << endl; 
    153153        tic = cputime(); 
    154         nWeights = remap(&targetElements[0], targetElements.size(), interpOrder, renormalize); 
     154        nWeights = remap(&targetElements[0], targetElements.size(), interpOrder, renormalize, quantity); 
    155155        timings.push_back(cputime() - tic); 
    156156 
     
    166166   @param order is the order of interpolaton (must be 1 or 2). 
    167167*/ 
    168 int Mapper::remap(Elt *elements, int nbElements, int order, bool renormalize) 
     168int Mapper::remap(Elt *elements, int nbElements, int order, bool renormalize, bool quantity) 
    169169{ 
    170170        int mpiSize, mpiRank; 
     
    184184        int **sendElement = new int*[mpiSize]; /* indices of elements required from other rank */ 
    185185        double **recvValue = new double*[mpiSize]; 
     186        double **recvArea = new double*[mpiSize]; 
    186187        Coord **recvGrad = new Coord*[mpiSize]; 
    187188        GloId **recvNeighIds = new GloId*[mpiSize]; /* ids of the of the source neighbours which also contribute through gradient */ 
     
    205206                        sendElement[rank] = new int[nbSendElement[rank]]; 
    206207                        recvValue[rank]   = new double[nbSendElement[rank]]; 
     208                        recvArea[rank]    = new double[nbSendElement[rank]]; 
    207209                        if (order == 2) 
    208210                        { 
     
    234236        int **recvElement = new int*[mpiSize]; 
    235237        double **sendValue = new double*[mpiSize]; 
     238        double **sendArea = new double*[mpiSize]; 
    236239        Coord **sendGrad = new Coord*[mpiSize]; 
    237240        GloId **sendNeighIds = new GloId*[mpiSize]; 
    238         MPI_Request *sendRequest = new MPI_Request[3*mpiSize]; 
    239         MPI_Request *recvRequest = new MPI_Request[3*mpiSize]; 
     241        MPI_Request *sendRequest = new MPI_Request[4*mpiSize]; 
     242        MPI_Request *recvRequest = new MPI_Request[4*mpiSize]; 
    240243        for (int rank = 0; rank < mpiSize; rank++) 
    241244        { 
     
    250253                        recvElement[rank] = new int[nbRecvElement[rank]]; 
    251254                        sendValue[rank]   = new double[nbRecvElement[rank]]; 
     255                        sendArea[rank]   = new double[nbRecvElement[rank]]; 
    252256                        if (order == 2) 
    253257                        { 
     
    263267                } 
    264268        } 
    265         MPI_Status *status = new MPI_Status[3*mpiSize]; 
    266         MPI_Waitall(nbRecvRequest, recvRequest, status); 
     269        MPI_Status *status = new MPI_Status[4*mpiSize]; 
     270         
    267271        MPI_Waitall(nbSendRequest, sendRequest, status); 
     272        MPI_Waitall(nbRecvRequest, recvRequest, status); 
    268273 
    269274        /* for all indices that have been received from requesting ranks: pack values and gradients, then send */ 
     
    278283                        { 
    279284                                sendValue[rank][j] = sstree.localElements[recvElement[rank][j]].val; 
     285                                sendArea[rank][j] = sstree.localElements[recvElement[rank][j]].area; 
    280286                                if (order == 2) 
    281287                                { 
     
    297303                        MPI_Issend(sendValue[rank],  nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]); 
    298304                        nbSendRequest++; 
     305                        MPI_Issend(sendArea[rank],  nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]); 
     306                        nbSendRequest++; 
    299307                        if (order == 2) 
    300308                        { 
     
    317325                        MPI_Irecv(recvValue[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
    318326                        nbRecvRequest++; 
     327                        MPI_Irecv(recvArea[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
     328                        nbRecvRequest++; 
    319329                        if (order == 2) 
    320330                        { 
     
    334344                } 
    335345        } 
     346         
     347        MPI_Waitall(nbSendRequest, sendRequest, status); 
    336348        MPI_Waitall(nbRecvRequest, recvRequest, status); 
    337         MPI_Waitall(nbSendRequest, sendRequest, status); 
     349         
    338350 
    339351        /* now that all values and gradients are available use them to computed interpolated values on target 
     
    357369                        int rank = (*it)->id.rank; 
    358370                        double fk = recvValue[rank][n1]; 
     371                        double srcArea = recvArea[rank][n1]; 
    359372                        double w = (*it)->area; 
     373      if (quantity) w/=srcArea ; 
    360374 
    361375                        /* first order: src value times weight (weight = supermesh area), later divide by target area */ 
    362376                        int kk = (order == 2) ? n1 * (NMAX + 1) : n1; 
    363377                        GloId neighID = recvNeighIds[rank][kk]; 
    364                         wgt_map[neighID] += (*it)->area; 
     378                        wgt_map[neighID] += w; 
    365379 
    366380                        if (order == 2) 
     
    383397    for (map<GloId,double>::iterator it = wgt_map.begin(); it != wgt_map.end(); it++) 
    384398                { 
    385                         this->remapMatrix[i] = (it->second / e.area) / renorm; 
     399      if (quantity)  this->remapMatrix[i] = (it->second ) / renorm; 
     400                        else this->remapMatrix[i] = (it->second / e.area) / renorm; 
    386401                        this->srcAddress[i] = it->first.ind; 
    387402                        this->srcRank[i] = it->first.rank; 
     
    400415                        delete[] sendElement[rank]; 
    401416                        delete[] recvValue[rank]; 
     417                        delete[] recvArea[rank]; 
    402418                        if (order == 2) 
    403419                        { 
     
    410426                        delete[] recvElement[rank]; 
    411427                        delete[] sendValue[rank]; 
     428                        delete[] sendArea[rank]; 
    412429                        if (order == 2) 
    413430                                delete[] sendGrad[rank]; 
  • XIOS/dev/dev_olga/extern/remap/src/mapper.hpp

    r844 r1158  
    3434       /** @param trgElts are the elements of the unstructured target grid 
    3535           Returns the timings for substeps: */ 
    36        vector<double> computeWeights(int interpOrder, bool renormalize=false); 
     36       vector<double> computeWeights(int interpOrder, bool renormalize=false, bool quantity=false); 
    3737       int getNbWeights(void) { return nWeights ; } 
    3838/* 
     
    5151private: 
    5252       /** @return number of weights (local to cpu) */ 
    53        int remap(Elt* elements, int nbElements, int order, bool renormalize=false); 
     53       int remap(Elt* elements, int nbElements, int order, bool renormalize=false, bool quantity=false); 
    5454 
    5555       void buildMeshTopology(); 
  • XIOS/dev/dev_olga/extern/remap/src/tree.cpp

    r951 r1158  
    142142        root->parent = 0; 
    143143        root->leafCount = 0; 
    144         root->centre = ORIGIN; 
     144// initialize root node on the sphere 
     145  root->centre.x=1 ; root->centre.y=0 ; root->centre.z=0 ;  
    145146        root->radius = 0.; 
    146147        root->reinserted = false; 
  • XIOS/dev/dev_olga/extern/remap/src/triple.cpp

    r849 r1158  
    124124} 
    125125 
     126// return oriented vector angle in range [-pi..pi], pole must be orthogonal to a and b 
     127double vectAngle(const Coord &a, const Coord &b, const Coord &pole) 
     128{  
     129  double nab = 1./(norm(a)*norm(b)) ; 
     130   
     131  Coord a_cross_b=crossprod(a, b)*nab ; 
     132  double sinVect ; 
     133  if (scalarprod(a_cross_b, pole) >= 0) sinVect=norm(a_cross_b) ; 
     134  else sinVect=-norm(a_cross_b) ; 
     135  double cosVect=scalarprod(a,b)*nab ; 
     136 
     137  return atan2(sinVect,cosVect) ; 
    126138} 
     139 
     140} 
  • XIOS/dev/dev_olga/extern/remap/src/triple.hpp

    r688 r1158  
    121121 
    122122double angle(const Coord &a, const Coord &b, const Coord &pole); 
     123 
     124// return oriented vector angle in range [-pi..pi], pole must be orthogonal to a and b 
     125double vectAngle(const Coord &a, const Coord &b, const Coord &pole) ; 
     126 
    123127void print_Coord(Coord &p); 
    124128 
  • XIOS/dev/dev_olga/src/array_new.hpp

    r731 r1158  
    302302      } 
    303303 
     304      bool operator== (const CArray<T_numtype,N_rank>& array) 
     305      { 
     306        size_t nbThis = this->numElements(); 
     307        size_t nbArr  = array.numElements(); 
     308        if (nbThis != nbArr) return false; 
     309        typename Array<T_numtype,N_rank>::const_iterator itx=array.begin(), itxe=array.end(), ity=this->begin() ; 
     310        for(;itx!=itxe;++itx,++ity) if (*itx!=*ity) return false ; 
     311        return true; 
     312      } 
     313 
     314      bool operator== (const Array<T_numtype,N_rank>& array) 
     315      { 
     316        return ((*this) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(array))); 
     317      } 
     318 
    304319      void resize(int extent) 
    305320      { 
     
    552567  }; 
    553568 
     569 
     570#define macro(NRANK)\ 
     571\ 
     572  template <>\ 
     573  inline size_t CArray<StdString,NRANK>::size(void) const\ 
     574  {\ 
     575    size_t size=(1 + NRANK) * sizeof(int) ;\ 
     576    Array<StdString,NRANK>::const_iterator it, itb=this->begin(), ite=this->end() ;\ 
     577\ 
     578    for(it=itb;it!=ite;++it)\ 
     579    {\ 
     580      size+= sizeof(size_t) ;\ 
     581      size+= (*it).size();\ 
     582    } \ 
     583    return size ;\ 
     584  }\ 
     585\ 
     586/* for array string this function is an evaluation of maximum size of the array, considering stringArrayLen is the maximum size of the strings*/ \ 
     587  template <>\ 
     588  inline size_t CArray<StdString,NRANK>::size(sizeType numElements)\ 
     589  {\ 
     590    return (NRANK + 1) * sizeof(int) + numElements * stringArrayLen;\ 
     591  }\ 
     592  \ 
     593  template <>\ 
     594  inline bool CArray<StdString,NRANK>::toBuffer(CBufferOut& buffer) const\ 
     595  {\ 
     596    bool ret;\ 
     597    ret =  buffer.put(this->dimensions());\ 
     598    ret &= buffer.put(this->shape().data(), this->dimensions());\ 
     599\ 
     600    Array<StdString,NRANK>::const_iterator it, itb=this->begin(), ite=this->end() ;\ 
     601\ 
     602    for(it=itb;it!=ite;++it)\ 
     603    {\ 
     604      ret &= buffer.put((*it).size()) ;\ 
     605      ret &= buffer.put((*it).data(),(*it).size());\ 
     606    } \ 
     607    return ret;\ 
     608  }\ 
     609\ 
     610  template <>\ 
     611  inline bool CArray<StdString,NRANK>::fromBuffer(CBufferIn& buffer)\ 
     612  {\ 
     613     bool ret;\ 
     614     int numDim;\ 
     615     TinyVector<int,NRANK> vect;\ 
     616     size_t ne;\ 
     617\ 
     618     ret =  buffer.get(numDim);\ 
     619     ret &= buffer.get(vect.data(), NRANK);\ 
     620     this->resize(vect);\ 
     621\ 
     622     Array<StdString,NRANK>::iterator it, itb=this->begin(), ite=this->end() ;\ 
     623     for(it=itb;it!=ite;++it)\ 
     624     {\ 
     625       ret &= buffer.get(ne) ;\ 
     626       char* str = new char[ne] ;\ 
     627       ret &= buffer.get(str, ne);\ 
     628       *it = string(str,ne) ;\ 
     629       delete [] str ;\ 
     630     }\ 
     631     initialized = true;\ 
     632     return ret;\ 
     633  } 
     634macro(1) 
     635macro(2) 
     636macro(3) 
     637macro(4) 
     638macro(5) 
     639macro(6) 
     640macro(7) 
     641 
     642#undef macro 
     643 
    554644  template <typename T_numtype,int N_rank> inline CBufferOut& operator<<(CBufferOut& buffer, const CArray<T_numtype,N_rank>& array) 
    555645  { 
  • XIOS/dev/dev_olga/src/attribute.cpp

    r680 r1158  
    66namespace xios 
    77{ 
     8 
     9      const StdString CAttribute::resetInheritanceStr("_reset_") ; 
     10 
    811      /// ////////////////////// Définitions ////////////////////// /// 
    912      CAttribute::CAttribute(const StdString & id) 
    10          : CObject(id), CBaseType() 
     13         : CObject(id), CBaseType(), _canInherite(true) 
    1114//         , value() 
    1215      { /* Ne rien faire de plus */ } 
    1316/* 
    14       CAttribute::CAttribute(const CAttribute & attribut) 
    15          : CObject(attribut.getId()),CBaseType() 
    16       {  
    17  //        this->value = attribut.getAnyValue();  
    18       } 
    1917*/       
    2018      CAttribute::~CAttribute(void) 
     
    2220       
    2321      ///-------------------------------------------------------------- 
    24 /* 
    25       const boost::any & CAttribute::getAnyValue(void) const 
    26       {  
    27          return (this->value);  
    28       } 
    2922 
    30  
    31       void CAttribute::setAnyValue(const boost::any & value) 
    32       {  
    33          this->value = value;  
    34       } 
    35        
    36       void CAttribute::clear(void) 
    37       { 
    38          this->value = boost::any();  
    39       } 
    40  
    41       //--------------------------------------------------------------- 
    42  
    43       bool CAttribute::isEmpty(void) const 
    44       {  
    45          return (this->value.empty());  
    46       } 
    47 */ 
    4823      const StdString & CAttribute::getName(void) const 
    4924      {  
     
    7954      ///-------------------------------------------------------------- 
    8055 
    81  
    8256      CMessage& operator<<(CMessage& msg,CAttribute& type) 
    8357      { 
  • XIOS/dev/dev_olga/src/attribute.hpp

    r1025 r1158  
    1616{ 
    1717      /// ////////////////////// Déclarations ////////////////////// /// 
     18   /*! 
     19   \class CAttribute 
     20      The fundamental class which describes the attributes of other different class in XIOS. 
     21      This class only plays a role of interface, its class child will have specific implelemtation corresponding to type of attribute 
     22   */ 
    1823      class CAttribute : public CObject, public virtual CBaseType 
    1924      { 
     
    2429            /// Constructeurs /// 
    2530            explicit CAttribute(const StdString & id); 
    26 //            CAttribute(const CAttribute & attribut); 
    27 //            CAttribute(const CAttribute * const attribut); // Not implemented. 
    2831 
    2932            /// Accesseurs /// 
    3033            const StdString & getName(void) const; 
    31 //            const boost::any & getAnyValue(void) const; 
    32 //            template <typename T> inline T getValue(void) const; 
    33 //            template <typename T> inline T* getRef(void); 
    3434 
    35 //            /// Mutateurs /// 
    36 //            template <typename T> inline void setValue(const T & value); 
    37 //            void setAnyValue(const boost::any & value); 
    38 //            void clear(void); 
    39  
    40             /// Test /// 
    41 //            bool isEmpty(void) const; 
    42 //            template <typename T> inline bool isType(void) const; 
    4335            virtual void set(const CAttribute& ) =0 ; 
    4436            virtual void reset(void ) =0 ; 
     
    4941            virtual StdString toString(void) const = 0; 
    5042            virtual void fromString(const StdString & str) = 0; 
    51  
    52 //            virtual void toBinary  (StdOStream & os) const = 0; 
    53 //            virtual void fromBinary(StdIStream & is) = 0; 
     43            virtual bool isEqual(const CAttribute& ) = 0; 
    5444 
    5545            //! Returns true if and only if the attribute should be publicly exposed in the API 
     
    5949            virtual bool doSend() const { return true; } 
    6050 
     51            /* 
     52              Groupd of functions to generate C and Fortran interface  
     53            */ 
    6154            virtual void generateCInterface(ostream& oss, const string& className) = 0 ; 
    6255            virtual void generateCInterfaceIsDefined(ostream& oss, const string& className) ; 
     
    7568            virtual void setInheritedValue(const CAttribute& ) = 0 ; 
    7669            virtual bool hasInheritedValue(void) const = 0; 
    77              
    78          protected : 
    7970 
    80             /// Constructeurs /// 
    81 //            CAttribute(void);  // Not implemented. 
    82  
    83             /// Propriété /// 
    84 //            boost::any value; 
     71            bool canInherite(void) {return _canInherite ;} 
     72         protected :  
     73            bool _canInherite ; 
     74            static const StdString resetInheritanceStr ;  
    8575 
    8676      }; // class CAttribute 
    8777 
    88       /// ////////////////////// Définitions ////////////////////// /// 
    89 /* 
    90       template <typename T> 
    91          T CAttribute::getValue(void) const 
    92       {  
    93          return (boost::any_cast<T>(this->value));  
    94       } 
    95  
    96       template <typename T> 
    97          T* CAttribute::getRef(void) 
    98       {  
    99          return (boost::any_cast<T>(&value));  
    100       } 
    101  
    102       template <typename T> 
    103          void CAttribute::setValue(const T & value) 
    104       {  
    105          this->value = value;  
    106       } 
    107  
    108       template<typename T> 
    109          bool CAttribute::isType(void) const 
    110       {  
    111          return (this->value.type() == typeid(T));  
    112       } 
    113 */ 
    114   
    11578   CMessage& operator<<(CMessage& msg,CAttribute& type) ; 
    11679   CMessage& operator<<(CMessage& msg, const CAttribute&  type) ; 
  • XIOS/dev/dev_olga/src/attribute_array.hpp

    r780 r1158  
    1313{ 
    1414      /// ////////////////////// Déclarations ////////////////////// /// 
     15      /*! 
     16        \class CAttributeArray 
     17        This class implements the attribute representing array of value 
     18      */ 
    1519      template <typename T_numtype, int N_rank> 
    1620         class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> 
     
    1923 
    2024           using CArray<T_numtype,N_rank>::operator = ; 
    21 //           using Array<T_numtype,N_rank>::operator = ; 
    2225 
    2326            /// Constructeurs /// 
     
    4043            CArray<T_numtype, N_rank> getInheritedValue(void) const ; 
    4144            bool hasInheritedValue(void) const; 
     45             
     46            bool isEqual(const CAttributeArray& attr); 
     47            bool isEqual(const CAttribute& attr); 
    4248 
    4349            /// Destructeur /// 
     
    4753            /// Autre /// 
    4854            virtual string toString(void) const { return _toString();} 
    49             virtual void fromString(const StdString & str) { _fromString(str);} 
     55            virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;}  else _fromString(str);} 
    5056            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
    5157            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 
     
    6066            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 
    6167 
    62  
    63          protected : 
    64  
    65             /// Constructeurs /// 
    66  
    6768         private : 
    6869          CArray<T_numtype, N_rank> inheritedValue ; 
  • XIOS/dev/dev_olga/src/attribute_array_decl.cpp

    r932 r1158  
    1717  template class CAttributeArray<bool,6> ; 
    1818  template class CAttributeArray<bool,7> ; 
     19  template class CAttributeArray<StdString,1> ; 
     20  template class CAttributeArray<StdString,2> ; 
    1921} 
  • XIOS/dev/dev_olga/src/attribute_array_impl.hpp

    r778 r1158  
    8383    void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttributeArray& attr) 
    8484    { 
    85       if (this->isEmpty() && attr.hasInheritedValue()) 
     85      if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) 
    8686      { 
    8787        inheritedValue.resize(attr.shape()) ; 
     
    103103    } 
    104104 
     105    template <typename T_numtype, int N_rank> 
     106    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttributeArray& attr) 
     107    { 
     108      return ((dynamic_cast<CArray<T_numtype,N_rank>& >(*this)) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(attr)));       
     109    } 
     110 
     111    template <typename T_numtype, int N_rank> 
     112    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute& attr) 
     113    { 
     114      return ((*this) == (dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)));       
     115    } 
    105116 
    106117    template <typename T_numtype, int N_rank> 
  • XIOS/dev/dev_olga/src/attribute_enum.hpp

    r591 r1158  
    1515{ 
    1616      /// ////////////////////// Déclarations ////////////////////// /// 
     17        /*! 
     18        \class CAttributeEnum 
     19        This class implements the attribute representing enumeration 
     20      */ 
    1721      template <class T> 
    1822         class CAttributeEnum : public CAttribute, public CEnum<T> 
     
    4751            bool hasInheritedValue(void) const;           
    4852           
     53            bool isEqual(const CAttributeEnum& attr ); 
     54            bool isEqual(const CAttribute& attr ); 
     55 
    4956            /// Destructeur /// 
    5057            virtual ~CAttributeEnum(void) { } 
     
    5562            /// Autre /// 
    5663            virtual StdString toString(void) const { return _toString();} 
    57             virtual void fromString(const StdString & str) { _fromString(str);} 
     64            virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;}  else _fromString(str);} 
    5865 
    5966            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);}  
     
    6976            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 
    7077 
    71        
    72          protected : 
    73  
    74             /// Constructeurs /// 
    75 //            CAttributeTemplate(void); // Not implemented. 
    7678         private : 
    7779          StdString _toString(void) const; 
  • XIOS/dev/dev_olga/src/attribute_enum_impl.hpp

    r580 r1158  
    8888  void CAttributeEnum<T>::setInheritedValue(const CAttributeEnum& attr) 
    8989  { 
    90     if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()); 
     90    if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()); 
    9191  } 
    9292 
     
    109109  { 
    110110    return !this->isEmpty() || !inheritedValue.isEmpty(); 
     111  } 
     112 
     113  template <class T> 
     114  bool CAttributeEnum<T>::isEqual(const CAttribute& attr) 
     115  { 
     116    return (this->isEqual(dynamic_cast<const CAttributeEnum<T>& >(attr))); 
     117  } 
     118 
     119  template <class T> 
     120  bool CAttributeEnum<T>::isEqual(const CAttributeEnum& attr) 
     121  { 
     122    return ((dynamic_cast<const CEnum<T>& >(*this)) == (dynamic_cast<const CEnum<T>& >(attr))); 
    111123  } 
    112124 
  • XIOS/dev/dev_olga/src/attribute_map.cpp

    r1009 r1158  
    1616      ///-------------------------------------------------------------- 
    1717 
     18      /*! 
     19         Clear all attributes of an object and reset them to empty state 
     20      */ 
    1821      void CAttributeMap::clearAllAttributes(void) 
    1922      { 
     
    2932      //--------------------------------------------------------------- 
    3033 
     34      /* 
     35        Clear an attribute and reset its value 
     36        \param[in] key id of attribute 
     37      */ 
    3138      void CAttributeMap::clearAttribute(const StdString& key) 
    3239      { 
     
    3643      //--------------------------------------------------------------- 
    3744 
     45      /*! 
     46        Set an attribute of certain id with a value 
     47        \param[in] key id of the attribute 
     48        \param[in] attr value of attribute 
     49      */ 
    3850      void CAttributeMap::setAttribute(const StdString& key, CAttribute* const attr) 
    3951      { 
     
    5062      //--------------------------------------------------------------- 
    5163 
     64      /*! 
     65        Subscript operator. Return attribute with a specific id 
     66      */ 
    5267      CAttribute* CAttributeMap::operator[](const StdString& key) 
    5368      { 
     
    103118         } 
    104119      } 
     120 
     121      /*! 
     122         Compare two attribute maps 
     123         \param [in] another attribute map to compare 
     124         \param [in] excludedAttrs attribute to be excluded from comparasion 
     125         \return true if these two maps have same attributes whose value are identical 
     126      */ 
     127      bool CAttributeMap::isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs) 
     128      { 
     129         SuperClassMap::const_iterator itb = another.begin(), ite = another.end(), it; 
     130         for (it = itb; it !=ite; ++it) 
     131         { 
     132            bool excluded = false; 
     133            for (int idx = 0; idx < excludedAttrs.size(); ++idx) 
     134            { 
     135               if (0 == (*it).first.compare(excludedAttrs[idx])) 
     136               { 
     137                 excluded = true; 
     138                 break; 
     139               }  
     140            } 
     141 
     142            if (!excluded) 
     143            { 
     144              if ((*it).first.compare(StdString("id")) != 0 && (*it).first.compare(StdString("src")) != 0) 
     145              { 
     146                if (this->hasAttribute(it->first)) 
     147                {  
     148                  if (!((*it).second->isEqual(*(*this)[it->first]))) 
     149                  { 
     150                    return false; 
     151                  } 
     152                } 
     153                else 
     154                  return false; 
     155              } 
     156            } 
     157         } 
     158 
     159         return true; 
     160      } 
     161 
    105162 
    106163      //--------------------------------------------------------------- 
     
    129186               if (apply) 
    130187               { 
    131                  if (currentAtt->isEmpty() && !el.second->isEmpty()) 
     188                 if (currentAtt->isEmpty() && currentAtt->canInherite() && !el.second->isEmpty()) 
    132189                 { 
    133190                    this->setAttribute(el.first, el.second); 
     
    139196      } 
    140197 
     198      /*! 
     199        Duplicate attribute map with a specific attribute map. 
     200        Copy all non-empty attribute of the current attribute map 
     201        \param [in] srcAttr attribute map which is copied from. 
     202      */ 
    141203      void CAttributeMap::duplicateAttributes(const CAttributeMap* const srcAttr) 
    142204      { 
     
    216278      } 
    217279 */ 
     280       
    218281      void CAttributeMap::generateCInterface(ostream& oss, const string& className) 
    219282      { 
  • XIOS/dev/dev_olga/src/attribute_map.hpp

    r1009 r1158  
    1212{ 
    1313      /// ////////////////////// Déclarations ////////////////////// /// 
     14      /*! 
     15        \class CAttributeMap 
     16        This class represents the set of attributes which an object can have. 
     17        Each attribute in the set is represented by an unique id. 
     18      */ 
     19 
    1420      class CAttributeMap 
    1521         : public xios_map<StdString, CAttribute*> 
     
    3440 
    3541            void clearAttribute(const StdString& key); 
     42            bool isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs); 
    3643 
    3744            /// Destructeur /// 
     
    7481      inline bool CAttributeMap::hasAttribute(const StdString& key) const 
    7582      { 
    76         return (this->find(key) != this->end()); 
     83         return (this->find(key) != this->end()); 
    7784      } 
    7885 
  • XIOS/dev/dev_olga/src/attribute_template.hpp

    r780 r1158  
    1616{ 
    1717      /// ////////////////////// Déclarations ////////////////////// /// 
     18  /*! 
     19    \class CAttributeTemplate 
     20    The class implements attribute of some basic types 
     21  */ 
    1822      template <class T> 
    1923         class CAttributeTemplate : public CAttribute, public CType<T> 
     
    5458            bool hasInheritedValue(void) const; 
    5559 
     60            bool isEqual_(const CAttributeTemplate& attr ); 
     61            bool isEqual(const CAttribute& attr ); 
     62 
    5663            /// Destructeur /// 
    5764            virtual ~CAttributeTemplate(void) { } 
     
    6269            /// Autre /// 
    6370            virtual StdString toString(void) const { return _toString();} 
    64             virtual void fromString(const StdString & str) { _fromString(str);} 
     71            virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;}  else _fromString(str);} 
    6572//            virtual CAttributeTemplate* clone() const {} 
    6673//            virtual void toBinary  (StdOStream & os) const; 
  • XIOS/dev/dev_olga/src/attribute_template_impl.hpp

    r778 r1158  
    7171         T CAttributeTemplate<T>::getValue(void) const 
    7272      { 
    73          return CType<T>::get() ; 
    74 /* 
    75          if (SuperClass::isEmpty()) 
    76          { 
    77             ERROR("T CAttributeTemplate<T>::getValue(void) const", 
    78                   << "[ id = " << this->getId() << "]" 
    79                   << " L'attribut est requis mais n'est pas défini !"); 
    80           } 
    81          return (SuperClass::getValue<T>()); 
     73        return CType<T>::get() ; 
     74/* 
     75        if (SuperClass::isEmpty()) 
     76        { 
     77           ERROR("T CAttributeTemplate<T>::getValue(void) const", 
     78                 << "[ id = " << this->getId() << "]" 
     79                 << " L'attribut est requis mais n'est pas défini !"); 
     80         } 
     81        return (SuperClass::getValue<T>()); 
    8282*/ 
    8383      } 
     
    125125    void CAttributeTemplate<T>::setInheritedValue(const CAttributeTemplate& attr) 
    126126    { 
    127       if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 
     127      if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 
    128128    } 
    129129 
     
    139139    { 
    140140      return !this->isEmpty() || !inheritedValue.isEmpty() ; 
     141    } 
     142 
     143    template <class T> 
     144    bool CAttributeTemplate<T>::isEqual(const CAttribute& attr) 
     145    { 
     146      const CAttributeTemplate<T>& tmp = dynamic_cast<const CAttributeTemplate<T>& >(attr); 
     147      return this->isEqual_(tmp); 
     148    } 
     149 
     150    template <class T> 
     151    bool CAttributeTemplate<T>::isEqual_(const CAttributeTemplate& attr) 
     152    { 
     153      if ((!this->hasInheritedValue() && !attr.hasInheritedValue())) 
     154          return true; 
     155      if (this->hasInheritedValue() && attr.hasInheritedValue()) 
     156          return (this->getInheritedValue() == attr.getInheritedValue()); 
     157      else  
     158        return false; 
    141159    } 
    142160 
  • XIOS/dev/dev_olga/src/client.cpp

    r1152 r1158  
    1818    MPI_Comm CClient::interComm ; 
    1919    std::list<MPI_Comm> CClient::contextInterComms; 
    20     int CClient::serverLeader; 
     20    int CClient::serverLeader ; 
    2121    bool CClient::is_MPI_Initialized ; 
    2222    int CClient::rank_ = INVALID_RANK; 
     
    5454          } 
    5555          CTimer::get("XIOS").resume() ; 
    56           CTimer::get("XIOS init").resume() ; 
     56          CTimer::get("XIOS init/finalize").resume() ; 
    5757          boost::hash<string> hashString ; 
    5858 
    59           unsigned long hashClient = hashString(codeId) ; 
    60           unsigned long hashServer = hashString(CXios::xiosCodeId); 
    61 //          unsigned long hashServer = hashString(CXios::xiosCodeIdPrm); 
     59          unsigned long hashClient=hashString(codeId) ; 
     60          unsigned long hashServer=hashString(CXios::xiosCodeId) ; 
    6261          unsigned long* hashAll ; 
    6362          int size ; 
     
    7170          hashAll=new unsigned long[size] ; 
    7271 
    73           MPI_Allgather(&hashClient, 1, MPI_LONG, hashAll, 1, MPI_LONG, CXios::globalComm) ; 
     72          MPI_Allgather(&hashClient,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ; 
    7473 
    7574          map<unsigned long, int> colors ; 
     
    9089          for (i=0; i < size; ++i) 
    9190          { 
    92             if (hashAll[i] == hashString(CXios::xiosCodeId)) 
     91            if (hashServer == hashAll[i]) 
    9392            { 
    9493              CXios::setUsingServer(); 
     
    148147 
    149148        CTimer::get("XIOS").resume() ; 
    150         CTimer::get("XIOS init").resume() ; 
     149        CTimer::get("XIOS init/finalize").resume() ; 
    151150 
    152151        if (CXios::usingServer) 
     
    216215 
    217216        int messageSize=msg.size() ; 
    218         void * buff = new char[messageSize] ; 
    219         CBufferOut buffer(buff,messageSize) ; 
     217        char * buff = new char[messageSize] ; 
     218        CBufferOut buffer((void*)buff,messageSize) ; 
    220219        buffer<<msg ; 
    221220 
    222         MPI_Send(buff, buffer.count(), MPI_CHAR, serverLeader, 1, CXios::globalComm) ; 
    223         MPI_Intercomm_create(contextComm, 0, CXios::globalComm, serverLeader, 10+globalRank, &contextInterComm) ; 
     221        MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 
     222 
     223        MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 
    224224        info(10)<<"Register new Context : "<<id<<endl ; 
    225225        MPI_Comm inter ; 
     
    257257      MPI_Comm_free(&intraComm); 
    258258 
    259       CTimer::get("XIOS finalize").suspend() ; 
     259      CTimer::get("XIOS init/finalize").suspend() ; 
    260260      CTimer::get("XIOS").suspend() ; 
    261261 
     
    267267       
    268268      info(20) << "Client side context is finalized"<<endl ; 
     269      report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 
    269270      report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 
    270271      report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 
    271       report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS").getCumulatedTime()*100.<<" %"<<endl ; 
     272      report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS init/finalize").getCumulatedTime()*100.<<" %"<<endl ; 
    272273      report(0)<< " Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 
    273274//      report(0)<< " Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 
    274275      report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 
    275276      report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 
    276  
     277      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
    277278   } 
    278279 
  • XIOS/dev/dev_olga/src/client.hpp

    r1148 r1158  
    1111      public: 
    1212        static void initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm); 
    13  
    1413        static void finalize(void); 
    1514        static void registerContext(const string& id, MPI_Comm contextComm); 
  • XIOS/dev/dev_olga/src/client_client_dht_template_impl.hpp

    r1030 r1158  
    307307 
    308308  indexToInfoMappingLevel_.swap(indexToInfoMapping); 
    309  
    310309  if (0 != recvNbIndexCount) delete [] recvIndexBuff; 
    311310  for (boost::unordered_map<int,size_t*>::const_iterator it = client2ClientIndex.begin(); 
  • XIOS/dev/dev_olga/src/client_server_mapping.hpp

    r1030 r1158  
    2626public: 
    2727  typedef boost::unordered_map<int, std::vector<size_t> > GlobalIndexMap; 
    28 //  typedef boost::map<int, std::vector<size_t> > GlobalIndexMap; 
    2928  public: 
    3029    /** Default constructor */ 
  • XIOS/dev/dev_olga/src/config/axis_attribute.conf

    r1025 r1158  
    66 
    77DECLARE_ATTRIBUTE(int,       n_glo) 
    8 DECLARE_ENUM2(positive, up, down)                
     8DECLARE_ENUM2(positive, up, down) 
    99 
    1010/* GLOBAL */ 
     
    2929DECLARE_ARRAY(bool, 1 , mask) 
    3030DECLARE_ARRAY(double, 2 , bounds) 
     31DECLARE_ATTRIBUTE(int,       prec) 
     32DECLARE_ARRAY(StdString    ,1    , label) 
  • XIOS/dev/dev_olga/src/config/domain_attribute.conf

    r1025 r1158  
    5353DECLARE_ENUM4(type,rectilinear,curvilinear,unstructured, gaussian) 
    5454DECLARE_ATTRIBUTE(StdString, domain_ref) 
     55DECLARE_ATTRIBUTE(int,       prec) 
  • XIOS/dev/dev_olga/src/config/domain_attribute_private.conf

    r1099 r1158  
    1414DECLARE_ARRAY_PRIVATE(double, 1, latvalue_rectilinear_read_from_file) 
    1515 
     16// Array contain whole value (non distributed) of longitude and latitude of curvilinear read from a file 
     17DECLARE_ARRAY_PRIVATE(double, 2, lonvalue_curvilinear_read_from_file) 
     18DECLARE_ARRAY_PRIVATE(double, 2, latvalue_curvilinear_read_from_file) 
     19DECLARE_ARRAY_PRIVATE(double, 3, bounds_lonvalue_curvilinear_read_from_file) 
     20DECLARE_ARRAY_PRIVATE(double, 3, bounds_latvalue_curvilinear_read_from_file) 
     21 
     22// Array contain whole value (non distributed) of longitude and latitude of unstructured read from a file 
     23DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_unstructured_read_from_file) 
     24DECLARE_ARRAY_PRIVATE(double, 1, latvalue_unstructured_read_from_file) 
     25DECLARE_ARRAY_PRIVATE(double, 2, bounds_lonvalue_unstructured_read_from_file) 
     26DECLARE_ARRAY_PRIVATE(double, 2, bounds_latvalue_unstructured_read_from_file) 
     27 
    1628DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ibegin) 
    1729DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ni) 
  • XIOS/dev/dev_olga/src/config/expand_domain_attribute.conf

    r941 r1158  
    22 
    33DECLARE_ENUM2(type,node,edge) 
     4 
     5// Flag to determine if domain expension should be periodic (and in which direction) 
     6DECLARE_ATTRIBUTE(bool,      i_periodic) 
     7DECLARE_ATTRIBUTE(bool,      j_periodic) 
  • XIOS/dev/dev_olga/src/config/file_attribute.conf

    r983 r1158  
    1414DECLARE_ENUM2(format,        netcdf4, netcdf4_classic) 
    1515DECLARE_ENUM2(convention,    CF, UGRID) 
     16DECLARE_ATTRIBUTE(StdString, convention_str) 
    1617DECLARE_ENUM2(par_access,    collective, independent) 
    1718DECLARE_ATTRIBUTE(bool,      append) 
    1819DECLARE_ENUM2(mode,          read, write) 
    19 DECLARE_ENUM4(time_counter,  centered, instant, record, none) 
     20DECLARE_ENUM7(time_counter,  centered, instant, record, exclusive, centered_exclusive, instant_exclusive, none) 
    2021DECLARE_ATTRIBUTE(StdString, time_counter_name) 
     22DECLARE_ENUM2(time_units, seconds, days) 
    2123DECLARE_ATTRIBUTE(int,       record_offset) 
    2224DECLARE_ATTRIBUTE(bool,      cyclic) 
    2325 
    2426DECLARE_ATTRIBUTE(int,       compression_level) 
    25 DECLARE_ATTRIBUTE(bool,      coupler) 
    2627 
    2728DECLARE_ENUM4(timeseries,    none, only, both, exclusive) 
    2829DECLARE_ATTRIBUTE(StdString, ts_prefix) 
    29  
     30DECLARE_ATTRIBUTE(StdString, time_stamp_name) 
     31DECLARE_ATTRIBUTE(StdString, time_stamp_format) 
     32DECLARE_ATTRIBUTE(StdString, uuid_name) 
     33DECLARE_ATTRIBUTE(StdString, uuid_format) 
  • XIOS/dev/dev_olga/src/config/interpolate_domain_attribute.conf

    r1021 r1158  
    11/* GLOBAL */ 
    2 DECLARE_ATTRIBUTE(StdString, file) 
    32DECLARE_ATTRIBUTE(int, order) 
    43DECLARE_ATTRIBUTE(bool, renormalize) 
     4DECLARE_ATTRIBUTE(bool, quantity) 
    55 
    66/* Write interpolation weights into file */ 
  • XIOS/dev/dev_olga/src/config/scalar_attribute.conf

    r887 r1158  
    99 
    1010DECLARE_ATTRIBUTE(StdString, scalar_ref) 
     11DECLARE_ATTRIBUTE(int, prec) 
  • XIOS/dev/dev_olga/src/config/var_attribute.conf

    r527 r1158  
    11DECLARE_TYPE(type) 
    22DECLARE_ATTRIBUTE(StdString, name) 
     3DECLARE_ENUM4(ts_target, file, field, both, none) 
  • XIOS/dev/dev_olga/src/context_client.cpp

    r1139 r1158  
    5252          ranksServerLeader.push_back(rankStart + i); 
    5353 
    54         ranksServerNotLeader.resize(0);      } 
     54        ranksServerNotLeader.resize(0); 
     55      } 
    5556      else 
    5657      { 
     
    125126     * Send the temporarily buffered event (if any). 
    126127     * 
    127      * \return true if a temporarily buffered event could be sent, false otherwise 
     128     * \return true if a temporarily buffered event could be sent, false otherwise  
    128129     */ 
    129130    bool CContextClient::sendTemporarilyBufferedEvent() 
     
    171172      } 
    172173    } 
    173  
    174174 
    175175    /*! 
     
    323323   } 
    324324 
    325    /*! 
    326     Get leading server in the group of connected server 
    327     \return ranks of leading servers 
    328     */ 
    329     const std::list<int>& CContextClient::getRanksServerNotLeader(void) const 
    330     { 
    331       return ranksServerNotLeader; 
    332     } 
    333  
    334     /*! 
    335     Check if client connects to leading server 
    336     \return connected(true), not connected (false) 
    337     */ 
    338     bool CContextClient::isServerNotLeader(void) const 
    339     { 
    340       return !ranksServerNotLeader.empty(); 
    341     } 
     325  /*! 
     326  Get leading server in the group of connected server 
     327  \return ranks of leading servers 
     328  */ 
     329  const std::list<int>& CContextClient::getRanksServerNotLeader(void) const 
     330  { 
     331    return ranksServerNotLeader; 
     332  } 
     333 
     334  /*! 
     335  Check if client connects to leading server 
     336  \return connected(true), not connected (false) 
     337  */ 
     338  bool CContextClient::isServerNotLeader(void) const 
     339  { 
     340    return !ranksServerNotLeader.empty(); 
     341  } 
    342342 
    343343  /*! 
  • XIOS/dev/dev_olga/src/context_client.hpp

    r1148 r1158  
    7272      MPI_Comm intraComm; //!< Communicator of client group 
    7373 
    74       map<int,CClientBuffer*> buffers;         //!< Buffers for connection to servers 
     74      map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers 
    7575 
    7676    private: 
  • XIOS/dev/dev_olga/src/context_server.cpp

    r1139 r1158  
    2323{ 
    2424 
    25   CContextServer::CContextServer(CContext* parent, MPI_Comm intraComm_,MPI_Comm interComm_) 
     25  CContextServer::CContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) 
    2626  { 
    2727    context=parent; 
     
    5050    pendingEvent=true; 
    5151  } 
    52  
    5352 
    5453  bool CContextServer::hasPendingEvent(void) 
     
    207206  { 
    208207    map<int,CServerBuffer*>::iterator it; 
    209     for(it=buffers.begin();it!=buffers.end();++it) 
    210       delete it->second; 
     208    for(it=buffers.begin();it!=buffers.end();++it) delete it->second; 
    211209  } 
    212210 
     
    263261    } 
    264262  } 
    265  
    266263} 
  • XIOS/dev/dev_olga/src/context_server.hpp

    r1130 r1158  
    1414    public: 
    1515 
    16     CContextServer(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm) ; 
    17  
     16    CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ; 
    1817    bool eventLoop(bool enableEventsProcessing = true); 
    1918    void listen(void) ; 
    2019    void checkPendingRequest(void) ; 
     20    void processRequest(int rank, char* buff,int count) ; 
    2121    void processEvents(void) ; 
    2222    bool hasFinished(void); 
     
    2424    void setPendingEvent(void) ; 
    2525    bool hasPendingEvent(void) ; 
    26  
    27     void processRequest(int rank, char* buff,int count) ; 
    2826 
    2927    MPI_Comm intraComm ; 
     
    5048 
    5149    private: 
    52     std::map<int, StdSize> mapBufferSize_; 
    53  
     50      std::map<int, StdSize> mapBufferSize_; 
    5451  } ; 
    5552 
  • XIOS/dev/dev_olga/src/cxios.cpp

    r1130 r1158  
    1616  string CXios::rootFile="./iodef.xml" ; 
    1717  string CXios::xiosCodeId="xios.x" ; 
    18 //  string CXios::xiosCodeIdPrm="xios.x.1" ; 
    19 //  string CXios::xiosCodeIdSnd="xios.x.2" ; 
    2018  string CXios::clientFile="./xios_client"; 
    2119  string CXios::serverFile="./xios_server"; 
     
    3634  bool CXios::isOptPerformance = true; 
    3735  CRegistry* CXios::globalRegistry = 0; 
     36  double CXios::recvFieldTimeout = 10.0; 
    3837 
    3938  //! Parse configuration file and create some objects from it 
     
    7170    bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor); 
    7271    minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double)); 
     72    recvFieldTimeout = getin<double>("recv_field_timeout", 10.0); 
     73    if (recvFieldTimeout < 0.0) 
     74      ERROR("CXios::parseXiosConfig()", "recv_field_timeout cannot be negative."); 
    7375 
    7476    globalComm=MPI_COMM_WORLD ; 
     
    115117       delete globalRegistry ; 
    116118     } 
    117      CClient::closeInfoStream(); 
    118    
    119119 
    120120#ifdef XIOS_MEMTRACK 
     121 
     122#ifdef XIOS_MEMTRACK_LIGHT 
     123       report(10) << " Memory report : current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 
     124       report(10) << " Memory report : maximum memory used by XIOS : "<<  MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 
     125#endif 
     126 
     127#ifdef XIOS_MEMTRACK_FULL 
    121128     MemTrack::TrackListMemoryUsage() ; 
    122129     MemTrack::TrackDumpBlocks(); 
     130#endif 
     131 
     132     CClient::closeInfoStream(); 
     133 
    123134#endif 
    124135  } 
     
    138149  { 
    139150    initServer(); 
     151    isClient = false; 
     152    isServer = true; 
    140153 
    141154    // Initialize all aspects MPI 
    142155    CServer::initialize(); 
    143     isServer = true; 
    144     isClient = false; 
    145  
    146156    if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ; 
    147157     
     
    181191     } 
    182192    CServer::finalize(); 
     193 
     194#ifdef XIOS_MEMTRACK 
     195 
     196#ifdef XIOS_MEMTRACK_LIGHT 
     197       report(10) << " Memory report : current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 
     198       report(10) << " Memory report : maximum memory used by XIOS : "<<  MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 
     199#endif 
     200 
     201#ifdef XIOS_MEMTRACK_FULL 
     202     MemTrack::TrackListMemoryUsage() ; 
     203     MemTrack::TrackDumpBlocks(); 
     204#endif 
     205#endif 
    183206    CServer::closeInfoStream(); 
    184207  } 
  • XIOS/dev/dev_olga/src/cxios.hpp

    r1077 r1158  
    3737     static bool isServer ; //!< Check if xios is server 
    3838 
    39 //     static int serverLevel ; 
    40  
    4139     static MPI_Comm globalComm ; //!< Global communicator 
    4240 
     
    5149     static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 
    5250     static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 
     51     static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field 
    5352 
    5453    public: 
  • XIOS/dev/dev_olga/src/data_output.cpp

    r887 r1158  
    8484      //---------------------------------------------------------------- 
    8585 
    86       void CDataOutput::writeField(CField* field) 
     86      void CDataOutput::writeFieldTimeAxis(CField* field) 
    8787      { 
    8888         CContext* context = CContext::getCurrent() ; 
    8989         boost::shared_ptr<CCalendar> calendar = context->getCalendar(); 
    9090 
     91         this->writeTimeAxis_(field, calendar); 
     92      } 
     93       
     94      void CDataOutput::writeField(CField* field) 
     95      { 
    9196         this->writeField_(field); 
    92          this->writeTimeAxis_(field, calendar); 
    9397      } 
    9498 
  • XIOS/dev/dev_olga/src/data_output.hpp

    r887 r1158  
    2525            void closeFile     (void); 
    2626            void writeField    (CField* field); 
     27            void writeFieldTimeAxis(CField* field) ; 
    2728            void writeFieldGrid(CField* field); 
    2829            void writeTimeDimension(void); 
  • XIOS/dev/dev_olga/src/date.cpp

    r647 r1158  
    6262         hour = date.hour; minute = date.minute; second = date.second; 
    6363         return (*this); 
     64      } 
     65 
     66      bool CDate::operator==(const CDate& date) 
     67      {          
     68         return (&(*relCalendar) == &(*date.relCalendar) && 
     69                 year == date.year && month  == date.month  && day == date.day && 
     70                 hour == date.hour && minute == date.minute && second == date.second); 
     71          
    6472      } 
    6573 
  • XIOS/dev/dev_olga/src/date.hpp

    r591 r1158  
    3232            /// Opérateurs /// 
    3333            CDate& operator=(const CDate& date); 
     34            bool operator==(const CDate& date); 
    3435            friend StdOStream& operator<<(StdOStream& out, const CDate& date); 
    3536            friend StdIStream& operator>>(StdIStream& in, CDate& date); 
  • XIOS/dev/dev_olga/src/declare_ref_func.hpp

    r1099 r1158  
    107107      if (refer_ptr->hasAutoGeneratedId() &&                           \ 
    108108          refer_ptr->hasDirect##type##Reference())                     \ 
    109           nameRef = refer_ptr->name_##_ref;                            \ 
     109        nameRef = refer_ptr->name_##_ref;                              \ 
    110110      else {                                                           \ 
    111          nameRef = refer_ptr->getId(); break;                           \ 
    112        }                                                                \ 
    113        if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr))        \ 
    114        {                                                                \ 
     111        nameRef = refer_ptr->getId(); break;                           \ 
     112      }                                                                \ 
     113      if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr))        \ 
     114      {                                                                \ 
    115115        ERROR("const StdString& C" #type "::get" #type "OutputName(void) const ",      \ 
    116                << "Circular dependency stopped for " #name_ " object "  \ 
    117                << "with id = \"" << refer_ptr->getId() << "\".");       \ 
    118        }                                                               \ 
     116              << "Circular dependency stopped for " #name_ " object "  \ 
     117              << "with id = \"" << refer_ptr->getId() << "\".");       \ 
     118      }                                                                \ 
    119119    }                                                                  \ 
    120120    return nameRef;                                                    \ 
  • XIOS/dev/dev_olga/src/dht_auto_indexing.cpp

    r924 r1158  
    7979    for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx) 
    8080    { 
    81       (itIdx->second)[0] = beginIndexOnProc_ + idx; 
     81//      (itIdx->second)[0] = beginIndexOnProc_ + idx; 
     82      (itIdx->second)[1] = beginIndexOnProc_ + idx; 
    8283      globalIndex_[idx] = beginIndexOnProc_ + idx; 
    8384      ++idx ; 
  • XIOS/dev/dev_olga/src/distribution_client.cpp

    r1144 r1158  
    152152  infoIndex_.resize(this->dims_); 
    153153 
     154  // A trick to determine position of each domain in domainList 
     155  int domIndex = 0, axisIndex = 0, scalarIndex = 0; 
     156  idx = 0; 
     157 
    154158  elementLocalIndex_.resize(numElement_); 
    155159  elementGlobalIndex_.resize(numElement_); 
     
    158162  elementNLocal_.resize(numElement_); 
    159163  elementNGlobal_.resize(numElement_); 
    160  
    161164  elementNLocal_[0] = 1; 
    162165  elementNGlobal_[0] = 1; 
     166  size_t localSize = 1, globalSize = 1; 
     167 
    163168  isDataDistributed_ = false; 
    164  
    165   size_t localSize = 1, globalSize = 1; 
    166  
    167   // A trick to determine position of each domain in domainList 
    168   int domIndex = 0, axisIndex = 0, scalarIndex = 0; 
    169   idx = 0; 
    170  
    171    
    172169  // Update all the vectors above 
    173170  for (idx = 0; idx < numElement_; ++idx) 
  • XIOS/dev/dev_olga/src/distribution_server.hpp

    r1144 r1158  
    4343    virtual void createGlobalIndex(); 
    4444 
    45     void createGlobalIndexFromIndex(const std::vector<CArray<int,1> >& globalIndexOnEachDimension, 
    46                                     const std::vector<int>& nbGlobal); 
    47  
    4845  protected: 
    4946    GlobalLocalMap globalLocalIndexMap_; 
  • XIOS/dev/dev_olga/src/duration.cpp

    r612 r1158  
    2626      } 
    2727 
     28      /*! 
     29        This operation may not serve much, it's here because of the need of operator== from generic class CType<T> 
     30      */ 
     31      bool CDuration::operator==(const CDuration& duration) 
     32      { 
     33        return (year == duration.year && month  == duration.month  && day == duration.day && 
     34                hour == duration.hour && minute == duration.minute && second == duration.second && timestep == duration.timestep);         
     35      } 
     36 
    2837      StdOStream& operator<<(StdOStream& out, const CDuration& duration) 
    2938      { 
     
    3847        char   c = '/'; 
    3948        bool   invalidUnit = false; 
     49        CDuration sentinel = NoneDu; 
     50 
     51#define setDuration(unit, value)                                                  \ 
     52        {                                                                         \ 
     53          if (sentinel.unit)                                                      \ 
     54            ERROR("StdIStream& operator>>(StdIStream& in , CDuration& duration)", \ 
     55                  << "Bad duration format: " #unit " has already been set.");      \ 
     56                                                                                  \ 
     57          duration.unit = value;                                                  \ 
     58          sentinel.unit = 1.0;                                                    \ 
     59        } 
    4060 
    4161        do 
     
    4868          switch (c) 
    4969          { 
    50             case 'y': duration.year   = v; break; 
    51             case 'd': duration.day    = v; break; 
    52             case 'h': duration.hour   = v; break; 
    53             case 's': duration.second = v; break; 
     70            case 'y': setDuration(year, v) break; 
     71            case 'd': setDuration(day, v) break; 
     72            case 'h': setDuration(hour, v) break; 
     73            case 's': setDuration(second, v) break; 
    5474            case 'm': 
    5575            { 
    5676              in >> c; 
    57               if      (c == 'i') duration.minute = v; 
    58               else if (c == 'o') duration.month  = v; 
     77              if      (c == 'i') setDuration(minute, v) 
     78              else if (c == 'o') setDuration(month, v) 
    5979              else invalidUnit = true; 
    6080              break; 
     
    6383            { 
    6484              in >> c; 
    65               if (c == 's') duration.timestep = v; 
     85              if (c == 's') setDuration(timestep, v) 
    6686              else invalidUnit = true; 
    6787              break; 
     
    7696                  << "Bad duration format: invalid unit, unexpected '" << c << "' character."); 
    7797        } while (in.peek() != EOF); // check whether there is a next character to read 
     98 
     99#undef setDuration 
    78100 
    79101        return in; 
  • XIOS/dev/dev_olga/src/duration.hpp

    r612 r1158  
    2222            /// Opérateurs /// 
    2323            CDuration& operator=(const CDuration& duration); 
     24            bool operator==(const CDuration& duration); 
    2425 
    2526            friend StdOStream& operator<<(StdOStream& out, const CDuration& duration); 
  • XIOS/dev/dev_olga/src/event_scheduler.cpp

    r992 r1158  
    150150        size_t hashId=recvRequest->buffer[1] ; 
    151151        size_t lev=recvRequest->buffer[2] ; 
    152 //        delete recvRequest ; 
     152        delete recvRequest ; 
    153153        pendingRecvParentRequest.pop() ;        
    154154  
    155155        if (lev==level) eventStack.push(pair<size_t,size_t>(timeLine,hashId)) ; 
    156156        else  bcastEvent(timeLine, hashId, lev) ; 
    157         delete recvRequest ; 
    158157      } 
    159158    }    
  • XIOS/dev/dev_olga/src/filter/file_server_writer_filter.cpp

    r1026 r1158  
    1818    field->writeUpdateData(data[0]->data); 
    1919  } 
     20 
     21  bool CFileServerWriterFilter::isDataExpected(const CDate& date) const 
     22  { 
     23    return true; 
     24  } 
    2025} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/file_server_writer_filter.hpp

    r1026 r1158  
    2323      CFileServerWriterFilter(CGarbageCollector& gc, CField* field); 
    2424 
     25      bool virtual isDataExpected(const CDate& date) const; 
    2526    protected: 
    2627      /*! 
  • XIOS/dev/dev_olga/src/filter/file_writer_filter.cpp

    r639 r1158  
    22#include "exception.hpp" 
    33#include "field.hpp" 
     4#include "utils.hpp" 
    45 
    56namespace xios 
     
    1617  void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    1718  { 
     19    bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() &&  
     20                               !field->default_value.isEmpty() &&  
     21                               field->detect_missing_value == true); 
     22    if (ignoreMissingValue) 
     23    { 
     24      double missingValue = field->default_value; 
     25      size_t nbData = data[0]->data.numElements(); 
     26      for (size_t idx = 0; idx < nbData; ++idx) 
     27      { 
     28        if (NumTraits<double>::isnan(data[0]->data(idx))) 
     29          data[0]->data(idx) = missingValue; 
     30      } 
     31    }     
     32 
    1833    field->sendUpdateData(data[0]->data); 
    1934  } 
     35 
     36  bool CFileWriterFilter::isDataExpected(const CDate& date) const 
     37  { 
     38    return true; 
     39  } 
    2040} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/file_writer_filter.hpp

    r639 r1158  
    2323      CFileWriterFilter(CGarbageCollector& gc, CField* field); 
    2424 
     25      /*! 
     26       * Tests whether data is expected for the specified date. 
     27       * 
     28       * \param date the date associated to the data 
     29       */ 
     30      bool virtual isDataExpected(const CDate& date) const; 
     31 
    2532    protected: 
    2633      /*! 
  • XIOS/dev/dev_olga/src/filter/filter.cpp

    r1021 r1158  
    4040    return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); 
    4141  } 
     42 
     43  bool CFilter::isDataExpected(const CDate& date) const 
     44  { 
     45    return COutputPin::isDataExpected(date); 
     46  } 
    4247} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/filter.hpp

    r1021 r1158  
    4848      bool virtual canBeTriggered() const; 
    4949 
     50      /*! 
     51       * Tests whether data is expected for the specified date. 
     52       * 
     53       * \param date the date associated to the data 
     54       */ 
     55      bool virtual isDataExpected(const CDate& date) const; 
     56 
    5057    protected: 
    5158      IFilterEngine* engine; //!< The filter engine, might be the filter itself 
  • XIOS/dev/dev_olga/src/filter/input_pin.hpp

    r1021 r1158  
    6060 
    6161      /*! 
     62       * Tests whether data is expected for the specified date. 
     63       * 
     64       * \param date the date associated to the data 
     65       */ 
     66      bool virtual isDataExpected(const CDate& date) const = 0; 
     67 
     68      /*! 
    6269       * Removes all pending packets which are older than the specified timestamp. 
    6370       * 
  • XIOS/dev/dev_olga/src/filter/output_pin.cpp

    r1021 r1158  
    7373  } 
    7474 
     75  bool COutputPin::isDataExpected(const CDate& date) const 
     76  { 
     77    std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 
     78    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
     79    { 
     80      if (it->first->isDataExpected(date)) 
     81        return true; 
     82    } 
     83 
     84    return false; 
     85  } 
     86 
    7587  void COutputPin::invalidate(Time timestamp) 
    7688  { 
  • XIOS/dev/dev_olga/src/filter/output_pin.hpp

    r1021 r1158  
    4646 
    4747      /*! 
     48       * Tests whether data is expected for the specified date. 
     49       * 
     50       * \param date the date associated to the data 
     51       */ 
     52      bool virtual isDataExpected(const CDate& date) const; 
     53 
     54      /*! 
    4855       * Removes all pending packets which are older than the specified timestamp. 
    4956       * 
  • XIOS/dev/dev_olga/src/filter/source_filter.cpp

    r1021 r1158  
    33#include "exception.hpp" 
    44#include "calendar_util.hpp" 
     5#include <limits>  
    56 
    67namespace xios 
    78{ 
    89  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
    9                                const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/) 
     10                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 
     11                               bool hasMissingValue /*= false*/, 
     12                               double defaultValue /*= 0.0*/) 
    1013    : COutputPin(gc, manualTrigger) 
    1114    , grid(grid) 
    1215    , offset(offset) 
     16    , hasMissingValue(hasMissingValue), defaultValue(defaultValue) 
    1317  { 
    1418    if (!grid) 
     
    2933    packet->data.resize(grid->storeIndex_client.numElements()); 
    3034    grid->inputField(data, packet->data); 
     35 
     36    // Convert missing values to NaN 
     37    if (hasMissingValue) 
     38    { 
     39      double nanValue = std::numeric_limits<double>::quiet_NaN(); 
     40      size_t nbData = packet->data.numElements(); 
     41      for (size_t idx = 0; idx < nbData; ++idx) 
     42      { 
     43        if (defaultValue == packet->data(idx)) 
     44          packet->data(idx) = nanValue; 
     45      } 
     46    } 
    3147 
    3248    onOutputReady(packet); 
  • XIOS/dev/dev_olga/src/filter/source_filter.hpp

    r1021 r1158  
    2323       * \param offset the offset applied to the timestamp of all packets 
    2424       * \param manualTrigger whether the output should be triggered manually 
     25       * \param hasMissingValue whether data has missing value 
     26       * \param defaultValue missing value to detect 
    2527       */ 
    2628      CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
    27                     const CDuration offset = NoneDu, bool manualTrigger = false); 
     29                    const CDuration offset = NoneDu, bool manualTrigger = false, 
     30                    bool hasMissingValue = false, 
     31                    double defaultValue = 0.0); 
    2832 
    2933      /*! 
     
    5862      CGrid* grid; //!< The grid attached to the data the filter can accept 
    5963      const CDuration offset; //!< The offset applied to the timestamp of all packets 
     64      bool hasMissingValue; 
     65      double defaultValue; 
    6066  }; // class CSourceFilter 
    6167} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp

    r1021 r1158  
    1111 
    1212  std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
    13   CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue) 
     13  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue) 
    1414  { 
    1515    if (!srcGrid || !destGrid) 
     
    2626      const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs(); 
    2727      size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size()); 
     28      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0; 
    2829      boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
    2930 
     
    103104      } 
    104105      packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 
    105       packet->data = defaultValue; 
     106      if (0 != packet->data.numElements()) 
     107        (packet->data)(0) = defaultValue; 
    106108      apply(data[0]->data, packet->data); 
    107109    } 
     
    115117 
    116118    // Get default value for output data 
    117     double defaultValue = 0.0; 
    118     if (0 != dataDest.numElements()) defaultValue = dataDest(0); 
     119    bool ignoreMissingValue = false;  
     120    double defaultValue = std::numeric_limits<double>::quiet_NaN(); 
     121    if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::isnan(dataDest(0)); 
    119122 
    120123    const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource(); 
     
    191194        else dataCurrentDest(i) = defaultValue; 
    192195 
    193       std::vector<bool> localInitFlag(dataCurrentDest.size(), true); 
     196      std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true); 
    194197      currentBuff = 0; 
    195198      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) 
     
    201204                         dataCurrentDest, 
    202205                         localInitFlag, 
    203                          defaultValue); 
     206                         ignoreMissingValue); 
    204207 
    205208        currentBuff += countSize; 
  • XIOS/dev/dev_olga/src/filter/spatial_transform_filter.hpp

    r873 r1158  
    3232       * \param srcGrid the source grid 
    3333       * \param destGrid the destination grid 
     34       * \param hasMissingValue whether field source has missing value 
     35       * \param defaultValue default value 
    3436       * \return the first and the last filters of the filter graph 
    3537       */ 
    3638      static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
    37       buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue); 
     39      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue); 
    3840 
    3941    protected: 
  • XIOS/dev/dev_olga/src/filter/store_filter.cpp

    r1021 r1158  
    2424    CTimer timer("CStoreFilter::getPacket"); 
    2525    CConstDataPacketPtr packet; 
    26     const double timeout = 10 ; // 10 seconds timeout 
     26    const double timeout = CXios::recvFieldTimeout; 
    2727 
    2828    do 
     
    8181  } 
    8282 
     83  bool CStoreFilter::isDataExpected(const CDate& date) const 
     84  { 
     85    return true; 
     86  } 
     87 
    8388  void CStoreFilter::invalidate(Time timestamp) 
    8489  { 
  • XIOS/dev/dev_olga/src/filter/store_filter.hpp

    r1021 r1158  
    5050 
    5151      /*! 
     52       * Tests whether data is expected for the specified date. 
     53       * 
     54       * \param date the date associated to the data 
     55       */ 
     56      bool virtual isDataExpected(const CDate& date) const; 
     57 
     58      /*! 
    5259       * Removes all pending packets which are older than the specified timestamp. 
    5360       * 
  • XIOS/dev/dev_olga/src/filter/temporal_filter.cpp

    r854 r1158  
    55namespace xios 
    66{ 
     7  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData); 
     8 
    79  CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 
    810                                   const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 
    911                                   bool ignoreMissingValue /*= false*/, double missingValue /*= 0.0*/) 
    1012    : CFilter(gc, 1, this) 
    11     , samplingFreq(samplingFreq) 
     13    , functor(createFunctor(opId, ignoreMissingValue, missingValue, tmpData)) 
     14    , isOnceOperation(functor->timeType() == func::CFunctor::once) 
     15    , isInstantOperation(functor->timeType() == func::CFunctor::instant) 
     16    // If we can optimize the sampling when dealing with an instant functor we do it 
     17    , samplingFreq((isInstantOperation && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq : samplingFreq) 
     18    , samplingOffset((isInstantOperation && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq - initDate.getRelCalendar().getTimeStep() : samplingOffset) 
    1219    , opFreq(opFreq) 
    13     , nextSamplingDate(initDate + samplingOffset + initDate.getRelCalendar().getTimeStep()) 
    14     , nextOperationDate(initDate + opFreq) 
     20    , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) 
     21    , nextOperationDate(initDate + this->samplingOffset + opFreq) 
    1522    , isFirstOperation(true) 
    1623  { 
    17 #define DECLARE_FUNCTOR(MType, mtype) \ 
    18     if (opId.compare(#mtype) == 0) \ 
    19     { \ 
    20       if (ignoreMissingValue) \ 
    21       { \ 
    22         functor.reset(new func::C##MType(tmpData, missingValue)); \ 
    23       } \ 
    24       else \ 
    25       { \ 
    26         functor.reset(new func::C##MType(tmpData)); \ 
    27       } \ 
    28     } 
    29  
    30 #include "functor_type.conf" 
    31  
    32     if (!functor) 
    33       ERROR("CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, ...)", 
    34             << "\"" << opId << "\" is not a valid operation."); 
    35  
    36     isOnceOperation = (functor->timeType() == func::CFunctor::once); 
    3724  } 
    3825 
     
    4330    if (data[0]->status != CDataPacket::END_OF_STREAM) 
    4431    { 
    45       const bool usePacket = isOnceOperation ? isFirstOperation : (data[0]->date >= nextSamplingDate); 
     32      bool usePacket, outputResult, copyLess; 
     33      if (isOnceOperation) 
     34        usePacket = outputResult = copyLess = isFirstOperation; 
     35      else 
     36      { 
     37        usePacket = (data[0]->date >= nextSamplingDate); 
     38        outputResult = (data[0]->date + samplingFreq > nextOperationDate); 
     39        copyLess = (isInstantOperation && usePacket && outputResult); 
     40      } 
     41 
    4642      if (usePacket) 
    4743      { 
    48         if (!tmpData.numElements()) 
    49           tmpData.resize(data[0]->data.numElements()); 
     44        if (!copyLess) 
     45        { 
     46          if (!tmpData.numElements()) 
     47            tmpData.resize(data[0]->data.numElements()); 
    5048 
    51         (*functor)(data[0]->data); 
     49          (*functor)(data[0]->data); 
     50        } 
    5251 
    5352        nextSamplingDate = nextSamplingDate + samplingFreq; 
    5453      } 
    5554 
    56       const bool outputResult = isOnceOperation ? isFirstOperation : (data[0]->date + samplingFreq > nextOperationDate); 
    5755      if (outputResult) 
    5856      { 
    59         functor->final(); 
     57        if (!copyLess) 
     58        { 
     59          functor->final(); 
    6060 
    61         packet = CDataPacketPtr(new CDataPacket); 
    62         packet->date = data[0]->date; 
    63         packet->timestamp = data[0]->timestamp; 
    64         packet->status = data[0]->status; 
    65         packet->data.resize(tmpData.numElements()); 
    66         packet->data = tmpData; 
     61          packet = CDataPacketPtr(new CDataPacket); 
     62          packet->date = data[0]->date; 
     63          packet->timestamp = data[0]->timestamp; 
     64          packet->status = data[0]->status; 
     65          packet->data.resize(tmpData.numElements()); 
     66          packet->data = tmpData; 
     67        } 
     68        else 
     69          packet = data[0]; 
    6770 
    6871        isFirstOperation = false; 
     
    7376    return packet; 
    7477  } 
     78 
     79  bool CTemporalFilter::isDataExpected(const CDate& date) const 
     80  { 
     81    return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate); 
     82  } 
     83 
     84  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData) 
     85  { 
     86    func::CFunctor* functor = NULL; 
     87 
     88    double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue; 
     89 
     90#define DECLARE_FUNCTOR(MType, mtype) \ 
     91    if (opId.compare(#mtype) == 0) \ 
     92    { \ 
     93      if (ignoreMissingValue) \ 
     94      { \ 
     95        functor = new func::C##MType(tmpData, defaultValue); \ 
     96      } \ 
     97      else \ 
     98      { \ 
     99        functor = new func::C##MType(tmpData); \ 
     100      } \ 
     101    } 
     102 
     103#include "functor_type.conf" 
     104 
     105    if (!functor) 
     106      ERROR("createFunctor(const std::string& opId, ...)", 
     107            << "\"" << opId << "\" is not a valid operation."); 
     108 
     109    return functor; 
     110  } 
    75111} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/temporal_filter.hpp

    r643 r1158  
    4040      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 
    4141 
     42      /*! 
     43       * Tests whether data is expected for the specified date. 
     44       * 
     45       * \param date the date associated to the data 
     46       */ 
     47      bool virtual isDataExpected(const CDate& date) const; 
     48 
    4249    private: 
    43       boost::scoped_ptr<func::CFunctor> functor; //!< The functor corresponding to the temporal operation 
     50      const boost::scoped_ptr<func::CFunctor> functor; //!< The functor corresponding to the temporal operation 
    4451      CArray<double, 1> tmpData; //!< The array of data used for temporary storage 
    4552      const CDuration samplingFreq; //!< The sampling frequency, i.e. the frequency at which the input data will be used 
     53      const CDuration samplingOffset; //!< The sampling offset, i.e. the offset after which the input data will be used 
    4654      const CDuration opFreq; //!< The operation frequency, i.e. the frequency at which the output data will be computed 
    4755      CDate nextSamplingDate; //!< The date of the next sampling 
    4856      CDate nextOperationDate; //!< The date of the next operation 
    4957      bool isFirstOperation; //!< True before the first operation was been computed 
    50       bool isOnceOperation; //!< True if the operation should be computed just once 
     58      const bool isOnceOperation; //!< True if the operation should be computed just once 
     59      const bool isInstantOperation; //!< True if the operation is instant 
    5160  }; // class CTemporalFilter 
    5261} // namespace xios 
  • XIOS/dev/dev_olga/src/functor/accumulate.cpp

    r591 r1158  
    11#include "accumulate.hpp" 
    22#include "array_new.hpp" 
     3#include "utils.hpp" 
    34 
    45namespace xios 
     
    3334            double* out=_doutput.dataFirst(); 
    3435            for (i=0; i<n; ++i,++in,++out)  
    35               if (*in!=missingValue) 
     36              if (!NumTraits<double>::isnan(*in)) 
    3637              { 
    37                 if(*out!=missingValue) *out  += *in; 
     38                if(!NumTraits<double>::isnan(*out)) *out  += *in; 
    3839                else *out=*in ; 
    3940              } 
  • XIOS/dev/dev_olga/src/functor/average.cpp

    r591 r1158  
    11#include "average.hpp" 
    22#include "array_new.hpp" 
     3#include "utils.hpp" 
    34 
    45namespace xios 
     
    4243            int* nc=nbcalls.dataFirst() ; 
    4344            for (i=0; i<n; ++i,++nc,++in)  
    44               if (*in!=missingValue) (*nc) ++; 
     45              if (!NumTraits<double>::isnan(*in)) (*nc) ++; 
    4546          } 
    4647        } 
     
    5455            int* nc=nbcalls.dataFirst() ; 
    5556            for (i=0; i<n; ++i,++in,++out,++nc)  
    56               if (*in!=missingValue)  
     57              if (!NumTraits<double>::isnan(*in))  
    5758              { 
    5859                if (*nc != 0) (*out)  += *in; 
  • XIOS/dev/dev_olga/src/functor/maximum.cpp

    r591 r1158  
    11#include "maximum.hpp" 
    22#include "array_new.hpp" 
    3  
    4  
     3#include "utils.hpp" 
    54 
    65namespace xios 
     
    3534           {  
    3635             for (; it1 != end1; it1++, it++)  
    37                if (*it1 != missingValue) 
     36               if (!NumTraits<double>::isnan(*it1)) 
    3837               { 
    39                  if ( *it != missingValue) *it = std::max(*it1, *it); 
     38                 if (!NumTraits<double>::isnan(*it)) *it = std::max(*it1, *it); 
    4039                 else *it=*it1 ;   
    4140               } 
  • XIOS/dev/dev_olga/src/functor/minimum.cpp

    r591 r1158  
    22#include "array_new.hpp" 
    33#include <algorithm> 
     4#include "utils.hpp" 
    45 
    56namespace xios 
     
    2627      { 
    2728        const double * it1  = _dinput.dataFirst(), 
    28                       * end1 = _dinput.dataFirst() + _dinput.numElements(); 
     29                      *end1 = _dinput.dataFirst() + _dinput.numElements(); 
    2930        double * it   = _doutput.dataFirst(); 
    3031         
     
    3536          {  
    3637            for (; it1 != end1; it1++, it++)  
    37               if (*it1!=missingValue) 
     38              if (!NumTraits<double>::isnan(*it1)) 
    3839              { 
    39                 if (*it != missingValue) *it = std::min(*it1, *it); 
     40                if (!NumTraits<double>::isnan(*it)) *it = std::min(*it1, *it); 
    4041                else *it=*it1 ; 
    4142              } 
  • XIOS/dev/dev_olga/src/generate_interface_impl.hpp

    r966 r1158  
    547547#undef macro 
    548548 
     549#define macro(N,EXTENT)\ 
     550  template <>\ 
     551  void CInterface::AttributeCInterface<CArray<StdString,N> >(ostream& oss, const string& className, const string& name)\ 
     552  { \ 
     553    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << "char* " << name <<", int str_len, int* str_size, int* extent)" << iendl; \ 
     554    oss << "{" << iendl; \ 
     555    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     556    oss << "  "<<className<<"_hdl->"<<name<<".resize(shape("<<EXTENT<<"));"<<iendl;\ 
     557    oss << "  Array<StdString,"<<#N<<">::iterator it, itb="<<className<<"_hdl->"<<name<<".begin(), ite="<<className<<"_hdl->"<<name<<".end() ;"<<iendl ;\ 
     558    oss << "  int i, n ;"<< iendl; \ 
     559    oss << "  for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&"<<name<<"[n],str_size[i]) ;"<<iendl ;\ 
     560    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     561    oss << "}" << std::endl; \ 
     562    oss << iendl; \ 
     563    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << "char* " << name << ", int str_size, int* extent)" << iendl; \ 
     564    oss << "{" << iendl; \ 
     565    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     566    oss << "  Array<StdString,"<<#N<<">::const_iterator it, itb="<<className<<"_hdl->"<<name<<".getInheritedValue().begin(), ite="<<className<<"_hdl->"<<name<<".getInheritedValue().end() ;" << iendl; \ 
     567    oss << "  int n ;"<< iendl; \ 
     568    oss << "  for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&"<<name<<"[n],it->size()) ; "<< iendl; \ 
     569    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     570    oss << "}" << std::endl; \ 
     571  } 
     572 
     573macro(1,"extent[0]") 
     574macro(2,"extent[0],extent[1]") 
     575macro(3,"extent[0],extent[1],extent[2]") 
     576macro(4,"extent[0],extent[1],extent[2],extent[3]") 
     577macro(5,"extent[0],extent[1],extent[2],extent[3],extent[4]") 
     578macro(6,"extent[0],extent[1],extent[2],extent[3],extent[4],extent[5]") 
     579macro(7,"extent[0],extent[1],extent[2],extent[3],extent[4],extent[5],extent[6]") 
     580#undef macro 
    549581// ///////////////////////////////////////////////// 
    550582// //          Fortran 2003 Interface             // 
     
    705737  #undef macro 
    706738 
     739#define macro(T)\ 
     740  template <>\ 
     741  void CInterface::AttributeFortran2003Interface<CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 
     742  {\ 
     743    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", str_len, str_size, extent) BIND(C)" << iendl; \ 
     744    oss << "  USE ISO_C_BINDING" << iendl; \ 
     745    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     746    oss << "  CHARACTER (KIND=C_CHAR), DIMENSION(*)    :: " << name << iendl; \ 
     747    oss << "  INTEGER (kind = C_INT), VALUE            :: str_len" << iendl; \ 
     748    oss << "  INTEGER (kind = C_INT), DIMENSION(*)     :: str_size" << iendl; \ 
     749    oss << "  INTEGER (kind = C_INT), DIMENSION(*)     :: extent" << iendl; \ 
     750    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     751    oss << iendl; \ 
     752    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", str_size, extent) BIND(C)" << iendl; \ 
     753    oss << "  USE ISO_C_BINDING" << iendl; \ 
     754    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     755    oss << "  CHARACTER (KIND=C_CHAR), DIMENSION(*)    :: " << name << iendl; \ 
     756    oss << "  INTEGER (kind = C_INT), VALUE            :: str_size" << iendl; \ 
     757    oss << "  INTEGER (kind = C_INT), DIMENSION(*)     :: extent" << iendl; \ 
     758    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
     759  } 
     760  macro(1) 
     761  macro(2) 
     762  macro(3) 
     763  macro(4) 
     764  macro(5) 
     765  macro(6) 
     766  macro(7) 
     767 
     768#undef macro 
     769 
    707770#define macro(T) \ 
    708771  template <> \ 
     
    808871 
    809872#undef macro 
     873 
     874#define macro(T,EXTENT)\ 
     875  template <> \ 
     876  void CInterface::AttributeFortranInterfaceDeclaration<CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 
     877  {\ 
     878    oss << "CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: " << name << "("<<EXTENT<<")"; \ 
     879  }\ 
     880\ 
     881  template <>\  
     882  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 
     883  {\ 
     884    oss << "CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: " << name << "("<<EXTENT<<")"; \ 
     885  } 
     886  macro(1,":") 
     887  macro(2,":,:") 
     888  macro(3,":,:,:") 
     889  macro(4,":,:,:,:") 
     890  macro(5,":,:,:,:,:") 
     891  macro(6,":,:,:,:,:,:") 
     892  macro(7,":,:,:,:,:,:,:") 
     893 
     894#undef macro 
     895 
     896 
     897 
     898 
     899   
    810900 
    811901#define macro(T) \ 
     
    9471037#undef macro 
    9481038 
     1039#define macro(T)\ 
     1040  template <>\ 
     1041  void CInterface::AttributeFortranInterfaceBody< CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 
     1042  {\ 
     1043     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     1044     oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     1045     oss << "(" << className << "_hdl%daddr, " << name <<"_, LEN("<<name<<"_), LEN_TRIM("<<name<< "_), SHAPE(" << name << "_))" << iendl; \ 
     1046     oss << "ENDIF"; \ 
     1047  } 
     1048 
     1049  macro(1) 
     1050  macro(2) 
     1051#undef macro 
     1052 
    9491053#define macro(T) \ 
    9501054  template <>  \ 
     
    10841188 
    10851189#undef macro 
     1190 
     1191#define macro(T)\ 
     1192  template <> \ 
     1193  void CInterface::AttributeFortranInterfaceGetBody< CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 
     1194  {\ 
     1195    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     1196    oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1197    oss << "(" << className << "_hdl%daddr, " << name << "_, LEN("<<name<<"_), SHAPE(" << name << "_))" << iendl; \ 
     1198    oss << "ENDIF"; \ 
     1199  } 
     1200  macro(1) 
     1201  macro(2) 
     1202  macro(3) 
     1203  macro(4) 
     1204  macro(5) 
     1205  macro(6) 
     1206  macro(7) 
     1207 
     1208#undef macro 
     1209   
    10861210} 
    10871211#endif 
  • XIOS/dev/dev_olga/src/group_template_impl.hpp

    r1030 r1158  
    88#include "context.hpp" 
    99#include "event_client.hpp" 
     10#include "context_client.hpp" 
    1011#include "message.hpp" 
    1112#include "type.hpp" 
     
    398399      } 
    399400    } 
    400  
    401     // if (! context->hasServer ) 
    402     // { 
    403     //    CContextClient* client=context->client ; 
    404  
    405     //    CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;    
    406     //    if (client->isServerLeader()) 
    407     //    { 
    408     //      CMessage msg ; 
    409     //      msg<<this->getId() ; 
    410     //      msg<<id ; 
    411     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    412     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    413     //        event.push(*itRank,1,msg) ; 
    414     //      client->sendEvent(event) ; 
    415     //    } 
    416     //    else client->sendEvent(event) ; 
    417     // } 
    418401       
    419402   } 
     
    464447      } 
    465448    } 
    466  
    467     // if (! context->hasServer ) 
    468     // { 
    469     //    CContextClient* client=context->client ; 
    470  
    471     //    CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;    
    472     //    if (client->isServerLeader()) 
    473     //    { 
    474     //      CMessage msg ; 
    475     //      msg<<this->getId() ; 
    476     //      msg<<id ; 
    477     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    478     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    479     //        event.push(*itRank,1,msg) ; 
    480     //      client->sendEvent(event) ; 
    481     //    } 
    482     //    else client->sendEvent(event) ; 
    483     // } 
    484        
    485449   } 
    486450    
     
    488452   void CGroupTemplate<U, V, W>::recvCreateChild(CEventServer& event) 
    489453   { 
    490        
    491454      CBufferIn* buffer=event.subEvents.begin()->buffer; 
    492455      string id; 
  • XIOS/dev/dev_olga/src/interface/c/icfield.cpp

    r943 r1158  
    7676// -----------------------------------------------------------------------------------------------------    
    7777 
    78   void cxios_field_is_active (XFieldPtr field_hdl, bool* ret) 
     78  void cxios_field_is_active (XFieldPtr field_hdl, bool at_current_timestep, bool* ret) 
    7979  { 
    8080    CTimer::get("XIOS").resume() ; 
    81     *ret = field_hdl->isActive(); 
     81    *ret = field_hdl->isActive(at_current_timestep); 
    8282    CTimer::get("XIOS").suspend() ; 
    8383  } 
  • XIOS/dev/dev_olga/src/interface/c_attr/icaxis_attr.cpp

    r817 r1158  
    188188 
    189189 
     190  void cxios_set_axis_label(axis_Ptr axis_hdl, char* label, int str_len, int* str_size, int* extent) 
     191  { 
     192    CTimer::get("XIOS").resume(); 
     193    axis_hdl->label.resize(shape(extent[0])); 
     194    Array<StdString,1>::iterator it, itb=axis_hdl->label.begin(), ite=axis_hdl->label.end() ; 
     195    int i, n ; 
     196    for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&label[n],str_size[i]) ; 
     197    CTimer::get("XIOS").suspend(); 
     198  } 
     199 
     200  void cxios_get_axis_label(axis_Ptr axis_hdl, char* label, int str_size, int* extent) 
     201  { 
     202    CTimer::get("XIOS").resume(); 
     203    Array<StdString,1>::const_iterator it, itb=axis_hdl->label.getInheritedValue().begin(), ite=axis_hdl->label.getInheritedValue().end() ; 
     204    int n ; 
     205    for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&label[n],it->size()) ;  
     206    CTimer::get("XIOS").suspend(); 
     207  } 
     208 
     209  bool cxios_is_defined_axis_label(axis_Ptr axis_hdl) 
     210  { 
     211     CTimer::get("XIOS").resume(); 
     212     bool isDefined = axis_hdl->label.hasInheritedValue(); 
     213     CTimer::get("XIOS").suspend(); 
     214     return isDefined; 
     215  } 
     216 
     217 
    190218  void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size) 
    191219  { 
     
    360388 
    361389 
     390  void cxios_set_axis_prec(axis_Ptr axis_hdl, int prec) 
     391  { 
     392    CTimer::get("XIOS").resume(); 
     393    axis_hdl->prec.setValue(prec); 
     394    CTimer::get("XIOS").suspend(); 
     395  } 
     396 
     397  void cxios_get_axis_prec(axis_Ptr axis_hdl, int* prec) 
     398  { 
     399    CTimer::get("XIOS").resume(); 
     400    *prec = axis_hdl->prec.getInheritedValue(); 
     401    CTimer::get("XIOS").suspend(); 
     402  } 
     403 
     404  bool cxios_is_defined_axis_prec(axis_Ptr axis_hdl) 
     405  { 
     406     CTimer::get("XIOS").resume(); 
     407     bool isDefined = axis_hdl->prec.hasInheritedValue(); 
     408     CTimer::get("XIOS").suspend(); 
     409     return isDefined; 
     410  } 
     411 
     412 
    362413  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size) 
    363414  { 
  • XIOS/dev/dev_olga/src/interface/c_attr/icaxisgroup_attr.cpp

    r817 r1158  
    214214 
    215215 
     216  void cxios_set_axisgroup_label(axisgroup_Ptr axisgroup_hdl, char* label, int str_len, int* str_size, int* extent) 
     217  { 
     218    CTimer::get("XIOS").resume(); 
     219    axisgroup_hdl->label.resize(shape(extent[0])); 
     220    Array<StdString,1>::iterator it, itb=axisgroup_hdl->label.begin(), ite=axisgroup_hdl->label.end() ; 
     221    int i, n ; 
     222    for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&label[n],str_size[i]) ; 
     223    CTimer::get("XIOS").suspend(); 
     224  } 
     225 
     226  void cxios_get_axisgroup_label(axisgroup_Ptr axisgroup_hdl, char* label, int str_size, int* extent) 
     227  { 
     228    CTimer::get("XIOS").resume(); 
     229    Array<StdString,1>::const_iterator it, itb=axisgroup_hdl->label.getInheritedValue().begin(), ite=axisgroup_hdl->label.getInheritedValue().end() ; 
     230    int n ; 
     231    for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&label[n],it->size()) ;  
     232    CTimer::get("XIOS").suspend(); 
     233  } 
     234 
     235  bool cxios_is_defined_axisgroup_label(axisgroup_Ptr axisgroup_hdl) 
     236  { 
     237     CTimer::get("XIOS").resume(); 
     238     bool isDefined = axisgroup_hdl->label.hasInheritedValue(); 
     239     CTimer::get("XIOS").suspend(); 
     240     return isDefined; 
     241  } 
     242 
     243 
    216244  void cxios_set_axisgroup_long_name(axisgroup_Ptr axisgroup_hdl, const char * long_name, int long_name_size) 
    217245  { 
     
    386414 
    387415 
     416  void cxios_set_axisgroup_prec(axisgroup_Ptr axisgroup_hdl, int prec) 
     417  { 
     418    CTimer::get("XIOS").resume(); 
     419    axisgroup_hdl->prec.setValue(prec); 
     420    CTimer::get("XIOS").suspend(); 
     421  } 
     422 
     423  void cxios_get_axisgroup_prec(axisgroup_Ptr axisgroup_hdl, int* prec) 
     424  { 
     425    CTimer::get("XIOS").resume(); 
     426    *prec = axisgroup_hdl->prec.getInheritedValue(); 
     427    CTimer::get("XIOS").suspend(); 
     428  } 
     429 
     430  bool cxios_is_defined_axisgroup_prec(axisgroup_Ptr axisgroup_hdl) 
     431  { 
     432     CTimer::get("XIOS").resume(); 
     433     bool isDefined = axisgroup_hdl->prec.hasInheritedValue(); 
     434     CTimer::get("XIOS").suspend(); 
     435     return isDefined; 
     436  } 
     437 
     438 
    388439  void cxios_set_axisgroup_standard_name(axisgroup_Ptr axisgroup_hdl, const char * standard_name, int standard_name_size) 
    389440  { 
  • XIOS/dev/dev_olga/src/interface/c_attr/icdomain_attr.cpp

    r789 r1158  
    747747 
    748748 
     749  void cxios_set_domain_prec(domain_Ptr domain_hdl, int prec) 
     750  { 
     751    CTimer::get("XIOS").resume(); 
     752    domain_hdl->prec.setValue(prec); 
     753    CTimer::get("XIOS").suspend(); 
     754  } 
     755 
     756  void cxios_get_domain_prec(domain_Ptr domain_hdl, int* prec) 
     757  { 
     758    CTimer::get("XIOS").resume(); 
     759    *prec = domain_hdl->prec.getInheritedValue(); 
     760    CTimer::get("XIOS").suspend(); 
     761  } 
     762 
     763  bool cxios_is_defined_domain_prec(domain_Ptr domain_hdl) 
     764  { 
     765     CTimer::get("XIOS").resume(); 
     766     bool isDefined = domain_hdl->prec.hasInheritedValue(); 
     767     CTimer::get("XIOS").suspend(); 
     768     return isDefined; 
     769  } 
     770 
     771 
    749772  void cxios_set_domain_standard_name(domain_Ptr domain_hdl, const char * standard_name, int standard_name_size) 
    750773  { 
  • XIOS/dev/dev_olga/src/interface/c_attr/icdomaingroup_attr.cpp

    r789 r1158  
    773773 
    774774 
     775  void cxios_set_domaingroup_prec(domaingroup_Ptr domaingroup_hdl, int prec) 
     776  { 
     777    CTimer::get("XIOS").resume(); 
     778    domaingroup_hdl->prec.setValue(prec); 
     779    CTimer::get("XIOS").suspend(); 
     780  } 
     781 
     782  void cxios_get_domaingroup_prec(domaingroup_Ptr domaingroup_hdl, int* prec) 
     783  { 
     784    CTimer::get("XIOS").resume(); 
     785    *prec = domaingroup_hdl->prec.getInheritedValue(); 
     786    CTimer::get("XIOS").suspend(); 
     787  } 
     788 
     789  bool cxios_is_defined_domaingroup_prec(domaingroup_Ptr domaingroup_hdl) 
     790  { 
     791     CTimer::get("XIOS").resume(); 
     792     bool isDefined = domaingroup_hdl->prec.hasInheritedValue(); 
     793     CTimer::get("XIOS").suspend(); 
     794     return isDefined; 
     795  } 
     796 
     797 
    775798  void cxios_set_domaingroup_standard_name(domaingroup_Ptr domaingroup_hdl, const char * standard_name, int standard_name_size) 
    776799  { 
  • XIOS/dev/dev_olga/src/interface/c_attr/icexpand_domain_attr.cpp

    r981 r1158  
    1717{ 
    1818  typedef xios::CExpandDomain* expand_domain_Ptr; 
     19 
     20  void cxios_set_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl, bool i_periodic) 
     21  { 
     22    CTimer::get("XIOS").resume(); 
     23    expand_domain_hdl->i_periodic.setValue(i_periodic); 
     24    CTimer::get("XIOS").suspend(); 
     25  } 
     26 
     27  void cxios_get_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl, bool* i_periodic) 
     28  { 
     29    CTimer::get("XIOS").resume(); 
     30    *i_periodic = expand_domain_hdl->i_periodic.getInheritedValue(); 
     31    CTimer::get("XIOS").suspend(); 
     32  } 
     33 
     34  bool cxios_is_defined_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl) 
     35  { 
     36     CTimer::get("XIOS").resume(); 
     37     bool isDefined = expand_domain_hdl->i_periodic.hasInheritedValue(); 
     38     CTimer::get("XIOS").suspend(); 
     39     return isDefined; 
     40  } 
     41 
     42 
     43  void cxios_set_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl, bool j_periodic) 
     44  { 
     45    CTimer::get("XIOS").resume(); 
     46    expand_domain_hdl->j_periodic.setValue(j_periodic); 
     47    CTimer::get("XIOS").suspend(); 
     48  } 
     49 
     50  void cxios_get_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl, bool* j_periodic) 
     51  { 
     52    CTimer::get("XIOS").resume(); 
     53    *j_periodic = expand_domain_hdl->j_periodic.getInheritedValue(); 
     54    CTimer::get("XIOS").suspend(); 
     55  } 
     56 
     57  bool cxios_is_defined_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl) 
     58  { 
     59     CTimer::get("XIOS").resume(); 
     60     bool isDefined = expand_domain_hdl->j_periodic.hasInheritedValue(); 
     61     CTimer::get("XIOS").suspend(); 
     62     return isDefined; 
     63  } 
     64 
    1965 
    2066  void cxios_set_expand_domain_order(expand_domain_Ptr expand_domain_hdl, int order) 
  • XIOS/dev/dev_olga/src/interface/c_attr/icfile_attr.cpp

    r932 r1158  
    553553 
    554554 
     555  void cxios_set_file_time_stamp_format(file_Ptr file_hdl, const char * time_stamp_format, int time_stamp_format_size) 
     556  { 
     557    std::string time_stamp_format_str; 
     558    if (!cstr2string(time_stamp_format, time_stamp_format_size, time_stamp_format_str)) return; 
     559    CTimer::get("XIOS").resume(); 
     560    file_hdl->time_stamp_format.setValue(time_stamp_format_str); 
     561    CTimer::get("XIOS").suspend(); 
     562  } 
     563 
     564  void cxios_get_file_time_stamp_format(file_Ptr file_hdl, char * time_stamp_format, int time_stamp_format_size) 
     565  { 
     566    CTimer::get("XIOS").resume(); 
     567    if (!string_copy(file_hdl->time_stamp_format.getInheritedValue(), time_stamp_format, time_stamp_format_size)) 
     568      ERROR("void cxios_get_file_time_stamp_format(file_Ptr file_hdl, char * time_stamp_format, int time_stamp_format_size)", << "Input string is too short"); 
     569    CTimer::get("XIOS").suspend(); 
     570  } 
     571 
     572  bool cxios_is_defined_file_time_stamp_format(file_Ptr file_hdl) 
     573  { 
     574     CTimer::get("XIOS").resume(); 
     575     bool isDefined = file_hdl->time_stamp_format.hasInheritedValue(); 
     576     CTimer::get("XIOS").suspend(); 
     577     return isDefined; 
     578  } 
     579 
     580 
     581  void cxios_set_file_time_stamp_name(file_Ptr file_hdl, const char * time_stamp_name, int time_stamp_name_size) 
     582  { 
     583    std::string time_stamp_name_str; 
     584    if (!cstr2string(time_stamp_name, time_stamp_name_size, time_stamp_name_str)) return; 
     585    CTimer::get("XIOS").resume(); 
     586    file_hdl->time_stamp_name.setValue(time_stamp_name_str); 
     587    CTimer::get("XIOS").suspend(); 
     588  } 
     589 
     590  void cxios_get_file_time_stamp_name(file_Ptr file_hdl, char * time_stamp_name, int time_stamp_name_size) 
     591  { 
     592    CTimer::get("XIOS").resume(); 
     593    if (!string_copy(file_hdl->time_stamp_name.getInheritedValue(), time_stamp_name, time_stamp_name_size)) 
     594      ERROR("void cxios_get_file_time_stamp_name(file_Ptr file_hdl, char * time_stamp_name, int time_stamp_name_size)", << "Input string is too short"); 
     595    CTimer::get("XIOS").suspend(); 
     596  } 
     597 
     598  bool cxios_is_defined_file_time_stamp_name(file_Ptr file_hdl) 
     599  { 
     600     CTimer::get("XIOS").resume(); 
     601     bool isDefined = file_hdl->time_stamp_name.hasInheritedValue(); 
     602     CTimer::get("XIOS").suspend(); 
     603     return isDefined; 
     604  } 
     605 
     606 
     607  void cxios_set_file_time_units(file_Ptr file_hdl, const char * time_units, int time_units_size) 
     608  { 
     609    std::string time_units_str; 
     610    if (!cstr2string(time_units, time_units_size, time_units_str)) return; 
     611    CTimer::get("XIOS").resume(); 
     612    file_hdl->time_units.fromString(time_units_str); 
     613    CTimer::get("XIOS").suspend(); 
     614  } 
     615 
     616  void cxios_get_file_time_units(file_Ptr file_hdl, char * time_units, int time_units_size) 
     617  { 
     618    CTimer::get("XIOS").resume(); 
     619    if (!string_copy(file_hdl->time_units.getInheritedStringValue(), time_units, time_units_size)) 
     620      ERROR("void cxios_get_file_time_units(file_Ptr file_hdl, char * time_units, int time_units_size)", << "Input string is too short"); 
     621    CTimer::get("XIOS").suspend(); 
     622  } 
     623 
     624  bool cxios_is_defined_file_time_units(file_Ptr file_hdl) 
     625  { 
     626     CTimer::get("XIOS").resume(); 
     627     bool isDefined = file_hdl->time_units.hasInheritedValue(); 
     628     CTimer::get("XIOS").suspend(); 
     629     return isDefined; 
     630  } 
     631 
     632 
    555633  void cxios_set_file_timeseries(file_Ptr file_hdl, const char * timeseries, int timeseries_size) 
    556634  { 
     
    629707     return isDefined; 
    630708  } 
     709 
     710 
     711  void cxios_set_file_uuid_format(file_Ptr file_hdl, const char * uuid_format, int uuid_format_size) 
     712  { 
     713    std::string uuid_format_str; 
     714    if (!cstr2string(uuid_format, uuid_format_size, uuid_format_str)) return; 
     715    CTimer::get("XIOS").resume(); 
     716    file_hdl->uuid_format.setValue(uuid_format_str); 
     717    CTimer::get("XIOS").suspend(); 
     718  } 
     719 
     720  void cxios_get_file_uuid_format(file_Ptr file_hdl, char * uuid_format, int uuid_format_size) 
     721  { 
     722    CTimer::get("XIOS").resume(); 
     723    if (!string_copy(file_hdl->uuid_format.getInheritedValue(), uuid_format, uuid_format_size)) 
     724      ERROR("void cxios_get_file_uuid_format(file_Ptr file_hdl, char * uuid_format, int uuid_format_size)", << "Input string is too short"); 
     725    CTimer::get("XIOS").suspend(); 
     726  } 
     727 
     728  bool cxios_is_defined_file_uuid_format(file_Ptr file_hdl) 
     729  { 
     730     CTimer::get("XIOS").resume(); 
     731     bool isDefined = file_hdl->uuid_format.hasInheritedValue(); 
     732     CTimer::get("XIOS").suspend(); 
     733     return isDefined; 
     734  } 
     735 
     736 
     737  void cxios_set_file_uuid_name(file_Ptr file_hdl, const char * uuid_name, int uuid_name_size) 
     738  { 
     739    std::string uuid_name_str; 
     740    if (!cstr2string(uuid_name, uuid_name_size, uuid_name_str)) return; 
     741    CTimer::get("XIOS").resume(); 
     742    file_hdl->uuid_name.setValue(uuid_name_str); 
     743    CTimer::get("XIOS").suspend(); 
     744  } 
     745 
     746  void cxios_get_file_uuid_name(file_Ptr file_hdl, char * uuid_name, int uuid_name_size) 
     747  { 
     748    CTimer::get("XIOS").resume(); 
     749    if (!string_copy(file_hdl->uuid_name.getInheritedValue(), uuid_name, uuid_name_size)) 
     750      ERROR("void cxios_get_file_uuid_name(file_Ptr file_hdl, char * uuid_name, int uuid_name_size)", << "Input string is too short"); 
     751    CTimer::get("XIOS").suspend(); 
     752  } 
     753 
     754  bool cxios_is_defined_file_uuid_name(file_Ptr file_hdl) 
     755  { 
     756     CTimer::get("XIOS").resume(); 
     757     bool isDefined = file_hdl->uuid_name.hasInheritedValue(); 
     758     CTimer::get("XIOS").suspend(); 
     759     return isDefined; 
     760  } 
    631761} 
  • XIOS/dev/dev_olga/src/interface/c_attr/icfilegroup_attr.cpp

    r932 r1158  
    579579 
    580580 
     581  void cxios_set_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl, const char * time_stamp_format, int time_stamp_format_size) 
     582  { 
     583    std::string time_stamp_format_str; 
     584    if (!cstr2string(time_stamp_format, time_stamp_format_size, time_stamp_format_str)) return; 
     585    CTimer::get("XIOS").resume(); 
     586    filegroup_hdl->time_stamp_format.setValue(time_stamp_format_str); 
     587    CTimer::get("XIOS").suspend(); 
     588  } 
     589 
     590  void cxios_get_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl, char * time_stamp_format, int time_stamp_format_size) 
     591  { 
     592    CTimer::get("XIOS").resume(); 
     593    if (!string_copy(filegroup_hdl->time_stamp_format.getInheritedValue(), time_stamp_format, time_stamp_format_size)) 
     594      ERROR("void cxios_get_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl, char * time_stamp_format, int time_stamp_format_size)", << "Input string is too short"); 
     595    CTimer::get("XIOS").suspend(); 
     596  } 
     597 
     598  bool cxios_is_defined_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl) 
     599  { 
     600     CTimer::get("XIOS").resume(); 
     601     bool isDefined = filegroup_hdl->time_stamp_format.hasInheritedValue(); 
     602     CTimer::get("XIOS").suspend(); 
     603     return isDefined; 
     604  } 
     605 
     606 
     607  void cxios_set_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl, const char * time_stamp_name, int time_stamp_name_size) 
     608  { 
     609    std::string time_stamp_name_str; 
     610    if (!cstr2string(time_stamp_name, time_stamp_name_size, time_stamp_name_str)) return; 
     611    CTimer::get("XIOS").resume(); 
     612    filegroup_hdl->time_stamp_name.setValue(time_stamp_name_str); 
     613    CTimer::get("XIOS").suspend(); 
     614  } 
     615 
     616  void cxios_get_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl, char * time_stamp_name, int time_stamp_name_size) 
     617  { 
     618    CTimer::get("XIOS").resume(); 
     619    if (!string_copy(filegroup_hdl->time_stamp_name.getInheritedValue(), time_stamp_name, time_stamp_name_size)) 
     620      ERROR("void cxios_get_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl, char * time_stamp_name, int time_stamp_name_size)", << "Input string is too short"); 
     621    CTimer::get("XIOS").suspend(); 
     622  } 
     623 
     624  bool cxios_is_defined_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl) 
     625  { 
     626     CTimer::get("XIOS").resume(); 
     627     bool isDefined = filegroup_hdl->time_stamp_name.hasInheritedValue(); 
     628     CTimer::get("XIOS").suspend(); 
     629     return isDefined; 
     630  } 
     631 
     632 
     633  void cxios_set_filegroup_time_units(filegroup_Ptr filegroup_hdl, const char * time_units, int time_units_size) 
     634  { 
     635    std::string time_units_str; 
     636    if (!cstr2string(time_units, time_units_size, time_units_str)) return; 
     637    CTimer::get("XIOS").resume(); 
     638    filegroup_hdl->time_units.fromString(time_units_str); 
     639    CTimer::get("XIOS").suspend(); 
     640  } 
     641 
     642  void cxios_get_filegroup_time_units(filegroup_Ptr filegroup_hdl, char * time_units, int time_units_size) 
     643  { 
     644    CTimer::get("XIOS").resume(); 
     645    if (!string_copy(filegroup_hdl->time_units.getInheritedStringValue(), time_units, time_units_size)) 
     646      ERROR("void cxios_get_filegroup_time_units(filegroup_Ptr filegroup_hdl, char * time_units, int time_units_size)", << "Input string is too short"); 
     647    CTimer::get("XIOS").suspend(); 
     648  } 
     649 
     650  bool cxios_is_defined_filegroup_time_units(filegroup_Ptr filegroup_hdl) 
     651  { 
     652     CTimer::get("XIOS").resume(); 
     653     bool isDefined = filegroup_hdl->time_units.hasInheritedValue(); 
     654     CTimer::get("XIOS").suspend(); 
     655     return isDefined; 
     656  } 
     657 
     658 
    581659  void cxios_set_filegroup_timeseries(filegroup_Ptr filegroup_hdl, const char * timeseries, int timeseries_size) 
    582660  { 
     
    655733     return isDefined; 
    656734  } 
     735 
     736 
     737  void cxios_set_filegroup_uuid_format(filegroup_Ptr filegroup_hdl, const char * uuid_format, int uuid_format_size) 
     738  { 
     739    std::string uuid_format_str; 
     740    if (!cstr2string(uuid_format, uuid_format_size, uuid_format_str)) return; 
     741    CTimer::get("XIOS").resume(); 
     742    filegroup_hdl->uuid_format.setValue(uuid_format_str); 
     743    CTimer::get("XIOS").suspend(); 
     744  } 
     745 
     746  void cxios_get_filegroup_uuid_format(filegroup_Ptr filegroup_hdl, char * uuid_format, int uuid_format_size) 
     747  { 
     748    CTimer::get("XIOS").resume(); 
     749    if (!string_copy(filegroup_hdl->uuid_format.getInheritedValue(), uuid_format, uuid_format_size)) 
     750      ERROR("void cxios_get_filegroup_uuid_format(filegroup_Ptr filegroup_hdl, char * uuid_format, int uuid_format_size)", << "Input string is too short"); 
     751    CTimer::get("XIOS").suspend(); 
     752  } 
     753 
     754  bool cxios_is_defined_filegroup_uuid_format(filegroup_Ptr filegroup_hdl) 
     755  { 
     756     CTimer::get("XIOS").resume(); 
     757     bool isDefined = filegroup_hdl->uuid_format.hasInheritedValue(); 
     758     CTimer::get("XIOS").suspend(); 
     759     return isDefined; 
     760  } 
     761 
     762 
     763  void cxios_set_filegroup_uuid_name(filegroup_Ptr filegroup_hdl, const char * uuid_name, int uuid_name_size) 
     764  { 
     765    std::string uuid_name_str; 
     766    if (!cstr2string(uuid_name, uuid_name_size, uuid_name_str)) return; 
     767    CTimer::get("XIOS").resume(); 
     768    filegroup_hdl->uuid_name.setValue(uuid_name_str); 
     769    CTimer::get("XIOS").suspend(); 
     770  } 
     771 
     772  void cxios_get_filegroup_uuid_name(filegroup_Ptr filegroup_hdl, char * uuid_name, int uuid_name_size) 
     773  { 
     774    CTimer::get("XIOS").resume(); 
     775    if (!string_copy(filegroup_hdl->uuid_name.getInheritedValue(), uuid_name, uuid_name_size)) 
     776      ERROR("void cxios_get_filegroup_uuid_name(filegroup_Ptr filegroup_hdl, char * uuid_name, int uuid_name_size)", << "Input string is too short"); 
     777    CTimer::get("XIOS").suspend(); 
     778  } 
     779 
     780  bool cxios_is_defined_filegroup_uuid_name(filegroup_Ptr filegroup_hdl) 
     781  { 
     782     CTimer::get("XIOS").resume(); 
     783     bool isDefined = filegroup_hdl->uuid_name.hasInheritedValue(); 
     784     CTimer::get("XIOS").suspend(); 
     785     return isDefined; 
     786  } 
    657787} 
  • XIOS/dev/dev_olga/src/interface/c_attr/icinterpolate_domain_attr.cpp

    r1021 r1158  
    1717{ 
    1818  typedef xios::CInterpolateDomain* interpolate_domain_Ptr; 
    19  
    20   void cxios_set_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, const char * file, int file_size) 
    21   { 
    22     std::string file_str; 
    23     if (!cstr2string(file, file_size, file_str)) return; 
    24     CTimer::get("XIOS").resume(); 
    25     interpolate_domain_hdl->file.setValue(file_str); 
    26     CTimer::get("XIOS").suspend(); 
    27   } 
    28  
    29   void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size) 
    30   { 
    31     CTimer::get("XIOS").resume(); 
    32     if (!string_copy(interpolate_domain_hdl->file.getInheritedValue(), file, file_size)) 
    33       ERROR("void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)", << "Input string is too short"); 
    34     CTimer::get("XIOS").suspend(); 
    35   } 
    36  
    37   bool cxios_is_defined_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl) 
    38   { 
    39      CTimer::get("XIOS").resume(); 
    40      bool isDefined = interpolate_domain_hdl->file.hasInheritedValue(); 
    41      CTimer::get("XIOS").suspend(); 
    42      return isDefined; 
    43   } 
    44  
    4519 
    4620  void cxios_set_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size) 
  • XIOS/dev/dev_olga/src/interface/c_attr/icscalar_attr.cpp

    r891 r1158  
    6565     CTimer::get("XIOS").resume(); 
    6666     bool isDefined = scalar_hdl->name.hasInheritedValue(); 
     67     CTimer::get("XIOS").suspend(); 
     68     return isDefined; 
     69  } 
     70 
     71 
     72  void cxios_set_scalar_prec(scalar_Ptr scalar_hdl, int prec) 
     73  { 
     74    CTimer::get("XIOS").resume(); 
     75    scalar_hdl->prec.setValue(prec); 
     76    CTimer::get("XIOS").suspend(); 
     77  } 
     78 
     79  void cxios_get_scalar_prec(scalar_Ptr scalar_hdl, int* prec) 
     80  { 
     81    CTimer::get("XIOS").resume(); 
     82    *prec = scalar_hdl->prec.getInheritedValue(); 
     83    CTimer::get("XIOS").suspend(); 
     84  } 
     85 
     86  bool cxios_is_defined_scalar_prec(scalar_Ptr scalar_hdl) 
     87  { 
     88     CTimer::get("XIOS").resume(); 
     89     bool isDefined = scalar_hdl->prec.hasInheritedValue(); 
    6790     CTimer::get("XIOS").suspend(); 
    6891     return isDefined; 
  • XIOS/dev/dev_olga/src/interface/c_attr/icscalargroup_attr.cpp

    r891 r1158  
    9696 
    9797 
     98  void cxios_set_scalargroup_prec(scalargroup_Ptr scalargroup_hdl, int prec) 
     99  { 
     100    CTimer::get("XIOS").resume(); 
     101    scalargroup_hdl->prec.setValue(prec); 
     102    CTimer::get("XIOS").suspend(); 
     103  } 
     104 
     105  void cxios_get_scalargroup_prec(scalargroup_Ptr scalargroup_hdl, int* prec) 
     106  { 
     107    CTimer::get("XIOS").resume(); 
     108    *prec = scalargroup_hdl->prec.getInheritedValue(); 
     109    CTimer::get("XIOS").suspend(); 
     110  } 
     111 
     112  bool cxios_is_defined_scalargroup_prec(scalargroup_Ptr scalargroup_hdl) 
     113  { 
     114     CTimer::get("XIOS").resume(); 
     115     bool isDefined = scalargroup_hdl->prec.hasInheritedValue(); 
     116     CTimer::get("XIOS").suspend(); 
     117     return isDefined; 
     118  } 
     119 
     120 
    98121  void cxios_set_scalargroup_scalar_ref(scalargroup_Ptr scalargroup_hdl, const char * scalar_ref, int scalar_ref_size) 
    99122  { 
  • XIOS/dev/dev_olga/src/interface/c_attr/icvariable_attr.cpp

    r591 r1158  
    4444 
    4545 
     46  void cxios_set_variable_ts_target(variable_Ptr variable_hdl, const char * ts_target, int ts_target_size) 
     47  { 
     48    std::string ts_target_str; 
     49    if (!cstr2string(ts_target, ts_target_size, ts_target_str)) return; 
     50    CTimer::get("XIOS").resume(); 
     51    variable_hdl->ts_target.fromString(ts_target_str); 
     52    CTimer::get("XIOS").suspend(); 
     53  } 
     54 
     55  void cxios_get_variable_ts_target(variable_Ptr variable_hdl, char * ts_target, int ts_target_size) 
     56  { 
     57    CTimer::get("XIOS").resume(); 
     58    if (!string_copy(variable_hdl->ts_target.getInheritedStringValue(), ts_target, ts_target_size)) 
     59      ERROR("void cxios_get_variable_ts_target(variable_Ptr variable_hdl, char * ts_target, int ts_target_size)", << "Input string is too short"); 
     60    CTimer::get("XIOS").suspend(); 
     61  } 
     62 
     63  bool cxios_is_defined_variable_ts_target(variable_Ptr variable_hdl) 
     64  { 
     65     CTimer::get("XIOS").resume(); 
     66     bool isDefined = variable_hdl->ts_target.hasInheritedValue(); 
     67     CTimer::get("XIOS").suspend(); 
     68     return isDefined; 
     69  } 
     70 
     71 
    4672  void cxios_set_variable_type(variable_Ptr variable_hdl, const char * type, int type_size) 
    4773  { 
  • XIOS/dev/dev_olga/src/interface/c_attr/icvariablegroup_attr.cpp

    r591 r1158  
    7070 
    7171 
     72  void cxios_set_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, const char * ts_target, int ts_target_size) 
     73  { 
     74    std::string ts_target_str; 
     75    if (!cstr2string(ts_target, ts_target_size, ts_target_str)) return; 
     76    CTimer::get("XIOS").resume(); 
     77    variablegroup_hdl->ts_target.fromString(ts_target_str); 
     78    CTimer::get("XIOS").suspend(); 
     79  } 
     80 
     81  void cxios_get_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, char * ts_target, int ts_target_size) 
     82  { 
     83    CTimer::get("XIOS").resume(); 
     84    if (!string_copy(variablegroup_hdl->ts_target.getInheritedStringValue(), ts_target, ts_target_size)) 
     85      ERROR("void cxios_get_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, char * ts_target, int ts_target_size)", << "Input string is too short"); 
     86    CTimer::get("XIOS").suspend(); 
     87  } 
     88 
     89  bool cxios_is_defined_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl) 
     90  { 
     91     CTimer::get("XIOS").resume(); 
     92     bool isDefined = variablegroup_hdl->ts_target.hasInheritedValue(); 
     93     CTimer::get("XIOS").suspend(); 
     94     return isDefined; 
     95  } 
     96 
     97 
    7298  void cxios_set_variablegroup_type(variablegroup_Ptr variablegroup_hdl, const char * type, int type_size) 
    7399  { 
  • XIOS/dev/dev_olga/src/interface/fortran/field_interface.f90

    r943 r1158  
    1818      END SUBROUTINE cxios_field_valid_id 
    1919 
    20       SUBROUTINE cxios_field_is_active(field_hdl, ret) BIND(C) 
     20      SUBROUTINE cxios_field_is_active(field_hdl, at_current_timestep, ret) BIND(C) 
    2121         USE ISO_C_BINDING 
    2222         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl 
     23         LOGICAL  (kind = C_BOOL), VALUE            :: at_current_timestep 
    2324         LOGICAL  (kind = C_BOOL)                   :: ret 
    2425      END SUBROUTINE cxios_field_is_active 
  • XIOS/dev/dev_olga/src/interface/fortran/idata.F90

    r1054 r1158  
    88 
    99      SUBROUTINE  cxios_init_server() BIND(C) 
    10          USE ISO_C_BINDING 
    1110      END SUBROUTINE cxios_init_server 
    1211 
     
    454453   SUBROUTINE  xios(init_server)() 
    455454   IMPLICIT NONE 
    456        CALL cxios_init_server() 
     455     CALL cxios_init_server() 
    457456   END SUBROUTINE xios(init_server) 
    458457 
  • XIOS/dev/dev_olga/src/interface/fortran/ifield.F90

    r943 r1158  
    142142   END FUNCTION  xios(is_valid_fieldgroup) 
    143143    
    144   LOGICAL FUNCTION xios(field_is_active_id(field_id)) 
     144  LOGICAL FUNCTION xios(field_is_active_id)(field_id, at_current_timestep_arg) 
    145145      IMPLICIT NONE 
    146       CHARACTER(len  = *)    , INTENT(IN) :: field_id 
    147       LOGICAL  (kind = 1)                 :: val 
    148       TYPE(txios(field))                 :: field_hdl 
    149        
     146      CHARACTER(len  = *) , INTENT(IN) :: field_id 
     147      LOGICAL, OPTIONAL   , INTENT(IN) :: at_current_timestep_arg 
     148      TYPE(txios(field))               :: field_hdl 
     149 
    150150      CALL xios(get_field_handle)(field_id,field_hdl) 
    151       xios(field_is_active_id)=xios(field_is_active_hdl(field_hdl)) 
     151      xios(field_is_active_id) = xios(field_is_active_hdl)(field_hdl, at_current_timestep_arg) 
    152152 
    153    END FUNCTION  xios(field_is_active_id) 
    154     
    155     
    156    LOGICAL FUNCTION xios(field_is_active_hdl(field_hdl)) 
     153   END FUNCTION xios(field_is_active_id) 
     154 
     155   LOGICAL FUNCTION xios(field_is_active_hdl)(field_hdl, at_current_timestep_arg) 
    157156      IMPLICIT NONE 
    158       TYPE(txios(field)),INTENT(IN)       :: field_hdl 
    159       LOGICAL  (kind = 1)                 :: ret 
    160        
    161       CALL cxios_field_is_active(field_hdl%daddr, ret); 
     157      TYPE(txios(field)) , INTENT(IN) :: field_hdl 
     158      LOGICAL, OPTIONAL  , INTENT(IN) :: at_current_timestep_arg 
     159      LOGICAL(kind = C_BOOL)          :: at_current_timestep 
     160      LOGICAL(kind = C_BOOL)          :: ret 
     161 
     162      IF (PRESENT(at_current_timestep_arg)) THEN 
     163         at_current_timestep = at_current_timestep_arg 
     164      ELSE 
     165         at_current_timestep = .FALSE. 
     166      ENDIF 
     167 
     168      CALL cxios_field_is_active(field_hdl%daddr, at_current_timestep, ret); 
    162169      xios(field_is_active_hdl) = ret 
    163170       
    164    END FUNCTION  xios(field_is_active_hdl)  
     171   END FUNCTION xios(field_is_active_hdl) 
    165172  
    166  
    167173END MODULE IFIELD 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/axis_interface_attr.F90

    r817 r1158  
    151151 
    152152 
     153    SUBROUTINE cxios_set_axis_label(axis_hdl, label, str_len, str_size, extent) BIND(C) 
     154      USE ISO_C_BINDING 
     155      INTEGER (kind = C_INTPTR_T), VALUE       :: axis_hdl 
     156      CHARACTER (KIND=C_CHAR), DIMENSION(*)    :: label 
     157      INTEGER (kind = C_INT), VALUE            :: str_len 
     158      INTEGER (kind = C_INT), DIMENSION(*)     :: str_size 
     159      INTEGER (kind = C_INT), DIMENSION(*)     :: extent 
     160    END SUBROUTINE cxios_set_axis_label 
     161 
     162    SUBROUTINE cxios_get_axis_label(axis_hdl, label, str_size, extent) BIND(C) 
     163      USE ISO_C_BINDING 
     164      INTEGER (kind = C_INTPTR_T), VALUE       :: axis_hdl 
     165      CHARACTER (KIND=C_CHAR), DIMENSION(*)    :: label 
     166      INTEGER (kind = C_INT), VALUE            :: str_size 
     167      INTEGER (kind = C_INT), DIMENSION(*)     :: extent 
     168    END SUBROUTINE cxios_get_axis_label 
     169 
     170    FUNCTION cxios_is_defined_axis_label(axis_hdl) BIND(C) 
     171      USE ISO_C_BINDING 
     172      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_label 
     173      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 
     174    END FUNCTION cxios_is_defined_axis_label 
     175 
     176 
    153177    SUBROUTINE cxios_set_axis_long_name(axis_hdl, long_name, long_name_size) BIND(C) 
    154178      USE ISO_C_BINDING 
     
    292316 
    293317 
     318    SUBROUTINE cxios_set_axis_prec(axis_hdl, prec) BIND(C) 
     319      USE ISO_C_BINDING 
     320      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 
     321      INTEGER (KIND=C_INT)      , VALUE :: prec 
     322    END SUBROUTINE cxios_set_axis_prec 
     323 
     324    SUBROUTINE cxios_get_axis_prec(axis_hdl, prec) BIND(C) 
     325      USE ISO_C_BINDING 
     326      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 
     327      INTEGER (KIND=C_INT)             :: prec 
     328    END SUBROUTINE cxios_get_axis_prec 
     329 
     330    FUNCTION cxios_is_defined_axis_prec(axis_hdl) BIND(C) 
     331      USE ISO_C_BINDING 
     332      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_prec 
     333      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 
     334    END FUNCTION cxios_is_defined_axis_prec 
     335 
     336 
    294337    SUBROUTINE cxios_set_axis_standard_name(axis_hdl, standard_name, standard_name_size) BIND(C) 
    295338      USE ISO_C_BINDING 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/axisgroup_interface_attr.F90

    r817 r1158  
    172172 
    173173 
     174    SUBROUTINE cxios_set_axisgroup_label(axisgroup_hdl, label, str_len, str_size, extent) BIND(C) 
     175      USE ISO_C_BINDING 
     176      INTEGER (kind = C_INTPTR_T), VALUE       :: axisgroup_hdl 
     177      CHARACTER (KIND=C_CHAR), DIMENSION(*)    :: label 
     178      INTEGER (kind = C_INT), VALUE            :: str_len 
     179      INTEGER (kind = C_INT), DIMENSION(*)     :: str_size 
     180      INTEGER (kind = C_INT), DIMENSION(*)     :: extent 
     181    END SUBROUTINE cxios_set_axisgroup_label 
     182 
     183    SUBROUTINE cxios_get_axisgroup_label(axisgroup_hdl, label, str_size, extent) BIND(C) 
     184      USE ISO_C_BINDING 
     185      INTEGER (kind = C_INTPTR_T), VALUE       :: axisgroup_hdl 
     186      CHARACTER (KIND=C_CHAR), DIMENSION(*)    :: label 
     187      INTEGER (kind = C_INT), VALUE            :: str_size 
     188      INTEGER (kind = C_INT), DIMENSION(*)     :: extent 
     189    END SUBROUTINE cxios_get_axisgroup_label 
     190 
     191    FUNCTION cxios_is_defined_axisgroup_label(axisgroup_hdl) BIND(C) 
     192      USE ISO_C_BINDING 
     193      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_label 
     194      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 
     195    END FUNCTION cxios_is_defined_axisgroup_label 
     196 
     197 
    174198    SUBROUTINE cxios_set_axisgroup_long_name(axisgroup_hdl, long_name, long_name_size) BIND(C) 
    175199      USE ISO_C_BINDING 
     
    313337 
    314338 
     339    SUBROUTINE cxios_set_axisgroup_prec(axisgroup_hdl, prec) BIND(C) 
     340      USE ISO_C_BINDING 
     341      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 
     342      INTEGER (KIND=C_INT)      , VALUE :: prec 
     343    END SUBROUTINE cxios_set_axisgroup_prec 
     344 
     345    SUBROUTINE cxios_get_axisgroup_prec(axisgroup_hdl, prec) BIND(C) 
     346      USE ISO_C_BINDING 
     347      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 
     348      INTEGER (KIND=C_INT)             :: prec 
     349    END SUBROUTINE cxios_get_axisgroup_prec 
     350 
     351    FUNCTION cxios_is_defined_axisgroup_prec(axisgroup_hdl) BIND(C) 
     352      USE ISO_C_BINDING 
     353      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_prec 
     354      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 
     355    END FUNCTION cxios_is_defined_axisgroup_prec 
     356 
     357 
    315358    SUBROUTINE cxios_set_axisgroup_standard_name(axisgroup_hdl, standard_name, standard_name_size) BIND(C) 
    316359      USE ISO_C_BINDING 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/domain_interface_attr.F90

    r789 r1158  
    616616 
    617617 
     618    SUBROUTINE cxios_set_domain_prec(domain_hdl, prec) BIND(C) 
     619      USE ISO_C_BINDING 
     620      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl 
     621      INTEGER (KIND=C_INT)      , VALUE :: prec 
     622    END SUBROUTINE cxios_set_domain_prec 
     623 
     624    SUBROUTINE cxios_get_domain_prec(domain_hdl, prec) BIND(C) 
     625      USE ISO_C_BINDING 
     626      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl 
     627      INTEGER (KIND=C_INT)             :: prec 
     628    END SUBROUTINE cxios_get_domain_prec 
     629 
     630    FUNCTION cxios_is_defined_domain_prec(domain_hdl) BIND(C) 
     631      USE ISO_C_BINDING 
     632      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_prec 
     633      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl 
     634    END FUNCTION cxios_is_defined_domain_prec 
     635 
     636 
    618637    SUBROUTINE cxios_set_domain_standard_name(domain_hdl, standard_name, standard_name_size) BIND(C) 
    619638      USE ISO_C_BINDING 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/domaingroup_interface_attr.F90

    r789 r1158  
    637637 
    638638 
     639    SUBROUTINE cxios_set_domaingroup_prec(domaingroup_hdl, prec) BIND(C) 
     640      USE ISO_C_BINDING 
     641      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl 
     642      INTEGER (KIND=C_INT)      , VALUE :: prec 
     643    END SUBROUTINE cxios_set_domaingroup_prec 
     644 
     645    SUBROUTINE cxios_get_domaingroup_prec(domaingroup_hdl, prec) BIND(C) 
     646      USE ISO_C_BINDING 
     647      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl 
     648      INTEGER (KIND=C_INT)             :: prec 
     649    END SUBROUTINE cxios_get_domaingroup_prec 
     650 
     651    FUNCTION cxios_is_defined_domaingroup_prec(domaingroup_hdl) BIND(C) 
     652      USE ISO_C_BINDING 
     653      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_prec 
     654      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl 
     655    END FUNCTION cxios_is_defined_domaingroup_prec 
     656 
     657 
    639658    SUBROUTINE cxios_set_domaingroup_standard_name(domaingroup_hdl, standard_name, standard_name_size) BIND(C) 
    640659      USE ISO_C_BINDING 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/expand_domain_interface_attr.F90

    r981 r1158  
    99  INTERFACE 
    1010    ! Do not call directly / interface FORTRAN 2003 <-> C99 
     11 
     12    SUBROUTINE cxios_set_expand_domain_i_periodic(expand_domain_hdl, i_periodic) BIND(C) 
     13      USE ISO_C_BINDING 
     14      INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 
     15      LOGICAL (KIND=C_BOOL)      , VALUE :: i_periodic 
     16    END SUBROUTINE cxios_set_expand_domain_i_periodic 
     17 
     18    SUBROUTINE cxios_get_expand_domain_i_periodic(expand_domain_hdl, i_periodic) BIND(C) 
     19      USE ISO_C_BINDING 
     20      INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 
     21      LOGICAL (KIND=C_BOOL)             :: i_periodic 
     22    END SUBROUTINE cxios_get_expand_domain_i_periodic 
     23 
     24    FUNCTION cxios_is_defined_expand_domain_i_periodic(expand_domain_hdl) BIND(C) 
     25      USE ISO_C_BINDING 
     26      LOGICAL(kind=C_BOOL) :: cxios_is_defined_expand_domain_i_periodic 
     27      INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 
     28    END FUNCTION cxios_is_defined_expand_domain_i_periodic 
     29 
     30 
     31    SUBROUTINE cxios_set_expand_domain_j_periodic(expand_domain_hdl, j_periodic) BIND(C) 
     32      USE ISO_C_BINDING 
     33      INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 
     34      LOGICAL (KIND=C_BOOL)      , VALUE :: j_periodic 
     35    END SUBROUTINE cxios_set_expand_domain_j_periodic 
     36 
     37    SUBROUTINE cxios_get_expand_domain_j_periodic(expand_domain_hdl, j_periodic) BIND(C) 
     38      USE ISO_C_BINDING 
     39      INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 
     40      LOGICAL (KIND=C_BOOL)             :: j_periodic 
     41    END SUBROUTINE cxios_get_expand_domain_j_periodic 
     42 
     43    FUNCTION cxios_is_defined_expand_domain_j_periodic(expand_domain_hdl) BIND(C) 
     44      USE ISO_C_BINDING 
     45      LOGICAL(kind=C_BOOL) :: cxios_is_defined_expand_domain_j_periodic 
     46      INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 
     47    END FUNCTION cxios_is_defined_expand_domain_j_periodic 
     48 
    1149 
    1250    SUBROUTINE cxios_set_expand_domain_order(expand_domain_hdl, order) BIND(C) 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/file_interface_attr.F90

    r932 r1158  
    416416 
    417417 
     418    SUBROUTINE cxios_set_file_time_stamp_format(file_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 
     419      USE ISO_C_BINDING 
     420      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     421      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_format 
     422      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_format_size 
     423    END SUBROUTINE cxios_set_file_time_stamp_format 
     424 
     425    SUBROUTINE cxios_get_file_time_stamp_format(file_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 
     426      USE ISO_C_BINDING 
     427      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     428      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_format 
     429      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_format_size 
     430    END SUBROUTINE cxios_get_file_time_stamp_format 
     431 
     432    FUNCTION cxios_is_defined_file_time_stamp_format(file_hdl) BIND(C) 
     433      USE ISO_C_BINDING 
     434      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_stamp_format 
     435      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     436    END FUNCTION cxios_is_defined_file_time_stamp_format 
     437 
     438 
     439    SUBROUTINE cxios_set_file_time_stamp_name(file_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 
     440      USE ISO_C_BINDING 
     441      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     442      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_name 
     443      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_name_size 
     444    END SUBROUTINE cxios_set_file_time_stamp_name 
     445 
     446    SUBROUTINE cxios_get_file_time_stamp_name(file_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 
     447      USE ISO_C_BINDING 
     448      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     449      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_name 
     450      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_name_size 
     451    END SUBROUTINE cxios_get_file_time_stamp_name 
     452 
     453    FUNCTION cxios_is_defined_file_time_stamp_name(file_hdl) BIND(C) 
     454      USE ISO_C_BINDING 
     455      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_stamp_name 
     456      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     457    END FUNCTION cxios_is_defined_file_time_stamp_name 
     458 
     459 
     460    SUBROUTINE cxios_set_file_time_units(file_hdl, time_units, time_units_size) BIND(C) 
     461      USE ISO_C_BINDING 
     462      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     463      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_units 
     464      INTEGER  (kind = C_INT)     , VALUE        :: time_units_size 
     465    END SUBROUTINE cxios_set_file_time_units 
     466 
     467    SUBROUTINE cxios_get_file_time_units(file_hdl, time_units, time_units_size) BIND(C) 
     468      USE ISO_C_BINDING 
     469      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     470      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_units 
     471      INTEGER  (kind = C_INT)     , VALUE        :: time_units_size 
     472    END SUBROUTINE cxios_get_file_time_units 
     473 
     474    FUNCTION cxios_is_defined_file_time_units(file_hdl) BIND(C) 
     475      USE ISO_C_BINDING 
     476      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_units 
     477      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     478    END FUNCTION cxios_is_defined_file_time_units 
     479 
     480 
    418481    SUBROUTINE cxios_set_file_timeseries(file_hdl, timeseries, timeseries_size) BIND(C) 
    419482      USE ISO_C_BINDING 
     
    478541    END FUNCTION cxios_is_defined_file_type 
    479542 
     543 
     544    SUBROUTINE cxios_set_file_uuid_format(file_hdl, uuid_format, uuid_format_size) BIND(C) 
     545      USE ISO_C_BINDING 
     546      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     547      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_format 
     548      INTEGER  (kind = C_INT)     , VALUE        :: uuid_format_size 
     549    END SUBROUTINE cxios_set_file_uuid_format 
     550 
     551    SUBROUTINE cxios_get_file_uuid_format(file_hdl, uuid_format, uuid_format_size) BIND(C) 
     552      USE ISO_C_BINDING 
     553      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     554      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_format 
     555      INTEGER  (kind = C_INT)     , VALUE        :: uuid_format_size 
     556    END SUBROUTINE cxios_get_file_uuid_format 
     557 
     558    FUNCTION cxios_is_defined_file_uuid_format(file_hdl) BIND(C) 
     559      USE ISO_C_BINDING 
     560      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_uuid_format 
     561      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     562    END FUNCTION cxios_is_defined_file_uuid_format 
     563 
     564 
     565    SUBROUTINE cxios_set_file_uuid_name(file_hdl, uuid_name, uuid_name_size) BIND(C) 
     566      USE ISO_C_BINDING 
     567      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     568      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_name 
     569      INTEGER  (kind = C_INT)     , VALUE        :: uuid_name_size 
     570    END SUBROUTINE cxios_set_file_uuid_name 
     571 
     572    SUBROUTINE cxios_get_file_uuid_name(file_hdl, uuid_name, uuid_name_size) BIND(C) 
     573      USE ISO_C_BINDING 
     574      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     575      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_name 
     576      INTEGER  (kind = C_INT)     , VALUE        :: uuid_name_size 
     577    END SUBROUTINE cxios_get_file_uuid_name 
     578 
     579    FUNCTION cxios_is_defined_file_uuid_name(file_hdl) BIND(C) 
     580      USE ISO_C_BINDING 
     581      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_uuid_name 
     582      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     583    END FUNCTION cxios_is_defined_file_uuid_name 
     584 
    480585  END INTERFACE 
    481586 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/filegroup_interface_attr.F90

    r932 r1158  
    437437 
    438438 
     439    SUBROUTINE cxios_set_filegroup_time_stamp_format(filegroup_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 
     440      USE ISO_C_BINDING 
     441      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     442      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_format 
     443      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_format_size 
     444    END SUBROUTINE cxios_set_filegroup_time_stamp_format 
     445 
     446    SUBROUTINE cxios_get_filegroup_time_stamp_format(filegroup_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 
     447      USE ISO_C_BINDING 
     448      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     449      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_format 
     450      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_format_size 
     451    END SUBROUTINE cxios_get_filegroup_time_stamp_format 
     452 
     453    FUNCTION cxios_is_defined_filegroup_time_stamp_format(filegroup_hdl) BIND(C) 
     454      USE ISO_C_BINDING 
     455      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_stamp_format 
     456      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     457    END FUNCTION cxios_is_defined_filegroup_time_stamp_format 
     458 
     459 
     460    SUBROUTINE cxios_set_filegroup_time_stamp_name(filegroup_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 
     461      USE ISO_C_BINDING 
     462      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     463      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_name 
     464      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_name_size 
     465    END SUBROUTINE cxios_set_filegroup_time_stamp_name 
     466 
     467    SUBROUTINE cxios_get_filegroup_time_stamp_name(filegroup_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 
     468      USE ISO_C_BINDING 
     469      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     470      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_stamp_name 
     471      INTEGER  (kind = C_INT)     , VALUE        :: time_stamp_name_size 
     472    END SUBROUTINE cxios_get_filegroup_time_stamp_name 
     473 
     474    FUNCTION cxios_is_defined_filegroup_time_stamp_name(filegroup_hdl) BIND(C) 
     475      USE ISO_C_BINDING 
     476      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_stamp_name 
     477      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     478    END FUNCTION cxios_is_defined_filegroup_time_stamp_name 
     479 
     480 
     481    SUBROUTINE cxios_set_filegroup_time_units(filegroup_hdl, time_units, time_units_size) BIND(C) 
     482      USE ISO_C_BINDING 
     483      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     484      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_units 
     485      INTEGER  (kind = C_INT)     , VALUE        :: time_units_size 
     486    END SUBROUTINE cxios_set_filegroup_time_units 
     487 
     488    SUBROUTINE cxios_get_filegroup_time_units(filegroup_hdl, time_units, time_units_size) BIND(C) 
     489      USE ISO_C_BINDING 
     490      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     491      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_units 
     492      INTEGER  (kind = C_INT)     , VALUE        :: time_units_size 
     493    END SUBROUTINE cxios_get_filegroup_time_units 
     494 
     495    FUNCTION cxios_is_defined_filegroup_time_units(filegroup_hdl) BIND(C) 
     496      USE ISO_C_BINDING 
     497      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_units 
     498      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     499    END FUNCTION cxios_is_defined_filegroup_time_units 
     500 
     501 
    439502    SUBROUTINE cxios_set_filegroup_timeseries(filegroup_hdl, timeseries, timeseries_size) BIND(C) 
    440503      USE ISO_C_BINDING 
     
    499562    END FUNCTION cxios_is_defined_filegroup_type 
    500563 
     564 
     565    SUBROUTINE cxios_set_filegroup_uuid_format(filegroup_hdl, uuid_format, uuid_format_size) BIND(C) 
     566      USE ISO_C_BINDING 
     567      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     568      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_format 
     569      INTEGER  (kind = C_INT)     , VALUE        :: uuid_format_size 
     570    END SUBROUTINE cxios_set_filegroup_uuid_format 
     571 
     572    SUBROUTINE cxios_get_filegroup_uuid_format(filegroup_hdl, uuid_format, uuid_format_size) BIND(C) 
     573      USE ISO_C_BINDING 
     574      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     575      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_format 
     576      INTEGER  (kind = C_INT)     , VALUE        :: uuid_format_size 
     577    END SUBROUTINE cxios_get_filegroup_uuid_format 
     578 
     579    FUNCTION cxios_is_defined_filegroup_uuid_format(filegroup_hdl) BIND(C) 
     580      USE ISO_C_BINDING 
     581      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_uuid_format 
     582      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     583    END FUNCTION cxios_is_defined_filegroup_uuid_format 
     584 
     585 
     586    SUBROUTINE cxios_set_filegroup_uuid_name(filegroup_hdl, uuid_name, uuid_name_size) BIND(C) 
     587      USE ISO_C_BINDING 
     588      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     589      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_name 
     590      INTEGER  (kind = C_INT)     , VALUE        :: uuid_name_size 
     591    END SUBROUTINE cxios_set_filegroup_uuid_name 
     592 
     593    SUBROUTINE cxios_get_filegroup_uuid_name(filegroup_hdl, uuid_name, uuid_name_size) BIND(C) 
     594      USE ISO_C_BINDING 
     595      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     596      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: uuid_name 
     597      INTEGER  (kind = C_INT)     , VALUE        :: uuid_name_size 
     598    END SUBROUTINE cxios_get_filegroup_uuid_name 
     599 
     600    FUNCTION cxios_is_defined_filegroup_uuid_name(filegroup_hdl) BIND(C) 
     601      USE ISO_C_BINDING 
     602      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_uuid_name 
     603      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     604    END FUNCTION cxios_is_defined_filegroup_uuid_name 
     605 
    501606  END INTERFACE 
    502607 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/iaxis_attr.F90

    r966 r1158  
    1212 
    1313  SUBROUTINE xios(set_axis_attr)  & 
    14     ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n  & 
    15     , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     14    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     15    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     16     ) 
    1617 
    1718    IMPLICIT NONE 
     
    2526      INTEGER  , OPTIONAL, INTENT(IN) :: data_n 
    2627      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
     28      CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 
    2729      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    2830      LOGICAL  , OPTIONAL, INTENT(IN) :: mask(:) 
     
    3335      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
    3436      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 
     37      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    3538      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    3639      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit 
     
    4043      (axis_id,axis_hdl) 
    4144      CALL xios(set_axis_attr_hdl_)   & 
    42       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    43       , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     45      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     46      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     47       ) 
    4448 
    4549  END SUBROUTINE xios(set_axis_attr) 
    4650 
    4751  SUBROUTINE xios(set_axis_attr_hdl)  & 
    48     ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    49     , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     52    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     53    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     54     ) 
    5055 
    5156    IMPLICIT NONE 
     
    5863      INTEGER  , OPTIONAL, INTENT(IN) :: data_n 
    5964      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
     65      CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 
    6066      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    6167      LOGICAL  , OPTIONAL, INTENT(IN) :: mask(:) 
     
    6672      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
    6773      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 
     74      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    6875      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    6976      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit 
     
    7178 
    7279      CALL xios(set_axis_attr_hdl_)  & 
    73       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    74       , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     80      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     81      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     82       ) 
    7583 
    7684  END SUBROUTINE xios(set_axis_attr_hdl) 
    7785 
    7886  SUBROUTINE xios(set_axis_attr_hdl_)   & 
    79     ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, long_name_  & 
    80     , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_  & 
    81     ) 
     87    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_  & 
     88    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_  & 
     89    , value_ ) 
    8290 
    8391    IMPLICIT NONE 
     
    9098      INTEGER  , OPTIONAL, INTENT(IN) :: data_n_ 
    9199      INTEGER  , OPTIONAL, INTENT(IN) :: index_(:) 
     100      CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label_(:) 
    92101      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 
    93102      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_(:) 
     
    98107      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
    99108      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_ 
     109      INTEGER  , OPTIONAL, INTENT(IN) :: prec_ 
    100110      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
    101111      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_ 
     
    135145        CALL cxios_set_axis_index & 
    136146      (axis_hdl%daddr, index_, SHAPE(index_)) 
     147      ENDIF 
     148 
     149      IF (PRESENT(label_)) THEN 
     150        CALL cxios_set_axis_label & 
     151      (axis_hdl%daddr, label_, LEN(label_), LEN_TRIM(label_), SHAPE(label_)) 
    137152      ENDIF 
    138153 
     
    174189      ENDIF 
    175190 
     191      IF (PRESENT(prec_)) THEN 
     192        CALL cxios_set_axis_prec & 
     193      (axis_hdl%daddr, prec_) 
     194      ENDIF 
     195 
    176196      IF (PRESENT(standard_name_)) THEN 
    177197        CALL cxios_set_axis_standard_name & 
     
    192212 
    193213  SUBROUTINE xios(get_axis_attr)  & 
    194     ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n  & 
    195     , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     214    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     215    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     216     ) 
    196217 
    197218    IMPLICIT NONE 
     
    205226      INTEGER  , OPTIONAL, INTENT(OUT) :: data_n 
    206227      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
     228      CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 
    207229      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    208230      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask(:) 
     
    213235      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
    214236      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 
     237      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    215238      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    216239      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit 
     
    220243      (axis_id,axis_hdl) 
    221244      CALL xios(get_axis_attr_hdl_)   & 
    222       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    223       , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     245      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     246      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     247       ) 
    224248 
    225249  END SUBROUTINE xios(get_axis_attr) 
    226250 
    227251  SUBROUTINE xios(get_axis_attr_hdl)  & 
    228     ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    229     , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     252    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     253    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     254     ) 
    230255 
    231256    IMPLICIT NONE 
     
    238263      INTEGER  , OPTIONAL, INTENT(OUT) :: data_n 
    239264      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
     265      CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 
    240266      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    241267      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask(:) 
     
    246272      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
    247273      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 
     274      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    248275      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    249276      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit 
     
    251278 
    252279      CALL xios(get_axis_attr_hdl_)  & 
    253       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    254       , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     280      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     281      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     282       ) 
    255283 
    256284  END SUBROUTINE xios(get_axis_attr_hdl) 
    257285 
    258286  SUBROUTINE xios(get_axis_attr_hdl_)   & 
    259     ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, long_name_  & 
    260     , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_  & 
    261     ) 
     287    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_  & 
     288    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_  & 
     289    , value_ ) 
    262290 
    263291    IMPLICIT NONE 
     
    270298      INTEGER  , OPTIONAL, INTENT(OUT) :: data_n_ 
    271299      INTEGER  , OPTIONAL, INTENT(OUT) :: index_(:) 
     300      CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label_(:) 
    272301      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 
    273302      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_(:) 
     
    278307      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
    279308      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_ 
     309      INTEGER  , OPTIONAL, INTENT(OUT) :: prec_ 
    280310      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
    281311      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_ 
     
    315345        CALL cxios_get_axis_index & 
    316346      (axis_hdl%daddr, index_, SHAPE(index_)) 
     347      ENDIF 
     348 
     349      IF (PRESENT(label_)) THEN 
     350        CALL cxios_get_axis_label & 
     351      (axis_hdl%daddr, label_, LEN(label_), SHAPE(label_)) 
    317352      ENDIF 
    318353 
     
    354389      ENDIF 
    355390 
     391      IF (PRESENT(prec_)) THEN 
     392        CALL cxios_get_axis_prec & 
     393      (axis_hdl%daddr, prec_) 
     394      ENDIF 
     395 
    356396      IF (PRESENT(standard_name_)) THEN 
    357397        CALL cxios_get_axis_standard_name & 
     
    372412 
    373413  SUBROUTINE xios(is_defined_axis_attr)  & 
    374     ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n  & 
    375     , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     414    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     415    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     416     ) 
    376417 
    377418    IMPLICIT NONE 
     
    392433      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
    393434      LOGICAL(KIND=C_BOOL) :: index_tmp 
     435      LOGICAL, OPTIONAL, INTENT(OUT) :: label 
     436      LOGICAL(KIND=C_BOOL) :: label_tmp 
    394437      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 
    395438      LOGICAL(KIND=C_BOOL) :: long_name_tmp 
     
    406449      LOGICAL, OPTIONAL, INTENT(OUT) :: positive 
    407450      LOGICAL(KIND=C_BOOL) :: positive_tmp 
     451      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     452      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    408453      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    409454      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    416461      (axis_id,axis_hdl) 
    417462      CALL xios(is_defined_axis_attr_hdl_)   & 
    418       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    419       , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     463      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     464      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     465       ) 
    420466 
    421467  END SUBROUTINE xios(is_defined_axis_attr) 
    422468 
    423469  SUBROUTINE xios(is_defined_axis_attr_hdl)  & 
    424     ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    425     , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     470    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     471    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     472     ) 
    426473 
    427474    IMPLICIT NONE 
     
    441488      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
    442489      LOGICAL(KIND=C_BOOL) :: index_tmp 
     490      LOGICAL, OPTIONAL, INTENT(OUT) :: label 
     491      LOGICAL(KIND=C_BOOL) :: label_tmp 
    443492      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 
    444493      LOGICAL(KIND=C_BOOL) :: long_name_tmp 
     
    455504      LOGICAL, OPTIONAL, INTENT(OUT) :: positive 
    456505      LOGICAL(KIND=C_BOOL) :: positive_tmp 
     506      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     507      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    457508      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    458509      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    463514 
    464515      CALL xios(is_defined_axis_attr_hdl_)  & 
    465       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
    466       , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     516      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  & 
     517      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  & 
     518       ) 
    467519 
    468520  END SUBROUTINE xios(is_defined_axis_attr_hdl) 
    469521 
    470522  SUBROUTINE xios(is_defined_axis_attr_hdl_)   & 
    471     ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, long_name_  & 
    472     , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_  & 
    473     ) 
     523    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_  & 
     524    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_  & 
     525    , value_ ) 
    474526 
    475527    IMPLICIT NONE 
     
    489541      LOGICAL, OPTIONAL, INTENT(OUT) :: index_ 
    490542      LOGICAL(KIND=C_BOOL) :: index__tmp 
     543      LOGICAL, OPTIONAL, INTENT(OUT) :: label_ 
     544      LOGICAL(KIND=C_BOOL) :: label__tmp 
    491545      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_ 
    492546      LOGICAL(KIND=C_BOOL) :: long_name__tmp 
     
    503557      LOGICAL, OPTIONAL, INTENT(OUT) :: positive_ 
    504558      LOGICAL(KIND=C_BOOL) :: positive__tmp 
     559      LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 
     560      LOGICAL(KIND=C_BOOL) :: prec__tmp 
    505561      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 
    506562      LOGICAL(KIND=C_BOOL) :: standard_name__tmp 
     
    552608      ENDIF 
    553609 
     610      IF (PRESENT(label_)) THEN 
     611        label__tmp = cxios_is_defined_axis_label & 
     612      (axis_hdl%daddr) 
     613        label_ = label__tmp 
     614      ENDIF 
     615 
    554616      IF (PRESENT(long_name_)) THEN 
    555617        long_name__tmp = cxios_is_defined_axis_long_name & 
     
    594656      ENDIF 
    595657 
     658      IF (PRESENT(prec_)) THEN 
     659        prec__tmp = cxios_is_defined_axis_prec & 
     660      (axis_hdl%daddr) 
     661        prec_ = prec__tmp 
     662      ENDIF 
     663 
    596664      IF (PRESENT(standard_name_)) THEN 
    597665        standard_name__tmp = cxios_is_defined_axis_standard_name & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/iaxisgroup_attr.F90

    r966 r1158  
    1212 
    1313  SUBROUTINE xios(set_axisgroup_attr)  & 
    14     ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    15     , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     14    ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     15    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     16    , value ) 
    1617 
    1718    IMPLICIT NONE 
     
    2627      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 
    2728      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
     29      CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 
    2830      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    2931      LOGICAL  , OPTIONAL, INTENT(IN) :: mask(:) 
     
    3436      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
    3537      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 
     38      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    3639      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    3740      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit 
     
    4144      (axisgroup_id,axisgroup_hdl) 
    4245      CALL xios(set_axisgroup_attr_hdl_)   & 
    43       ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    44       , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     46      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     47      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     48      , value ) 
    4549 
    4650  END SUBROUTINE xios(set_axisgroup_attr) 
    4751 
    4852  SUBROUTINE xios(set_axisgroup_attr_hdl)  & 
    49     ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    50     , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     53    ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     54    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     55    , value ) 
    5156 
    5257    IMPLICIT NONE 
     
    6065      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 
    6166      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
     67      CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 
    6268      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    6369      LOGICAL  , OPTIONAL, INTENT(IN) :: mask(:) 
     
    6874      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
    6975      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 
     76      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    7077      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    7178      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit 
     
    7380 
    7481      CALL xios(set_axisgroup_attr_hdl_)  & 
    75       ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    76       , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     82      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     83      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     84      , value ) 
    7785 
    7886  END SUBROUTINE xios(set_axisgroup_attr_hdl) 
     
    8088  SUBROUTINE xios(set_axisgroup_attr_hdl_)   & 
    8189    ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_  & 
    82     , long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_  & 
     90    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  & 
    8391    , unit_, value_ ) 
    8492 
     
    93101      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_ 
    94102      INTEGER  , OPTIONAL, INTENT(IN) :: index_(:) 
     103      CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label_(:) 
    95104      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 
    96105      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_(:) 
     
    101110      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
    102111      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_ 
     112      INTEGER  , OPTIONAL, INTENT(IN) :: prec_ 
    103113      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
    104114      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_ 
     
    143153        CALL cxios_set_axisgroup_index & 
    144154      (axisgroup_hdl%daddr, index_, SHAPE(index_)) 
     155      ENDIF 
     156 
     157      IF (PRESENT(label_)) THEN 
     158        CALL cxios_set_axisgroup_label & 
     159      (axisgroup_hdl%daddr, label_, LEN(label_), LEN_TRIM(label_), SHAPE(label_)) 
    145160      ENDIF 
    146161 
     
    182197      ENDIF 
    183198 
     199      IF (PRESENT(prec_)) THEN 
     200        CALL cxios_set_axisgroup_prec & 
     201      (axisgroup_hdl%daddr, prec_) 
     202      ENDIF 
     203 
    184204      IF (PRESENT(standard_name_)) THEN 
    185205        CALL cxios_set_axisgroup_standard_name & 
     
    200220 
    201221  SUBROUTINE xios(get_axisgroup_attr)  & 
    202     ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    203     , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     222    ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     223    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     224    , value ) 
    204225 
    205226    IMPLICIT NONE 
     
    214235      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 
    215236      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
     237      CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 
    216238      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    217239      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask(:) 
     
    222244      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
    223245      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 
     246      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    224247      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    225248      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit 
     
    229252      (axisgroup_id,axisgroup_hdl) 
    230253      CALL xios(get_axisgroup_attr_hdl_)   & 
    231       ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    232       , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     254      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     255      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     256      , value ) 
    233257 
    234258  END SUBROUTINE xios(get_axisgroup_attr) 
    235259 
    236260  SUBROUTINE xios(get_axisgroup_attr_hdl)  & 
    237     ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    238     , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     261    ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     262    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     263    , value ) 
    239264 
    240265    IMPLICIT NONE 
     
    248273      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 
    249274      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
     275      CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 
    250276      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    251277      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask(:) 
     
    256282      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
    257283      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 
     284      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    258285      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    259286      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit 
     
    261288 
    262289      CALL xios(get_axisgroup_attr_hdl_)  & 
    263       ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    264       , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     290      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     291      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     292      , value ) 
    265293 
    266294  END SUBROUTINE xios(get_axisgroup_attr_hdl) 
     
    268296  SUBROUTINE xios(get_axisgroup_attr_hdl_)   & 
    269297    ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_  & 
    270     , long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_  & 
     298    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  & 
    271299    , unit_, value_ ) 
    272300 
     
    281309      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_ 
    282310      INTEGER  , OPTIONAL, INTENT(OUT) :: index_(:) 
     311      CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label_(:) 
    283312      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 
    284313      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_(:) 
     
    289318      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
    290319      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_ 
     320      INTEGER  , OPTIONAL, INTENT(OUT) :: prec_ 
    291321      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
    292322      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_ 
     
    331361        CALL cxios_get_axisgroup_index & 
    332362      (axisgroup_hdl%daddr, index_, SHAPE(index_)) 
     363      ENDIF 
     364 
     365      IF (PRESENT(label_)) THEN 
     366        CALL cxios_get_axisgroup_label & 
     367      (axisgroup_hdl%daddr, label_, LEN(label_), SHAPE(label_)) 
    333368      ENDIF 
    334369 
     
    370405      ENDIF 
    371406 
     407      IF (PRESENT(prec_)) THEN 
     408        CALL cxios_get_axisgroup_prec & 
     409      (axisgroup_hdl%daddr, prec_) 
     410      ENDIF 
     411 
    372412      IF (PRESENT(standard_name_)) THEN 
    373413        CALL cxios_get_axisgroup_standard_name & 
     
    388428 
    389429  SUBROUTINE xios(is_defined_axisgroup_attr)  & 
    390     ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    391     , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     430    ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     431    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     432    , value ) 
    392433 
    393434    IMPLICIT NONE 
     
    410451      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
    411452      LOGICAL(KIND=C_BOOL) :: index_tmp 
     453      LOGICAL, OPTIONAL, INTENT(OUT) :: label 
     454      LOGICAL(KIND=C_BOOL) :: label_tmp 
    412455      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 
    413456      LOGICAL(KIND=C_BOOL) :: long_name_tmp 
     
    424467      LOGICAL, OPTIONAL, INTENT(OUT) :: positive 
    425468      LOGICAL(KIND=C_BOOL) :: positive_tmp 
     469      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     470      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    426471      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    427472      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    434479      (axisgroup_id,axisgroup_hdl) 
    435480      CALL xios(is_defined_axisgroup_attr_hdl_)   & 
    436       ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    437       , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     481      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     482      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     483      , value ) 
    438484 
    439485  END SUBROUTINE xios(is_defined_axisgroup_attr) 
    440486 
    441487  SUBROUTINE xios(is_defined_axisgroup_attr_hdl)  & 
    442     ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    443     , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     488    ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     489    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     490    , value ) 
    444491 
    445492    IMPLICIT NONE 
     
    461508      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
    462509      LOGICAL(KIND=C_BOOL) :: index_tmp 
     510      LOGICAL, OPTIONAL, INTENT(OUT) :: label 
     511      LOGICAL(KIND=C_BOOL) :: label_tmp 
    463512      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 
    464513      LOGICAL(KIND=C_BOOL) :: long_name_tmp 
     
    475524      LOGICAL, OPTIONAL, INTENT(OUT) :: positive 
    476525      LOGICAL(KIND=C_BOOL) :: positive_tmp 
     526      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     527      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    477528      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    478529      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    483534 
    484535      CALL xios(is_defined_axisgroup_attr_hdl_)  & 
    485       ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name  & 
    486       , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
     536      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  & 
     537      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  & 
     538      , value ) 
    487539 
    488540  END SUBROUTINE xios(is_defined_axisgroup_attr_hdl) 
     
    490542  SUBROUTINE xios(is_defined_axisgroup_attr_hdl_)   & 
    491543    ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_  & 
    492     , long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_  & 
     544    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  & 
    493545    , unit_, value_ ) 
    494546 
     
    511563      LOGICAL, OPTIONAL, INTENT(OUT) :: index_ 
    512564      LOGICAL(KIND=C_BOOL) :: index__tmp 
     565      LOGICAL, OPTIONAL, INTENT(OUT) :: label_ 
     566      LOGICAL(KIND=C_BOOL) :: label__tmp 
    513567      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_ 
    514568      LOGICAL(KIND=C_BOOL) :: long_name__tmp 
     
    525579      LOGICAL, OPTIONAL, INTENT(OUT) :: positive_ 
    526580      LOGICAL(KIND=C_BOOL) :: positive__tmp 
     581      LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 
     582      LOGICAL(KIND=C_BOOL) :: prec__tmp 
    527583      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 
    528584      LOGICAL(KIND=C_BOOL) :: standard_name__tmp 
     
    580636      ENDIF 
    581637 
     638      IF (PRESENT(label_)) THEN 
     639        label__tmp = cxios_is_defined_axisgroup_label & 
     640      (axisgroup_hdl%daddr) 
     641        label_ = label__tmp 
     642      ENDIF 
     643 
    582644      IF (PRESENT(long_name_)) THEN 
    583645        long_name__tmp = cxios_is_defined_axisgroup_long_name & 
     
    622684      ENDIF 
    623685 
     686      IF (PRESENT(prec_)) THEN 
     687        prec__tmp = cxios_is_defined_axisgroup_prec & 
     688      (axisgroup_hdl%daddr) 
     689        prec_ = prec__tmp 
     690      ENDIF 
     691 
    624692      IF (PRESENT(standard_name_)) THEN 
    625693        standard_name__tmp = cxios_is_defined_axisgroup_standard_name & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/idomain_attr.F90

    r966 r1158  
    1515    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    1616    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    17     , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     17    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    1818 
    1919    IMPLICIT NONE 
     
    5252      INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo 
    5353      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex 
     54      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    5455      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    5556      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     
    6162      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    6263      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    63       , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     64      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    6465 
    6566  END SUBROUTINE xios(set_domain_attr) 
     
    6970    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    7071    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    71     , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     72    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    7273 
    7374    IMPLICIT NONE 
     
    105106      INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo 
    106107      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex 
     108      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    107109      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    108110      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     
    112114      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    113115      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    114       , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     116      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    115117 
    116118  END SUBROUTINE xios(set_domain_attr_hdl) 
     
    120122    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  & 
    121123    , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  & 
    122     , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_  & 
     124    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  & 
    123125    , type_ ) 
    124126 
     
    157159      INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo_ 
    158160      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex_ 
     161      INTEGER  , OPTIONAL, INTENT(IN) :: prec_ 
    159162      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
    160163      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
     
    314317      ENDIF 
    315318 
     319      IF (PRESENT(prec_)) THEN 
     320        CALL cxios_set_domain_prec & 
     321      (domain_hdl%daddr, prec_) 
     322      ENDIF 
     323 
    316324      IF (PRESENT(standard_name_)) THEN 
    317325        CALL cxios_set_domain_standard_name & 
     
    330338    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    331339    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    332     , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     340    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    333341 
    334342    IMPLICIT NONE 
     
    367375      INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo 
    368376      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex 
     377      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    369378      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    370379      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     
    376385      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    377386      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    378       , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     387      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    379388 
    380389  END SUBROUTINE xios(get_domain_attr) 
     
    384393    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    385394    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    386     , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     395    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    387396 
    388397    IMPLICIT NONE 
     
    420429      INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo 
    421430      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex 
     431      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    422432      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    423433      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     
    427437      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    428438      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    429       , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     439      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    430440 
    431441  END SUBROUTINE xios(get_domain_attr_hdl) 
     
    435445    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  & 
    436446    , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  & 
    437     , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_  & 
     447    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  & 
    438448    , type_ ) 
    439449 
     
    472482      INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo_ 
    473483      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex_ 
     484      INTEGER  , OPTIONAL, INTENT(OUT) :: prec_ 
    474485      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
    475486      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
     
    629640      ENDIF 
    630641 
     642      IF (PRESENT(prec_)) THEN 
     643        CALL cxios_get_domain_prec & 
     644      (domain_hdl%daddr, prec_) 
     645      ENDIF 
     646 
    631647      IF (PRESENT(standard_name_)) THEN 
    632648        CALL cxios_get_domain_standard_name & 
     
    645661    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    646662    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    647     , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     663    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    648664 
    649665    IMPLICIT NONE 
     
    710726      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 
    711727      LOGICAL(KIND=C_BOOL) :: nvertex_tmp 
     728      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     729      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    712730      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    713731      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    721739      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    722740      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    723       , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     741      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    724742 
    725743  END SUBROUTINE xios(is_defined_domain_attr) 
     
    729747    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    730748    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    731     , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     749    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    732750 
    733751    IMPLICIT NONE 
     
    793811      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 
    794812      LOGICAL(KIND=C_BOOL) :: nvertex_tmp 
     813      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     814      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    795815      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    796816      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    802822      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  & 
    803823      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  & 
    804       , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     824      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    805825 
    806826  END SUBROUTINE xios(is_defined_domain_attr_hdl) 
     
    810830    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  & 
    811831    , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  & 
    812     , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_  & 
     832    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  & 
    813833    , type_ ) 
    814834 
     
    875895      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex_ 
    876896      LOGICAL(KIND=C_BOOL) :: nvertex__tmp 
     897      LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 
     898      LOGICAL(KIND=C_BOOL) :: prec__tmp 
    877899      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 
    878900      LOGICAL(KIND=C_BOOL) :: standard_name__tmp 
     
    10601082      ENDIF 
    10611083 
     1084      IF (PRESENT(prec_)) THEN 
     1085        prec__tmp = cxios_is_defined_domain_prec & 
     1086      (domain_hdl%daddr) 
     1087        prec_ = prec__tmp 
     1088      ENDIF 
     1089 
    10621090      IF (PRESENT(standard_name_)) THEN 
    10631091        standard_name__tmp = cxios_is_defined_domain_standard_name & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/idomaingroup_attr.F90

    r966 r1158  
    1515    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    1616    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    17     , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     17    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    1818 
    1919    IMPLICIT NONE 
     
    5353      INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo 
    5454      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex 
     55      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    5556      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    5657      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     
    6263      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    6364      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    64       , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     65      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    6566 
    6667  END SUBROUTINE xios(set_domaingroup_attr) 
     
    7071    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    7172    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    72     , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     73    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    7374 
    7475    IMPLICIT NONE 
     
    107108      INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo 
    108109      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex 
     110      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    109111      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
    110112      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     
    114116      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    115117      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    116       , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     118      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    117119 
    118120  END SUBROUTINE xios(set_domaingroup_attr_hdl) 
     
    122124    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  & 
    123125    , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  & 
    124     , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_  & 
     126    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  & 
    125127    , type_ ) 
    126128 
     
    160162      INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo_ 
    161163      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex_ 
     164      INTEGER  , OPTIONAL, INTENT(IN) :: prec_ 
    162165      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
    163166      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
     
    322325      ENDIF 
    323326 
     327      IF (PRESENT(prec_)) THEN 
     328        CALL cxios_set_domaingroup_prec & 
     329      (domaingroup_hdl%daddr, prec_) 
     330      ENDIF 
     331 
    324332      IF (PRESENT(standard_name_)) THEN 
    325333        CALL cxios_set_domaingroup_standard_name & 
     
    338346    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    339347    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    340     , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     348    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    341349 
    342350    IMPLICIT NONE 
     
    376384      INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo 
    377385      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex 
     386      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    378387      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    379388      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     
    385394      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    386395      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    387       , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     396      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    388397 
    389398  END SUBROUTINE xios(get_domaingroup_attr) 
     
    393402    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    394403    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    395     , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     404    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    396405 
    397406    IMPLICIT NONE 
     
    430439      INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo 
    431440      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex 
     441      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    432442      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
    433443      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     
    437447      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    438448      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    439       , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     449      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    440450 
    441451  END SUBROUTINE xios(get_domaingroup_attr_hdl) 
     
    445455    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  & 
    446456    , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  & 
    447     , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_  & 
     457    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  & 
    448458    , type_ ) 
    449459 
     
    483493      INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo_ 
    484494      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex_ 
     495      INTEGER  , OPTIONAL, INTENT(OUT) :: prec_ 
    485496      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
    486497      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
     
    645656      ENDIF 
    646657 
     658      IF (PRESENT(prec_)) THEN 
     659        CALL cxios_get_domaingroup_prec & 
     660      (domaingroup_hdl%daddr, prec_) 
     661      ENDIF 
     662 
    647663      IF (PRESENT(standard_name_)) THEN 
    648664        CALL cxios_get_domaingroup_standard_name & 
     
    661677    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    662678    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    663     , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     679    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    664680 
    665681    IMPLICIT NONE 
     
    728744      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 
    729745      LOGICAL(KIND=C_BOOL) :: nvertex_tmp 
     746      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     747      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    730748      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    731749      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    739757      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    740758      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    741       , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     759      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    742760 
    743761  END SUBROUTINE xios(is_defined_domaingroup_attr) 
     
    747765    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    748766    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    749     , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     767    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    750768 
    751769    IMPLICIT NONE 
     
    813831      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 
    814832      LOGICAL(KIND=C_BOOL) :: nvertex_tmp 
     833      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     834      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    815835      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    816836      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     
    822842      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  & 
    823843      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  & 
    824       , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type ) 
     844      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 
    825845 
    826846  END SUBROUTINE xios(is_defined_domaingroup_attr_hdl) 
     
    830850    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  & 
    831851    , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  & 
    832     , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_  & 
     852    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  & 
    833853    , type_ ) 
    834854 
     
    897917      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex_ 
    898918      LOGICAL(KIND=C_BOOL) :: nvertex__tmp 
     919      LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 
     920      LOGICAL(KIND=C_BOOL) :: prec__tmp 
    899921      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 
    900922      LOGICAL(KIND=C_BOOL) :: standard_name__tmp 
     
    10881110      ENDIF 
    10891111 
     1112      IF (PRESENT(prec_)) THEN 
     1113        prec__tmp = cxios_is_defined_domaingroup_prec & 
     1114      (domaingroup_hdl%daddr) 
     1115        prec_ = prec__tmp 
     1116      ENDIF 
     1117 
    10901118      IF (PRESENT(standard_name_)) THEN 
    10911119        standard_name__tmp = cxios_is_defined_domaingroup_standard_name & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/iexpand_domain_attr.F90

    r981 r1158  
    1212 
    1313  SUBROUTINE xios(set_expand_domain_attr)  & 
    14     ( expand_domain_id, order, type ) 
     14    ( expand_domain_id, i_periodic, j_periodic, order, type ) 
    1515 
    1616    IMPLICIT NONE 
    1717      TYPE(txios(expand_domain))  :: expand_domain_hdl 
    1818      CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 
     19      LOGICAL  , OPTIONAL, INTENT(IN) :: i_periodic 
     20      LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 
     21      LOGICAL  , OPTIONAL, INTENT(IN) :: j_periodic 
     22      LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 
    1923      INTEGER  , OPTIONAL, INTENT(IN) :: order 
    2024      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     
    2327      (expand_domain_id,expand_domain_hdl) 
    2428      CALL xios(set_expand_domain_attr_hdl_)   & 
    25       ( expand_domain_hdl, order, type ) 
     29      ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
    2630 
    2731  END SUBROUTINE xios(set_expand_domain_attr) 
    2832 
    2933  SUBROUTINE xios(set_expand_domain_attr_hdl)  & 
    30     ( expand_domain_hdl, order, type ) 
    31  
    32     IMPLICIT NONE 
    33       TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     34    ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
     35 
     36    IMPLICIT NONE 
     37      TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     38      LOGICAL  , OPTIONAL, INTENT(IN) :: i_periodic 
     39      LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 
     40      LOGICAL  , OPTIONAL, INTENT(IN) :: j_periodic 
     41      LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 
    3442      INTEGER  , OPTIONAL, INTENT(IN) :: order 
    3543      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
    3644 
    3745      CALL xios(set_expand_domain_attr_hdl_)  & 
    38       ( expand_domain_hdl, order, type ) 
     46      ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
    3947 
    4048  END SUBROUTINE xios(set_expand_domain_attr_hdl) 
    4149 
    4250  SUBROUTINE xios(set_expand_domain_attr_hdl_)   & 
    43     ( expand_domain_hdl, order_, type_ ) 
    44  
    45     IMPLICIT NONE 
    46       TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     51    ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 
     52 
     53    IMPLICIT NONE 
     54      TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     55      LOGICAL  , OPTIONAL, INTENT(IN) :: i_periodic_ 
     56      LOGICAL (KIND=C_BOOL) :: i_periodic__tmp 
     57      LOGICAL  , OPTIONAL, INTENT(IN) :: j_periodic_ 
     58      LOGICAL (KIND=C_BOOL) :: j_periodic__tmp 
    4759      INTEGER  , OPTIONAL, INTENT(IN) :: order_ 
    4860      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
     61 
     62      IF (PRESENT(i_periodic_)) THEN 
     63        i_periodic__tmp = i_periodic_ 
     64        CALL cxios_set_expand_domain_i_periodic & 
     65      (expand_domain_hdl%daddr, i_periodic__tmp) 
     66      ENDIF 
     67 
     68      IF (PRESENT(j_periodic_)) THEN 
     69        j_periodic__tmp = j_periodic_ 
     70        CALL cxios_set_expand_domain_j_periodic & 
     71      (expand_domain_hdl%daddr, j_periodic__tmp) 
     72      ENDIF 
    4973 
    5074      IF (PRESENT(order_)) THEN 
     
    6185 
    6286  SUBROUTINE xios(get_expand_domain_attr)  & 
    63     ( expand_domain_id, order, type ) 
     87    ( expand_domain_id, i_periodic, j_periodic, order, type ) 
    6488 
    6589    IMPLICIT NONE 
    6690      TYPE(txios(expand_domain))  :: expand_domain_hdl 
    6791      CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 
     92      LOGICAL  , OPTIONAL, INTENT(OUT) :: i_periodic 
     93      LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 
     94      LOGICAL  , OPTIONAL, INTENT(OUT) :: j_periodic 
     95      LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 
    6896      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
    6997      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     
    72100      (expand_domain_id,expand_domain_hdl) 
    73101      CALL xios(get_expand_domain_attr_hdl_)   & 
    74       ( expand_domain_hdl, order, type ) 
     102      ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
    75103 
    76104  END SUBROUTINE xios(get_expand_domain_attr) 
    77105 
    78106  SUBROUTINE xios(get_expand_domain_attr_hdl)  & 
    79     ( expand_domain_hdl, order, type ) 
    80  
    81     IMPLICIT NONE 
    82       TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     107    ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
     108 
     109    IMPLICIT NONE 
     110      TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     111      LOGICAL  , OPTIONAL, INTENT(OUT) :: i_periodic 
     112      LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 
     113      LOGICAL  , OPTIONAL, INTENT(OUT) :: j_periodic 
     114      LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 
    83115      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
    84116      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
    85117 
    86118      CALL xios(get_expand_domain_attr_hdl_)  & 
    87       ( expand_domain_hdl, order, type ) 
     119      ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
    88120 
    89121  END SUBROUTINE xios(get_expand_domain_attr_hdl) 
    90122 
    91123  SUBROUTINE xios(get_expand_domain_attr_hdl_)   & 
    92     ( expand_domain_hdl, order_, type_ ) 
    93  
    94     IMPLICIT NONE 
    95       TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     124    ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 
     125 
     126    IMPLICIT NONE 
     127      TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     128      LOGICAL  , OPTIONAL, INTENT(OUT) :: i_periodic_ 
     129      LOGICAL (KIND=C_BOOL) :: i_periodic__tmp 
     130      LOGICAL  , OPTIONAL, INTENT(OUT) :: j_periodic_ 
     131      LOGICAL (KIND=C_BOOL) :: j_periodic__tmp 
    96132      INTEGER  , OPTIONAL, INTENT(OUT) :: order_ 
    97133      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
     134 
     135      IF (PRESENT(i_periodic_)) THEN 
     136        CALL cxios_get_expand_domain_i_periodic & 
     137      (expand_domain_hdl%daddr, i_periodic__tmp) 
     138        i_periodic_ = i_periodic__tmp 
     139      ENDIF 
     140 
     141      IF (PRESENT(j_periodic_)) THEN 
     142        CALL cxios_get_expand_domain_j_periodic & 
     143      (expand_domain_hdl%daddr, j_periodic__tmp) 
     144        j_periodic_ = j_periodic__tmp 
     145      ENDIF 
    98146 
    99147      IF (PRESENT(order_)) THEN 
     
    110158 
    111159  SUBROUTINE xios(is_defined_expand_domain_attr)  & 
    112     ( expand_domain_id, order, type ) 
     160    ( expand_domain_id, i_periodic, j_periodic, order, type ) 
    113161 
    114162    IMPLICIT NONE 
    115163      TYPE(txios(expand_domain))  :: expand_domain_hdl 
    116164      CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 
     165      LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic 
     166      LOGICAL(KIND=C_BOOL) :: i_periodic_tmp 
     167      LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic 
     168      LOGICAL(KIND=C_BOOL) :: j_periodic_tmp 
    117169      LOGICAL, OPTIONAL, INTENT(OUT) :: order 
    118170      LOGICAL(KIND=C_BOOL) :: order_tmp 
     
    123175      (expand_domain_id,expand_domain_hdl) 
    124176      CALL xios(is_defined_expand_domain_attr_hdl_)   & 
    125       ( expand_domain_hdl, order, type ) 
     177      ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
    126178 
    127179  END SUBROUTINE xios(is_defined_expand_domain_attr) 
    128180 
    129181  SUBROUTINE xios(is_defined_expand_domain_attr_hdl)  & 
    130     ( expand_domain_hdl, order, type ) 
    131  
    132     IMPLICIT NONE 
    133       TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     182    ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
     183 
     184    IMPLICIT NONE 
     185      TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     186      LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic 
     187      LOGICAL(KIND=C_BOOL) :: i_periodic_tmp 
     188      LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic 
     189      LOGICAL(KIND=C_BOOL) :: j_periodic_tmp 
    134190      LOGICAL, OPTIONAL, INTENT(OUT) :: order 
    135191      LOGICAL(KIND=C_BOOL) :: order_tmp 
     
    138194 
    139195      CALL xios(is_defined_expand_domain_attr_hdl_)  & 
    140       ( expand_domain_hdl, order, type ) 
     196      ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 
    141197 
    142198  END SUBROUTINE xios(is_defined_expand_domain_attr_hdl) 
    143199 
    144200  SUBROUTINE xios(is_defined_expand_domain_attr_hdl_)   & 
    145     ( expand_domain_hdl, order_, type_ ) 
    146  
    147     IMPLICIT NONE 
    148       TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     201    ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 
     202 
     203    IMPLICIT NONE 
     204      TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 
     205      LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic_ 
     206      LOGICAL(KIND=C_BOOL) :: i_periodic__tmp 
     207      LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic_ 
     208      LOGICAL(KIND=C_BOOL) :: j_periodic__tmp 
    149209      LOGICAL, OPTIONAL, INTENT(OUT) :: order_ 
    150210      LOGICAL(KIND=C_BOOL) :: order__tmp 
     
    152212      LOGICAL(KIND=C_BOOL) :: type__tmp 
    153213 
     214      IF (PRESENT(i_periodic_)) THEN 
     215        i_periodic__tmp = cxios_is_defined_expand_domain_i_periodic & 
     216      (expand_domain_hdl%daddr) 
     217        i_periodic_ = i_periodic__tmp 
     218      ENDIF 
     219 
     220      IF (PRESENT(j_periodic_)) THEN 
     221        j_periodic__tmp = cxios_is_defined_expand_domain_j_periodic & 
     222      (expand_domain_hdl%daddr) 
     223        j_periodic_ = j_periodic__tmp 
     224      ENDIF 
     225 
    154226      IF (PRESENT(order_)) THEN 
    155227        order__tmp = cxios_is_defined_expand_domain_order & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/ifile_attr.F90

    r966 r1158  
    1414    ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    1515    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    16     , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    17     ) 
     16    , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     17    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    1818 
    1919    IMPLICIT NONE 
     
    4343      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
    4444      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
     45      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 
     46      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 
     47      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 
    4548      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    4649      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
    4750      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     51      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 
     52      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 
    4853 
    4954      CALL xios(get_file_handle) & 
     
    5257      ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    5358      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    54       , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    55       ) 
     59      , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     60      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    5661 
    5762  END SUBROUTINE xios(set_file_attr) 
     
    6065    ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    6166    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    62     , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    63     ) 
     67    , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     68    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    6469 
    6570    IMPLICIT NONE 
     
    8893      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
    8994      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
     95      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 
     96      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 
     97      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 
    9098      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    9199      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
    92100      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     101      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 
     102      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 
    93103 
    94104      CALL xios(set_file_attr_hdl_)  & 
    95105      ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    96106      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    97       , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    98       ) 
     107      , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     108      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    99109 
    100110  END SUBROUTINE xios(set_file_attr_hdl) 
     
    103113    ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    104114    , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_  & 
    105     , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_  & 
    106     , ts_prefix_, type_ ) 
     115    , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_  & 
     116    , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 
    107117 
    108118    IMPLICIT NONE 
     
    131141      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_ 
    132142      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name_ 
     143      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format_ 
     144      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name_ 
     145      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units_ 
    133146      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries_ 
    134147      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix_ 
    135148      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
     149      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format_ 
     150      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name_ 
    136151 
    137152      IF (PRESENT(append_)) THEN 
     
    238253      ENDIF 
    239254 
     255      IF (PRESENT(time_stamp_format_)) THEN 
     256        CALL cxios_set_file_time_stamp_format & 
     257      (file_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 
     258      ENDIF 
     259 
     260      IF (PRESENT(time_stamp_name_)) THEN 
     261        CALL cxios_set_file_time_stamp_name & 
     262      (file_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 
     263      ENDIF 
     264 
     265      IF (PRESENT(time_units_)) THEN 
     266        CALL cxios_set_file_time_units & 
     267      (file_hdl%daddr, time_units_, len(time_units_)) 
     268      ENDIF 
     269 
    240270      IF (PRESENT(timeseries_)) THEN 
    241271        CALL cxios_set_file_timeseries & 
     
    253283      ENDIF 
    254284 
     285      IF (PRESENT(uuid_format_)) THEN 
     286        CALL cxios_set_file_uuid_format & 
     287      (file_hdl%daddr, uuid_format_, len(uuid_format_)) 
     288      ENDIF 
     289 
     290      IF (PRESENT(uuid_name_)) THEN 
     291        CALL cxios_set_file_uuid_name & 
     292      (file_hdl%daddr, uuid_name_, len(uuid_name_)) 
     293      ENDIF 
     294 
    255295  END SUBROUTINE xios(set_file_attr_hdl_) 
    256296 
     
    258298    ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    259299    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    260     , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    261     ) 
     300    , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     301    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    262302 
    263303    IMPLICIT NONE 
     
    287327      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
    288328      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
     329      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 
     330      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 
     331      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 
    289332      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    290333      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
    291334      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     335      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 
     336      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 
    292337 
    293338      CALL xios(get_file_handle) & 
     
    296341      ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    297342      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    298       , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    299       ) 
     343      , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     344      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    300345 
    301346  END SUBROUTINE xios(get_file_attr) 
     
    304349    ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    305350    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    306     , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    307     ) 
     351    , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     352    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    308353 
    309354    IMPLICIT NONE 
     
    332377      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
    333378      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
     379      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 
     380      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 
     381      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 
    334382      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    335383      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
    336384      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     385      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 
     386      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 
    337387 
    338388      CALL xios(get_file_attr_hdl_)  & 
    339389      ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    340390      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    341       , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    342       ) 
     391      , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     392      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    343393 
    344394  END SUBROUTINE xios(get_file_attr_hdl) 
     
    347397    ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    348398    , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_  & 
    349     , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_  & 
    350     , ts_prefix_, type_ ) 
     399    , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_  & 
     400    , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 
    351401 
    352402    IMPLICIT NONE 
     
    375425      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_ 
    376426      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name_ 
     427      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format_ 
     428      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name_ 
     429      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units_ 
    377430      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries_ 
    378431      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix_ 
    379432      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
     433      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format_ 
     434      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name_ 
    380435 
    381436      IF (PRESENT(append_)) THEN 
     
    482537      ENDIF 
    483538 
     539      IF (PRESENT(time_stamp_format_)) THEN 
     540        CALL cxios_get_file_time_stamp_format & 
     541      (file_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 
     542      ENDIF 
     543 
     544      IF (PRESENT(time_stamp_name_)) THEN 
     545        CALL cxios_get_file_time_stamp_name & 
     546      (file_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 
     547      ENDIF 
     548 
     549      IF (PRESENT(time_units_)) THEN 
     550        CALL cxios_get_file_time_units & 
     551      (file_hdl%daddr, time_units_, len(time_units_)) 
     552      ENDIF 
     553 
    484554      IF (PRESENT(timeseries_)) THEN 
    485555        CALL cxios_get_file_timeseries & 
     
    497567      ENDIF 
    498568 
     569      IF (PRESENT(uuid_format_)) THEN 
     570        CALL cxios_get_file_uuid_format & 
     571      (file_hdl%daddr, uuid_format_, len(uuid_format_)) 
     572      ENDIF 
     573 
     574      IF (PRESENT(uuid_name_)) THEN 
     575        CALL cxios_get_file_uuid_name & 
     576      (file_hdl%daddr, uuid_name_, len(uuid_name_)) 
     577      ENDIF 
     578 
    499579  END SUBROUTINE xios(get_file_attr_hdl_) 
    500580 
     
    502582    ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    503583    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    504     , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    505     ) 
     584    , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     585    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    506586 
    507587    IMPLICIT NONE 
     
    548628      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
    549629      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
     630      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 
     631      LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 
     632      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 
     633      LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 
     634      LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 
     635      LOGICAL(KIND=C_BOOL) :: time_units_tmp 
    550636      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    551637      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    554640      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    555641      LOGICAL(KIND=C_BOOL) :: type_tmp 
     642      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 
     643      LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 
     644      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 
     645      LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 
    556646 
    557647      CALL xios(get_file_handle) & 
     
    560650      ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    561651      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    562       , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    563       ) 
     652      , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     653      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    564654 
    565655  END SUBROUTINE xios(is_defined_file_attr) 
     
    568658    ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    569659    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    570     , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    571     ) 
     660    , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     661    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    572662 
    573663    IMPLICIT NONE 
     
    613703      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
    614704      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
     705      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 
     706      LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 
     707      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 
     708      LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 
     709      LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 
     710      LOGICAL(KIND=C_BOOL) :: time_units_tmp 
    615711      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    616712      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    619715      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    620716      LOGICAL(KIND=C_BOOL) :: type_tmp 
     717      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 
     718      LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 
     719      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 
     720      LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 
    621721 
    622722      CALL xios(is_defined_file_attr_hdl_)  & 
    623723      ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits  & 
    624724      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    625       , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
    626       ) 
     725      , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  & 
     726      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    627727 
    628728  END SUBROUTINE xios(is_defined_file_attr_hdl) 
     
    631731    ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_  & 
    632732    , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_  & 
    633     , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_  & 
    634     , ts_prefix_, type_ ) 
     733    , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_  & 
     734    , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 
    635735 
    636736    IMPLICIT NONE 
     
    676776      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name_ 
    677777      LOGICAL(KIND=C_BOOL) :: time_counter_name__tmp 
     778      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format_ 
     779      LOGICAL(KIND=C_BOOL) :: time_stamp_format__tmp 
     780      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name_ 
     781      LOGICAL(KIND=C_BOOL) :: time_stamp_name__tmp 
     782      LOGICAL, OPTIONAL, INTENT(OUT) :: time_units_ 
     783      LOGICAL(KIND=C_BOOL) :: time_units__tmp 
    678784      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries_ 
    679785      LOGICAL(KIND=C_BOOL) :: timeseries__tmp 
     
    682788      LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 
    683789      LOGICAL(KIND=C_BOOL) :: type__tmp 
     790      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format_ 
     791      LOGICAL(KIND=C_BOOL) :: uuid_format__tmp 
     792      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name_ 
     793      LOGICAL(KIND=C_BOOL) :: uuid_name__tmp 
    684794 
    685795      IF (PRESENT(append_)) THEN 
     
    803913      ENDIF 
    804914 
     915      IF (PRESENT(time_stamp_format_)) THEN 
     916        time_stamp_format__tmp = cxios_is_defined_file_time_stamp_format & 
     917      (file_hdl%daddr) 
     918        time_stamp_format_ = time_stamp_format__tmp 
     919      ENDIF 
     920 
     921      IF (PRESENT(time_stamp_name_)) THEN 
     922        time_stamp_name__tmp = cxios_is_defined_file_time_stamp_name & 
     923      (file_hdl%daddr) 
     924        time_stamp_name_ = time_stamp_name__tmp 
     925      ENDIF 
     926 
     927      IF (PRESENT(time_units_)) THEN 
     928        time_units__tmp = cxios_is_defined_file_time_units & 
     929      (file_hdl%daddr) 
     930        time_units_ = time_units__tmp 
     931      ENDIF 
     932 
    805933      IF (PRESENT(timeseries_)) THEN 
    806934        timeseries__tmp = cxios_is_defined_file_timeseries & 
     
    821949      ENDIF 
    822950 
     951      IF (PRESENT(uuid_format_)) THEN 
     952        uuid_format__tmp = cxios_is_defined_file_uuid_format & 
     953      (file_hdl%daddr) 
     954        uuid_format_ = uuid_format__tmp 
     955      ENDIF 
     956 
     957      IF (PRESENT(uuid_name_)) THEN 
     958        uuid_name__tmp = cxios_is_defined_file_uuid_name & 
     959      (file_hdl%daddr) 
     960        uuid_name_ = uuid_name__tmp 
     961      ENDIF 
     962 
    823963  END SUBROUTINE xios(is_defined_file_attr_hdl_) 
    824964 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/ifilegroup_attr.F90

    r966 r1158  
    1414    ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format  & 
    1515    , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    16     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    17     , type ) 
     16    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     17    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    1818 
    1919    IMPLICIT NONE 
     
    4444      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
    4545      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
     46      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 
     47      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 
     48      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 
    4649      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    4750      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
    4851      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     52      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 
     53      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 
    4954 
    5055      CALL xios(get_filegroup_handle) & 
     
    5358      ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    5459      , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    55       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    56       , type ) 
     60      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     61      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    5762 
    5863  END SUBROUTINE xios(set_filegroup_attr) 
     
    6166    ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    6267    , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    63     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    64     , type ) 
     68    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     69    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    6570 
    6671    IMPLICIT NONE 
     
    9095      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
    9196      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
     97      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 
     98      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 
     99      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 
    92100      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    93101      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
    94102      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
     103      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 
     104      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 
    95105 
    96106      CALL xios(set_filegroup_attr_hdl_)  & 
    97107      ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    98108      , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    99       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    100       , type ) 
     109      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     110      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    101111 
    102112  END SUBROUTINE xios(set_filegroup_attr_hdl) 
     
    106116    , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
    107117    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
    108     , timeseries_, ts_prefix_, type_ ) 
     118    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
     119    , uuid_name_ ) 
    109120 
    110121    IMPLICIT NONE 
     
    134145      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_ 
    135146      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name_ 
     147      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format_ 
     148      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name_ 
     149      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units_ 
    136150      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries_ 
    137151      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix_ 
    138152      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
     153      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format_ 
     154      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name_ 
    139155 
    140156      IF (PRESENT(append_)) THEN 
     
    246262      ENDIF 
    247263 
     264      IF (PRESENT(time_stamp_format_)) THEN 
     265        CALL cxios_set_filegroup_time_stamp_format & 
     266      (filegroup_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 
     267      ENDIF 
     268 
     269      IF (PRESENT(time_stamp_name_)) THEN 
     270        CALL cxios_set_filegroup_time_stamp_name & 
     271      (filegroup_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 
     272      ENDIF 
     273 
     274      IF (PRESENT(time_units_)) THEN 
     275        CALL cxios_set_filegroup_time_units & 
     276      (filegroup_hdl%daddr, time_units_, len(time_units_)) 
     277      ENDIF 
     278 
    248279      IF (PRESENT(timeseries_)) THEN 
    249280        CALL cxios_set_filegroup_timeseries & 
     
    261292      ENDIF 
    262293 
     294      IF (PRESENT(uuid_format_)) THEN 
     295        CALL cxios_set_filegroup_uuid_format & 
     296      (filegroup_hdl%daddr, uuid_format_, len(uuid_format_)) 
     297      ENDIF 
     298 
     299      IF (PRESENT(uuid_name_)) THEN 
     300        CALL cxios_set_filegroup_uuid_name & 
     301      (filegroup_hdl%daddr, uuid_name_, len(uuid_name_)) 
     302      ENDIF 
     303 
    263304  END SUBROUTINE xios(set_filegroup_attr_hdl_) 
    264305 
     
    266307    ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format  & 
    267308    , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    268     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    269     , type ) 
     309    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     310    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    270311 
    271312    IMPLICIT NONE 
     
    296337      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
    297338      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
     339      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 
     340      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 
     341      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 
    298342      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    299343      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
    300344      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     345      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 
     346      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 
    301347 
    302348      CALL xios(get_filegroup_handle) & 
     
    305351      ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    306352      , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    307       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    308       , type ) 
     353      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     354      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    309355 
    310356  END SUBROUTINE xios(get_filegroup_attr) 
     
    313359    ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    314360    , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    315     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    316     , type ) 
     361    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     362    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    317363 
    318364    IMPLICIT NONE 
     
    342388      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
    343389      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
     390      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 
     391      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 
     392      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 
    344393      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    345394      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
    346395      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
     396      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 
     397      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 
    347398 
    348399      CALL xios(get_filegroup_attr_hdl_)  & 
    349400      ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    350401      , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    351       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    352       , type ) 
     402      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     403      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    353404 
    354405  END SUBROUTINE xios(get_filegroup_attr_hdl) 
     
    358409    , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
    359410    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
    360     , timeseries_, ts_prefix_, type_ ) 
     411    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
     412    , uuid_name_ ) 
    361413 
    362414    IMPLICIT NONE 
     
    386438      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_ 
    387439      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name_ 
     440      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format_ 
     441      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name_ 
     442      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units_ 
    388443      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries_ 
    389444      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix_ 
    390445      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
     446      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format_ 
     447      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name_ 
    391448 
    392449      IF (PRESENT(append_)) THEN 
     
    498555      ENDIF 
    499556 
     557      IF (PRESENT(time_stamp_format_)) THEN 
     558        CALL cxios_get_filegroup_time_stamp_format & 
     559      (filegroup_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 
     560      ENDIF 
     561 
     562      IF (PRESENT(time_stamp_name_)) THEN 
     563        CALL cxios_get_filegroup_time_stamp_name & 
     564      (filegroup_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 
     565      ENDIF 
     566 
     567      IF (PRESENT(time_units_)) THEN 
     568        CALL cxios_get_filegroup_time_units & 
     569      (filegroup_hdl%daddr, time_units_, len(time_units_)) 
     570      ENDIF 
     571 
    500572      IF (PRESENT(timeseries_)) THEN 
    501573        CALL cxios_get_filegroup_timeseries & 
     
    513585      ENDIF 
    514586 
     587      IF (PRESENT(uuid_format_)) THEN 
     588        CALL cxios_get_filegroup_uuid_format & 
     589      (filegroup_hdl%daddr, uuid_format_, len(uuid_format_)) 
     590      ENDIF 
     591 
     592      IF (PRESENT(uuid_name_)) THEN 
     593        CALL cxios_get_filegroup_uuid_name & 
     594      (filegroup_hdl%daddr, uuid_name_, len(uuid_name_)) 
     595      ENDIF 
     596 
    515597  END SUBROUTINE xios(get_filegroup_attr_hdl_) 
    516598 
     
    518600    ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format  & 
    519601    , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    520     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    521     , type ) 
     602    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     603    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    522604 
    523605    IMPLICIT NONE 
     
    566648      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
    567649      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
     650      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 
     651      LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 
     652      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 
     653      LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 
     654      LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 
     655      LOGICAL(KIND=C_BOOL) :: time_units_tmp 
    568656      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    569657      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    572660      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    573661      LOGICAL(KIND=C_BOOL) :: type_tmp 
     662      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 
     663      LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 
     664      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 
     665      LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 
    574666 
    575667      CALL xios(get_filegroup_handle) & 
     
    578670      ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    579671      , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    580       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    581       , type ) 
     672      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     673      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    582674 
    583675  END SUBROUTINE xios(is_defined_filegroup_attr) 
     
    586678    ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    587679    , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    588     , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    589     , type ) 
     680    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     681    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    590682 
    591683    IMPLICIT NONE 
     
    633725      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
    634726      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
     727      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 
     728      LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 
     729      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 
     730      LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 
     731      LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 
     732      LOGICAL(KIND=C_BOOL) :: time_units_tmp 
    635733      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    636734      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    639737      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    640738      LOGICAL(KIND=C_BOOL) :: type_tmp 
     739      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 
     740      LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 
     741      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 
     742      LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 
    641743 
    642744      CALL xios(is_defined_filegroup_attr_hdl_)  & 
    643745      ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format  & 
    644746      , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  & 
    645       , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix  & 
    646       , type ) 
     747      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  & 
     748      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 
    647749 
    648750  END SUBROUTINE xios(is_defined_filegroup_attr_hdl) 
     
    652754    , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  & 
    653755    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  & 
    654     , timeseries_, ts_prefix_, type_ ) 
     756    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  & 
     757    , uuid_name_ ) 
    655758 
    656759    IMPLICIT NONE 
     
    698801      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name_ 
    699802      LOGICAL(KIND=C_BOOL) :: time_counter_name__tmp 
     803      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format_ 
     804      LOGICAL(KIND=C_BOOL) :: time_stamp_format__tmp 
     805      LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name_ 
     806      LOGICAL(KIND=C_BOOL) :: time_stamp_name__tmp 
     807      LOGICAL, OPTIONAL, INTENT(OUT) :: time_units_ 
     808      LOGICAL(KIND=C_BOOL) :: time_units__tmp 
    700809      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries_ 
    701810      LOGICAL(KIND=C_BOOL) :: timeseries__tmp 
     
    704813      LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 
    705814      LOGICAL(KIND=C_BOOL) :: type__tmp 
     815      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format_ 
     816      LOGICAL(KIND=C_BOOL) :: uuid_format__tmp 
     817      LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name_ 
     818      LOGICAL(KIND=C_BOOL) :: uuid_name__tmp 
    706819 
    707820      IF (PRESENT(append_)) THEN 
     
    831944      ENDIF 
    832945 
     946      IF (PRESENT(time_stamp_format_)) THEN 
     947        time_stamp_format__tmp = cxios_is_defined_filegroup_time_stamp_format & 
     948      (filegroup_hdl%daddr) 
     949        time_stamp_format_ = time_stamp_format__tmp 
     950      ENDIF 
     951 
     952      IF (PRESENT(time_stamp_name_)) THEN 
     953        time_stamp_name__tmp = cxios_is_defined_filegroup_time_stamp_name & 
     954      (filegroup_hdl%daddr) 
     955        time_stamp_name_ = time_stamp_name__tmp 
     956      ENDIF 
     957 
     958      IF (PRESENT(time_units_)) THEN 
     959        time_units__tmp = cxios_is_defined_filegroup_time_units & 
     960      (filegroup_hdl%daddr) 
     961        time_units_ = time_units__tmp 
     962      ENDIF 
     963 
    833964      IF (PRESENT(timeseries_)) THEN 
    834965        timeseries__tmp = cxios_is_defined_filegroup_timeseries & 
     
    849980      ENDIF 
    850981 
     982      IF (PRESENT(uuid_format_)) THEN 
     983        uuid_format__tmp = cxios_is_defined_filegroup_uuid_format & 
     984      (filegroup_hdl%daddr) 
     985        uuid_format_ = uuid_format__tmp 
     986      ENDIF 
     987 
     988      IF (PRESENT(uuid_name_)) THEN 
     989        uuid_name__tmp = cxios_is_defined_filegroup_uuid_name & 
     990      (filegroup_hdl%daddr) 
     991        uuid_name_ = uuid_name__tmp 
     992      ENDIF 
     993 
    851994  END SUBROUTINE xios(is_defined_filegroup_attr_hdl_) 
    852995 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/iinterpolate_domain_attr.F90

    r1021 r1158  
    1212 
    1313  SUBROUTINE xios(set_interpolate_domain_attr)  & 
    14     ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight ) 
     14    ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 
    1515 
    1616    IMPLICIT NONE 
    1717      TYPE(txios(interpolate_domain))  :: interpolate_domain_hdl 
    1818      CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 
    19       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 
    2019      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    2120      INTEGER  , OPTIONAL, INTENT(IN) :: order 
     
    2928      (interpolate_domain_id,interpolate_domain_hdl) 
    3029      CALL xios(set_interpolate_domain_attr_hdl_)   & 
    31       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     30      ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
    3231 
    3332  END SUBROUTINE xios(set_interpolate_domain_attr) 
    3433 
    3534  SUBROUTINE xios(set_interpolate_domain_attr_hdl)  & 
    36     ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
    37  
    38     IMPLICIT NONE 
    39       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    40       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 
     35    ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     36 
     37    IMPLICIT NONE 
     38      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    4139      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    4240      INTEGER  , OPTIONAL, INTENT(IN) :: order 
     
    4846 
    4947      CALL xios(set_interpolate_domain_attr_hdl_)  & 
    50       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     48      ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
    5149 
    5250  END SUBROUTINE xios(set_interpolate_domain_attr_hdl) 
    5351 
    5452  SUBROUTINE xios(set_interpolate_domain_attr_hdl_)   & 
    55     ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  & 
    56      ) 
    57  
    58     IMPLICIT NONE 
    59       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    60       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file_ 
     53    ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 
     54 
     55    IMPLICIT NONE 
     56      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    6157      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_ 
    6258      INTEGER  , OPTIONAL, INTENT(IN) :: order_ 
     
    6763      LOGICAL (KIND=C_BOOL) :: write_weight__tmp 
    6864 
    69       IF (PRESENT(file_)) THEN 
    70         CALL cxios_set_interpolate_domain_file & 
    71       (interpolate_domain_hdl%daddr, file_, len(file_)) 
    72       ENDIF 
    73  
    7465      IF (PRESENT(mode_)) THEN 
    7566        CALL cxios_set_interpolate_domain_mode & 
     
    10293 
    10394  SUBROUTINE xios(get_interpolate_domain_attr)  & 
    104     ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight ) 
     95    ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 
    10596 
    10697    IMPLICIT NONE 
    10798      TYPE(txios(interpolate_domain))  :: interpolate_domain_hdl 
    10899      CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 
    109       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 
    110100      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    111101      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
     
    119109      (interpolate_domain_id,interpolate_domain_hdl) 
    120110      CALL xios(get_interpolate_domain_attr_hdl_)   & 
    121       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     111      ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
    122112 
    123113  END SUBROUTINE xios(get_interpolate_domain_attr) 
    124114 
    125115  SUBROUTINE xios(get_interpolate_domain_attr_hdl)  & 
    126     ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
    127  
    128     IMPLICIT NONE 
    129       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    130       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 
     116    ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     117 
     118    IMPLICIT NONE 
     119      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    131120      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    132121      INTEGER  , OPTIONAL, INTENT(OUT) :: order 
     
    138127 
    139128      CALL xios(get_interpolate_domain_attr_hdl_)  & 
    140       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     129      ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
    141130 
    142131  END SUBROUTINE xios(get_interpolate_domain_attr_hdl) 
    143132 
    144133  SUBROUTINE xios(get_interpolate_domain_attr_hdl_)   & 
    145     ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  & 
    146      ) 
    147  
    148     IMPLICIT NONE 
    149       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    150       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file_ 
     134    ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 
     135 
     136    IMPLICIT NONE 
     137      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    151138      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_ 
    152139      INTEGER  , OPTIONAL, INTENT(OUT) :: order_ 
     
    157144      LOGICAL (KIND=C_BOOL) :: write_weight__tmp 
    158145 
    159       IF (PRESENT(file_)) THEN 
    160         CALL cxios_get_interpolate_domain_file & 
    161       (interpolate_domain_hdl%daddr, file_, len(file_)) 
    162       ENDIF 
    163  
    164146      IF (PRESENT(mode_)) THEN 
    165147        CALL cxios_get_interpolate_domain_mode & 
     
    192174 
    193175  SUBROUTINE xios(is_defined_interpolate_domain_attr)  & 
    194     ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight ) 
     176    ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 
    195177 
    196178    IMPLICIT NONE 
    197179      TYPE(txios(interpolate_domain))  :: interpolate_domain_hdl 
    198180      CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 
    199       LOGICAL, OPTIONAL, INTENT(OUT) :: file 
    200       LOGICAL(KIND=C_BOOL) :: file_tmp 
    201181      LOGICAL, OPTIONAL, INTENT(OUT) :: mode 
    202182      LOGICAL(KIND=C_BOOL) :: mode_tmp 
     
    213193      (interpolate_domain_id,interpolate_domain_hdl) 
    214194      CALL xios(is_defined_interpolate_domain_attr_hdl_)   & 
    215       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     195      ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
    216196 
    217197  END SUBROUTINE xios(is_defined_interpolate_domain_attr) 
    218198 
    219199  SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)  & 
    220     ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
    221  
    222     IMPLICIT NONE 
    223       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    224       LOGICAL, OPTIONAL, INTENT(OUT) :: file 
    225       LOGICAL(KIND=C_BOOL) :: file_tmp 
     200    ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
     201 
     202    IMPLICIT NONE 
     203      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    226204      LOGICAL, OPTIONAL, INTENT(OUT) :: mode 
    227205      LOGICAL(KIND=C_BOOL) :: mode_tmp 
     
    236214 
    237215      CALL xios(is_defined_interpolate_domain_attr_hdl_)  & 
    238       ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 
     216      ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 
    239217 
    240218  END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) 
    241219 
    242220  SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)   & 
    243     ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  & 
    244      ) 
    245  
    246     IMPLICIT NONE 
    247       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    248       LOGICAL, OPTIONAL, INTENT(OUT) :: file_ 
    249       LOGICAL(KIND=C_BOOL) :: file__tmp 
     221    ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 
     222 
     223    IMPLICIT NONE 
     224      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 
    250225      LOGICAL, OPTIONAL, INTENT(OUT) :: mode_ 
    251226      LOGICAL(KIND=C_BOOL) :: mode__tmp 
     
    259234      LOGICAL(KIND=C_BOOL) :: write_weight__tmp 
    260235 
    261       IF (PRESENT(file_)) THEN 
    262         file__tmp = cxios_is_defined_interpolate_domain_file & 
    263       (interpolate_domain_hdl%daddr) 
    264         file_ = file__tmp 
    265       ENDIF 
    266  
    267236      IF (PRESENT(mode_)) THEN 
    268237        mode__tmp = cxios_is_defined_interpolate_domain_mode & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/interpolate_domain_interface_attr.F90

    r1021 r1158  
    99  INTERFACE 
    1010    ! Do not call directly / interface FORTRAN 2003 <-> C99 
    11  
    12     SUBROUTINE cxios_set_interpolate_domain_file(interpolate_domain_hdl, file, file_size) BIND(C) 
    13       USE ISO_C_BINDING 
    14       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    15       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: file 
    16       INTEGER  (kind = C_INT)     , VALUE        :: file_size 
    17     END SUBROUTINE cxios_set_interpolate_domain_file 
    18  
    19     SUBROUTINE cxios_get_interpolate_domain_file(interpolate_domain_hdl, file, file_size) BIND(C) 
    20       USE ISO_C_BINDING 
    21       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    22       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: file 
    23       INTEGER  (kind = C_INT)     , VALUE        :: file_size 
    24     END SUBROUTINE cxios_get_interpolate_domain_file 
    25  
    26     FUNCTION cxios_is_defined_interpolate_domain_file(interpolate_domain_hdl) BIND(C) 
    27       USE ISO_C_BINDING 
    28       LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_file 
    29       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
    30     END FUNCTION cxios_is_defined_interpolate_domain_file 
    31  
    3211 
    3312    SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C) 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/iscalar_attr.F90

    r966 r1158  
    1212 
    1313  SUBROUTINE xios(set_scalar_attr)  & 
    14     ( scalar_id, long_name, name, scalar_ref, standard_name, unit, value ) 
     14    ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    1515 
    1616    IMPLICIT NONE 
     
    1919      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    2020      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     21      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    2122      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 
    2223      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
     
    2728      (scalar_id,scalar_hdl) 
    2829      CALL xios(set_scalar_attr_hdl_)   & 
    29       ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     30      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    3031 
    3132  END SUBROUTINE xios(set_scalar_attr) 
    3233 
    3334  SUBROUTINE xios(set_scalar_attr_hdl)  & 
    34     ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     35    ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    3536 
    3637    IMPLICIT NONE 
     
    3839      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    3940      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     41      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    4042      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 
    4143      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
     
    4446 
    4547      CALL xios(set_scalar_attr_hdl_)  & 
    46       ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     48      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    4749 
    4850  END SUBROUTINE xios(set_scalar_attr_hdl) 
    4951 
    5052  SUBROUTINE xios(set_scalar_attr_hdl_)   & 
    51     ( scalar_hdl, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ ) 
     53    ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ ) 
    5254 
    5355    IMPLICIT NONE 
     
    5557      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 
    5658      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
     59      INTEGER  , OPTIONAL, INTENT(IN) :: prec_ 
    5760      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref_ 
    5861      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
     
    7073      ENDIF 
    7174 
     75      IF (PRESENT(prec_)) THEN 
     76        CALL cxios_set_scalar_prec & 
     77      (scalar_hdl%daddr, prec_) 
     78      ENDIF 
     79 
    7280      IF (PRESENT(scalar_ref_)) THEN 
    7381        CALL cxios_set_scalar_scalar_ref & 
     
    93101 
    94102  SUBROUTINE xios(get_scalar_attr)  & 
    95     ( scalar_id, long_name, name, scalar_ref, standard_name, unit, value ) 
     103    ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    96104 
    97105    IMPLICIT NONE 
     
    100108      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    101109      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     110      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    102111      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 
    103112      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
     
    108117      (scalar_id,scalar_hdl) 
    109118      CALL xios(get_scalar_attr_hdl_)   & 
    110       ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     119      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    111120 
    112121  END SUBROUTINE xios(get_scalar_attr) 
    113122 
    114123  SUBROUTINE xios(get_scalar_attr_hdl)  & 
    115     ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     124    ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    116125 
    117126    IMPLICIT NONE 
     
    119128      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    120129      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     130      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    121131      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 
    122132      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
     
    125135 
    126136      CALL xios(get_scalar_attr_hdl_)  & 
    127       ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     137      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    128138 
    129139  END SUBROUTINE xios(get_scalar_attr_hdl) 
    130140 
    131141  SUBROUTINE xios(get_scalar_attr_hdl_)   & 
    132     ( scalar_hdl, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ ) 
     142    ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ ) 
    133143 
    134144    IMPLICIT NONE 
     
    136146      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 
    137147      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
     148      INTEGER  , OPTIONAL, INTENT(OUT) :: prec_ 
    138149      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref_ 
    139150      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
     
    151162      ENDIF 
    152163 
     164      IF (PRESENT(prec_)) THEN 
     165        CALL cxios_get_scalar_prec & 
     166      (scalar_hdl%daddr, prec_) 
     167      ENDIF 
     168 
    153169      IF (PRESENT(scalar_ref_)) THEN 
    154170        CALL cxios_get_scalar_scalar_ref & 
     
    174190 
    175191  SUBROUTINE xios(is_defined_scalar_attr)  & 
    176     ( scalar_id, long_name, name, scalar_ref, standard_name, unit, value ) 
     192    ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    177193 
    178194    IMPLICIT NONE 
     
    183199      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    184200      LOGICAL(KIND=C_BOOL) :: name_tmp 
     201      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     202      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    185203      LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 
    186204      LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp 
     
    195213      (scalar_id,scalar_hdl) 
    196214      CALL xios(is_defined_scalar_attr_hdl_)   & 
    197       ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     215      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    198216 
    199217  END SUBROUTINE xios(is_defined_scalar_attr) 
    200218 
    201219  SUBROUTINE xios(is_defined_scalar_attr_hdl)  & 
    202     ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     220    ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    203221 
    204222    IMPLICIT NONE 
     
    208226      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    209227      LOGICAL(KIND=C_BOOL) :: name_tmp 
     228      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     229      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    210230      LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 
    211231      LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp 
     
    218238 
    219239      CALL xios(is_defined_scalar_attr_hdl_)  & 
    220       ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value ) 
     240      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    221241 
    222242  END SUBROUTINE xios(is_defined_scalar_attr_hdl) 
    223243 
    224244  SUBROUTINE xios(is_defined_scalar_attr_hdl_)   & 
    225     ( scalar_hdl, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ ) 
     245    ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ ) 
    226246 
    227247    IMPLICIT NONE 
     
    231251      LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 
    232252      LOGICAL(KIND=C_BOOL) :: name__tmp 
     253      LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 
     254      LOGICAL(KIND=C_BOOL) :: prec__tmp 
    233255      LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref_ 
    234256      LOGICAL(KIND=C_BOOL) :: scalar_ref__tmp 
     
    252274      ENDIF 
    253275 
     276      IF (PRESENT(prec_)) THEN 
     277        prec__tmp = cxios_is_defined_scalar_prec & 
     278      (scalar_hdl%daddr) 
     279        prec_ = prec__tmp 
     280      ENDIF 
     281 
    254282      IF (PRESENT(scalar_ref_)) THEN 
    255283        scalar_ref__tmp = cxios_is_defined_scalar_scalar_ref & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/iscalargroup_attr.F90

    r966 r1158  
    1212 
    1313  SUBROUTINE xios(set_scalargroup_attr)  & 
    14     ( scalargroup_id, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     14    ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    1515 
    1616    IMPLICIT NONE 
     
    2020      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    2121      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     22      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    2223      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 
    2324      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
     
    2829      (scalargroup_id,scalargroup_hdl) 
    2930      CALL xios(set_scalargroup_attr_hdl_)   & 
    30       ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     31      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     32       ) 
    3133 
    3234  END SUBROUTINE xios(set_scalargroup_attr) 
    3335 
    3436  SUBROUTINE xios(set_scalargroup_attr_hdl)  & 
    35     ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     37    ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     38     ) 
    3639 
    3740    IMPLICIT NONE 
     
    4043      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    4144      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     45      INTEGER  , OPTIONAL, INTENT(IN) :: prec 
    4246      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 
    4347      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
     
    4650 
    4751      CALL xios(set_scalargroup_attr_hdl_)  & 
    48       ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     52      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     53       ) 
    4954 
    5055  END SUBROUTINE xios(set_scalargroup_attr_hdl) 
    5156 
    5257  SUBROUTINE xios(set_scalargroup_attr_hdl_)   & 
    53     ( scalargroup_hdl, group_ref_, long_name_, name_, scalar_ref_, standard_name_, unit_, value_  & 
    54     ) 
     58    ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_  & 
     59    , value_ ) 
    5560 
    5661    IMPLICIT NONE 
     
    5964      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 
    6065      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
     66      INTEGER  , OPTIONAL, INTENT(IN) :: prec_ 
    6167      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref_ 
    6268      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
     
    7985      ENDIF 
    8086 
     87      IF (PRESENT(prec_)) THEN 
     88        CALL cxios_set_scalargroup_prec & 
     89      (scalargroup_hdl%daddr, prec_) 
     90      ENDIF 
     91 
    8192      IF (PRESENT(scalar_ref_)) THEN 
    8293        CALL cxios_set_scalargroup_scalar_ref & 
     
    102113 
    103114  SUBROUTINE xios(get_scalargroup_attr)  & 
    104     ( scalargroup_id, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     115    ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    105116 
    106117    IMPLICIT NONE 
     
    110121      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    111122      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     123      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    112124      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 
    113125      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
     
    118130      (scalargroup_id,scalargroup_hdl) 
    119131      CALL xios(get_scalargroup_attr_hdl_)   & 
    120       ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     132      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     133       ) 
    121134 
    122135  END SUBROUTINE xios(get_scalargroup_attr) 
    123136 
    124137  SUBROUTINE xios(get_scalargroup_attr_hdl)  & 
    125     ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     138    ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     139     ) 
    126140 
    127141    IMPLICIT NONE 
     
    130144      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    131145      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     146      INTEGER  , OPTIONAL, INTENT(OUT) :: prec 
    132147      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 
    133148      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
     
    136151 
    137152      CALL xios(get_scalargroup_attr_hdl_)  & 
    138       ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     153      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     154       ) 
    139155 
    140156  END SUBROUTINE xios(get_scalargroup_attr_hdl) 
    141157 
    142158  SUBROUTINE xios(get_scalargroup_attr_hdl_)   & 
    143     ( scalargroup_hdl, group_ref_, long_name_, name_, scalar_ref_, standard_name_, unit_, value_  & 
    144     ) 
     159    ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_  & 
     160    , value_ ) 
    145161 
    146162    IMPLICIT NONE 
     
    149165      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 
    150166      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
     167      INTEGER  , OPTIONAL, INTENT(OUT) :: prec_ 
    151168      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref_ 
    152169      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
     
    169186      ENDIF 
    170187 
     188      IF (PRESENT(prec_)) THEN 
     189        CALL cxios_get_scalargroup_prec & 
     190      (scalargroup_hdl%daddr, prec_) 
     191      ENDIF 
     192 
    171193      IF (PRESENT(scalar_ref_)) THEN 
    172194        CALL cxios_get_scalargroup_scalar_ref & 
     
    192214 
    193215  SUBROUTINE xios(is_defined_scalargroup_attr)  & 
    194     ( scalargroup_id, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     216    ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value ) 
    195217 
    196218    IMPLICIT NONE 
     
    203225      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    204226      LOGICAL(KIND=C_BOOL) :: name_tmp 
     227      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     228      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    205229      LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 
    206230      LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp 
     
    215239      (scalargroup_id,scalargroup_hdl) 
    216240      CALL xios(is_defined_scalargroup_attr_hdl_)   & 
    217       ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     241      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     242       ) 
    218243 
    219244  END SUBROUTINE xios(is_defined_scalargroup_attr) 
    220245 
    221246  SUBROUTINE xios(is_defined_scalargroup_attr_hdl)  & 
    222     ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     247    ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     248     ) 
    223249 
    224250    IMPLICIT NONE 
     
    230256      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    231257      LOGICAL(KIND=C_BOOL) :: name_tmp 
     258      LOGICAL, OPTIONAL, INTENT(OUT) :: prec 
     259      LOGICAL(KIND=C_BOOL) :: prec_tmp 
    232260      LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 
    233261      LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp 
     
    240268 
    241269      CALL xios(is_defined_scalargroup_attr_hdl_)  & 
    242       ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 
     270      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  & 
     271       ) 
    243272 
    244273  END SUBROUTINE xios(is_defined_scalargroup_attr_hdl) 
    245274 
    246275  SUBROUTINE xios(is_defined_scalargroup_attr_hdl_)   & 
    247     ( scalargroup_hdl, group_ref_, long_name_, name_, scalar_ref_, standard_name_, unit_, value_  & 
    248     ) 
     276    ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_  & 
     277    , value_ ) 
    249278 
    250279    IMPLICIT NONE 
     
    256285      LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 
    257286      LOGICAL(KIND=C_BOOL) :: name__tmp 
     287      LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 
     288      LOGICAL(KIND=C_BOOL) :: prec__tmp 
    258289      LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref_ 
    259290      LOGICAL(KIND=C_BOOL) :: scalar_ref__tmp 
     
    283314      ENDIF 
    284315 
     316      IF (PRESENT(prec_)) THEN 
     317        prec__tmp = cxios_is_defined_scalargroup_prec & 
     318      (scalargroup_hdl%daddr) 
     319        prec_ = prec__tmp 
     320      ENDIF 
     321 
    285322      IF (PRESENT(scalar_ref_)) THEN 
    286323        scalar_ref__tmp = cxios_is_defined_scalargroup_scalar_ref & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/ivariable_attr.F90

    r966 r1158  
    1212 
    1313  SUBROUTINE xios(set_variable_attr)  & 
    14     ( variable_id, name, type ) 
     14    ( variable_id, name, ts_target, type ) 
    1515 
    1616    IMPLICIT NONE 
     
    1818      CHARACTER(LEN=*), INTENT(IN) ::variable_id 
    1919      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     20      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 
    2021      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
    2122 
     
    2324      (variable_id,variable_hdl) 
    2425      CALL xios(set_variable_attr_hdl_)   & 
    25       ( variable_hdl, name, type ) 
     26      ( variable_hdl, name, ts_target, type ) 
    2627 
    2728  END SUBROUTINE xios(set_variable_attr) 
    2829 
    2930  SUBROUTINE xios(set_variable_attr_hdl)  & 
    30     ( variable_hdl, name, type ) 
     31    ( variable_hdl, name, ts_target, type ) 
    3132 
    3233    IMPLICIT NONE 
    3334      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 
    3435      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     36      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 
    3537      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
    3638 
    3739      CALL xios(set_variable_attr_hdl_)  & 
    38       ( variable_hdl, name, type ) 
     40      ( variable_hdl, name, ts_target, type ) 
    3941 
    4042  END SUBROUTINE xios(set_variable_attr_hdl) 
    4143 
    4244  SUBROUTINE xios(set_variable_attr_hdl_)   & 
    43     ( variable_hdl, name_, type_ ) 
     45    ( variable_hdl, name_, ts_target_, type_ ) 
    4446 
    4547    IMPLICIT NONE 
    4648      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 
    4749      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
     50      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target_ 
    4851      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
    4952 
     
    5154        CALL cxios_set_variable_name & 
    5255      (variable_hdl%daddr, name_, len(name_)) 
     56      ENDIF 
     57 
     58      IF (PRESENT(ts_target_)) THEN 
     59        CALL cxios_set_variable_ts_target & 
     60      (variable_hdl%daddr, ts_target_, len(ts_target_)) 
    5361      ENDIF 
    5462 
     
    6169 
    6270  SUBROUTINE xios(get_variable_attr)  & 
    63     ( variable_id, name, type ) 
     71    ( variable_id, name, ts_target, type ) 
    6472 
    6573    IMPLICIT NONE 
     
    6775      CHARACTER(LEN=*), INTENT(IN) ::variable_id 
    6876      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     77      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 
    6978      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
    7079 
     
    7281      (variable_id,variable_hdl) 
    7382      CALL xios(get_variable_attr_hdl_)   & 
    74       ( variable_hdl, name, type ) 
     83      ( variable_hdl, name, ts_target, type ) 
    7584 
    7685  END SUBROUTINE xios(get_variable_attr) 
    7786 
    7887  SUBROUTINE xios(get_variable_attr_hdl)  & 
    79     ( variable_hdl, name, type ) 
     88    ( variable_hdl, name, ts_target, type ) 
    8089 
    8190    IMPLICIT NONE 
    8291      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 
    8392      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     93      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 
    8494      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
    8595 
    8696      CALL xios(get_variable_attr_hdl_)  & 
    87       ( variable_hdl, name, type ) 
     97      ( variable_hdl, name, ts_target, type ) 
    8898 
    8999  END SUBROUTINE xios(get_variable_attr_hdl) 
    90100 
    91101  SUBROUTINE xios(get_variable_attr_hdl_)   & 
    92     ( variable_hdl, name_, type_ ) 
     102    ( variable_hdl, name_, ts_target_, type_ ) 
    93103 
    94104    IMPLICIT NONE 
    95105      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 
    96106      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
     107      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target_ 
    97108      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
    98109 
     
    100111        CALL cxios_get_variable_name & 
    101112      (variable_hdl%daddr, name_, len(name_)) 
     113      ENDIF 
     114 
     115      IF (PRESENT(ts_target_)) THEN 
     116        CALL cxios_get_variable_ts_target & 
     117      (variable_hdl%daddr, ts_target_, len(ts_target_)) 
    102118      ENDIF 
    103119 
     
    110126 
    111127  SUBROUTINE xios(is_defined_variable_attr)  & 
    112     ( variable_id, name, type ) 
     128    ( variable_id, name, ts_target, type ) 
    113129 
    114130    IMPLICIT NONE 
     
    117133      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    118134      LOGICAL(KIND=C_BOOL) :: name_tmp 
     135      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 
     136      LOGICAL(KIND=C_BOOL) :: ts_target_tmp 
    119137      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    120138      LOGICAL(KIND=C_BOOL) :: type_tmp 
     
    123141      (variable_id,variable_hdl) 
    124142      CALL xios(is_defined_variable_attr_hdl_)   & 
    125       ( variable_hdl, name, type ) 
     143      ( variable_hdl, name, ts_target, type ) 
    126144 
    127145  END SUBROUTINE xios(is_defined_variable_attr) 
    128146 
    129147  SUBROUTINE xios(is_defined_variable_attr_hdl)  & 
    130     ( variable_hdl, name, type ) 
     148    ( variable_hdl, name, ts_target, type ) 
    131149 
    132150    IMPLICIT NONE 
     
    134152      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    135153      LOGICAL(KIND=C_BOOL) :: name_tmp 
     154      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 
     155      LOGICAL(KIND=C_BOOL) :: ts_target_tmp 
    136156      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    137157      LOGICAL(KIND=C_BOOL) :: type_tmp 
    138158 
    139159      CALL xios(is_defined_variable_attr_hdl_)  & 
    140       ( variable_hdl, name, type ) 
     160      ( variable_hdl, name, ts_target, type ) 
    141161 
    142162  END SUBROUTINE xios(is_defined_variable_attr_hdl) 
    143163 
    144164  SUBROUTINE xios(is_defined_variable_attr_hdl_)   & 
    145     ( variable_hdl, name_, type_ ) 
     165    ( variable_hdl, name_, ts_target_, type_ ) 
    146166 
    147167    IMPLICIT NONE 
     
    149169      LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 
    150170      LOGICAL(KIND=C_BOOL) :: name__tmp 
     171      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target_ 
     172      LOGICAL(KIND=C_BOOL) :: ts_target__tmp 
    151173      LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 
    152174      LOGICAL(KIND=C_BOOL) :: type__tmp 
     
    156178      (variable_hdl%daddr) 
    157179        name_ = name__tmp 
     180      ENDIF 
     181 
     182      IF (PRESENT(ts_target_)) THEN 
     183        ts_target__tmp = cxios_is_defined_variable_ts_target & 
     184      (variable_hdl%daddr) 
     185        ts_target_ = ts_target__tmp 
    158186      ENDIF 
    159187 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/ivariablegroup_attr.F90

    r966 r1158  
    1212 
    1313  SUBROUTINE xios(set_variablegroup_attr)  & 
    14     ( variablegroup_id, group_ref, name, type ) 
     14    ( variablegroup_id, group_ref, name, ts_target, type ) 
    1515 
    1616    IMPLICIT NONE 
     
    1919      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 
    2020      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     21      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 
    2122      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
    2223 
     
    2425      (variablegroup_id,variablegroup_hdl) 
    2526      CALL xios(set_variablegroup_attr_hdl_)   & 
    26       ( variablegroup_hdl, group_ref, name, type ) 
     27      ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    2728 
    2829  END SUBROUTINE xios(set_variablegroup_attr) 
    2930 
    3031  SUBROUTINE xios(set_variablegroup_attr_hdl)  & 
    31     ( variablegroup_hdl, group_ref, name, type ) 
     32    ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    3233 
    3334    IMPLICIT NONE 
     
    3536      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 
    3637      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
     38      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 
    3739      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 
    3840 
    3941      CALL xios(set_variablegroup_attr_hdl_)  & 
    40       ( variablegroup_hdl, group_ref, name, type ) 
     42      ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    4143 
    4244  END SUBROUTINE xios(set_variablegroup_attr_hdl) 
    4345 
    4446  SUBROUTINE xios(set_variablegroup_attr_hdl_)   & 
    45     ( variablegroup_hdl, group_ref_, name_, type_ ) 
     47    ( variablegroup_hdl, group_ref_, name_, ts_target_, type_ ) 
    4648 
    4749    IMPLICIT NONE 
     
    4951      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_ 
    5052      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
     53      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target_ 
    5154      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 
    5255 
     
    6164      ENDIF 
    6265 
     66      IF (PRESENT(ts_target_)) THEN 
     67        CALL cxios_set_variablegroup_ts_target & 
     68      (variablegroup_hdl%daddr, ts_target_, len(ts_target_)) 
     69      ENDIF 
     70 
    6371      IF (PRESENT(type_)) THEN 
    6472        CALL cxios_set_variablegroup_type & 
     
    6977 
    7078  SUBROUTINE xios(get_variablegroup_attr)  & 
    71     ( variablegroup_id, group_ref, name, type ) 
     79    ( variablegroup_id, group_ref, name, ts_target, type ) 
    7280 
    7381    IMPLICIT NONE 
     
    7684      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 
    7785      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     86      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 
    7887      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
    7988 
     
    8190      (variablegroup_id,variablegroup_hdl) 
    8291      CALL xios(get_variablegroup_attr_hdl_)   & 
    83       ( variablegroup_hdl, group_ref, name, type ) 
     92      ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    8493 
    8594  END SUBROUTINE xios(get_variablegroup_attr) 
    8695 
    8796  SUBROUTINE xios(get_variablegroup_attr_hdl)  & 
    88     ( variablegroup_hdl, group_ref, name, type ) 
     97    ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    8998 
    9099    IMPLICIT NONE 
     
    92101      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 
    93102      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
     103      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 
    94104      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 
    95105 
    96106      CALL xios(get_variablegroup_attr_hdl_)  & 
    97       ( variablegroup_hdl, group_ref, name, type ) 
     107      ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    98108 
    99109  END SUBROUTINE xios(get_variablegroup_attr_hdl) 
    100110 
    101111  SUBROUTINE xios(get_variablegroup_attr_hdl_)   & 
    102     ( variablegroup_hdl, group_ref_, name_, type_ ) 
     112    ( variablegroup_hdl, group_ref_, name_, ts_target_, type_ ) 
    103113 
    104114    IMPLICIT NONE 
     
    106116      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_ 
    107117      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
     118      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target_ 
    108119      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 
    109120 
     
    118129      ENDIF 
    119130 
     131      IF (PRESENT(ts_target_)) THEN 
     132        CALL cxios_get_variablegroup_ts_target & 
     133      (variablegroup_hdl%daddr, ts_target_, len(ts_target_)) 
     134      ENDIF 
     135 
    120136      IF (PRESENT(type_)) THEN 
    121137        CALL cxios_get_variablegroup_type & 
     
    126142 
    127143  SUBROUTINE xios(is_defined_variablegroup_attr)  & 
    128     ( variablegroup_id, group_ref, name, type ) 
     144    ( variablegroup_id, group_ref, name, ts_target, type ) 
    129145 
    130146    IMPLICIT NONE 
     
    135151      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    136152      LOGICAL(KIND=C_BOOL) :: name_tmp 
     153      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 
     154      LOGICAL(KIND=C_BOOL) :: ts_target_tmp 
    137155      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    138156      LOGICAL(KIND=C_BOOL) :: type_tmp 
     
    141159      (variablegroup_id,variablegroup_hdl) 
    142160      CALL xios(is_defined_variablegroup_attr_hdl_)   & 
    143       ( variablegroup_hdl, group_ref, name, type ) 
     161      ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    144162 
    145163  END SUBROUTINE xios(is_defined_variablegroup_attr) 
    146164 
    147165  SUBROUTINE xios(is_defined_variablegroup_attr_hdl)  & 
    148     ( variablegroup_hdl, group_ref, name, type ) 
     166    ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    149167 
    150168    IMPLICIT NONE 
     
    154172      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    155173      LOGICAL(KIND=C_BOOL) :: name_tmp 
     174      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 
     175      LOGICAL(KIND=C_BOOL) :: ts_target_tmp 
    156176      LOGICAL, OPTIONAL, INTENT(OUT) :: type 
    157177      LOGICAL(KIND=C_BOOL) :: type_tmp 
    158178 
    159179      CALL xios(is_defined_variablegroup_attr_hdl_)  & 
    160       ( variablegroup_hdl, group_ref, name, type ) 
     180      ( variablegroup_hdl, group_ref, name, ts_target, type ) 
    161181 
    162182  END SUBROUTINE xios(is_defined_variablegroup_attr_hdl) 
    163183 
    164184  SUBROUTINE xios(is_defined_variablegroup_attr_hdl_)   & 
    165     ( variablegroup_hdl, group_ref_, name_, type_ ) 
     185    ( variablegroup_hdl, group_ref_, name_, ts_target_, type_ ) 
    166186 
    167187    IMPLICIT NONE 
     
    171191      LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 
    172192      LOGICAL(KIND=C_BOOL) :: name__tmp 
     193      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target_ 
     194      LOGICAL(KIND=C_BOOL) :: ts_target__tmp 
    173195      LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 
    174196      LOGICAL(KIND=C_BOOL) :: type__tmp 
     
    186208      ENDIF 
    187209 
     210      IF (PRESENT(ts_target_)) THEN 
     211        ts_target__tmp = cxios_is_defined_variablegroup_ts_target & 
     212      (variablegroup_hdl%daddr) 
     213        ts_target_ = ts_target__tmp 
     214      ENDIF 
     215 
    188216      IF (PRESENT(type_)) THEN 
    189217        type__tmp = cxios_is_defined_variablegroup_type & 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/scalar_interface_attr.F90

    r891 r1158  
    5050      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 
    5151    END FUNCTION cxios_is_defined_scalar_name 
     52 
     53 
     54    SUBROUTINE cxios_set_scalar_prec(scalar_hdl, prec) BIND(C) 
     55      USE ISO_C_BINDING 
     56      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 
     57      INTEGER (KIND=C_INT)      , VALUE :: prec 
     58    END SUBROUTINE cxios_set_scalar_prec 
     59 
     60    SUBROUTINE cxios_get_scalar_prec(scalar_hdl, prec) BIND(C) 
     61      USE ISO_C_BINDING 
     62      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 
     63      INTEGER (KIND=C_INT)             :: prec 
     64    END SUBROUTINE cxios_get_scalar_prec 
     65 
     66    FUNCTION cxios_is_defined_scalar_prec(scalar_hdl) BIND(C) 
     67      USE ISO_C_BINDING 
     68      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_prec 
     69      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 
     70    END FUNCTION cxios_is_defined_scalar_prec 
    5271 
    5372 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/scalargroup_interface_attr.F90

    r891 r1158  
    7171      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 
    7272    END FUNCTION cxios_is_defined_scalargroup_name 
     73 
     74 
     75    SUBROUTINE cxios_set_scalargroup_prec(scalargroup_hdl, prec) BIND(C) 
     76      USE ISO_C_BINDING 
     77      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 
     78      INTEGER (KIND=C_INT)      , VALUE :: prec 
     79    END SUBROUTINE cxios_set_scalargroup_prec 
     80 
     81    SUBROUTINE cxios_get_scalargroup_prec(scalargroup_hdl, prec) BIND(C) 
     82      USE ISO_C_BINDING 
     83      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 
     84      INTEGER (KIND=C_INT)             :: prec 
     85    END SUBROUTINE cxios_get_scalargroup_prec 
     86 
     87    FUNCTION cxios_is_defined_scalargroup_prec(scalargroup_hdl) BIND(C) 
     88      USE ISO_C_BINDING 
     89      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_prec 
     90      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 
     91    END FUNCTION cxios_is_defined_scalargroup_prec 
    7392 
    7493 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/variable_interface_attr.F90

    r581 r1158  
    3131 
    3232 
     33    SUBROUTINE cxios_set_variable_ts_target(variable_hdl, ts_target, ts_target_size) BIND(C) 
     34      USE ISO_C_BINDING 
     35      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl 
     36      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: ts_target 
     37      INTEGER  (kind = C_INT)     , VALUE        :: ts_target_size 
     38    END SUBROUTINE cxios_set_variable_ts_target 
     39 
     40    SUBROUTINE cxios_get_variable_ts_target(variable_hdl, ts_target, ts_target_size) BIND(C) 
     41      USE ISO_C_BINDING 
     42      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl 
     43      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: ts_target 
     44      INTEGER  (kind = C_INT)     , VALUE        :: ts_target_size 
     45    END SUBROUTINE cxios_get_variable_ts_target 
     46 
     47    FUNCTION cxios_is_defined_variable_ts_target(variable_hdl) BIND(C) 
     48      USE ISO_C_BINDING 
     49      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variable_ts_target 
     50      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl 
     51    END FUNCTION cxios_is_defined_variable_ts_target 
     52 
     53 
    3354    SUBROUTINE cxios_set_variable_type(variable_hdl, type, type_size) BIND(C) 
    3455      USE ISO_C_BINDING 
  • XIOS/dev/dev_olga/src/interface/fortran_attr/variablegroup_interface_attr.F90

    r581 r1158  
    5252 
    5353 
     54    SUBROUTINE cxios_set_variablegroup_ts_target(variablegroup_hdl, ts_target, ts_target_size) BIND(C) 
     55      USE ISO_C_BINDING 
     56      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl 
     57      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: ts_target 
     58      INTEGER  (kind = C_INT)     , VALUE        :: ts_target_size 
     59    END SUBROUTINE cxios_set_variablegroup_ts_target 
     60 
     61    SUBROUTINE cxios_get_variablegroup_ts_target(variablegroup_hdl, ts_target, ts_target_size) BIND(C) 
     62      USE ISO_C_BINDING 
     63      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl 
     64      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: ts_target 
     65      INTEGER  (kind = C_INT)     , VALUE        :: ts_target_size 
     66    END SUBROUTINE cxios_get_variablegroup_ts_target 
     67 
     68    FUNCTION cxios_is_defined_variablegroup_ts_target(variablegroup_hdl) BIND(C) 
     69      USE ISO_C_BINDING 
     70      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variablegroup_ts_target 
     71      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl 
     72    END FUNCTION cxios_is_defined_variablegroup_ts_target 
     73 
     74 
    5475    SUBROUTINE cxios_set_variablegroup_type(variablegroup_hdl, type, type_size) BIND(C) 
    5576      USE ISO_C_BINDING 
  • XIOS/dev/dev_olga/src/io/nc4_data_input.cpp

    r967 r1158  
    262262    itMapNj = itMapNi; ++itMapNj; 
    263263 
    264     if ((CDomain::type_attr::rectilinear == domain->type))// || this->isRectilinear(fieldId)) 
     264    if ((CDomain::type_attr::rectilinear == domain->type)) 
    265265    { 
    266266      // Ok, try to read some f.. attributes such as longitude and latitude 
     
    279279        std::vector<StdSize> nBeginLon(1, 0), nSizeLon(1, itMapNi->second); 
    280280        readFieldVariableValue(domain->lonvalue_rectilinear_read_from_file, itMapNi->first, nBeginLon, nSizeLon, true); 
    281       } 
    282       domain->fillInRectilinearLonLat(); 
    283     } 
    284     else if ((CDomain::type_attr::curvilinear == domain->type))// || (this->isCurvilinear(fieldId))) 
     281      }       
     282    } 
     283    else if ((CDomain::type_attr::curvilinear == domain->type)) 
    285284    { 
    286285      int ni = domain->ni; 
    287286      int nj = domain->nj; 
    288287      std::vector<StdSize> nBeginLatLon(2), nSizeLatLon(2); 
    289       nBeginLatLon[0] = domain->jbegin.getValue(); nBeginLatLon[1] = domain->ibegin.getValue(); 
    290       nSizeLatLon[0]  = nj; nSizeLatLon[1] = ni; 
     288      nBeginLatLon[0] = 0; nBeginLatLon[1] = 0; 
     289      nSizeLatLon[0]  = domain->nj_glo.getValue(); nSizeLatLon[1] = domain->ni_glo.getValue(); 
    291290 
    292291      StdString latName = this->getLatCoordName(fieldId); 
    293       if (SuperClassWriter::hasVariable(latName)) //(0 != latName.compare("")) 
    294       { 
    295         domain->latvalue_2d.resize(ni,nj); 
    296         readFieldVariableValue(domain->latvalue_2d, latName, nBeginLatLon, nSizeLatLon); 
     292      if (SuperClassWriter::hasVariable(latName)) 
     293      { 
     294        domain->latvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo); 
     295        readFieldVariableValue(domain->latvalue_curvilinear_read_from_file, latName, nBeginLatLon, nSizeLatLon); 
    297296      } 
    298297      StdString lonName = this->getLonCoordName(fieldId); 
    299       if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare("")) 
    300       { 
    301         domain->lonvalue_2d.resize(ni,nj); 
    302         readFieldVariableValue(domain->lonvalue_2d, lonName, nBeginLatLon, nSizeLatLon); 
     298      if (SuperClassWriter::hasVariable(lonName)) 
     299      { 
     300        domain->lonvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo); 
     301        readFieldVariableValue(domain->lonvalue_curvilinear_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 
    303302      } 
    304303 
     
    307306 
    308307      int nbVertex = this->getNbVertex(fieldId); 
    309       if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName)) //if ((0 != boundsLatName.compare("")) || (0 != boundsLonName.compare(""))) 
     308      if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 
     309      { 
     310        ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 
     311          << "The domain " << domain->getDomainOutputName() 
     312          << " has nvertex read from file " << this->filename << " and nvertex provided from model" 
     313          << " are not coherent. They should be the same." << std::endl  
     314          << " nvertex read from file: "<< nbVertex 
     315          << " nvertex from model: "<< domain->nvertex << std::endl); 
     316      }  
     317 
     318      if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName))  
    310319        domain->nvertex.setValue(nbVertex); 
    311320      std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3); 
    312       nBeginBndsLatLon[0] = domain->jbegin.getValue(); nSizeBndsLatLon[0] = nj; 
    313       nBeginBndsLatLon[1] = domain->ibegin.getValue(); nSizeBndsLatLon[1] = ni; 
     321      nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->nj_glo.getValue(); 
     322      nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->nj_glo.getValue(); 
    314323      nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex; 
    315324 
    316       if (SuperClassWriter::hasVariable(boundsLatName)) //(0 != boundsLatName.compare("")) 
    317       { 
    318         domain->bounds_lat_2d.resize(nbVertex,ni,nj); 
    319         readFieldVariableValue(domain->bounds_lat_2d, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 
    320  
    321       } 
    322       if (SuperClassWriter::hasVariable(boundsLonName)) //(0 != boundsLonName.compare("")) 
    323       { 
    324         domain->bounds_lon_2d.resize(nbVertex,ni,nj); 
    325         readFieldVariableValue(domain->bounds_lon_2d, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 
    326       } 
     325      if (SuperClassWriter::hasVariable(boundsLatName)) 
     326      { 
     327        domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo); 
     328        readFieldVariableValue(domain->bounds_latvalue_curvilinear_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 
     329 
     330      } 
     331      if (SuperClassWriter::hasVariable(boundsLonName))  
     332      { 
     333        domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo); 
     334        readFieldVariableValue(domain->bounds_lonvalue_curvilinear_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 
     335      }       
    327336    } 
    328337    else if ((CDomain::type_attr::unstructured == domain->type))// || (this->isUnstructured(fieldId))) 
    329338    { 
    330       /* 
    331       if (domain->i_index.isEmpty()) 
    332          ERROR("CNc4DataInput::readDomainAttributeValueFromFile(...)", 
    333               << "Field '" << fieldId << std::endl 
    334               << "Trying to read attributes from unstructured grid." 
    335               << "i_index of domain" << domain->getId() << " is mandatory"); 
    336  
    337       int ni = domain->i_index.numElements(); 
    338 */ 
    339  
    340       int ni     = domain->ni.isEmpty() ? 0 : domain->ni; 
    341       int ibegin = domain->ibegin.isEmpty() ? 0 : domain->ibegin; 
    342  
    343       if (domain->i_index.isEmpty() && (!domain->ni.isEmpty()) ) 
    344       { 
    345         domain->i_index.resize(ni) ; 
    346         for(int idx = 0; idx < ni; ++idx) domain->i_index(idx)=ibegin+idx ; 
    347       } 
    348  
    349339      std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0); 
    350340      nSizeLatLon[0]  = domain->ni_glo.getValue(); 
     
    352342 
    353343      StdString latName = this->getLatCoordName(fieldId); 
    354       if (SuperClassWriter::hasVariable(latName)) //(0 != latName.compare("")) 
    355       { 
    356         readFieldVariableValue(globalLonLat, latName, nBeginLatLon, nSizeLatLon); 
    357         domain->latvalue_1d.resize(ni); 
    358         for (int idx = 0; idx < ni; ++idx) 
    359           domain->latvalue_1d(idx) =  globalLonLat(domain->i_index(idx)); 
     344      if (SuperClassWriter::hasVariable(latName)) 
     345      { 
     346        domain->latvalue_unstructured_read_from_file.resize(domain->ni_glo); 
     347        readFieldVariableValue(domain->latvalue_unstructured_read_from_file, latName, nBeginLatLon, nSizeLatLon);   
    360348      } 
    361349 
     
    363351      if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare("")) 
    364352      { 
    365         readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon); 
    366         domain->lonvalue_1d.resize(ni); 
    367         for (int idx = 0; idx < ni; ++idx) 
    368           domain->lonvalue_1d(idx) = globalLonLat(domain->i_index(idx)); 
     353        // readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon); 
     354        domain->lonvalue_unstructured_read_from_file.resize(domain->ni_glo); 
     355        readFieldVariableValue(domain->lonvalue_unstructured_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 
    369356      } 
    370357 
     
    373360 
    374361      int nbVertex = this->getNbVertex(fieldId); 
    375       if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName)) // (0 != boundsLatName.compare("")) || (0 != boundsLonName.compare(""))) 
     362      if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 
     363      { 
     364        ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 
     365          << "The domain " << domain->getDomainOutputName() 
     366          << " has nvertex read from file " << this->filename << " and nvertex provided from model" 
     367          << " are not coherent. They should be the same." << std::endl  
     368          << " nvertex read from file: "<< nbVertex 
     369          << " nvertex from model: "<< domain->nvertex << std::endl); 
     370      }  
     371       
     372      if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName))  
    376373        domain->nvertex.setValue(nbVertex); 
    377374 
     
    380377      nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = nbVertex; 
    381378 
    382       if (SuperClassWriter::hasVariable(boundsLatName)) //(0 != boundsLatName.compare("")) 
    383       { 
    384         CArray<double,2> globalBndsLonLat(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 
    385         readFieldVariableValue(globalBndsLonLat, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 
    386         domain->bounds_lat_1d.resize(nbVertex,ni); 
    387         for (int idx = 0; idx < ni; ++idx) 
    388           for (int jdx = 0; jdx < nbVertex; ++jdx) 
    389             domain->bounds_lat_1d(jdx,idx) = globalBndsLonLat(jdx, domain->i_index(idx)); 
    390       } 
    391  
    392       if (SuperClassWriter::hasVariable(boundsLonName)) //(0 != boundsLonName.compare("")) 
    393       { 
    394         CArray<double,2> globalBndsLonLat(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 
    395         readFieldVariableValue(globalBndsLonLat, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 
    396         domain->bounds_lon_1d.resize(nbVertex,ni); 
    397         for (int idx = 0; idx < ni; ++idx) 
    398           for (int jdx = 0; jdx < nbVertex; ++jdx) 
    399             domain->bounds_lon_1d(jdx,idx) = globalBndsLonLat(jdx, domain->i_index(idx)); 
    400       } 
    401     } 
     379      if (SuperClassWriter::hasVariable(boundsLatName))  
     380      { 
     381        domain->bounds_latvalue_unstructured_read_from_file.resize(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 
     382        readFieldVariableValue(domain->bounds_latvalue_unstructured_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 
     383      } 
     384 
     385      if (SuperClassWriter::hasVariable(boundsLonName))  
     386      { 
     387        domain->bounds_lonvalue_unstructured_read_from_file.resize(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 
     388        readFieldVariableValue(domain->bounds_lonvalue_unstructured_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 
     389      }       
     390    } 
     391    domain->fillInLonLat(); 
    402392  } 
    403393 
     
    421411    if (this->isRectilinear(fieldId) || this->isCurvilinear(fieldId)) 
    422412    { 
     413      if (!domain->nj_glo.isEmpty() && (domain->nj_glo != itMapNj->second)) 
     414      { 
     415        ERROR("void CNc4DataInput::readDomainAttributesFromFile(...)", 
     416          << "The domain " << domain->getDomainOutputName() 
     417          << " has nj_glo read from file " << this->filename << " and nj_glo provided from model" 
     418          << " are not coherent. They should be the same." << std::endl  
     419          << " nj_glo read from file: "<< itMapNj->second 
     420          << " nj_glo from model: "<< domain->nj_glo << std::endl); 
     421      }  
    423422      domain->nj_glo.setValue(itMapNj->second); 
     423 
     424      if (!domain->ni_glo.isEmpty() && (domain->ni_glo != itMapNi->second)) 
     425      { 
     426        ERROR("void CNc4DataInput::readDomainAttributesFromFile(...)", 
     427          << "The domain " << domain->getDomainOutputName() 
     428          << " has ni_glo read from file " << this->filename << " and ni_glo provided from model" 
     429          << " are not coherent. They should be the same." << std::endl  
     430          << " ni_glo read from file: "<< itMapNi->second 
     431          << " ni_glo from model: "<< domain->ni_glo << std::endl); 
     432      }  
    424433      domain->ni_glo.setValue(itMapNi->second); 
    425434    } 
     
    427436    { 
    428437      domain->nj_glo.setValue(1); 
     438 
     439      if (!domain->ni_glo.isEmpty() && (domain->ni_glo != itMapNi->second)) 
     440      { 
     441        ERROR("void CNc4DataInput::readDomainAttributesFromFile(...)", 
     442          << "The domain " << domain->getDomainOutputName() 
     443          << " has ni_glo read from file " << this->filename << " and ni_glo provided from model" 
     444          << " are not coherent. They should be the same." << std::endl  
     445          << " ni_glo read from file: "<< itMapNi->second 
     446          << " ni_glo from model: "<< domain->ni_glo << std::endl); 
     447      }        
    429448      domain->ni_glo.setValue(itMapNi->second); 
    430449    } 
     
    444463                                                              iteMap = dimSizeMap.end(); 
    445464    for (int i = 0; i < elementPosition; ++i, ++itMapN) {} 
     465 
     466    if (!axis->n_glo.isEmpty() && (axis->n_glo != itMapN->second)) 
     467    { 
     468      ERROR("void CNc4DataInput::readAxisAttributesFromFile(...)", 
     469        << "The axis " << axis->getAxisOutputName() 
     470        << " has n_glo read from file " << this->filename << " and n_glo provided from model" 
     471        << " are not coherent. They should be the same." << std::endl  
     472        << " n_glo read from file: "<< itMapN->second 
     473        << " n_glo from model: "<< axis->n_glo << std::endl); 
     474    }     
    446475    axis->n_glo.setValue(itMapN->second); 
    447476  } 
     
    483512                                                  int elementPosition, const StdString& fieldId) 
    484513  { 
    485 //    std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), 
    486 //                                                              iteMap = dimSizeMap.end(); 
    487 //    for (int i = 0; i < elementPosition; ++i, ++itMapN) {} 
    488 //    axis->n_glo.setValue(itMapN->second); 
     514    /*Nothing to do */ 
    489515  } 
    490516 
     
    499525                                                      int elementPosition, const StdString& fieldId) 
    500526  { 
    501 //    std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), 
    502 //                                                              iteMap = dimSizeMap.end(); 
    503 //    for (int i = 0; i < elementPosition; ++i, ++itMapN) {} 
    504 // 
    505 //    { // Read axis value 
    506 //      std::vector<StdSize> nBegin(1, 0), nSize(1, itMapN->second); 
    507 //      CArray<double,1> readAxisValue(itMapN->second); 
    508 //      readFieldVariableValue(readAxisValue, itMapN->first, nBegin, nSize, true); 
    509 //      int begin = 0, n = itMapN->second; 
    510 //      if (!axis->begin.isEmpty()) begin = axis->begin.getValue(); 
    511 //      if (!axis->n.isEmpty()) n = axis->n.getValue(); 
    512 //      axis->value.resize(n); 
    513 //      for (int i = 0; i < n; ++i) axis->value(i) = readAxisValue(begin + i); 
    514 //    } 
     527    /*Nothing to do */ 
    515528  } 
    516529 
  • XIOS/dev/dev_olga/src/io/nc4_data_output.cpp

    r1144 r1158  
    1111#include "netCdfException.hpp" 
    1212#include "exception.hpp" 
    13  
     13#include "timer.hpp" 
     14#include "uuid.hpp" 
    1415namespace xios 
    1516{ 
    1617      /// ////////////////////// Dfinitions ////////////////////// /// 
    1718      CNc4DataOutput::CNc4DataOutput 
    18          (const StdString & filename, bool exist) 
     19         (CFile* file, const StdString & filename, bool exist) 
    1920            : SuperClass() 
    2021            , SuperClassWriter(filename, exist) 
    2122            , filename(filename) 
    22       { 
    23     SuperClass::type = MULTI_FILE; 
     23            , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none) 
     24      { 
     25        SuperClass::type = MULTI_FILE; 
    2426      } 
    2527 
    2628      CNc4DataOutput::CNc4DataOutput 
    27          (const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention, 
     29         (CFile* file, const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention, 
    2830          MPI_Comm comm_file, bool multifile, bool isCollective, const StdString& timeCounterName) 
    2931            : SuperClass() 
     
    3234            , filename(filename) 
    3335            , isCollective(isCollective) 
    34       { 
    35     SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 
     36            , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none) 
     37      { 
     38        SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 
    3639      } 
    3740 
     
    6063        } 
    6164 
    62          
    6365         CContext* context = CContext::getCurrent() ; 
    6466         CContextServer* server=context->server ; 
     
    7880         int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex; 
    7981 
    80          StdString dimXid, dimYid ; 
    81  
     82 
     83        StdString dimXid, dimYid ; 
     84 
     85        nc_type typePrec ; 
     86        if (domain->prec.isEmpty()) typePrec =  NC_FLOAT ; 
     87        else if (domain->prec==4)  typePrec =  NC_FLOAT ; 
     88        else if (domain->prec==8)   typePrec =  NC_DOUBLE ; 
     89          
    8290         bool isRegularDomain = (domain->type == CDomain::type_attr::rectilinear); 
    8391         switch (domain->type) 
     
    209217                   { 
    210218                     case CDomain::type_attr::curvilinear : 
    211                        SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 
    212                        SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0); 
     219                       SuperClassWriter::addVariable(latid, typePrec, dim0); 
     220                       SuperClassWriter::addVariable(lonid, typePrec, dim0); 
    213221                       break ; 
    214222                      case CDomain::type_attr::rectilinear : 
    215                         SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 
    216                         SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1); 
     223                        SuperClassWriter::addVariable(latid, typePrec, dim0); 
     224                        SuperClassWriter::addVariable(lonid, typePrec, dim1); 
    217225                        break ; 
    218226                   } 
     
    230238                     dim0.push_back(dimXid); 
    231239                     dim0.push_back(dimVertId); 
    232                      SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 
    233                      SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 
     240                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 
     241                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 
    234242                   } 
    235243                 } 
     
    256264                 if (domain->hasArea) 
    257265                 { 
    258                    SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0); 
     266                   SuperClassWriter::addVariable(areaId, typePrec, dim0); 
    259267                   SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 
    260268                   SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); 
     
    311319                       lonid = StdString("nav_lon").append(appendDomid); 
    312320                       latid = StdString("nav_lat").append(appendDomid); 
    313                        SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 
    314                        SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0); 
     321                       SuperClassWriter::addVariable(latid, typePrec, dim0); 
     322                       SuperClassWriter::addVariable(lonid, typePrec, dim0); 
    315323                       break; 
    316324 
     
    320328                       lonid = StdString("lon").append(appendDomid); 
    321329                       latid = StdString("lat").append(appendDomid); 
    322                        SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 
    323                        SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1); 
     330                       SuperClassWriter::addVariable(latid, typePrec, dim0); 
     331                       SuperClassWriter::addVariable(lonid, typePrec, dim1); 
    324332                       break; 
    325333                   } 
     
    342350                     dim0.push_back(dimXid); 
    343351                     dim0.push_back(dimVertId); 
    344                      SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 
    345                      SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 
     352                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 
     353                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 
    346354                   } 
    347355                 } 
     
    351359                   dim0.clear(); 
    352360                   dim0.push_back(dimYid); dim0.push_back(dimXid); 
    353                    SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0); 
     361                   SuperClassWriter::addVariable(areaId, typePrec, dim0); 
    354362                   SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 
    355363                   SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); 
     
    492500        if (SuperClass::type==MULTI_FILE) return ; 
    493501 
     502     nc_type typePrec ; 
     503     if (domain->prec.isEmpty()) typePrec =  NC_FLOAT ; 
     504     else if (domain->prec==4)  typePrec =  NC_FLOAT ; 
     505     else if (domain->prec==8)   typePrec =  NC_DOUBLE ; 
     506 
    494507      std::vector<StdString> dim0; 
    495508      StdString domid = domain->getDomainOutputName(); 
     
    543556                dim0.clear(); 
    544557                dim0.push_back(dimNode); 
    545                 SuperClassWriter::addVariable(node_x, NC_FLOAT, dim0); 
     558                SuperClassWriter::addVariable(node_x, typePrec, dim0); 
    546559                SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x); 
    547560                SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x); 
    548561                SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x); 
    549                 SuperClassWriter::addVariable(node_y, NC_FLOAT, dim0); 
     562                SuperClassWriter::addVariable(node_y, typePrec, dim0); 
    550563                SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y); 
    551564                SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y); 
     
    562575                dim0.clear(); 
    563576                dim0.push_back(dimNode); 
    564                 SuperClassWriter::addVariable(node_x, NC_FLOAT, dim0); 
     577                SuperClassWriter::addVariable(node_x, typePrec, dim0); 
    565578                SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x); 
    566579                SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x); 
    567580                SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x); 
    568                 SuperClassWriter::addVariable(node_y, NC_FLOAT, dim0); 
     581                SuperClassWriter::addVariable(node_y, typePrec, dim0); 
    569582                SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y); 
    570583                SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y); 
     
    576589              dim0.clear(); 
    577590              dim0.push_back(dimEdge); 
    578               SuperClassWriter::addVariable(edge_x, NC_FLOAT, dim0); 
     591              SuperClassWriter::addVariable(edge_x, typePrec, dim0); 
    579592              SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x); 
    580593              SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x); 
    581594              SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x); 
    582               SuperClassWriter::addVariable(edge_y, NC_FLOAT, dim0); 
     595              SuperClassWriter::addVariable(edge_y, typePrec, dim0); 
    583596              SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y); 
    584597              SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y); 
     
    602615                dim0.clear(); 
    603616                dim0.push_back(dimNode); 
    604                 SuperClassWriter::addVariable(node_x, NC_FLOAT, dim0); 
     617                SuperClassWriter::addVariable(node_x, typePrec, dim0); 
    605618                SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x); 
    606619                SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x); 
    607620                SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x); 
    608                 SuperClassWriter::addVariable(node_y, NC_FLOAT, dim0); 
     621                SuperClassWriter::addVariable(node_y, typePrec, dim0); 
    609622                SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y); 
    610623                SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y); 
     
    618631                dim0.clear(); 
    619632                dim0.push_back(dimEdge); 
    620                 SuperClassWriter::addVariable(edge_x, NC_FLOAT, dim0); 
     633                SuperClassWriter::addVariable(edge_x, typePrec, dim0); 
    621634                SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x); 
    622635                SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x); 
    623636                SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x); 
    624                 SuperClassWriter::addVariable(edge_y, NC_FLOAT, dim0); 
     637                SuperClassWriter::addVariable(edge_y, typePrec, dim0); 
    625638                SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y); 
    626639                SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y); 
     
    640653              dim0.clear(); 
    641654              dim0.push_back(dimFace); 
    642               SuperClassWriter::addVariable(face_x, NC_FLOAT, dim0); 
     655              SuperClassWriter::addVariable(face_x, typePrec, dim0); 
    643656              SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &face_x); 
    644657              SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh faces."), &face_x); 
    645658              SuperClassWriter::addAttribute("units", StdString("degrees_east"), &face_x); 
    646               SuperClassWriter::addVariable(face_y, NC_FLOAT, dim0); 
     659              SuperClassWriter::addVariable(face_y, typePrec, dim0); 
    647660              SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &face_y); 
    648661              SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh faces."), &face_y); 
     
    906919         string areaId = "area" + appendDomid; 
    907920 
     921         nc_type typePrec ; 
     922         if (domain->prec.isEmpty()) typePrec =  NC_FLOAT ; 
     923         else if (domain->prec==4)  typePrec =  NC_FLOAT ; 
     924         else if (domain->prec==8)   typePrec =  NC_DOUBLE ; 
     925 
    908926         int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex; 
    909927 
     
    965983                 if (domain->hasLonLat) 
    966984                 { 
    967                    SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 
    968                    SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0); 
     985                   SuperClassWriter::addVariable(latid, typePrec, dim0); 
     986                   SuperClassWriter::addVariable(lonid, typePrec, dim0); 
    969987                   this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid); 
    970988                   if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_lonid, &lonid); 
     
    978996                   dim0.push_back(dimXid); 
    979997                   dim0.push_back(dimVertId); 
    980                    SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 
    981                    SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 
     998                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 
     999                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 
    9821000                 } 
    9831001 
     
    9861004                 if (domain->hasArea) 
    9871005                 { 
    988                    SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0); 
     1006                   SuperClassWriter::addVariable(areaId, typePrec, dim0); 
    9891007                   SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 
    9901008                   SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); 
     
    10211039                 if (domain->hasLonLat) 
    10221040                 { 
    1023                    SuperClassWriter::addVariable(latid, NC_FLOAT, dim0); 
    1024                    SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0); 
     1041                   SuperClassWriter::addVariable(latid, typePrec, dim0); 
     1042                   SuperClassWriter::addVariable(lonid, typePrec, dim0); 
    10251043 
    10261044                   this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid); 
     
    10361054                   dim0.push_back(dimXid); 
    10371055                   dim0.push_back(dimVertId); 
    1038                    SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 
    1039                    SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 
     1056                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 
     1057                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 
    10401058                 } 
    10411059 
     
    10441062                   dim0.clear(); 
    10451063                   dim0.push_back(dimXid); 
    1046                    SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0); 
     1064                   SuperClassWriter::addVariable(areaId, typePrec, dim0); 
    10471065                   SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 
    10481066                   SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); 
     
    11111129      void CNc4DataOutput::writeAxis_(CAxis* axis) 
    11121130      { 
    1113         CContext* context = CContext::getCurrent(); 
    1114  
    11151131        if (axis->IsWritten(this->filename)) return; 
    11161132        axis->checkAttributes(); 
     
    11301146        else setWrittenAxis(axisid); 
    11311147 
     1148        nc_type typePrec ; 
     1149        if (axis->prec.isEmpty()) typePrec =  NC_FLOAT ; 
     1150        else if (axis->prec==4)  typePrec =  NC_FLOAT ; 
     1151        else if (axis->prec==8)   typePrec =  NC_DOUBLE ; 
     1152          
     1153        if (!axis->label.isEmpty()) typePrec = NC_CHAR ; 
     1154        string strId="str_len" ; 
    11321155        try 
    11331156        { 
    11341157          SuperClassWriter::addDimension(axisid, zoom_size); 
     1158          if (!axis->label.isEmpty()) SuperClassWriter::addDimension(strId, stringArrayLen); 
    11351159          if (axis->hasValue) 
    11361160          { 
    11371161            dims.push_back(axisid); 
    1138             SuperClassWriter::addVariable(axisid, NC_FLOAT, dims); 
     1162            if (!axis->label.isEmpty()) dims.push_back(strId); 
     1163            SuperClassWriter::addVariable(axisid, typePrec, dims); 
    11391164 
    11401165            if (!axis->name.isEmpty()) 
     
    11621187            { 
    11631188              dims.push_back("axis_nbounds"); 
    1164               SuperClassWriter::addVariable(axisBoundsId, NC_FLOAT, dims); 
     1189              SuperClassWriter::addVariable(axisBoundsId, typePrec, dims); 
    11651190              SuperClassWriter::addAttribute("bounds", axisBoundsId, &axisid); 
    11661191            } 
     
    11781203              case MULTI_FILE: 
    11791204              { 
    1180                 // CArray<double,1> axis_value(axis->zoom_n); 
    1181                 // for (int i = 0; i < axis->zoom_n; i++) axis_value(i) = axis->value(i); 
    11821205                SuperClassWriter::writeData(axis_value, axisid, isCollective, 0); 
    11831206 
    1184                 if (!axis->bounds.isEmpty()) 
     1207                if (!axis->bounds.isEmpty() && axis->label.isEmpty()) 
    11851208                  SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0); 
    11861209 
     1210                // Need to check after 
     1211                if (! axis->label.isEmpty())  SuperClassWriter::writeData(axis->label_srv, axisid, isCollective, 0); 
     1212  
    11871213                SuperClassWriter::definition_start(); 
    1188  
    11891214                break; 
    11901215              } 
    11911216              case ONE_FILE: 
    11921217              { 
    1193                 // CArray<double,1> axis_value(axis->zoom_n); 
    1194                 // axis_value = axis->value; 
    11951218                std::vector<StdSize> start(1), startBounds(2) ; 
    11961219                std::vector<StdSize> count(1), countBounds(2) ; 
     
    12011224                SuperClassWriter::writeData(axis_value, axisid, isCollective, 0, &start, &count); 
    12021225 
    1203                 if (!axis->bounds.isEmpty()) 
     1226                if (!axis->bounds.isEmpty()&& axis->label.isEmpty()) 
    12041227                { 
    12051228                  axis_bounds.resize(2, indexToWrite.numElements()); 
     
    12111234                  SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds); 
    12121235                } 
     1236 
     1237                // Need to check after 
     1238                if (! axis->label.isEmpty())  SuperClassWriter::writeData(axis->label_srv, axisid, isCollective, 0); 
    12131239 
    12141240                SuperClassWriter::definition_start(); 
     
    12331259          ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)", << msg); 
    12341260        } 
    1235        
    1236       axis->addRelFile(this->filename); 
     1261        axis->addRelFile(this->filename); 
    12371262     } 
    12381263 
     
    12471272        else setWrittenAxis(scalaId); 
    12481273 
     1274        nc_type typePrec ; 
     1275        if (scalar->prec.isEmpty()) typePrec =  NC_FLOAT ; 
     1276        else if (scalar->prec==4)  typePrec =  NC_FLOAT ; 
     1277        else if (scalar->prec==8)   typePrec =  NC_DOUBLE ; 
     1278 
     1279         
    12491280        try 
    12501281        { 
     
    12531284//            dims.push_back(scalaId); 
    12541285            std::vector<StdString> dims; 
    1255             SuperClassWriter::addVariable(scalaId, NC_FLOAT, dims); 
     1286            SuperClassWriter::addVariable(scalaId, typePrec, dims); 
    12561287 
    12571288            if (!scalar->name.isEmpty()) 
     
    15501581      void CNc4DataOutput::writeField_(CField* field) 
    15511582      { 
    1552          CContext* context = CContext::getCurrent() ; 
    1553          CContextServer* server=context->server ; 
    1554  
    1555          std::vector<StdString> dims, coodinates; 
    1556          CGrid* grid = field->grid; 
    1557          if (!grid->doGridHaveDataToWrite()) 
     1583        CContext* context = CContext::getCurrent() ; 
     1584        CContextServer* server=context->server ; 
     1585 
     1586        std::vector<StdString> dims, coodinates; 
     1587        CGrid* grid = field->grid; 
     1588        if (!grid->doGridHaveDataToWrite()) 
    15581589          if (SuperClass::type==MULTI_FILE) return ; 
    15591590 
    1560          CArray<int,1> axisDomainOrder = grid->axis_domain_order; 
    1561          int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 
    1562          std::vector<StdString> domainList = grid->getDomainList(); 
    1563          std::vector<StdString> axisList   = grid->getAxisList(); 
    1564          std::vector<StdString> scalarList = grid->getScalarList(); 
    1565  
    1566          StdString timeid  = getTimeCounterName(); 
    1567          StdString dimXid,dimYid; 
    1568          std::deque<StdString> dimIdList, dimCoordList; 
    1569          bool hasArea = false; 
    1570          StdString cellMeasures = "area:"; 
    1571          bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 
    1572  
    1573          for (int i = 0; i < numElement; ++i) 
    1574          { 
    1575            if (2 == axisDomainOrder(i)) 
    1576            { 
    1577              CDomain* domain = CDomain::get(domainList[idxDomain]); 
    1578              StdString domId = domain->getDomainOutputName(); 
    1579              StdString appendDomId  = singleDomain ? "" : "_" + domId ; 
    1580  
    1581              if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 
    1582              { 
    1583                dimIdList.push_back(domId + "_points"); 
    1584                field->setUseCompressedOutput(); 
    1585              } 
    1586  
    1587              switch (domain->type) 
    1588              { 
    1589                case CDomain::type_attr::curvilinear: 
    1590                  if (!compressedOutput || !domain->isCompressible()) 
    1591                  { 
    1592                    dimXid     = StdString("x").append(appendDomId); 
    1593                    dimIdList.push_back(dimXid); 
    1594                    dimYid     = StdString("y").append(appendDomId); 
    1595                    dimIdList.push_back(dimYid); 
    1596                  } 
    1597                  dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 
    1598                  dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 
    1599                  break ; 
    1600                case CDomain::type_attr::rectilinear: 
    1601                  if (!compressedOutput || !domain->isCompressible()) 
    1602                  { 
    1603                    dimXid     = StdString("lon").append(appendDomId); 
    1604                    dimIdList.push_back(dimXid); 
    1605                    dimYid     = StdString("lat").append(appendDomId); 
    1606                    dimIdList.push_back(dimYid); 
    1607                  } 
    1608                  break ; 
    1609                case CDomain::type_attr::unstructured: 
    1610                { 
    1611            if (SuperClassWriter::useCFConvention) 
    1612            { 
    1613             dimXid     = StdString("cell").append(appendDomId); 
    1614             dimIdList.push_back(dimXid); 
    1615             dimCoordList.push_back(StdString("lon").append(appendDomId)); 
    1616             dimCoordList.push_back(StdString("lat").append(appendDomId)); 
     1591        CArray<int,1> axisDomainOrder = grid->axis_domain_order; 
     1592        int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 
     1593        std::vector<StdString> domainList = grid->getDomainList(); 
     1594        std::vector<StdString> axisList   = grid->getAxisList(); 
     1595        std::vector<StdString> scalarList = grid->getScalarList();         
     1596 
     1597        StdString timeid  = getTimeCounterName(); 
     1598        StdString dimXid,dimYid; 
     1599        std::deque<StdString> dimIdList, dimCoordList; 
     1600        bool hasArea = false; 
     1601        StdString cellMeasures = "area:"; 
     1602        bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 
     1603 
     1604        for (int i = 0; i < numElement; ++i) 
     1605        { 
     1606          if (2 == axisDomainOrder(i)) 
     1607          { 
     1608            CDomain* domain = CDomain::get(domainList[idxDomain]); 
     1609            StdString domId = domain->getDomainOutputName(); 
     1610            StdString appendDomId  = singleDomain ? "" : "_" + domId ; 
     1611 
     1612            if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 
     1613            { 
     1614              dimIdList.push_back(domId + "_points"); 
     1615              field->setUseCompressedOutput(); 
     1616            } 
     1617 
     1618            switch (domain->type) 
     1619            { 
     1620              case CDomain::type_attr::curvilinear: 
     1621                if (!compressedOutput || !domain->isCompressible()) 
     1622                { 
     1623                  dimXid     = StdString("x").append(appendDomId); 
     1624                  dimIdList.push_back(dimXid); 
     1625                  dimYid     = StdString("y").append(appendDomId); 
     1626                  dimIdList.push_back(dimYid); 
     1627                } 
     1628                dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 
     1629                dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 
     1630              break ; 
     1631              case CDomain::type_attr::rectilinear: 
     1632                if (!compressedOutput || !domain->isCompressible()) 
     1633                { 
     1634                  dimXid     = StdString("lon").append(appendDomId); 
     1635                  dimIdList.push_back(dimXid); 
     1636                  dimYid     = StdString("lat").append(appendDomId); 
     1637                  dimIdList.push_back(dimYid); 
     1638                } 
     1639              break ; 
     1640              case CDomain::type_attr::unstructured: 
     1641              { 
     1642                if (SuperClassWriter::useCFConvention) 
     1643                { 
     1644                  dimXid     = StdString("cell").append(appendDomId); 
     1645                  dimIdList.push_back(dimXid); 
     1646                  dimCoordList.push_back(StdString("lon").append(appendDomId)); 
     1647                  dimCoordList.push_back(StdString("lat").append(appendDomId)); 
     1648                } 
     1649                else 
     1650                { 
     1651                  StdString domainName = domain->name; 
     1652                  if (domain->nvertex == 1) 
     1653                  { 
     1654                    dimXid     = "n" + domainName + "_node"; 
     1655                    dimIdList.push_back(dimXid); 
     1656                    dimCoordList.push_back(StdString(domainName + "_node_x")); 
     1657                    dimCoordList.push_back(StdString(domainName + "_node_y")); 
     1658                  } 
     1659                  else if (domain->nvertex == 2) 
     1660                  { 
     1661                    dimXid     = "n" + domainName + "_edge"; 
     1662                    dimIdList.push_back(dimXid); 
     1663                    dimCoordList.push_back(StdString(domainName + "_edge_x")); 
     1664                    dimCoordList.push_back(StdString(domainName + "_edge_y")); 
     1665                  } 
     1666                  else 
     1667                  { 
     1668                    dimXid     = "n" + domainName + "_face"; 
     1669                    dimIdList.push_back(dimXid); 
     1670                    dimCoordList.push_back(StdString(domainName + "_face_x")); 
     1671                    dimCoordList.push_back(StdString(domainName + "_face_y")); 
     1672                  } 
     1673                }  // ugrid convention 
     1674              }  // case unstructured domain 
     1675            } 
     1676 
     1677            if (domain->hasArea) 
     1678            { 
     1679              hasArea = true; 
     1680              cellMeasures += " area" + appendDomId; 
     1681            } 
     1682            ++idxDomain; 
    16171683          } 
    1618            else 
    1619            { 
    1620             StdString domainName = domain->name; 
    1621             if (domain->nvertex == 1) 
     1684          else if (1 == axisDomainOrder(i)) 
     1685          { 
     1686            CAxis* axis = CAxis::get(axisList[idxAxis]); 
     1687            StdString axisId = axis->getAxisOutputName(); 
     1688 
     1689            if (compressedOutput && axis->isCompressible()) 
    16221690            { 
    1623               dimXid     = "n" + domainName + "_node"; 
    1624               dimIdList.push_back(dimXid); 
    1625               dimCoordList.push_back(StdString(domainName + "_node_x")); 
    1626               dimCoordList.push_back(StdString(domainName + "_node_y")); 
    1627             } 
    1628             else if (domain->nvertex == 2) 
    1629             { 
    1630               dimXid     = "n" + domainName + "_edge"; 
    1631               dimIdList.push_back(dimXid); 
    1632               dimCoordList.push_back(StdString(domainName + "_edge_x")); 
    1633               dimCoordList.push_back(StdString(domainName + "_edge_y")); 
     1691              dimIdList.push_back(axisId + "_points"); 
     1692              field->setUseCompressedOutput(); 
    16341693            } 
    16351694            else 
    1636             { 
    1637               dimXid     = "n" + domainName + "_face"; 
    1638               dimIdList.push_back(dimXid); 
    1639               dimCoordList.push_back(StdString(domainName + "_face_x")); 
    1640               dimCoordList.push_back(StdString(domainName + "_face_y")); 
    1641             } 
    1642           }  // ugrid convention 
    1643         }  // case unstructured domain 
    1644              } 
    1645  
    1646              if (domain->hasArea) 
    1647              { 
    1648                hasArea = true; 
    1649                cellMeasures += " area" + appendDomId; 
    1650              } 
    1651              ++idxDomain; 
    1652            } 
    1653            else if (1 == axisDomainOrder(i)) 
    1654            { 
    1655              CAxis* axis = CAxis::get(axisList[idxAxis]); 
    1656              StdString axisId = axis->getAxisOutputName(); 
    1657  
    1658              if (compressedOutput && axis->isCompressible()) 
    1659              { 
    1660                dimIdList.push_back(axisId + "_points"); 
    1661                field->setUseCompressedOutput(); 
    1662              } 
    1663              else 
    1664                dimIdList.push_back(axisId); 
    1665  
    1666              dimCoordList.push_back(axisId); 
    1667              ++idxAxis; 
    1668            } 
    1669            else // scalar 
    1670            { 
     1695              dimIdList.push_back(axisId); 
     1696 
     1697            dimCoordList.push_back(axisId); 
     1698            ++idxAxis; 
     1699          } 
     1700          else // scalar 
     1701          { 
    16711702             /* Do nothing here */ 
    1672            } 
    1673          } 
    1674  
    1675 /* 
    1676          StdString lonid_loc = (server->intraCommSize > 1) 
    1677                              ? StdString("lon").append(appendDomid).append("_local") 
    1678                              : lonid; 
    1679          StdString latid_loc = (server->intraCommSize > 1) 
    1680                              ? StdString("lat").append(appendDomid).append("_local") 
    1681                              : latid; 
    1682 */ 
    1683          StdString fieldid = field->getFieldOutputName(); 
    1684  
    1685          nc_type type ; 
    1686          if (field->prec.isEmpty()) type =  NC_FLOAT ; 
    1687          else 
    1688          { 
    1689            if (field->prec==2) type = NC_SHORT ; 
    1690            else if (field->prec==4)  type =  NC_FLOAT ; 
    1691            else if (field->prec==8)   type =  NC_DOUBLE ; 
    1692          } 
    1693  
    1694          bool wtime   = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 
    1695  
    1696          if (wtime) 
    1697          { 
    1698  
    1699             //StdOStringStream oss; 
    1700            // oss << "time_" << field->operation.getValue() 
    1701            //     << "_" << field->getRelFile()->output_freq.getValue(); 
    1702           //oss 
    1703             if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant")); 
    1704             else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered")); 
    1705             dims.push_back(timeid); 
    1706          } 
    1707  
    1708          if (compressedOutput && grid->isCompressible()) 
    1709          { 
    1710            dims.push_back(grid->getId() + "_points"); 
    1711            field->setUseCompressedOutput(); 
    1712          } 
    1713          else 
    1714          { 
    1715            while (!dimIdList.empty()) 
    1716            { 
    1717              dims.push_back(dimIdList.back()); 
    1718              dimIdList.pop_back(); 
    1719            } 
    1720          } 
    1721  
    1722          while (!dimCoordList.empty()) 
    1723          { 
    1724            coodinates.push_back(dimCoordList.back()); 
    1725            dimCoordList.pop_back(); 
    1726          } 
    1727  
    1728          try 
    1729          { 
     1703          } 
     1704        } 
     1705 
     1706        StdString fieldid = field->getFieldOutputName(); 
     1707 
     1708        nc_type type ; 
     1709        if (field->prec.isEmpty()) type =  NC_FLOAT ; 
     1710        else 
     1711        { 
     1712          if (field->prec==2) type = NC_SHORT ; 
     1713          else if (field->prec==4)  type =  NC_FLOAT ; 
     1714          else if (field->prec==8)   type =  NC_DOUBLE ; 
     1715        } 
     1716 
     1717        bool wtime   = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 
     1718 
     1719        if (wtime) 
     1720        { 
     1721          if (field->hasTimeInstant && hasTimeInstant) coodinates.push_back(string("time_instant")); 
     1722          else if (field->hasTimeCentered && hasTimeCentered)  coodinates.push_back(string("time_centered")); 
     1723          dims.push_back(timeid); 
     1724        } 
     1725 
     1726        if (compressedOutput && grid->isCompressible()) 
     1727        { 
     1728          dims.push_back(grid->getId() + "_points"); 
     1729          field->setUseCompressedOutput(); 
     1730        } 
     1731        else 
     1732        { 
     1733          while (!dimIdList.empty()) 
     1734          { 
     1735            dims.push_back(dimIdList.back()); 
     1736            dimIdList.pop_back(); 
     1737          } 
     1738        } 
     1739 
     1740        while (!dimCoordList.empty()) 
     1741        { 
     1742          coodinates.push_back(dimCoordList.back()); 
     1743          dimCoordList.pop_back(); 
     1744        } 
     1745 
     1746        try 
     1747        { 
    17301748           SuperClassWriter::addVariable(fieldid, type, dims); 
    17311749 
     
    17421760                 ("units", field->unit.getValue(), &fieldid); 
    17431761 
    1744             if (!field->valid_min.isEmpty()) 
     1762           // Ugrid field attributes "mesh" and "location" 
     1763           if (!SuperClassWriter::useCFConvention) 
     1764           { 
     1765            if (!domainList.empty()) 
     1766            { 
     1767              CDomain* domain = CDomain::get(domainList[0]); // Suppose that we have only domain 
     1768              StdString mesh = domain->name; 
     1769              SuperClassWriter::addAttribute("mesh", mesh, &fieldid); 
     1770              StdString location; 
     1771              if (domain->nvertex == 1) 
     1772                location = "node"; 
     1773              else if (domain->nvertex == 2) 
     1774                location = "edge"; 
     1775              else if (domain->nvertex > 2) 
     1776                location = "face"; 
     1777              SuperClassWriter::addAttribute("location", location, &fieldid); 
     1778            } 
     1779 
     1780           } 
     1781 
     1782           if (!field->valid_min.isEmpty()) 
    17451783              SuperClassWriter::addAttribute 
    17461784                 ("valid_min", field->valid_min.getValue(), &fieldid); 
     
    17711809           if (!field->cell_methods.isEmpty()) 
    17721810           { 
    1773              StdString cellMethodString = field->cell_methods; 
    1774              if (field->cell_methods_mode.isEmpty() || 
     1811              StdString cellMethodString = field->cell_methods; 
     1812              if (field->cell_methods_mode.isEmpty() || 
    17751813                 (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode)) 
    1776              { 
    1777                SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid); 
    1778                alreadyAddCellMethod = true; 
    1779              } 
    1780              else 
    1781              { 
    1782                switch (field->cell_methods_mode) 
    1783                { 
    1784                case (CField::cell_methods_mode_attr::prefix): 
    1785                  cellMethodsPrefix = cellMethodString; 
    1786                  cellMethodsPrefix += " "; 
    1787                  break; 
    1788                case (CField::cell_methods_mode_attr::suffix): 
    1789                  cellMethodsSuffix = " "; 
    1790                  cellMethodsSuffix += cellMethodString; 
    1791                  break; 
    1792                case (CField::cell_methods_mode_attr::none): 
    1793                  break; 
    1794                default: 
    1795                  break; 
    1796                } 
    1797              } 
     1814              { 
     1815                SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid); 
     1816                alreadyAddCellMethod = true; 
     1817              } 
     1818              else 
     1819              { 
     1820                switch (field->cell_methods_mode) 
     1821                { 
     1822                  case (CField::cell_methods_mode_attr::prefix): 
     1823                    cellMethodsPrefix = cellMethodString; 
     1824                    cellMethodsPrefix += " "; 
     1825                    break; 
     1826                  case (CField::cell_methods_mode_attr::suffix): 
     1827                    cellMethodsSuffix = " "; 
     1828                    cellMethodsSuffix += cellMethodString; 
     1829                    break; 
     1830                  case (CField::cell_methods_mode_attr::none): 
     1831                    break; 
     1832                  default: 
     1833                    break; 
     1834                } 
     1835              } 
    17981836           } 
    17991837 
     
    18811919         singleDomain = (file->nbDomains == 1); 
    18821920 
     1921         StdString conv_str ; 
     1922         if (file->convention_str.isEmpty()) 
     1923         { 
     1924            if (SuperClassWriter::useCFConvention) conv_str="CF-1.6" ; 
     1925            else conv_str="UGRID" ; 
     1926         } 
     1927         else conv_str=file->convention_str ; 
     1928            
    18831929         try 
    18841930         { 
    1885        if (SuperClassWriter::useCFConvention) 
    1886              this->writeFileAttributes(filename, description, 
    1887                                        StdString("CF-1.5"), 
    1888                                        StdString("An IPSL model"), 
    1889                                        this->getTimeStamp()); 
    1890            else 
    1891              this->writeFileAttributes(filename, description, 
    1892                                        StdString("UGRID"), 
    1893                                        StdString("An IPSL model"), 
    1894                                        this->getTimeStamp()); 
    1895  
     1931           this->writeFileAttributes(filename, description, 
     1932                                      conv_str, 
     1933                                      StdString("An IPSL model"), 
     1934                                      this->getTimeStamp()); 
    18961935 
    18971936           if (!appendMode) 
     
    20172056         struct tm * timeinfo = NULL; 
    20182057         char buffer [buffer_size]; 
    2019  
     2058         StdString formatStr; 
     2059         if (file->time_stamp_format.isEmpty()) formatStr="%Y-%b-%d %H:%M:%S %Z" ; 
     2060         else formatStr=file->time_stamp_format; 
     2061 
     2062//         time ( &rawtime ); 
     2063//         timeinfo = localtime ( &rawtime ); 
    20202064         time ( &rawtime ); 
    2021          timeinfo = localtime ( &rawtime ); 
    2022          strftime (buffer, buffer_size, "%Y-%b-%d %H:%M:%S %Z", timeinfo); 
     2065         timeinfo = gmtime ( &rawtime ); 
     2066         strftime (buffer, buffer_size, formatStr.c_str(), timeinfo); 
    20232067 
    20242068         return (StdString(buffer)); 
     
    20332077        CGrid* grid = field->grid; 
    20342078 
    2035         if (field->getNStep()<1) return ; 
     2079        if (field->getNStep()<1)  
     2080        { 
     2081          return; 
     2082        } 
    20362083         
    20372084        if (!grid->doGridHaveDataToWrite()) 
    2038           if (SuperClass::type == MULTI_FILE || !isCollective) return; 
     2085          if (SuperClass::type == MULTI_FILE || !isCollective) 
     2086          { 
     2087            return; 
     2088          } 
    20392089 
    20402090        StdString fieldid = field->getFieldOutputName(); 
     
    20422092        StdOStringStream oss; 
    20432093        string timeAxisId; 
    2044         if (field->getOperationTimeType() == func::CFunctor::instant) timeAxisId = "time_instant"; 
    2045         else if (field->getOperationTimeType() == func::CFunctor::centered) timeAxisId = "time_centered"; 
     2094        if (field->hasTimeInstant) timeAxisId = "time_instant"; 
     2095        else if (field->hasTimeCentered) timeAxisId = "time_centered"; 
    20462096 
    20472097        StdString timeBoundId = getTimeCounterName() + "_bounds"; 
    20482098 
    20492099        StdString timeAxisBoundId; 
    2050         if (field->getOperationTimeType() == func::CFunctor::instant) timeAxisBoundId = "time_instant_bounds"; 
    2051         else if (field->getOperationTimeType() == func::CFunctor::centered) timeAxisBoundId = "time_centered_bounds"; 
     2100        if (field->hasTimeInstant) timeAxisBoundId = "time_instant_bounds"; 
     2101        else if (field->hasTimeCentered) timeAxisBoundId = "time_centered_bounds"; 
    20522102 
    20532103        if (!field->wasWritten()) 
    20542104        { 
    2055           if (appendMode && field->file->record_offset.isEmpty() && 
    2056                field->getOperationTimeType() != func::CFunctor::once) 
     2105          if (appendMode && field->file->record_offset.isEmpty() &&  
     2106              field->getOperationTimeType() != func::CFunctor::once) 
    20572107          { 
    2058             field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1); 
     2108            double factorUnit; 
     2109            if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) 
     2110            factorUnit=context->getCalendar()->getDayLengthInSeconds() ; 
     2111            else factorUnit=1 ; 
     2112            field->resetNStep(getRecordFromTime(field->last_Write_srv,factorUnit) + 1); 
    20592113          } 
    20602114 
     
    20692123 
    20702124        bool wtime = (field->getOperationTimeType() != func::CFunctor::once); 
     2125        bool wtimeCounter =false ; 
     2126        bool wtimeData =false ; 
     2127         
    20712128 
    20722129        if (wtime) 
     
    20752132          Time lastLastWrite = field->lastlast_Write_srv; 
    20762133 
    2077           if (field->getOperationTimeType() == func::CFunctor::instant) 
    2078             time_data(0) = lastWrite; 
    2079           else if (field->getOperationTimeType() == func::CFunctor::centered) 
     2134           
     2135          if (field->hasTimeInstant) 
     2136          { 
     2137            time_data(0) = time_data_bound(1) = lastWrite; 
     2138            time_data_bound(0) = time_data_bound(1) = lastWrite; 
     2139            if (timeCounterType==instant) 
     2140            { 
     2141              time_counter(0) = time_data(0); 
     2142              time_counter_bound(0) = time_data_bound(0); 
     2143              time_counter_bound(1) = time_data_bound(1); 
     2144              wtimeCounter=true ; 
     2145            } 
     2146            if (hasTimeInstant) wtimeData=true ; 
     2147          } 
     2148          else if (field->hasTimeCentered) 
     2149          { 
    20802150            time_data(0) = (lastWrite + lastLastWrite) / 2; 
    2081  
    2082           if (field->getOperationTimeType() == func::CFunctor::instant) 
    2083             time_data_bound(0) = time_data_bound(1) = lastWrite; 
    2084           else if (field->getOperationTimeType() == func::CFunctor::centered) 
    2085           { 
    20862151            time_data_bound(0) = lastLastWrite; 
    20872152            time_data_bound(1) = lastWrite; 
     2153            if (timeCounterType==centered) 
     2154            { 
     2155              time_counter(0) = time_data(0) ; 
     2156              time_counter_bound(0) = time_data_bound(0) ; 
     2157              time_counter_bound(1) = time_data_bound(1) ; 
     2158              wtimeCounter=true ; 
     2159            } 
     2160            if (hasTimeCentered) wtimeData=true ; 
    20882161          } 
    20892162 
    2090           if (field->file->time_counter == CFile::time_counter_attr::instant) 
    2091             time_counter(0) = lastWrite; 
    2092           else if (field->file->time_counter == CFile::time_counter_attr::centered) 
    2093             time_counter(0) = (lastWrite + lastLastWrite) / 2; 
    2094           else if (field->file->time_counter == CFile::time_counter_attr::record) 
     2163          if (timeCounterType==record) 
     2164          { 
    20952165            time_counter(0) = field->getNStep() - 1; 
    2096  
    2097  
    2098           if (field->file->time_counter == CFile::time_counter_attr::instant) 
    2099             time_counter_bound(0) = time_counter_bound(1) = lastWrite; 
    2100           else if (field->file->time_counter == CFile::time_counter_attr::centered) 
     2166            time_counter_bound(0) = time_counter_bound(1) = field->getNStep() - 1; 
     2167            wtimeCounter=true ; 
     2168          } 
     2169 
     2170          if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) 
    21012171          { 
    2102             time_counter_bound(0) = lastLastWrite; 
    2103             time_counter_bound(1) = lastWrite; 
     2172            double secByDay=context->getCalendar()->getDayLengthInSeconds() ; 
     2173            time_data/=secByDay; 
     2174            time_data_bound/=secByDay; 
     2175            time_counter/=secByDay; 
     2176            time_counter_bound/=secByDay; 
    21042177          } 
    2105           else if (field->file->time_counter == CFile::time_counter_attr::record) 
    2106             time_counter_bound(0) = time_counter_bound(1) = field->getNStep() - 1; 
    21072178        } 
    21082179 
     
    21402211              case (MULTI_FILE) : 
    21412212              { 
     2213                 CTimer::get("Files : writing data").resume(); 
    21422214                 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 
     2215                 CTimer::get("Files : writing data").suspend(); 
    21432216                 if (wtime) 
    21442217                 { 
    2145                    SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
    2146                    SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
    2147                    if (field->file->time_counter != CFile::time_counter_attr::none) 
     2218                   CTimer::get("Files : writing time axis").resume(); 
     2219                   if ( wtimeData) 
    21482220                   { 
    2149                      SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    2150                      if (field->file->time_counter != CFile::time_counter_attr::record) 
    2151                        SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2221//                     SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
     2222//                     SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
     2223                       SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
     2224                       SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
     2225                  } 
     2226                   if (wtimeCounter) 
     2227                   { 
     2228//                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
     2229//                     if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2230                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 
     2231                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
    21522232                   } 
     2233                   CTimer::get("Files : writing time axis").suspend(); 
    21532234                 } 
    21542235                 break; 
     
    22272308                      } 
    22282309                    } 
    2229                   }                 
     2310                  } 
    22302311                } 
    22312312                else 
     
    22782359                } 
    22792360 
     2361 
     2362                CTimer::get("Files : writing data").resume(); 
    22802363                SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 
    2281                 if (wtime) 
    2282                 { 
    2283                    SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
    2284                    SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
    2285                    if (field->file->time_counter != CFile::time_counter_attr::none) 
     2364                CTimer::get("Files : writing data").suspend(); 
     2365 
     2366                 if (wtime) 
     2367                 { 
     2368                   CTimer::get("Files : writing time axis").resume(); 
     2369                   if ( wtimeData) 
    22862370                   { 
    2287                      SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1, isRoot); 
    2288                      if (field->file->time_counter != CFile::time_counter_attr::record) 
    2289                        SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
     2371//                     SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
     2372//                     SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
     2373                     SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
     2374                     SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
    22902375                   } 
    2291                 } 
     2376                   if (wtimeCounter) 
     2377                   { 
     2378//                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
     2379//                     if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     2380                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 
     2381                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
     2382 
     2383                   } 
     2384                   CTimer::get("Files : writing time axis").suspend();   
     2385                 } 
    22922386 
    22932387                break; 
     
    23132407      { 
    23142408         StdOStringStream oss; 
    2315  
     2409         bool createInstantAxis=false ; 
     2410         bool createCenteredAxis=false ; 
     2411         bool createTimeCounterAxis=false ; 
     2412          
    23162413         if (field->getOperationTimeType() == func::CFunctor::once) return ; 
    23172414 
    2318 //         oss << "time_" << field->operation.getValue() 
    2319 //             << "_" << field->getRelFile()->output_freq.getValue(); 
    2320  
    2321 //         StdString axisid = oss.str(); 
    2322 //         if (field->getOperationTimeType() == func::CFunctor::centered) axisid="time_centered" ; 
    2323 //         else if (field->getOperationTimeType() == func::CFunctor::instant) axisid="time_instant" ; 
    2324  
    2325          StdString axisid("time_centered") ; 
    2326          StdString axisBoundId("time_centered_bounds"); 
     2415 
     2416         StdString axisId ; 
     2417         StdString axisBoundId; 
    23272418         StdString timeid(getTimeCounterName()); 
    23282419         StdString timeBoundId("axis_nbounds"); 
    23292420 
    2330          if (field->getOperationTimeType() == func::CFunctor::instant) 
    2331          { 
    2332             axisid = "time_instant"; 
    2333             axisBoundId = "time_instant_bounds"; 
    2334          } 
    2335  
     2421         StdString strTimeUnits ; 
     2422         if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) strTimeUnits="days since " ; 
     2423         else  strTimeUnits="seconds since " ; 
     2424  
     2425         if (field->getOperationTimeType() == func::CFunctor::instant) field->hasTimeInstant = true; 
     2426         if (field->getOperationTimeType() == func::CFunctor::centered) field->hasTimeCentered = true; 
     2427 
     2428 
     2429         if (field->file->time_counter.isEmpty()) 
     2430         { 
     2431           if (timeCounterType==none) createTimeCounterAxis=true ; 
     2432           if (field->hasTimeCentered) 
     2433           { 
     2434             timeCounterType=centered ; 
     2435             if (!hasTimeCentered) createCenteredAxis=true ; 
     2436           } 
     2437           if (field->hasTimeInstant) 
     2438           { 
     2439             if (timeCounterType==none) timeCounterType=instant ; 
     2440             if (!hasTimeInstant) createInstantAxis=true ; 
     2441           } 
     2442         } 
     2443         else if (field->file->time_counter==CFile::time_counter_attr::instant) 
     2444         { 
     2445           if (field->hasTimeCentered) 
     2446           { 
     2447             if (!hasTimeCentered) createCenteredAxis=true ; 
     2448           } 
     2449           if (field->hasTimeInstant) 
     2450           { 
     2451             if (timeCounterType==none) createTimeCounterAxis=true ; 
     2452             timeCounterType=instant ; 
     2453             if (!hasTimeInstant) createInstantAxis=true ; 
     2454           } 
     2455         } 
     2456         else if (field->file->time_counter==CFile::time_counter_attr::centered) 
     2457         { 
     2458           if (field->hasTimeCentered) 
     2459           { 
     2460             if (timeCounterType==none) createTimeCounterAxis=true ; 
     2461             timeCounterType=centered ; 
     2462             if (!hasTimeCentered) createCenteredAxis=true ; 
     2463           } 
     2464           if (field->hasTimeInstant) 
     2465           { 
     2466             if (!hasTimeInstant) createInstantAxis=true ; 
     2467           } 
     2468         } 
     2469         else if (field->file->time_counter==CFile::time_counter_attr::instant_exclusive) 
     2470         { 
     2471           if (field->hasTimeCentered) 
     2472           { 
     2473             if (!hasTimeCentered) createCenteredAxis=true ; 
     2474           } 
     2475           if (field->hasTimeInstant) 
     2476           { 
     2477             if (timeCounterType==none) createTimeCounterAxis=true ; 
     2478             timeCounterType=instant ; 
     2479           } 
     2480         } 
     2481         else if (field->file->time_counter==CFile::time_counter_attr::centered_exclusive) 
     2482         { 
     2483           if (field->hasTimeCentered) 
     2484           { 
     2485             if (timeCounterType==none) createTimeCounterAxis=true ; 
     2486             timeCounterType=centered ; 
     2487           } 
     2488           if (field->hasTimeInstant) 
     2489           { 
     2490             if (!hasTimeInstant) createInstantAxis=true ; 
     2491           } 
     2492         } 
     2493         else if (field->file->time_counter==CFile::time_counter_attr::exclusive) 
     2494         { 
     2495           if (field->hasTimeCentered) 
     2496           { 
     2497             if (timeCounterType==none) createTimeCounterAxis=true ; 
     2498             if (timeCounterType==instant) createInstantAxis=true ; 
     2499             timeCounterType=centered ; 
     2500           } 
     2501           if (field->hasTimeInstant) 
     2502           { 
     2503             if (timeCounterType==none) 
     2504             { 
     2505               createTimeCounterAxis=true ; 
     2506               timeCounterType=instant ; 
     2507             } 
     2508             if (timeCounterType==centered) 
     2509             { 
     2510               if (!hasTimeInstant) createInstantAxis=true ; 
     2511             } 
     2512           } 
     2513         } 
     2514         else if (field->file->time_counter==CFile::time_counter_attr::none) 
     2515         { 
     2516           if (field->hasTimeCentered) 
     2517           { 
     2518             if (!hasTimeCentered) createCenteredAxis=true ; 
     2519           } 
     2520           if (field->hasTimeInstant) 
     2521           { 
     2522             if (!hasTimeInstant) createInstantAxis=true ; 
     2523           } 
     2524         } 
     2525         else if (field->file->time_counter==CFile::time_counter_attr::record) 
     2526         { 
     2527           if (timeCounterType==none) createTimeCounterAxis=true ; 
     2528           timeCounterType=record ; 
     2529           if (field->hasTimeCentered) 
     2530           { 
     2531             if (!hasTimeCentered) createCenteredAxis=true ; 
     2532           } 
     2533           if (field->hasTimeInstant) 
     2534           { 
     2535             if (!hasTimeInstant) createInstantAxis=true ; 
     2536           } 
     2537         } 
     2538          
     2539         if (createInstantAxis) 
     2540         { 
     2541           axisId="time_instant" ; 
     2542           axisBoundId="time_instant_bounds"; 
     2543           hasTimeInstant=true ; 
     2544         } 
     2545 
     2546         if (createCenteredAxis) 
     2547         { 
     2548           axisId="time_centered" ; 
     2549           axisBoundId="time_centered_bounds"; 
     2550           hasTimeCentered=true ; 
     2551         } 
     2552 
     2553          
    23362554         try 
    23372555         { 
    2338           // Adding time_instant or time_centered 
    2339            std::vector<StdString> dims; 
    2340            dims.push_back(timeid); 
    2341            if (!SuperClassWriter::varExist(axisid)) 
    2342            { 
    2343               SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims); 
    2344  
    2345               CDate timeOrigin=cal->getTimeOrigin() ; 
    2346               StdOStringStream oss2; 
    2347   //            oss2<<initDate.getYear()<<"-"<<initDate.getMonth()<<"-"<<initDate.getDay()<<" " 
    2348   //                <<initDate.getHour()<<"-"<<initDate.getMinute()<<"-"<<initDate.getSecond() ; 
    2349               StdString strInitdate=oss2.str() ; 
    2350               StdString strTimeOrigin=timeOrigin.toString() ; 
    2351               this->writeTimeAxisAttributes 
    2352                  (axisid, cal->getType(), 
    2353                   StdString("seconds since ").append(strTimeOrigin), 
    2354                   strTimeOrigin, axisBoundId); 
    2355            } 
    2356  
    2357            // Adding time_instant_bounds or time_centered_bounds variables 
    2358            if (!SuperClassWriter::varExist(axisBoundId)) 
    2359            { 
    2360               dims.clear() ; 
     2556            std::vector<StdString> dims; 
     2557             
     2558            if (createInstantAxis || createCenteredAxis) 
     2559            { 
     2560              // Adding time_instant or time_centered 
    23612561              dims.push_back(timeid); 
    2362               dims.push_back(timeBoundId); 
    2363               SuperClassWriter::addVariable(axisBoundId, NC_DOUBLE, dims); 
    2364            } 
    2365  
    2366            if (field->file->time_counter != CFile::time_counter_attr::none) 
     2562              if (!SuperClassWriter::varExist(axisId)) 
     2563              { 
     2564                SuperClassWriter::addVariable(axisId, NC_DOUBLE, dims); 
     2565 
     2566                CDate timeOrigin=cal->getTimeOrigin() ; 
     2567                StdOStringStream oss2; 
     2568                StdString strInitdate=oss2.str() ; 
     2569                StdString strTimeOrigin=timeOrigin.toString() ; 
     2570                this->writeTimeAxisAttributes(axisId, cal->getType(),strTimeUnits+strTimeOrigin, 
     2571                                              strTimeOrigin, axisBoundId); 
     2572             } 
     2573 
     2574             // Adding time_instant_bounds or time_centered_bounds variables 
     2575             if (!SuperClassWriter::varExist(axisBoundId)) 
     2576             { 
     2577                dims.clear() ; 
     2578                dims.push_back(timeid); 
     2579                dims.push_back(timeBoundId); 
     2580                SuperClassWriter::addVariable(axisBoundId, NC_DOUBLE, dims); 
     2581             } 
     2582           } 
     2583 
     2584           if (createTimeCounterAxis) 
    23672585           { 
    23682586             // Adding time_counter 
    2369              axisid = getTimeCounterName(); 
     2587             axisId = getTimeCounterName(); 
    23702588             axisBoundId = getTimeCounterName() + "_bounds"; 
    23712589             dims.clear(); 
    23722590             dims.push_back(timeid); 
    2373              if (!SuperClassWriter::varExist(axisid)) 
     2591             if (!SuperClassWriter::varExist(axisId)) 
    23742592             { 
    2375                 SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims); 
    2376                 SuperClassWriter::addAttribute("axis", string("T"), &axisid); 
    2377  
    2378                 if (field->file->time_counter != CFile::time_counter_attr::record) 
     2593                SuperClassWriter::addVariable(axisId, NC_DOUBLE, dims); 
     2594                SuperClassWriter::addAttribute("axis", string("T"), &axisId); 
     2595 
     2596                if (field->file->time_counter.isEmpty() ||  
     2597                   (field->file->time_counter != CFile::time_counter_attr::record)) 
    23792598                { 
    23802599                  CDate timeOrigin = cal->getTimeOrigin(); 
    23812600                  StdString strTimeOrigin = timeOrigin.toString(); 
    23822601 
    2383                   this->writeTimeAxisAttributes(axisid, cal->getType(), 
    2384                                                 StdString("seconds since ").append(strTimeOrigin), 
     2602                  this->writeTimeAxisAttributes(axisId, cal->getType(), 
     2603                                                strTimeUnits+strTimeOrigin, 
    23852604                                                strTimeOrigin, axisBoundId); 
    23862605                } 
     
    23882607 
    23892608             // Adding time_counter_bound dimension 
    2390              if (field->file->time_counter != CFile::time_counter_attr::record) 
     2609             if (field->file->time_counter.isEmpty() || (field->file->time_counter != CFile::time_counter_attr::record)) 
    23912610             { 
    23922611                if (!SuperClassWriter::varExist(axisBoundId)) 
     
    25632782           SuperClassWriter::addAttribute("title"      , description); 
    25642783           SuperClassWriter::addAttribute("Conventions", conventions); 
    2565            SuperClassWriter::addAttribute("production" , production); 
    2566            SuperClassWriter::addAttribute("timeStamp"  , timeStamp); 
     2784           // SuperClassWriter::addAttribute("production" , production); 
     2785 
     2786           StdString timeStampStr ; 
     2787           if (file->time_stamp_name.isEmpty()) timeStampStr="timeStamp" ; 
     2788           else timeStampStr=file->time_stamp_name ; 
     2789           SuperClassWriter::addAttribute(timeStampStr, timeStamp); 
     2790 
     2791           StdString uuidName ; 
     2792           if (file->uuid_name.isEmpty()) uuidName="uuid" ; 
     2793           else uuidName=file->uuid_name ; 
     2794 
     2795           if (file->uuid_format.isEmpty()) SuperClassWriter::addAttribute(uuidName, getUuidStr()); 
     2796           else SuperClassWriter::addAttribute(uuidName, getUuidStr(file->uuid_format)); 
     2797           
    25672798         } 
    25682799         catch (CNetCdfException& e) 
     
    26162847      ///-------------------------------------------------------------- 
    26172848 
    2618       StdSize CNc4DataOutput::getRecordFromTime(Time time) 
     2849      StdSize CNc4DataOutput::getRecordFromTime(Time time, double factorUnit) 
    26192850      { 
    26202851        std::map<Time, StdSize>::const_iterator it = timeToRecordCache.find(time); 
     
    26222853        { 
    26232854          StdString timeAxisBoundsId(getTimeCounterName() + "_bounds"); 
    2624           if (!SuperClassWriter::varExist(timeAxisBoundsId)) 
    2625             timeAxisBoundsId = "time_instant_bounds"; 
     2855          if (!SuperClassWriter::varExist(timeAxisBoundsId)) timeAxisBoundsId = "time_centered_bounds"; 
     2856          if (!SuperClassWriter::varExist(timeAxisBoundsId)) timeAxisBoundsId = "time_instant_bounds"; 
    26262857 
    26272858          CArray<double,2> timeAxisBounds; 
    2628           SuperClassWriter::getTimeAxisBounds(timeAxisBounds, timeAxisBoundsId, isCollective); 
    2629  
     2859          std::vector<StdSize> dimSize(SuperClassWriter::getDimensions(timeAxisBoundsId)) ; 
     2860           
    26302861          StdSize record = 0; 
    26312862          double dtime(time); 
    2632           for (int n = timeAxisBounds.extent(1) - 1; n >= 0; n--) 
     2863          for (int n = dimSize[0] - 1; n >= 0; n--) 
    26332864          { 
    2634             if (timeAxisBounds(1, n) < dtime) 
     2865            SuperClassWriter::getTimeAxisBounds(timeAxisBounds, timeAxisBoundsId, isCollective, n); 
     2866            timeAxisBounds*=factorUnit ; 
     2867            if (timeAxisBounds(1, 0) < dtime) 
    26352868            { 
    26362869              record = n + 1; 
  • XIOS/dev/dev_olga/src/io/nc4_data_output.hpp

    r887 r1158  
    2323            /// Constructeurs /// 
    2424            CNc4DataOutput 
    25                (const StdString & filename, bool exist); 
     25               (CFile* file, const StdString & filename, bool exist); 
    2626            CNc4DataOutput 
    27                (const StdString & filename, bool exist, bool useClassicFormat, 
     27               (CFile* file, const StdString & filename, bool exist, bool useClassicFormat, 
    2828                bool useCFConvention, 
    2929                MPI_Comm comm_file, bool multifile, bool isCollective = true, 
     
    9696                                     const StdString & nav_model); 
    9797 
    98             StdSize getRecordFromTime(Time time); 
     98            StdSize getRecordFromTime(Time time, double factorUnit); 
    9999 
    100100         private : 
     
    123123            std::set<std::string> writtenAxis, writtenCompressedAxis; 
    124124            std::set<std::string> writtenScalar; 
     125 
     126            enum { none, centered, instant, record} timeCounterType ; 
     127            bool hasTimeInstant ; 
     128            bool hasTimeCentered ; 
    125129      }; // class CNc4DataOutput 
    126130 
  • XIOS/dev/dev_olga/src/io/netCdfInterface.cpp

    r972 r1158  
    967967} 
    968968 
     969template<> 
     970int CNetCdfInterface::ncGetVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, char* data) 
     971{ 
     972  return nc_get_vara_text(ncid, varid, start, count, data); 
     973} 
     974 
    969975// Some specializations of putVariableType 
    970976template<> 
     
    984990{ 
    985991  return nc_put_vara_int(ncid, varid, start, count, data); 
     992} 
     993 
     994template<> 
     995int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const char* data) 
     996{ 
     997  return nc_put_vara_text(ncid, varid, start, count, data); 
    986998} 
    987999 
  • XIOS/dev/dev_olga/src/io/netCdfInterface_decl.cpp

    r686 r1158  
    3333  macroPutVar(float) 
    3434  macroPutVar(int) 
    35  
     35  macroPutVar(char) 
     36   
    3637#define macroType(type, ncType) \ 
    3738  template<> nc_type CNetCdfInterface::getNcType<type>() { return ncType; } 
  • XIOS/dev/dev_olga/src/io/netCdfInterface_impl.hpp

    r1030 r1158  
    121121      inqVarName(ncid, varId, varName); 
    122122      sstr << "Unable to write data given the location id: " << ncid << " and the variable whose id: " << varId << " and name: " << varName << std::endl; 
    123 //      if (status == NC_ENOTVAR ) 
    124 //        sstr <<   "Variable not found. "<< std::endl; 
    125 //      else if (status == NC_EINVALCOORDS) 
    126 //        sstr <<   "Index exceeds dimension bound. "<< std::endl; 
    127 //      else if (status == NC_EEDGE) 
    128 //        sstr <<   " Start+count exceeds dimension bound. "<< std::endl; 
    129 //      else if (status == NC_ERANGE) 
    130 //        sstr <<   " One or more of the values are out of range. "<< std::endl; 
    131 //      else if (status == NC_EINDEFINE) 
    132 //        sstr <<   " Operation not allowed in define mode. "<< std::endl; 
    133 //      else if (status == NC_EBADID) 
    134 //        sstr <<   "Bad ncid. "<< std::endl; 
    135123      throw CNetCdfException(sstr.str()); 
    136124    } 
  • XIOS/dev/dev_olga/src/io/onetcdf4.cpp

    r878 r1158  
    77#include "netCdfInterface.hpp" 
    88#include "netCdfException.hpp" 
     9#include "timer.hpp" 
    910 
    1011namespace xios 
     
    5556         if (!append || !std::ifstream(filename.c_str())) 
    5657         { 
     58            CTimer::get("Files : create").resume(); 
    5759            if (wmpi) 
    5860               CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 
    5961            else 
    6062               CNetCdfInterface::create(filename, mode, this->ncidp); 
    61  
     63            CTimer::get("Files : create").suspend(); 
     64  
    6265            this->appendMode = false; 
    6366         } 
     
    6568         { 
    6669            mode |= NC_WRITE; 
     70            CTimer::get("Files : open").resume(); 
    6771            if (wmpi) 
    6872               CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 
    6973            else 
    7074               CNetCdfInterface::open(filename, mode, this->ncidp); 
    71  
     75            CTimer::get("Files : open").suspend(); 
    7276            this->appendMode = true; 
    7377         } 
     
    8387      void CONetCDF4::close() 
    8488      { 
     89        CTimer::get("Files : close").resume(); 
    8590        CNetCdfInterface::close(this->ncidp); 
     91        CTimer::get("Files : close").suspend(); 
    8692      } 
    8793 
     
    247253      } 
    248254 
    249       //--------------------------------------------------------------- 
     255      void CONetCDF4::getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective, size_t record) 
     256      { 
     257        int grpid = this->getCurrentGroup(); 
     258        int varid = this->getVariable(name); 
     259 
     260        std::vector<StdSize> start(2), count(2); 
     261        start[0] = record; 
     262        count[0] = 1 ; 
     263        start[1] = 0; 
     264        count[1] = 2; 
     265 
     266        timeAxisBounds.resize(2, 1); 
     267 
     268        if (this->wmpi && collective) 
     269          CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 
     270        if (this->wmpi && !collective) 
     271          CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
     272 
     273        CNetCdfInterface::getVaraType(grpid, varid, &start[0], &count[0], timeAxisBounds.dataFirst()); 
     274      } 
     275 
     276 
    250277 
    251278      const CONetCDF4::CONetCDF4Path& CONetCDF4::getCurrentPath(void) const 
     
    503530      void CONetCDF4::writeData_(int grpid, int varid, 
    504531                                 const std::vector<StdSize>& sstart, 
     532                                 const std::vector<StdSize>& scount, char* data) 
     533      { 
     534          CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data); 
     535      } 
     536       
     537      template <> 
     538      void CONetCDF4::writeData_(int grpid, int varid, 
     539                                 const std::vector<StdSize>& sstart, 
    505540                                 const std::vector<StdSize>& scount, const int* data) 
    506541      { 
    507542          CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data); 
    508543      } 
    509  
    510544      //--------------------------------------------------------------- 
    511545 
     
    528562 
    529563         this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL); 
     564 
    530565         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
     566 
    531567      } 
    532568 
     
    554590 
    555591         this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL); 
    556          if (using_netcdf_internal) 
    557          { 
    558            if (!isRoot) 
    559            { 
    560              sstart[0] = sstart[0] + 1; 
    561              scount[0] = 0; 
    562            } 
    563          } 
    564592         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    565593       } 
    566594 
     595      void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name, 
     596                                        bool collective, StdSize record, bool isRoot) 
     597      { 
     598         int grpid = this->getCurrentGroup(); 
     599         int varid = this->getVariable(name); 
     600 
     601         map<int,size_t>::iterator it=timeAxis.find(varid); 
     602         if (it == timeAxis.end()) timeAxis[varid] = record; 
     603         else 
     604         { 
     605           if (it->second >= record) return; 
     606           else it->second =record; 
     607         } 
     608 
     609         StdSize array_size = 1; 
     610         std::vector<StdSize> sstart, scount; 
     611 
     612         if (this->wmpi && collective) 
     613            CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 
     614         if (this->wmpi && !collective) 
     615            CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
     616 
     617         this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL); 
     618         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
     619       } 
     620 
     621 
    567622      //--------------------------------------------------------------- 
    568623 
  • XIOS/dev/dev_olga/src/io/onetcdf4.hpp

    r878 r1158  
    7171            void writeTimeAxisData(const CArray<double,1>& data, const StdString& name, 
    7272                                   bool collective, StdSize record, bool Isroot); 
     73            void writeTimeAxisDataBounds(const CArray<double,1>& data, const StdString& name, 
     74                                   bool collective, StdSize record, bool Isroot); 
    7375            /// Accesseur /// 
    7476            const CONetCDF4Path& getCurrentPath(void) const; 
     
    9799            const StdString& getTimeCounterName(void) const { return timeCounterName; }; 
    98100 
    99             void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective); 
     101            void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective ); 
     102            void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective, size_t record); 
    100103 
    101104            bool varExist(const StdString& varname); 
  • XIOS/dev/dev_olga/src/io/onetcdf4_decl.cpp

    r924 r1158  
    1414  macro(double, 2) 
    1515  macro(double, 3) 
     16  macro(StdString, 1) 
    1617  
    1718  template void CONetCDF4::setDefaultValue<double>(const StdString & varname, const double* value) ; 
  • XIOS/dev/dev_olga/src/io/onetcdf4_impl.hpp

    r685 r1158  
    44#include "onetcdf4.hpp" 
    55#include "netCdfInterface.hpp" 
     6#include "timer.hpp" 
    67 
    78namespace xios 
     
    2324    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    2425 
     26    CTimer::get("Files : get data infos").resume(); 
    2527    this->getWriteDataInfos 
    2628    (name, record, array_size,  sstart, scount, start, count); 
     29    CTimer::get("Files : get data infos").suspend(); 
     30 
    2731    if (data.numElements() != array_size) 
    2832    { 
     
    3438 
    3539    this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
     40  } 
     41 
     42  template <> 
     43  void CONetCDF4::writeData(const CArray<StdString, 1>& data, const StdString & name, 
     44                            bool collective, StdSize record, 
     45                            const std::vector<StdSize> * start, 
     46                            const std::vector<StdSize> * count) 
     47  { 
     48    int grpid = this->getCurrentGroup(); 
     49    int varid = this->getVariable(name); 
     50    StdSize array_size = 1; 
     51    std::vector<StdSize> sstart, scount; 
     52 
     53    if (this->wmpi && collective) 
     54    CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 
     55    if (this->wmpi && !collective) 
     56    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
     57 
     58    CTimer::get("CONetCDF4::writeData getWriteDataInfos").resume(); 
     59    this->getWriteDataInfos(name, record, array_size,  sstart, scount, start, count); 
     60    CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 
     61  
     62    if (data.numElements()*stringArrayLen != array_size) 
     63    { 
     64      ERROR("CONetCDF4::writeData(...)", 
     65      << "[ input array size = "  << data.numElements() 
     66      << ", intern array size = " << array_size 
     67      << " ] Invalid input data !" ); 
     68    } 
     69    char* ArrayStr ; 
     70    char *PtrArrayStr ; 
     71    PtrArrayStr=ArrayStr=new char[data.numElements()*stringArrayLen] ; 
     72    Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 
     73    for(it=itb;it!=ite;++it,PtrArrayStr+=stringArrayLen) 
     74    { 
     75      it->copy(PtrArrayStr,it->size()) ; 
     76      PtrArrayStr[it->size()]='\0' ; 
     77    } 
     78    CTimer::get("CONetCDF4::writeData writeData_").resume(); 
     79    this->writeData_(grpid, varid, sstart, scount, ArrayStr); 
     80    CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
     81    delete [] ArrayStr ; 
    3682  } 
    3783 
  • XIOS/dev/dev_olga/src/memtrack.cpp

    r501 r1158  
    5252{ 
    5353  void addr2line(const char *file_name, char** addr, int naddr) ; 
     54#ifdef XIOS_MEMTRACK_LIGHT 
     55  void addr2line(const char *file_name, char** addr, int naddr) {}  
     56#endif 
    5457} 
    5558/* ------------------------------------------------------------ */ 
     
    5962namespace MemTrack 
    6063{ 
     64    size_t currentMemorySize=0 ; 
     65    size_t maxMemorySize=0 ;  
     66 
     67    size_t getCurrentMemorySize(void) {return currentMemorySize; } 
     68    size_t getMaxMemorySize(void) {return maxMemorySize ; } 
    6169 
    6270    /* ------------------------------------------------------------ */ 
     
    375383        // Get the offset to the user chunk and return it. 
    376384        UserChunk *pUser = GetUserAddress(pProlog); 
     385 
     386        currentMemorySize += size ; 
     387        if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ; 
    377388         
    378389        return pUser; 
     
    400411        // Unlink the block header from the list and destroy it. 
    401412        BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 
     413        currentMemorySize-=pBlockHeader->GetRequestedSize(); 
    402414        BlockHeader::RemoveNode(pBlockHeader); 
    403415        pBlockHeader->~BlockHeader(); 
  • XIOS/dev/dev_olga/src/memtrack.hpp

    r501 r1158  
    6161    void TrackDumpBlocks(); 
    6262    void TrackListMemoryUsage(); 
    63  
     63    size_t getCurrentMemorySize(void) ; 
     64    size_t getMaxMemorySize(void) ; 
    6465    /* ---------------------------------------- operator * (MemStamp, ptr) */ 
    6566 
  • XIOS/dev/dev_olga/src/node/axis.cpp

    r1144 r1158  
    2727      , hasBounds_(false), isCompressible_(false) 
    2828      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 
    29       , transformationMap_(), hasValue(false), doZoomByIndex_(false) 
     29      , transformationMap_(), hasValue(false), doZoomByIndex_(false), hasLabel(false) 
    3030      , computedWrittenIndex_(false) 
    3131   { 
     
    3838      , hasBounds_(false), isCompressible_(false) 
    3939      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 
    40       , transformationMap_(), hasValue(false), doZoomByIndex_(false) 
     40      , transformationMap_(), hasValue(false), doZoomByIndex_(false), hasLabel(false) 
    4141      , computedWrittenIndex_(false) 
    4242   { 
     
    5858 
    5959   ///--------------------------------------------------------------- 
     60 
     61   const std::set<StdString> & CAxis::getRelFiles(void) const 
     62   { 
     63      return (this->relFiles); 
     64   } 
     65 
    6066   bool CAxis::IsWritten(const StdString & filename) const 
    6167   { 
     
    7076   bool CAxis::isDistributed(void) const 
    7177   { 
    72       return (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 
    73              (!this->n.isEmpty() && (this->n != this->n_glo));; 
     78      bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 
     79             (!this->n.isEmpty() && (this->n != this->n_glo)); 
     80      // A same stupid condition to make sure that if there is only one client, axis 
     81      // should be considered to be distributed. This should be a temporary solution      
     82      distributed |= (1 == CContext::getCurrent()->client->clientSize); 
     83      return distributed; 
    7484   } 
    7585 
     
    132142   std::map<int, StdSize> CAxis::getAttributesBufferSize() 
    133143   { 
    134 //     CContextClient* client = CContext::getCurrent()->client; 
    135144     // For now the assumption is that secondary server pools consist of the same number of procs. 
    136145     // CHANGE the line below if the assumption changes. 
     
    172181         if (hasBounds_) 
    173182           sizeValEvent += CArray<double,2>::size(2 * it->second.size()); 
     183  
     184         if (hasLabel) 
     185           sizeValEvent += CArray<StdString,1>::size(it->second.size()); 
    174186 
    175187         size_t size = CEventClient::headerSize + getId().size() + sizeof(size_t) + std::max(sizeIndexEvent, sizeValEvent); 
     
    255267      this->checkZoom(); 
    256268      this->checkMask(); 
    257       this->checkBounds();       
     269      this->checkBounds(); 
     270      this->checkLabel(); 
    258271   } 
    259272 
     
    339352   } 
    340353 
    341    void CAxis::checkEligibilityForCompressedOutput() 
    342    { 
    343      // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    344      isCompressible_ = !mask.isEmpty(); 
    345    } 
     354  void CAxis::checkLabel() 
     355  { 
     356    if (!label.isEmpty()) 
     357    { 
     358      if (label.extent(0) != n) 
     359        ERROR("CAxis::checkLabel(void)", 
     360              << "The label array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension of axis size." << std::endl 
     361              << "Axis size is " << n.getValue() << "." << std::endl 
     362              << "label size is "<< label.extent(0)<<  " ."); 
     363      hasLabel = true; 
     364    } 
     365    else hasLabel = false; 
     366  } 
     367  void CAxis::checkEligibilityForCompressedOutput() 
     368  { 
     369    // We don't check if the mask is valid here, just if a mask has been defined at this point. 
     370    isCompressible_ = !mask.isEmpty(); 
     371  } 
    346372 
    347373   bool CAxis::dispatchEvent(CEventServer& event) 
     
    437463    CContext* context = CContext::getCurrent(); 
    438464 
    439     // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 
    440465    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 
    441466    for (int p = 0; p < nbSrvPools; ++p) 
     
    729754    CContext* context = CContext::getCurrent(); 
    730755 
    731     // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 
    732756    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 
    733757    for (int p = 0; p < nbSrvPools; ++p) 
     
    10711095      } 
    10721096    } 
     1097 
     1098    if (hasLabel) 
     1099    { 
     1100      //label_srv(ind_srv) = labelVal( ind); 
     1101    } 
    10731102  } 
    10741103 
     
    11141143  } 
    11151144 
     1145  /*! 
     1146    Compare two axis objects.  
     1147    They are equal if only if they have identical attributes as well as their values. 
     1148    Moreover, they must have the same transformations. 
     1149  \param [in] axis Compared axis 
     1150  \return result of the comparison 
     1151  */ 
     1152  bool CAxis::isEqual(CAxis* obj) 
     1153  { 
     1154    vector<StdString> excludedAttr; 
     1155    excludedAttr.push_back("axis_ref"); 
     1156 
     1157    bool objEqual = SuperClass::isEqual(obj, excludedAttr);     
     1158    if (!objEqual) return objEqual; 
     1159 
     1160    TransMapTypes thisTrans = this->getAllTransformations(); 
     1161    TransMapTypes objTrans  = obj->getAllTransformations(); 
     1162 
     1163    TransMapTypes::const_iterator it, itb, ite; 
     1164    std::vector<ETranformationType> thisTransType, objTransType; 
     1165    for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 
     1166      thisTransType.push_back(it->first); 
     1167    for (it = objTrans.begin(); it != objTrans.end(); ++it) 
     1168      objTransType.push_back(it->first); 
     1169 
     1170    if (thisTransType.size() != objTransType.size()) return false; 
     1171    for (int idx = 0; idx < thisTransType.size(); ++idx) 
     1172      objEqual &= (thisTransType[idx] == objTransType[idx]); 
     1173 
     1174    return objEqual; 
     1175  } 
    11161176 
    11171177  CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 
  • XIOS/dev/dev_olga/src/node/axis.hpp

    r1144 r1158  
    6868 
    6969         static CAxis* createAxis(); 
    70       
     70 
     71         /// Accesseurs /// 
     72         const std::set<StdString> & getRelFiles(void) const; 
     73 
    7174         int getNumberWrittenIndexes() const; 
    7275         int getTotalNumberWrittenIndexes() const; 
     
    115118         void duplicateTransformation(CAxis*); 
    116119         CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id=""); 
     120         bool isEqual(CAxis* axis); 
    117121 
    118122      public: 
     
    121125        CArray<double,1> value_srv; 
    122126        CArray<double,2> bound_srv; 
     127        CArray<StdString,1> label_srv; 
    123128        bool hasValue; 
    124129        CArray<int,1> globalDimGrid; 
     
    131136         void checkMask(); 
    132137         void checkZoom(); 
    133          void checkBounds();          
     138         void checkBounds(); 
     139         void checkLabel(); 
    134140         void sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    135141                             CServerDistributionDescription::ServerDistributionType distType); 
     
    166172         std::map<int, CArray<int,1> > indiSrv_; 
    167173         bool hasBounds_; 
    168  
     174         bool hasLabel; 
    169175         bool doZoomByIndex_; 
    170176         bool computedWrittenIndex_; 
  • XIOS/dev/dev_olga/src/node/calendar_wrapper.cpp

    r983 r1158  
    8383  { 
    8484    // Create the calendar if possible 
    85     if (0 != calendar) 
     85    if (calendar) 
    8686    { 
    8787      ERROR("CCalendarWrapper::createCalendar(void)", 
  • XIOS/dev/dev_olga/src/node/context.cpp

    r1144 r1158  
    1414#include "type.hpp" 
    1515#include "xios_spl.hpp" 
     16#include "timer.hpp" 
     17#include "memtrack.hpp" 
    1618 
    1719#include "server.hpp" 
     
    372374       comms.push_back(interCommClient); 
    373375     } 
    374      client = new CContextClient(this,intraCommClient,interCommClient,cxtClient); 
     376     client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); 
    375377   } 
    376378 
     
    615617   void CContext::closeDefinition(void) 
    616618   { 
     619    CTimer::get("Context : close definition").resume() ; 
    617620    postProcessingGlobalAttributes(); 
    618621 
     
    640643      if (!hasServer) startPrefetchingOfEnabledReadModeFiles(); 
    641644    } 
     645    CTimer::get("Context : close definition").suspend() ; 
    642646   } 
    643647 
     
    690694       this->enabledFiles[i]->generateNewTransformationGridDest(); 
    691695     } 
    692  
    693696   } 
    694697 
     
    783786   { 
    784787      const std::vector<CFile*> allFiles = CFile::getAll(); 
     788      const CDate& initDate = calendar->getInitDate(); 
    785789 
    786790      for (unsigned int i = 0; i < allFiles.size(); i++) 
     
    788792         { 
    789793            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
     794            { 
     795              if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
     796              { 
     797                error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 
     798                    << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 
     799                    <<"\" is less than the time step. File will not be written."<<endl; 
     800              } 
     801              else 
    790802               enabledFiles.push_back(allFiles[i]); 
     803            } 
    791804         } 
    792          else enabledFiles.push_back(allFiles[i]); // otherwise true by default 
    793  
     805         else 
     806         { 
     807           if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
     808           { 
     809             error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 
     810                 << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 
     811                 <<"\" is less than the time step. File will not be written."<<endl; 
     812           } 
     813           else 
     814             enabledFiles.push_back(allFiles[i]); // otherwise true by default 
     815         } 
    794816 
    795817      if (enabledFiles.size() == 0) 
     
    12671289     StdString fileDefRoot("file_definition"); 
    12681290     CFileGroup* cfgrpPtr = CFileGroup::get(fileDefRoot); 
     1291 
    12691292     for (int i = 0; i < size; ++i) 
    12701293     { 
     
    13131336       CFile* file = allFiles[i]; 
    13141337 
     1338       std::vector<CVariable*> fileVars, fieldVars, vars = file->getAllVariables(); 
     1339       for (size_t k = 0; k < vars.size(); k++) 
     1340       { 
     1341         CVariable* var = vars[k]; 
     1342 
     1343         if (var->ts_target.isEmpty() 
     1344              || var->ts_target == CVariable::ts_target_attr::file || var->ts_target == CVariable::ts_target_attr::both) 
     1345           fileVars.push_back(var); 
     1346 
     1347         if (!var->ts_target.isEmpty() 
     1348              && (var->ts_target == CVariable::ts_target_attr::field || var->ts_target == CVariable::ts_target_attr::both)) 
     1349           fieldVars.push_back(var); 
     1350       } 
     1351 
    13151352       if (!file->timeseries.isEmpty() && file->timeseries != CFile::timeseries_attr::none) 
    13161353       { 
    1317          StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : file->getFileOutputName(); 
    1318  
     1354         StdString fileNameStr("%file_name%") ; 
     1355         StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : fileNameStr ; 
     1356          
     1357         StdString fileName=file->getFileOutputName(); 
     1358         size_t pos=tsPrefix.find(fileNameStr) ; 
     1359         while (pos!=std::string::npos) 
     1360         { 
     1361           tsPrefix=tsPrefix.replace(pos,fileNameStr.size(),fileName) ; 
     1362           pos=tsPrefix.find(fileNameStr) ; 
     1363         } 
     1364         
    13191365         const std::vector<CField*> allFields = file->getAllFields(); 
    13201366         for (size_t j = 0; j < allFields.size(); j++) 
     
    13261372             CFile* tsFile = CFile::create(); 
    13271373             tsFile->duplicateAttributes(file); 
    1328              tsFile->setVirtualVariableGroup(file->getVirtualVariableGroup()); 
    1329  
     1374 
     1375             // Add variables originating from file and targeted to timeserie file 
     1376             for (size_t k = 0; k < fileVars.size(); k++) 
     1377               tsFile->getVirtualVariableGroup()->addChild(fileVars[k]); 
     1378 
     1379             
    13301380             tsFile->name = tsPrefix + "_"; 
    13311381             if (!field->name.isEmpty()) 
     
    13411391             CField* tsField = tsFile->addField(); 
    13421392             tsField->field_ref = field->getId(); 
    1343              tsField->setVirtualVariableGroup(field->getVirtualVariableGroup()); 
     1393 
     1394             // Add variables originating from file and targeted to timeserie field 
     1395             for (size_t k = 0; k < fieldVars.size(); k++) 
     1396               tsField->getVirtualVariableGroup()->addChild(fieldVars[k]); 
     1397 
     1398             vars = field->getAllVariables(); 
     1399             for (size_t k = 0; k < vars.size(); k++) 
     1400             { 
     1401               CVariable* var = vars[k]; 
     1402 
     1403               // Add variables originating from field and targeted to timeserie field 
     1404               if (var->ts_target.isEmpty() 
     1405                    || var->ts_target == CVariable::ts_target_attr::field || var->ts_target == CVariable::ts_target_attr::both) 
     1406                 tsField->getVirtualVariableGroup()->addChild(var); 
     1407 
     1408               // Add variables originating from field and targeted to timeserie file 
     1409               if (!var->ts_target.isEmpty() 
     1410                    && (var->ts_target == CVariable::ts_target_attr::file || var->ts_target == CVariable::ts_target_attr::both)) 
     1411                 tsFile->getVirtualVariableGroup()->addChild(var); 
     1412             } 
    13441413 
    13451414             tsFile->solveFieldRefInheritance(true); 
     
    14561525   void CContext::updateCalendar(int step) 
    14571526   { 
    1458       info(50) <<"Context "<< this->getId() <<" updateCalendar : before : " << calendar->getCurrentDate() << endl; 
     1527      info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
    14591528      calendar->update(step); 
    1460       info(50) <<"Context "<< this->getId() << " updateCalendar : after : " << calendar->getCurrentDate() << endl; 
    1461  
     1529      info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
     1530#ifdef XIOS_MEMTRACK_LIGHT 
     1531      info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 
     1532#endif 
    14621533      if (hasClient) 
    14631534      { 
     
    15371608 
    15381609  void CContext::sendRegistry(void) 
    1539   {     
     1610  { 
    15401611    registryOut->hierarchicalGatherRegistry() ; 
    15411612 
  • XIOS/dev/dev_olga/src/node/domain.cpp

    r1144 r1158  
    2626namespace xios { 
    2727 
    28    /// ////////////////////// Dfinitions ////////////////////// /// 
     28   /// ////////////////////// Définitions ////////////////////// /// 
    2929 
    3030   CDomain::CDomain(void) 
     
    7979   } 
    8080 
     81   const std::set<StdString> & CDomain::getRelFiles(void) const 
     82   { 
     83      return (this->relFiles); 
     84   } 
     85 
     86 
    8187   /*! 
    8288     Returns the number of indexes written by each server. 
     
    170176   { 
    171177      return ((this->zoom_i_index.isEmpty()) || (0 == this->zoom_i_index.numElements())); 
    172       // return ((this->zoom_ni_srv == 0) || 
    173       //         (this->zoom_nj_srv == 0)); 
     178 
    174179   } 
    175180 
     
    190195   bool CDomain::isDistributed(void) const 
    191196   { 
    192       return !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 
     197      bool distributed = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 
    193198              (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo)); 
     199      distributed |= (1 == CContext::getCurrent()->client->clientSize); 
     200 
     201      return distributed; 
    194202   } 
    195203 
     
    221229 
    222230   //---------------------------------------------------------------- 
     231 
     232   /*! 
     233      Verify if all distribution information of a domain are available 
     234      This checking verifies the definition of distribution attributes (ni, nj, ibegin, jbegin) 
     235   */ 
     236   bool CDomain::distributionAttributesHaveValue() const 
     237   { 
     238      bool hasValues = true; 
     239 
     240      if (ni.isEmpty() && ibegin.isEmpty() && i_index.isEmpty()) 
     241      { 
     242        hasValues = false; 
     243        return hasValues; 
     244      } 
     245 
     246      return hasValues; 
     247   } 
    223248 
    224249   /*! 
     
    331356            ni.setValue(ni_glo - ibeginVec[iIdx]); 
    332357          } 
    333         } 
    334  
    335         // Now fill other attributes 
    336         if (type_attr::rectilinear == type) fillInRectilinearLonLat(); 
     358        }  
    337359     } 
    338360     else  // unstructured domain 
     
    380402            nj.setValue(1); 
    381403          } 
     404 
     405          i_index.resize(ni);           
     406          for(int idx = 0; idx < ni; ++idx) i_index(idx)=ibegin+idx; 
    382407        } 
    383408        else 
     
    391416 
    392417     checkDomain(); 
     418   } 
     419 
     420   /*! 
     421     Fill in longitude and latitude whose values are read from file 
     422   */ 
     423   void CDomain::fillInLonLat() 
     424   { 
     425     switch (type) 
     426     { 
     427      case type_attr::rectilinear: 
     428        fillInRectilinearLonLat(); 
     429        break; 
     430      case type_attr::curvilinear: 
     431        fillInCurvilinearLonLat(); 
     432        break; 
     433      case type_attr::unstructured: 
     434        fillInUnstructuredLonLat(); 
     435        break; 
     436 
     437      default: 
     438      break; 
     439     } 
     440 
    393441   } 
    394442 
     
    468516   } 
    469517 
    470  
    471  
     518    /* 
     519      Fill in longitude and latitude of curvilinear domain read from a file 
     520      If there are already longitude and latitude defined by model. We just igonore reading value. 
     521    */ 
     522   void CDomain::fillInCurvilinearLonLat() 
     523   { 
     524     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty()) 
     525     { 
     526       lonvalue_2d.resize(ni,nj); 
     527       for (int jdx = 0; jdx < nj; ++jdx) 
     528        for (int idx = 0; idx < ni; ++idx) 
     529         lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
     530 
     531       lonvalue_curvilinear_read_from_file.free(); 
     532     } 
     533 
     534     if (!latvalue_curvilinear_read_from_file.isEmpty() && latvalue_2d.isEmpty()) 
     535     { 
     536       latvalue_2d.resize(ni,nj); 
     537       for (int jdx = 0; jdx < nj; ++jdx) 
     538        for (int idx = 0; idx < ni; ++idx) 
     539         latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
     540 
     541       latvalue_curvilinear_read_from_file.free(); 
     542     } 
     543 
     544     if (!bounds_lonvalue_curvilinear_read_from_file.isEmpty() && bounds_lon_2d.isEmpty()) 
     545     { 
     546       bounds_lon_2d.resize(nvertex,ni,nj); 
     547       for (int jdx = 0; jdx < nj; ++jdx) 
     548        for (int idx = 0; idx < ni; ++idx) 
     549          for (int ndx = 0; ndx < nvertex; ++ndx) 
     550         bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 
     551 
     552       bounds_lonvalue_curvilinear_read_from_file.free(); 
     553     } 
     554 
     555     if (!bounds_latvalue_curvilinear_read_from_file.isEmpty() && bounds_lat_2d.isEmpty()) 
     556     { 
     557       bounds_lat_2d.resize(nvertex,ni,nj); 
     558       for (int jdx = 0; jdx < nj; ++jdx) 
     559        for (int idx = 0; idx < ni; ++idx) 
     560          for (int ndx = 0; ndx < nvertex; ++ndx) 
     561            bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 
     562 
     563       bounds_latvalue_curvilinear_read_from_file.free(); 
     564     } 
     565 
     566   } 
     567 
     568    /* 
     569      Fill in longitude and latitude of unstructured domain read from a file 
     570      If there are already longitude and latitude defined by model. We just igonore reading value. 
     571    */ 
     572   void CDomain::fillInUnstructuredLonLat() 
     573   { 
     574     if (i_index.isEmpty()) 
     575     { 
     576       i_index.resize(ni); 
     577       for(int idx = 0; idx < ni; ++idx) i_index(idx)=ibegin+idx; 
     578     } 
     579 
     580     if (!lonvalue_unstructured_read_from_file.isEmpty() && lonvalue_1d.isEmpty()) 
     581     { 
     582        lonvalue_1d.resize(ni); 
     583        for (int idx = 0; idx < ni; ++idx) 
     584          lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i_index(idx)); 
     585 
     586        // We dont need these values anymore, so just delete them 
     587        lonvalue_unstructured_read_from_file.free(); 
     588     }  
     589 
     590     if (!latvalue_unstructured_read_from_file.isEmpty() && latvalue_1d.isEmpty()) 
     591     { 
     592        latvalue_1d.resize(ni); 
     593        for (int idx = 0; idx < ni; ++idx) 
     594          latvalue_1d(idx) =  latvalue_unstructured_read_from_file(i_index(idx)); 
     595 
     596        // We dont need these values anymore, so just delete them 
     597        latvalue_unstructured_read_from_file.free(); 
     598     } 
     599 
     600     if (!bounds_lonvalue_unstructured_read_from_file.isEmpty() && bounds_lon_1d.isEmpty()) 
     601     { 
     602        int nbVertex = nvertex; 
     603        bounds_lon_1d.resize(nbVertex,ni); 
     604        for (int idx = 0; idx < ni; ++idx) 
     605          for (int jdx = 0; jdx < nbVertex; ++jdx) 
     606            bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     607 
     608        // We dont need these values anymore, so just delete them 
     609        lonvalue_unstructured_read_from_file.free(); 
     610     } 
     611 
     612     if (!bounds_latvalue_unstructured_read_from_file.isEmpty() && bounds_lat_1d.isEmpty()) 
     613     { 
     614        int nbVertex = nvertex; 
     615        bounds_lat_1d.resize(nbVertex,ni); 
     616        for (int idx = 0; idx < ni; ++idx) 
     617          for (int jdx = 0; jdx < nbVertex; ++jdx) 
     618            bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     619 
     620        // We dont need these values anymore, so just delete them 
     621        lonvalue_unstructured_read_from_file.free(); 
     622     } 
     623   } 
     624 
     625  /* 
     626    Get global longitude and latitude of rectilinear domain. 
     627  */ 
    472628   void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 
    473629   { 
     
    590746    else 
    591747    { 
    592       if (bounds_lat_start.isEmpty()) bounds_lon_start=-90. ; 
     748      if (bounds_lat_start.isEmpty()) bounds_lat_start=-90. ; 
    593749      if (bounds_lat_end.isEmpty()) bounds_lat_end=90 ; 
    594750    } 
     
    695851       for (int j = 0; j < nj; ++j) 
    696852         for (int i = 0; i < ni; ++i) j_index(i+j*ni) = j+jbegin; 
    697      }      
     853     } 
     854      
    698855     checkZoom(); 
    699856   } 
     
    14311588     if (context->hasClient) 
    14321589     { 
    1433        // this->checkMask(); 
    14341590      this->computeConnectedClients(); 
    1435        // if (hasLonLat || hasArea || isCompressible_) this->computeConnectedClients(); 
    14361591       if (hasLonLat) 
    14371592         if (!context->hasServer) 
     
    14821637     if (context->hasClient) 
    14831638     { 
    1484 //       this->completeLonLatClient(); 
    14851639       sendAttributes(); 
    14861640     } 
     
    26942848  } 
    26952849 
    2696  
    26972850  /*! 
    26982851    Receive area information from client(s) 
     
    27422895       
    27432896    } 
     2897  } 
     2898 
     2899  /*! 
     2900    Compare two domain objects.  
     2901    They are equal if only if they have identical attributes as well as their values. 
     2902    Moreover, they must have the same transformations. 
     2903  \param [in] domain Compared domain 
     2904  \return result of the comparison 
     2905  */ 
     2906  bool CDomain::isEqual(CDomain* obj) 
     2907  { 
     2908    vector<StdString> excludedAttr; 
     2909    excludedAttr.push_back("domain_ref"); 
     2910    bool objEqual = SuperClass::isEqual(obj, excludedAttr); 
     2911    if (!objEqual) return objEqual; 
     2912 
     2913    TransMapTypes thisTrans = this->getAllTransformations(); 
     2914    TransMapTypes objTrans  = obj->getAllTransformations(); 
     2915 
     2916    TransMapTypes::const_iterator it, itb, ite; 
     2917    std::vector<ETranformationType> thisTransType, objTransType; 
     2918    for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 
     2919      thisTransType.push_back(it->first); 
     2920    for (it = objTrans.begin(); it != objTrans.end(); ++it) 
     2921      objTransType.push_back(it->first); 
     2922 
     2923    if (thisTransType.size() != objTransType.size()) return false; 
     2924    for (int idx = 0; idx < thisTransType.size(); ++idx) 
     2925      objEqual &= (thisTransType[idx] == objTransType[idx]); 
     2926 
     2927    return objEqual; 
    27442928  } 
    27452929 
  • XIOS/dev/dev_olga/src/node/domain.hpp

    r1144 r1158  
    4242      , public CDomainAttributes 
    4343   { 
    44                /// typedef /// 
    45          typedef CObjectTemplate<CDomain>   SuperClass; 
    46          typedef CDomainAttributes SuperClassAttribute; 
    47           
    48       public : 
     44     /// typedef /// 
     45     typedef CObjectTemplate<CDomain>   SuperClass; 
     46     typedef CDomainAttributes SuperClassAttribute; 
     47     public: 
    4948         enum EEventId 
    5049         { 
     
    9190         CTransformation<CDomain>* addTransformation(ETranformationType transType, const StdString& id=""); 
    9291 
    93       public:          
     92      public: 
     93         const std::set<StdString> & getRelFiles(void) const; 
    9494         bool IsWritten(const StdString & filename) const; 
    9595         bool isWrittenCompressed(const StdString& filename) const; 
     
    116116         vector< vector<int> > i_indSrv ; // for each server, i global index to send 
    117117         vector< vector<int> > j_indSrv ; // for each server, j global index to send 
    118  
     118         std::vector<int> getNbGlob(); 
     119         bool isEqual(CDomain* domain); 
    119120      public: 
    120121         /// Mutateur /// 
     
    130131         void fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 
    131132                                           CArray<double,2>& boundsLon, CArray<double,2>& boundsLat); 
    132          void fillInRectilinearLonLat(); 
     133          
     134         void fillInLonLat(); 
     135         bool distributionAttributesHaveValue() const; 
    133136 
    134137         static bool dispatchEvent(CEventServer& event); 
     
    157160         static StdString GetName(void); 
    158161         static StdString GetDefName(void); 
    159          static ENodeType GetType(void);    
    160  
     162 
     163         static ENodeType GetType(void); 
     164         const std::map<int, vector<size_t> >& getIndexServer() const; 
    161165         CArray<bool, 1> localMask; 
    162166         bool isCurvilinear ; 
     
    182186 
    183187         void setTransformations(const TransMapTypes&);          
    184  
     188         void computeNGlobDomain(); 
    185189         void sendAttributes(); 
    186190         void sendIndex(); 
     
    192196         void sendDataIndex(); 
    193197         void convertLonLatValue(); 
    194  
     198         void fillInRectilinearLonLat(); 
     199         void fillInCurvilinearLonLat(); 
     200         void fillInUnstructuredLonLat(); 
    195201       private:          
    196202         bool doZoomByIndex_; 
  • XIOS/dev/dev_olga/src/node/expand_domain.cpp

    r941 r1158  
    3838  void CExpandDomain::checkValid(CDomain* domainDst) 
    3939  { 
    40     if (CDomain::type_attr::unstructured != domainDst->type) 
    41     { 
    42       ERROR("CExpandDomain::checkValid(CDomain* domainDst)", 
    43             << "Domain extension is only supported for unstructured" << std::endl 
    44             << "Check type of domain destination, id = " << domainDst->getId()); 
    45     } 
     40    // if (CDomain::type_attr::unstructured != domainDst->type) 
     41    // { 
     42    //   ERROR("CExpandDomain::checkValid(CDomain* domainDst)", 
     43    //         << "Domain extension is only supported for unstructured" << std::endl 
     44    //         << "Check type of domain destination, id = " << domainDst->getId()); 
     45    // } 
    4646 
    4747    if (this->type.isEmpty()) this->type.setValue(CExpandDomain::type_attr::edge); 
  • XIOS/dev/dev_olga/src/node/field.cpp

    r1144 r1158  
    3838      , areAllReferenceSolved(false), isReferenceSolved(false), isReferenceSolvedAndTransformed(false) 
    3939      , useCompressedOutput(false) 
     40      , hasTimeInstant(false) 
     41      , hasTimeCentered(false) 
    4042      , wasDataAlreadyReceivedFromServer(false) 
     43      , isEOF(false) 
    4144   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 
    4245 
     
    5053      , areAllReferenceSolved(false), isReferenceSolved(false), isReferenceSolvedAndTransformed(false) 
    5154      , useCompressedOutput(false) 
     55      , hasTimeInstant(false) 
     56      , hasTimeCentered(false) 
    5257      , wasDataAlreadyReceivedFromServer(false) 
     58      , isEOF(false) 
    5359   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 
    5460 
     
    122128  void CField::sendUpdateData(const CArray<double,1>& data) 
    123129  { 
    124     CTimer::get("XIOS Send Data").resume(); 
     130    CTimer::get("Field : send data").resume(); 
    125131 
    126132    CContext* context = CContext::getCurrent(); 
     
    174180      }     
    175181 
    176     CTimer::get("XIOS Send Data").suspend(); 
     182    CTimer::get("Field : send data").suspend(); 
    177183  } 
    178184 
     
    183189    list<CEventServer::SSubEvent>::iterator it; 
    184190    string fieldId; 
    185  
     191    CTimer::get("Field : recv data").resume(); 
    186192    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it) 
    187193    { 
     
    192198    } 
    193199    get(fieldId)->recvUpdateData(rankBuffers); 
     200    CTimer::get("Field : recv data").suspend(); 
    194201  } 
    195202 
     
    252259    } 
    253260  } 
    254    
    255 //   void  CField::recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers) 
    256 //   { 
    257 //     CContext* context = CContext::getCurrent(); 
    258  
    259 //     if (data_srv.empty()) 
    260 //     { 
    261 //       for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it) 
    262 //       { 
    263 //         int rank = it->first; 
    264 //         data_srv.insert(std::make_pair(rank, CArray<double,1>(it->second.numElements()))); 
    265 //         foperation_srv.insert(pair<int,boost::shared_ptr<func::CFunctor> >(rank,boost::shared_ptr<func::CFunctor>(new func::CInstant(data_srv[rank])))); 
    266 //       } 
    267 //     } 
    268  
    269 //     const CDate& currDate = context->getCalendar()->getCurrentDate(); 
    270 //     const CDate opeDate      = last_operation_srv +freq_op + freq_operation_srv - freq_op; 
    271 //     const CDate writeDate    = last_Write_srv     + freq_write_srv; 
    272  
    273 //     if (opeDate <= currDate) 
    274 //     { 
    275 //       for (int n = 0; n < ranks.size(); n++) 
    276 //       { 
    277 //         CArray<double,1> data_tmp; 
    278 //         *buffers[n] >> data_tmp; 
    279 //         (*foperation_srv[ranks[n]])(data_tmp); 
    280 //       } 
    281 //       last_operation_srv = currDate; 
    282 //     } 
    283  
    284 //     if (writeDate < (currDate + freq_operation_srv)) 
    285 //     { 
    286 //       for (int n = 0; n < ranks.size(); n++) 
    287 //       { 
    288 //         this->foperation_srv[ranks[n]]->final(); 
    289 //       } 
    290  
    291 //       last_Write_srv = writeDate; 
    292 //     } 
    293  
    294 //     if (context->hasClient && context->hasServer) 
    295 //     { 
    296 //       size_t writtenSize; 
    297 // //      if (field->getUseCompressedOutput()) 
    298 // //        writtenSize = grid->getNumberWrittenIndexes(); 
    299 // //      else 
    300 //         writtenSize = grid->getWrittenDataSize(); 
    301  
    302 //       CArray<double,1> fieldData(writtenSize); 
    303 // //      if (!field->default_value.isEmpty()) fieldData = field->default_value; 
    304  
    305 // //      if (field->getUseCompressedOutput()) 
    306 // //        field->outputCompressedField(fieldData); 
    307 // //      else 
    308 //         this->outputField(fieldData); 
    309 //       sendUpdateData(fieldData); 
    310 //     } 
    311 //     if (!context->hasClient && context->hasServer) 
    312 //     { 
    313 //       writeField(); 
    314 //     } 
    315  
    316 //     lastlast_Write_srv = last_Write_srv; 
    317  
    318 //   } 
    319261 
    320262  void CField::writeField(void) 
     
    331273  } 
    332274 
    333   void CField::sendReadDataRequest(const CDate& tsDataRequested) 
     275  bool CField::sendReadDataRequest(const CDate& tsDataRequested) 
    334276  { 
    335277    CContext* context = CContext::getCurrent(); 
     
    339281    lastDataRequestedFromServer = tsDataRequested; 
    340282 
    341     CEventClient event(getType(), EVENT_ID_READ_DATA); 
    342     if (client->isServerLeader()) 
     283    if (!isEOF) // No need to send the request if we already know we are at EOF 
    343284    { 
    344       CMessage msg; 
    345       msg << getId(); 
    346       const std::list<int>& ranks = client->getRanksServerLeader(); 
    347       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    348         event.push(*itRank, 1, msg); 
    349       client->sendEvent(event); 
    350     } 
    351     else client->sendEvent(event); 
     285      CEventClient event(getType(), EVENT_ID_READ_DATA); 
     286      if (client->isServerLeader()) 
     287      { 
     288        CMessage msg; 
     289        msg << getId(); 
     290        const std::list<int>& ranks = client->getRanksServerLeader(); 
     291        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
     292          event.push(*itRank, 1, msg); 
     293        client->sendEvent(event); 
     294      } 
     295      else client->sendEvent(event); 
     296    } 
     297    else 
     298      serverSourceFilter->signalEndOfStream(tsDataRequested); 
     299 
     300    return !isEOF; 
    352301  } 
    353302 
     
    361310 
    362311    bool dataRequested = false; 
     312 
    363313    while (currentDate >= lastDataRequestedFromServer) 
    364314    { 
     
    368318      info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 
    369319 
    370       sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 
    371  
    372       dataRequested = true; 
    373     } 
     320      dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 
     321    } 
     322 
    374323    return dataRequested; 
    375324  } 
     
    386335  { 
    387336    CContext* context = CContext::getCurrent(); 
    388     CContextClient* client = context->client;     
     337    CContextClient* client = context->client; 
    389338 
    390339    CEventClient event(getType(), EVENT_ID_READ_DATA_READY); 
     
    393342    bool hasData = readField(); 
    394343 
    395      
     344    map<int, CArray<double,1> >::iterator it; 
    396345    if (!grid->doGridHaveDataDistributed()) 
    397346    { 
     
    413362            } 
    414363          } 
    415  
    416364          client->sendEvent(event); 
    417365       } 
     
    500448    std::map<int, CArray<double,1> > data; 
    501449 
    502     bool isEOF = false; 
    503  
    504450    for (int i = 0; i < ranks.size(); i++) 
    505451    { 
     
    585531   //---------------------------------------------------------------- 
    586532 
    587    bool CField::isActive(void) const 
    588    { 
    589       return (instantDataFilter != NULL); 
     533   bool CField::isActive(bool atCurrentTimestep /*= false*/) const 
     534   { 
     535      if (clientSourceFilter) 
     536        return atCurrentTimestep ? clientSourceFilter->isDataExpected(CContext::getCurrent()->getCalendar()->getCurrentDate()) : true; 
     537      else if (storeFilter) 
     538        return true; 
     539      else if (instantDataFilter) 
     540        ERROR("bool CField::isActive(bool atCurrentTimestep)", 
     541              << "Impossible to check if field [ id = " << getId() << " ] is active as it cannot be used to receive nor send data."); 
     542 
     543      return false; 
    590544   } 
    591545 
     
    815769          if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false); 
    816770        } 
    817        else if (context->hasServer)         
     771        else if (context->hasServer) 
    818772          solveServerOperation(); 
    819773 
     
    940894       { 
    941895         // Check if we have an expression to parse 
    942        if (hasExpression()) 
     896         if (hasExpression()) 
    943897         { 
    944          boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 
    945          boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 
    946  
    947          // Check if a spatial transformation is needed 
    948          if (!field_ref.isEmpty()) 
    949          { 
    950            CGrid* gridRef = CField::get(field_ref)->grid; 
    951  
    952            if (grid && grid != gridRef && grid->hasTransform()) 
     898           boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 
     899           boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 
     900 
     901           // Check if a spatial transformation is needed 
     902           if (!field_ref.isEmpty()) 
    953903           { 
    954              double defaultValue = !default_value.isEmpty() ? default_value : 0.0; 
    955              std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, defaultValue); 
    956  
    957              filter->connectOutput(filters.first, 0); 
    958              filter = filters.second; 
     904             CGrid* gridRef = CField::get(field_ref)->grid; 
     905 
     906             if (grid && grid != gridRef && grid->hasTransform()) 
     907             { 
     908               bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     909               double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
     910               std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 
     911 
     912               filter->connectOutput(filters.first, 0); 
     913               filter = filters.second; 
     914             } 
    959915           } 
    960          } 
    961  
    962          instantDataFilter = filter; 
     916 
     917           instantDataFilter = filter; 
    963918         } 
    964919         // Check if we have a reference on another field 
     
    967922         // Check if the data is to be read from a file 
    968923         else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
    969          instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    970                                                                                                      freq_offset.isEmpty() ? NoneDu : freq_offset, 
    971                                                                                                      true)); 
     924           instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
     925                                                                                                       freq_offset.isEmpty() ? NoneDu : freq_offset, 
     926                                                                                                       true)); 
    972927         else // The data might be passed from the model 
    973          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid)); 
    974        } 
    975  
    976        // If the field data is to be read by the client or/and written to a file 
    977        if (enableOutput && !storeFilter && !fileWriterFilter) 
    978        { 
    979          if (!read_access.isEmpty() && read_access) 
    980928         { 
    981            storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 
    982            instantDataFilter->connectOutput(storeFilter, 0); 
     929            bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     930            double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
     931            instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
     932                                                                                                        ignoreMissingValue, defaultValue)); 
    983933         } 
    984  
    985          if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 
    986          { 
    987            fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
    988            getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 
    989          } 
    990        } 
    991      } 
    992    } 
    993  
     934       } 
     935     } 
     936 
     937     // If the field data is to be read by the client or/and written to a file 
     938     if (enableOutput && !storeFilter && !fileWriterFilter) 
     939     { 
     940       if (!read_access.isEmpty() && read_access) 
     941       { 
     942         storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 
     943         instantDataFilter->connectOutput(storeFilter, 0); 
     944       } 
     945 
     946       if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 
     947       { 
     948         fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
     949         getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 
     950       } 
     951     } 
     952   } 
    994953 
    995954   /*! 
     
    1000959    * \return the output pin corresponding to the field reference 
    1001960    */ 
    1002      boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
    1003      { 
    1004        if (instantDataFilter || field_ref.isEmpty()) 
    1005          ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 
    1006                "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref."); 
    1007  
    1008        CField* fieldRef = CField::get(field_ref); 
    1009        fieldRef->buildFilterGraph(gc, false); 
    1010  
    1011        std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters; 
    1012        // Check if a spatial transformation is needed 
    1013        if (grid && grid != fieldRef->grid && grid->hasTransform()) 
    1014        { 
    1015          double defaultValue = !default_value.isEmpty() ? default_value : 0.0; 
    1016          filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue); 
    1017        } 
    1018        else 
    1019          filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
    1020  
    1021        fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 
    1022  
    1023        return filters.second; 
    1024      } 
     961   boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
     962   { 
     963     if (instantDataFilter || field_ref.isEmpty()) 
     964       ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 
     965             "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref."); 
     966 
     967     CField* fieldRef = CField::get(field_ref); 
     968     fieldRef->buildFilterGraph(gc, false); 
     969 
     970     std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters; 
     971     // Check if a spatial transformation is needed 
     972     if (grid && grid != fieldRef->grid && grid->hasTransform()) 
     973     {        
     974       bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     975       double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);                                 
     976       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue); 
     977     } 
     978     else 
     979       filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
     980 
     981     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 
     982 
     983     return filters.second; 
     984   } 
    1025985 
    1026986   /*! 
     
    10581018       { 
    10591019         if (!clientSourceFilter) 
    1060            clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid)); 
     1020         { 
     1021           bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     1022           double defaultValue  = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);  
     1023           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
     1024                                                                                   ignoreMissingValue, defaultValue)); 
     1025         } 
    10611026 
    10621027         selfReferenceFilter = clientSourceFilter; 
     
    11041069     return it->second; 
    11051070   } 
     1071 
     1072  /*! 
     1073    * Returns the temporal filter corresponding to the field's temporal operation 
     1074    * for the specified operation frequency. 
     1075    * 
     1076    * \param gc the garbage collector to use 
     1077    * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed 
     1078    * \return the output pin corresponding to the requested temporal filter 
     1079    */ 
     1080    
     1081   boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1082   { 
     1083     if (instantDataFilter || !hasExpression()) 
     1084       ERROR("COutputPin* CField::getSelfTemporalDataFilter(CGarbageCollector& gc)", 
     1085             "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); 
     1086 
     1087     if (!selfReferenceFilter) getSelfReference(gc) ; 
     1088 
     1089     if (serverSourceFilter || clientSourceFilter) 
     1090     { 
     1091       if (operation.isEmpty()) 
     1092         ERROR("void CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)", 
     1093               << "An operation must be defined for field \"" << getId() << "\"."); 
     1094 
     1095       if (freq_op.isEmpty()) freq_op.setValue(TimeStep); 
     1096       if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 
     1097 
     1098       const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     1099 
     1100       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
     1101                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     1102                                                                             freq_op, freq_offset, outFreq, 
     1103                                                                             ignoreMissingValue, ignoreMissingValue ? default_value : 0.0)); 
     1104       selfReferenceFilter->connectOutput(temporalFilter, 0); 
     1105       return temporalFilter ; 
     1106     } 
     1107     else if (!field_ref.isEmpty()) 
     1108     { 
     1109       CField* fieldRef = CField::get(field_ref); 
     1110       fieldRef->buildFilterGraph(gc, false);  
     1111       return fieldRef->getTemporalDataFilter(gc, outFreq) ; 
     1112     } 
     1113  } 
    11061114 
    11071115   //---------------------------------------------------------------- 
  • XIOS/dev/dev_olga/src/node/field.hpp

    r1144 r1158  
    9999 
    100100       public: 
    101          bool isActive(void) const; 
     101         bool isActive(bool atCurrentTimestep = false) const; 
    102102         bool hasOutputFile; 
    103103 
     
    150150        void recvUpdateData(std::map<int,CBufferIn*>& rankBuffers); 
    151151        void writeField(void); 
    152         void sendReadDataRequest(const CDate& tsDataRequested); 
     152        bool sendReadDataRequest(const CDate& tsDataRequested); 
    153153        bool sendReadDataRequestIfNeeded(void); 
    154154        static void recvReadDataRequest(CEventServer& event); 
     
    157157        static void recvReadDataReady(CEventServer& event); 
    158158        void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers); 
     159        void outputField(CArray<double,3>& fieldOut); 
     160        void outputField(CArray<double,2>& fieldOut); 
    159161        void outputField(CArray<double,1>& fieldOut); 
     162        void inputField(CArray<double,3>& fieldOut); 
     163        void inputField(CArray<double,2>& fieldOut); 
    160164        void inputField(CArray<double,1>& fieldOut); 
    161165        void outputCompressedField(CArray<double, 1>& fieldOut); 
     
    240244         //! The terminal filter which stores the instant data 
    241245         boost::shared_ptr<CStoreFilter> storeFilter; 
    242          //! The terminal filter which sends the data to file 
     246         //! The terminal filter which writes the data to file 
    243247         boost::shared_ptr<CFileWriterFilter> fileWriterFilter; 
    244248         //! The terminal filter which writes data to file 
  • XIOS/dev/dev_olga/src/node/file.cpp

    r1144 r1158  
    1414#include "type.hpp" 
    1515#include "xios_spl.hpp" 
     16#include "context_client.hpp" 
    1617#include "mpi.hpp" 
     18#include "timer.hpp" 
    1719 
    1820namespace xios { 
     
    4951   //---------------------------------------------------------------- 
    5052 
    51    const StdString& CFile::getFileOutputName(void) const 
    52    { 
    53      return name.isEmpty() ? getId() : name; 
     53   const StdString CFile::getFileOutputName(void) const 
     54   { 
     55     return (name.isEmpty() ? getId() : name) + (name_suffix.isEmpty() ? StdString("") :  name_suffix.getValue()); 
    5456   } 
    5557 
     
    215217      if (!split_freq.isEmpty()) 
    216218      { 
    217         if (context->registryIn->foundKey("splitStart") && context->registryIn->foundKey("splitEnd")) 
     219        StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ;  
     220        if (context->registryIn->foundKey(keySuffix+"splitStart") && context->registryIn->foundKey(keySuffix+"splitEnd")) 
    218221        { 
    219222          CDate savedSplitStart(*context->getCalendar()), savedSplitEnd(*context->getCalendar()); 
    220           context->registryIn->getKey("splitStart", savedSplitStart); 
    221           context->registryIn->getKey("splitEnd",   savedSplitEnd); 
     223          context->registryIn->getKey(keySuffix+"splitStart", savedSplitStart); 
     224          context->registryIn->getKey(keySuffix+"splitEnd",   savedSplitEnd); 
    222225 
    223226          if (savedSplitStart <= lastSplit && lastSplit <= savedSplitEnd) 
     
    234237      const int recordOffset = record_offset.isEmpty() ? 0 : record_offset; 
    235238 
    236 //      set<CAxis*> setAxis; 
    237 //      set<CDomain*> setDomains; 
    238239      set<StdString> setAxis; 
    239240      set<StdString> setDomains; 
     
    263264      if (allDomainEmpty) MPI_Comm_free(&fileComm); 
    264265 
    265       if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 
     266      // if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 
    266267      if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    267268    } 
     
    281282        if (mode.isEmpty() || mode.getValue() == mode_attr::write) 
    282283        { 
     284          CTimer::get("Files : create headers").resume(); 
    283285          if (!isOpen) createHeader(); 
     286          CTimer::get("Files : create headers").suspend(); 
    284287          checkSync(); 
    285288        }         
     
    303306        if (!mode.isEmpty() && mode.getValue() == mode_attr::read) 
    304307        { 
     308          CTimer::get("Files : open headers").resume(); 
    305309          if (!isOpen) openInReadMode(&(context->server->intraComm)); 
     310          CTimer::get("Files : open headers").suspend(); 
    306311        } 
    307312        //checkSplit(); // Really need for reading? 
     
    374379      { 
    375380         StdString filename = getFileOutputName(); 
    376          if (!name_suffix.isEmpty()) filename+=name_suffix.getValue(); 
    377381 
    378382// determine splitting format in the file name  : firstPart%start_date%middlePart%end_date%lastPart 
     
    441445           oss << lastPart ; 
    442446 
    443            context->registryOut->setKey("splitStart", lastSplit); 
    444            context->registryOut->setKey("splitEnd",   splitEnd); 
     447           StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ;  
     448           context->registryOut->setKey(keySuffix+"splitStart", lastSplit); 
     449           context->registryOut->setKey(keySuffix+"splitEnd",   splitEnd); 
    445450         } 
    446451         else oss<<firstPart<<lastPart ; 
     
    489494         if (isOpen) data_out->closeFile(); 
    490495 
    491         data_out = shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), append, useClassicFormat, useCFConvention, 
     496        data_out = shared_ptr<CDataOutput>(new CNc4DataOutput(this, oss.str(), append, useClassicFormat, useCFConvention, 
    492497                                                              fileComm, multifile, isCollective, time_counter_name)); 
    493498        isOpen = true; 
     
    509514          { 
    510515            CField* field = *it; 
     516            this->data_out->writeFieldTimeAxis(field); 
     517          } 
     518           
     519          for (it = this->enabledFields.begin(); it != end; it++) 
     520          { 
     521            CField* field = *it; 
    511522            this->data_out->writeField(field); 
    512523          } 
     
    517528 
    518529          this->data_out->definition_end(); 
     530        } 
     531        else 
     532        { 
     533          // check time axis even in append mode 
     534          std::vector<CField*>::iterator it, end = this->enabledFields.end(); 
     535          for (it = this->enabledFields.begin(); it != end; it++) 
     536          { 
     537            CField* field = *it; 
     538            this->data_out->writeFieldTimeAxis(field); 
     539          } 
    519540        } 
    520541      } 
     
    535556      StdOStringStream oss; 
    536557      oss << filename; 
    537       if (!name_suffix.isEmpty()) oss << name_suffix.getValue(); 
    538558 
    539559      if (!split_freq.isEmpty()) 
     
    872892   } 
    873893 
    874  
    875894   /*! 
    876895   \brief Send a message to create a field on server side 
  • XIOS/dev/dev_olga/src/node/file.hpp

    r1144 r1158  
    7070      public: 
    7171         /// Accesseurs /// 
    72          const StdString& getFileOutputName(void) const; 
     72         const StdString getFileOutputName(void) const; 
    7373         boost::shared_ptr<CDataOutput> getDataOutput(void) const; 
    7474         boost::shared_ptr<CDataInput> getDataInput(void) const; 
  • XIOS/dev/dev_olga/src/node/grid.cpp

    r1144 r1158  
    3131      , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 
    3232      , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 
    33       , globalDim_(), connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 
     33      , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 
    3434      , transformations_(0), isTransformed_(false) 
    35       , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 
     35      , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 
    3636      , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 
    3737      , computedWrittenIndex_(false) 
     
    5050      , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 
    5151      , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 
    52       , globalDim_(), connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 
     52      , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 
    5353      , transformations_(0), isTransformed_(false) 
    54       , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 
     54      , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 
    5555      , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 
    5656      , computedWrittenIndex_(false) 
     
    7676 
    7777 
    78    StdSize CGrid::getDimension(void) const 
    79    { 
    80       return globalDim_.size(); 
     78   StdSize CGrid::getDimension(void) 
     79   { 
     80      return getGlobalDimension().size(); 
    8181   } 
    8282 
     
    196196        for (int i = 0; i < axisListP.size(); ++i) 
    197197        { 
    198           axisListP[i]->checkAttributesOnClientAfterTransformation(globalDim_,axisPositionInGrid_[i]); 
     198          axisListP[i]->checkAttributesOnClientAfterTransformation(getGlobalDimension(),axisPositionInGrid_[i]); 
    199199        } 
    200200      } 
     
    243243     this->solveScalarRef(areAttributesChecked); 
    244244     this->solveAxisRef(areAttributesChecked); 
    245      this->solveDomainRef(areAttributesChecked); 
    246      computeGridGlobalDimension(getDomains(), getAxis(), getScalars(), axis_domain_order); 
     245     this->solveDomainRef(areAttributesChecked);      
    247246     this->isDomainAxisChecked = areAttributesChecked; 
    248247   } 
     
    311310            {sendIndex(); this->isIndexSent = true;} 
    312311       } 
     312 
     313       // Not sure about this 
     314       //if (!(this->hasTransform() && !this->isTransformed())) 
     315       // this->isChecked = true; 
     316       //return; 
    313317     } 
    314318     
     
    409413      using namespace std; 
    410414      std::vector<CDomain*> domainP = this->getDomains(); 
    411       std::vector<CAxis*> axisP = this->getAxis();       
     415      std::vector<CAxis*> axisP = this->getAxis(); 
    412416      int dim = domainP.size() * 2 + axisP.size(); 
    413417 
     
    512516        { 
    513517          if (sendAtt) 
    514             axisListP[i]->sendCheckedAttributes(globalDim_,axisPositionInGrid_[i]); 
     518            axisListP[i]->sendCheckedAttributes(getGlobalDimension(),axisPositionInGrid_[i]); 
    515519          else 
    516520            axisListP[i]->checkAttributesOnClient(); 
     
    534538        } 
    535539      } 
     540   } 
     541   std::vector<int> CGrid::getAxisPositionInGrid() const 
     542   { 
     543     return axisPositionInGrid_; 
    536544   } 
    537545 
     
    652660              }               
    653661            } 
    654  
    655  
    656662          }           
    657663        } 
     
    695701       // Compute mapping between client and server 
    696702       std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement; 
    697        CServerDistributionDescription serverDistributionDescription(globalDim_, client->serverSize); 
     703       CServerDistributionDescription serverDistributionDescription(getGlobalDimension(), client->serverSize); 
    698704       serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement, 
    699705                                                                  client->clientRank, 
     
    933939        } 
    934940      } 
    935      } 
     941    } 
    936942   } 
    937943   //---------------------------------------------------------------- 
     
    11221128   } 
    11231129 
     1130/* 
     1131   void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field) 
     1132   { 
     1133     const CArray<size_t,1>& out_i = outIndexFromClient[rank]; 
     1134     StdSize numElements = stored.numElements(); 
     1135     for (StdSize n = 0; n < numElements; ++n) 
     1136     { 
     1137       field[out_i(n)] = stored(n); 
     1138     } 
     1139   } 
     1140 
     1141   void CGrid::inputField(int rank, const double* const field, CArray<double,1>& stored) 
     1142   { 
     1143     const CArray<size_t,1>& out_i = outIndexFromClient[rank]; 
     1144     StdSize numElements = stored.numElements(); 
     1145     for (StdSize n = 0; n < numElements; ++n) 
     1146     { 
     1147       stored(n) = field[out_i(n)]; 
     1148     } 
     1149   } 
     1150 
     1151   void CGrid::outputCompressedField(int rank, const CArray<double,1>& stored, double* field) 
     1152   { 
     1153     const CArray<size_t,1>& out_i = compressedOutIndexFromClient[rank]; 
     1154     StdSize numElements = stored.numElements(); 
     1155     for (StdSize n = 0; n < numElements; ++n) 
     1156     { 
     1157       field[out_i(n)] = stored(n); 
     1158     } 
     1159   } 
     1160*/ 
     1161   //---------------------------------------------------------------- 
     1162 
    11241163   void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 
    11251164   { 
     
    11701209  { 
    11711210    CContext* context = CContext::getCurrent(); 
    1172     // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 
    11731211    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 
    11741212    for (int p = 0; p < nbSrvPools; ++p) 
     
    15381576  } 
    15391577 
    1540   void CGrid::computeGridGlobalDimension(const std::vector<CDomain*>& domains, 
    1541                                          const std::vector<CAxis*>& axis, 
    1542                                          const std::vector<CScalar*>& scalars, 
    1543                                          const CArray<int,1>& axisDomainOrder) 
    1544   { 
    1545     globalDim_.resize(domains.size()*2+axis.size()+scalars.size()); 
     1578  /* 
     1579     Compute on the fly the global dimension of a grid with its elements 
     1580     \param[in/out] globalDim global dimension of grid 
     1581     \param[in] domains list of its domains 
     1582     \param[in] axiss list of its axis 
     1583     \param[in] scalars list of its scalars 
     1584     \param[in] axisDomainOrder the order of element in a grid (e.g: scalar then axis) 
     1585     \return The dimension of which we do distribution (often for server) 
     1586  */ 
     1587  int CGrid::computeGridGlobalDimension(std::vector<int>& globalDim, 
     1588                                        const std::vector<CDomain*> domains, 
     1589                                        const std::vector<CAxis*> axis, 
     1590                                        const std::vector<CScalar*> scalars, 
     1591                                        const CArray<int,1>& axisDomainOrder) 
     1592  { 
     1593    globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
     1594    int positionDimensionDistributed = 1; 
    15461595    int idx = 0, idxDomain = 0, idxAxis = 0, idxScalar = 0; 
    15471596    for (int i = 0; i < axisDomainOrder.numElements(); ++i) 
     
    15511600        if (!(domains[idxDomain]->type.isEmpty()) && (domains[idxDomain]->type==CDomain::type_attr::unstructured)) 
    15521601        { 
    1553           positionDimensionDistributed_ = idx; 
     1602          positionDimensionDistributed = idx; 
    15541603        } 
    15551604        else 
    15561605        { 
    1557           positionDimensionDistributed_ = idx +1; 
    1558         } 
    1559  
    1560         globalDim_[idx]   = domains[idxDomain]->ni_glo.getValue(); 
    1561         globalDim_[idx+1] = domains[idxDomain]->nj_glo.getValue(); 
     1606          positionDimensionDistributed = idx +1; 
     1607        } 
     1608 
     1609        globalDim[idx]   = domains[idxDomain]->ni_glo.getValue(); 
     1610        globalDim[idx+1] = domains[idxDomain]->nj_glo.getValue(); 
    15621611 
    15631612        ++idxDomain; 
     
    15661615      else if (1 == axisDomainOrder(i)) 
    15671616      { 
    1568         globalDim_[idx] = axis[idxAxis]->n_glo.getValue(); 
     1617        globalDim[idx] = axis[idxAxis]->n_glo.getValue(); 
    15691618        ++idxAxis; 
    15701619        ++idx; 
     
    15721621      else 
    15731622      { 
    1574         globalDim_[idx] = 1; 
     1623        globalDim[idx] = 1; 
    15751624        ++idxScalar; 
    15761625        ++idx; 
    15771626      } 
    15781627    } 
    1579   } 
    1580  
     1628 
     1629    return positionDimensionDistributed; 
     1630  } 
     1631 
     1632  // Retrieve the global dimension of grid 
    15811633  std::vector<int> CGrid::getGlobalDimension() 
    15821634  { 
    1583     return globalDim_; 
     1635    std::vector<int> globalDim; 
     1636    computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 
     1637 
     1638    return globalDim; 
     1639  } 
     1640 
     1641  // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 
     1642  int CGrid::getDistributedDimension() 
     1643  { 
     1644    std::vector<int> globalDim; 
     1645    return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order);     
    15841646  } 
    15851647 
  • XIOS/dev/dev_olga/src/node/grid.hpp

    r1144 r1158  
    8787 
    8888         /// Accesseurs /// 
    89          StdSize getDimension(void) const; 
     89         StdSize getDimension(void); 
    9090 
    9191         StdSize  getDataSize(void) const; 
     
    176176         std::vector<int> getGlobalDimension(); 
    177177         bool isScalarGrid() const; 
     178         std::vector<int> getAxisPositionInGrid() const; 
    178179 
    179180         bool doGridHaveDataToWrite(); 
     
    268269        void computeIndexByElement(const std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement, 
    269270                                   CClientServerMapping::GlobalIndexMap& globalIndexOnServer); 
     271        int computeGridGlobalDimension(std::vector<int>& globalDim, 
     272                                       const std::vector<CDomain*> domains, 
     273                                       const std::vector<CAxis*> axis, 
     274                                       const std::vector<CScalar*> scalars, 
     275                                       const CArray<int,1>& axisDomainOrder); 
     276        int getDistributedDimension(); 
    270277 
    271278        void computeClientIndex(); 
     
    296303        std::vector<int> axisPositionInGrid_; 
    297304        CGridTransformation* transformations_; 
    298         bool hasDomainAxisBaseRef_; 
    299         std::vector<int> globalDim_; 
     305        bool hasDomainAxisBaseRef_;         
    300306        std::map<CGrid*, std::pair<bool,StdString> > gridSrc_; 
    301307        bool hasTransform_; 
  • XIOS/dev/dev_olga/src/node/interpolate_domain.cpp

    r1021 r1158  
    5555    { 
    5656      case mode_attr::read: 
    57         if (this->file.isEmpty()) 
     57        if (this->weight_filename.isEmpty()) 
    5858        { 
    5959          if (!this->write_weight) 
     
    6464        else 
    6565        { 
    66           weightFile = this->file; 
     66          weightFile = this->weight_filename; 
    6767          ifstream f(weightFile.c_str()); 
    6868          if (!f.good()) 
     
    7575        break; 
    7676      case mode_attr::read_or_compute: 
    77         if (!this->file.isEmpty() && !this->write_weight) 
     77        if (!this->weight_filename.isEmpty() && !this->write_weight) 
    7878        { 
    79           weightFile = this->file; 
     79          weightFile = this->weight_filename; 
    8080          ifstream f(weightFile.c_str()); 
    8181          if (!f.good()) 
  • XIOS/dev/dev_olga/src/node/mesh.cpp

    r946 r1158  
    1111/// ////////////////////// Définitions ////////////////////// /// 
    1212 
    13   CMesh::CMesh(void) :  nbNodesGlo{0}, nbEdgesGlo{0} 
    14             ,  node_start{0}, node_count{0} 
    15             ,  edge_start{0}, edge_count{0} 
    16             ,  nbFaces_{0}, nbNodes_{0}, nbEdges_{0} 
    17             ,  nodesAreWritten{false}, edgesAreWritten{false}, facesAreWritten{false} 
     13  CMesh::CMesh(void) :  nbNodesGlo(0), nbEdgesGlo(0) 
     14            ,  node_start(0), node_count(0) 
     15            ,  edge_start(0), edge_count(0) 
     16            ,  nbFaces_(0), nbNodes_(0), nbEdges_(0) 
     17            ,  nodesAreWritten(false), edgesAreWritten(false), facesAreWritten(false) 
    1818            ,  node_lon(), node_lat() 
    1919            ,  edge_lon(), edge_lat(), edge_nodes() 
    2020            ,  face_lon(), face_lat() 
    2121            ,  face_nodes() 
    22             ,  pNodeGlobalIndex{NULL}, pEdgeGlobalIndex{NULL} 
     22            ,  pNodeGlobalIndex(NULL), pEdgeGlobalIndex(NULL) 
    2323  { 
    2424  } 
     
    9191      seed ^= sizetHash(first) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 
    9292    } 
    93     return seed ; 
    94   } 
    95  
    96 ///---------------------------------------------------------------- 
    97 /*! 
    98  * \fn size_t generateEdgeIndex(size_t first, size_t second, int rank) 
    99  * Generates an edge index. 
    100  * If the same edge is generated by two processes, each process will have its own edge index. 
    101  * \param [in] first Edge node. 
    102  * \param [in] second Edge node. 
    103  * \param [in] rank MPI process rank. 
    104  */ 
    105   size_t generateEdgeIndex(size_t first, size_t second, int rank) 
    106   { 
    107     size_t seed = rank ; 
    108     if (first < second) 
    109     { 
    110       seed = hashPair(seed, first); 
    111       seed = hashPair(seed, second); 
    112     } 
    113     else 
    114     { 
    115       seed = hashPair(seed, second); 
    116       seed = hashPair(seed, first); 
    117     } 
    118  
    11993    return seed ; 
    12094  } 
     
    141115    return seed ; 
    142116  } 
     117 
     118  ///---------------------------------------------------------------- 
     119  /*! 
     120   * \fn size_t generateNodeIndex(vector<size_t>& valList) 
     121   * Generates a node index unique for all processes. 
     122   * \param [in] valList Vector storing four node hashes. 
     123   */ 
     124    size_t generateNodeIndex(vector<size_t>& valList) 
     125    { 
     126      // Sort is needed to avoid problems for nodes with lon = 0 generated by faces in east and west semisphere 
     127      vector<size_t> vec = valList; 
     128      sort (vec.begin(), vec.end()); 
     129      size_t seed = vec[0] ; 
     130      int it = 1; 
     131      for(; it != vec.size(); ++it) 
     132      { 
     133         seed = hashPair(seed, vec[it]); 
     134      } 
     135      return seed ; 
     136    } 
     137 
    143138 
    144139///---------------------------------------------------------------- 
     
    600595        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2Idx; 
    601596        CArray<size_t,1> nodeHashList(nbEdges_*nvertex*4); 
     597        int nbHash = 0; 
    602598        for (int ne = 0; ne < nbEdges_; ++ne) 
    603599        { 
     
    609605              if (nodeHash2Idx[hashValues[nh]].size() == 0) 
    610606              { 
    611                 nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues, mpiRank)); 
     607                nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues)); 
    612608                nodeHash2Idx[hashValues[nh]].push_back(mpiRank); 
     609                nodeHashList(nbHash) = hashValues[nh]; 
     610                ++nbHash; 
    613611              } 
    614               nodeHashList((ne*nvertex + nv)*4 + nh) = hashValues[nh]; 
    615             } 
    616           } 
    617         } 
     612            } 
     613          } 
     614        } 
     615        nodeHashList.resizeAndPreserve(nbHash); 
    618616 
    619617        // (2.2) Generating global node indexes 
    620         // The ownership criterion: priority of the process holding the smaller index 
     618        // The ownership criterion: priority of the process of smaller index 
    621619        // Maps generated in this step are: 
    622         // nodeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
    623         // nodeIdx2IdxMin = <idx, idxMin> 
    624         // nodeIdx2IdxGlo = <idxMin, idxMin> 
    625  
    626         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 
    627         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 
    628         CArray<size_t,1> nodeIdxMinList(nbEdges_*nvertex); 
    629  
    630         CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 
    631         dhtNodeHash.computeIndexInfoMapping(nodeHashList); 
    632         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 
    633         size_t iIdxMin = 0; 
    634  
    635         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 
    636         { 
    637           size_t idx = (it->second)[0]; 
    638           size_t idxMin = (it->second)[0]; 
    639           for (int i = 2; i < (it->second).size();) 
    640           { 
    641             if (mpiRank == (it->second)[i+1]) 
    642             { 
    643               idx = (it->second)[i]; 
    644             } 
    645             if ((it->second)[i] < idxMin) 
    646             { 
    647                 idxMin = (it->second)[i]; 
    648                 (it->second)[i] = (it->second)[i-2]; 
    649             } 
    650             i += 2; 
    651           } 
    652           (it->second)[0] = idxMin; 
    653           if (nodeIdx2IdxMin.count(idx) == 0) 
    654           { 
    655             nodeIdx2IdxMin[idx].push_back(idxMin); 
    656             if (idx == idxMin) 
    657               nodeIdx2IdxGlo[idxMin].push_back(idxMin); 
    658             nodeIdxMinList(iIdxMin) = idxMin; 
    659             ++iIdxMin; 
    660           } 
    661         } 
    662         nodeIdxMinList.resizeAndPreserve(iIdxMin); 
    663         CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 
    664         CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 
    665         dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 
    666         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
    667         // nodeIdx2IdxGlo holds global indexes only for nodes owned by a process 
    668         // nodeIdxMin2IdxGlo holds global indexes for all nodes generated by a process 
     620        // Maps generated in this step are: 
     621         // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 
     622         // nodeIdx2Idx = <idx, <rankOwner, idx>> 
     623 
     624         CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 
     625         dhtNodeHash.computeIndexInfoMapping(nodeHashList); 
     626         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 
     627 
     628 
     629         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 
     630         CArray<size_t,1> nodeIdxList(nbEdges_*nvertex*4); 
     631         size_t nIdx = 0; 
     632 
     633         for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 
     634         { 
     635           size_t rankMin = (it->second)[1]; 
     636           size_t idx = (it->second)[0]; 
     637           for (int i = 2; i < (it->second).size();) 
     638           { 
     639             if ( (it->second)[i+1] < rankMin) 
     640             { 
     641               idx = (it->second)[i]; 
     642               rankMin = (it->second)[i+1]; 
     643               (it->second)[i+1] = (it->second)[i-1]; 
     644             } 
     645             i += 2; 
     646           } 
     647           if (nodeIdx2Idx.count(idx) == 0) 
     648           { 
     649             if (mpiRank == rankMin) 
     650             { 
     651               nodeIdx2Idx[idx].push_back(rankMin); 
     652               nodeIdx2Idx[idx].push_back(idx); 
     653             } 
     654             nodeIdxList(nIdx) = idx; 
     655             ++nIdx; 
     656           } 
     657         } 
     658         nodeIdxList.resizeAndPreserve(nIdx); 
     659 
     660         // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 
     661         // Solution: global node indexing by hand. 
     662         // Maps modified in this step: 
     663         // nodeIdx2Idx = <idx, idxGlo> 
     664         int nodeCount = nodeIdx2Idx.size(); 
     665         int nodeStart, nbNodes; 
     666         MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     667         int nNodes = nodeStart; 
     668         MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
     669         nbNodesGlo = nNodes; 
     670 
     671         nodeStart -= nodeCount; 
     672         node_start = nodeStart; 
     673         node_count = nodeCount; 
     674         CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 
     675         size_t count = 0; 
     676 
     677         for (int ne = 0; ne < nbEdges_; ++ne) 
     678         { 
     679           for (int nv = 0; nv < nvertex; ++nv) 
     680           { 
     681             vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 
     682             size_t nodeIdx = generateNodeIndex(hashValues); 
     683             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 
     684             if (it != nodeIdx2Idx.end()) 
     685             { 
     686               if (dummyMap.count(nodeIdx) == 0) 
     687               { 
     688                 dummyMap[nodeIdx].push_back(nodeIdx); 
     689                 (it->second)[1] = node_start + count; 
     690                 ++count; 
     691               } 
     692             } 
     693           } 
     694         } 
     695 
     696         CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 
     697         dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 
     698         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
    669699 
    670700        // (2.3) Saving variables: node_lon, node_lat, edge_nodes 
    671701        // Creating map nodeHash2IdxGlo <hash, idxGlo> 
    672702        // Creating map edgeHash2IdxGlo <hash, idxGlo> 
    673         nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
    674         node_count = dhtNodeIdxGlo.getIndexCount(); 
    675         node_start = dhtNodeIdxGlo.getIndexStart(); 
     703//        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
     704//        node_count = dhtNodeIdxGlo.getIndexCount(); 
     705//        node_start = dhtNodeIdxGlo.getIndexStart(); 
    676706        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2IdxGlo; 
    677707        node_lon.resize(node_count); 
     
    685715          { 
    686716            hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 
    687             size_t myIdx = generateNodeIndex(hashValues, mpiRank); 
    688             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxMin.find(myIdx); 
    689             size_t ownerIdx = (itIdx->second)[0]; 
    690  
    691             if (myIdx == ownerIdx) 
    692             { 
    693               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdx2IdxGlo.find(myIdx); 
    694               idxGlo = (itIdxGlo->second)[0]; 
     717            size_t myIdx = generateNodeIndex(hashValues); 
     718            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxGlo.find(myIdx); 
     719            idxGlo = (itIdx->second)[1]; 
     720 
     721            if (mpiRank == (itIdx->second)[0]) 
     722            { 
    695723//              node_lon(idxGlo - node_start) = (bounds_lon(nv, ne) == 360.) ? (0.) : (bounds_lon(nv, ne)); 
    696724              node_lon(idxGlo - node_start) = bounds_lon(nv, ne); 
    697725              node_lat(idxGlo - node_start) = bounds_lat(nv, ne); 
    698726            } 
    699             else 
    700             { 
    701               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdxMin2IdxGlo.find(ownerIdx); 
    702               idxGlo = (itIdxGlo->second)[0]; 
    703             } 
    704  
    705727            edge_nodes(nv,ne) = idxGlo; 
    706728            for (int nh = 0; nh < 4; ++nh) 
     
    793815        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHash2Rank; 
    794816        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 
    795         CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 
     817        CArray<size_t,1> edgeIdxList(nbFaces_*nvertex); 
    796818        size_t iIdx = 0; 
    797819 
     
    824846              if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 
    825847              { 
    826                 edgeIdxGloList(iIdx) = edgeIdxGlo; 
     848                edgeIdxList(iIdx) = edgeIdxGlo; 
    827849                ++iIdx; 
    828850              } 
    829851              edgeIdxGlo2Face[edgeIdxGlo].push_back(faceIdxGlo); 
    830               edgeHash2Rank[edgeHash].push_back(itEdgeHash->first); 
    831852              edgeHash2Rank[edgeHash].push_back(mpiRank); 
     853              edgeHash2Rank[edgeHash].push_back(itEdgeHash->second[0]); 
    832854            } 
    833855            else 
     
    837859          } 
    838860        } 
    839         edgeIdxGloList.resizeAndPreserve(iIdx); 
     861        edgeIdxList.resizeAndPreserve(iIdx); 
    840862 
    841863        // (1.3) Saving remaining variables edge_faces and face_faces 
     
    846868        dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 
    847869        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 
    848         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHashMin2IdxGlo; 
    849  
    850         // edgeHash2Info = <edgeHash, <idxGlo, rank1, idxGlo, rank2>> 
    851         // edgeHashMin2IdxGlo = <edgeHashMin, idxGlo> 
     870 
     871        // edgeHash2Info = <edgeHash, < rank1, idxGlo, rank2, idxGlo>> 
     872        int edgeCount = 0; 
    852873        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 
    853874        { 
    854875          vector <size_t> edgeInfo = it->second; 
    855           if (edgeInfo.size() == 4)                       // two processes generate the same edge 
    856             if (edgeInfo[1] > edgeInfo[3]) 
    857               edgeInfo[1] = edgeInfo[3]; 
    858           if (edgeInfo[1] == mpiRank) 
    859             edgeHashMin2IdxGlo[it->first].push_back(edgeInfo[0]); 
    860         } 
    861  
    862         CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeHashMin2IdxGlo, comm); 
    863         edge_count = dhtEdgeIdxGlo.getIndexCount(); 
    864         edge_start = dhtEdgeIdxGlo.getIndexStart(); 
     876          if (edgeInfo[0] == mpiRank) 
     877          { 
     878            ++edgeCount; 
     879          } 
     880        } 
     881 
     882        int edgeStart, nbEdges; 
     883        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     884        int nEdges = edgeStart; 
     885        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
     886        nbEdgesGlo = nEdges; 
     887 
     888        // edges to be splitted equally between procs 
     889        if ( (nbEdgesGlo % mpiSize) == 0) 
     890        { 
     891          edge_count = nbEdgesGlo/mpiSize; 
     892          edge_start = mpiRank*edge_count; 
     893        } 
     894        else 
     895        { 
     896          if (mpiRank == (mpiSize - 1) ) 
     897          { 
     898            edge_count = nbEdgesGlo/mpiSize; 
     899            edge_start = mpiRank*(nbEdgesGlo/mpiSize + 1); 
     900          } 
     901          else 
     902          { 
     903            edge_count = nbEdgesGlo/mpiSize + 1; 
     904            edge_start = mpiRank*edge_count; 
     905          } 
     906        } 
     907        CArray<size_t,1> edgeIdxGloList(edge_count); 
     908        for (int i = 0; i < edge_count; ++i) 
     909        { 
     910          edgeIdxGloList(i) = i + edge_start; 
     911        } 
     912 
     913        CClientClientDHTSizet dhtEdgeIdxGlo2Face (edgeIdxGlo2Face, comm); 
     914        CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm); 
     915        dhtEdgeIdxGlo2Face.computeIndexInfoMapping(edgeIdxGloList); 
     916        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdgeIdxGlo2Face.getInfoIndexMap(); 
     917        dhtEdge2Face.computeIndexInfoMapping(edgeIdxList); 
     918        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 
     919 
    865920 
    866921        edge_faces.resize(2, edge_count); 
     922        for (int i = 0; i < edge_count; ++i) 
     923        { 
     924          CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdxGlo2FaceIdx.find(i + edge_start); 
     925          int indexGlo = it->first; 
     926          vector<size_t> faces = it->second; 
     927          int face1 = faces[0]; 
     928          edge_faces(0, indexGlo - edge_start) = face1; 
     929          if (faces.size() == 2) 
     930          { 
     931            int face2 = faces[1]; 
     932            edge_faces(1, indexGlo - edge_start) = face2; 
     933          } 
     934          else 
     935          { 
     936            edge_faces(1, indexGlo - edge_start) = -999; 
     937          } 
     938        } 
     939 
     940        size_t tmp; 
     941        vector<size_t> tmpVec; 
     942        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2FaceIdx.begin(); it != edgeIdx2FaceIdx.end(); it++) 
     943        { 
     944          tmp = it->first; 
     945          tmpVec = it->second; 
     946          tmp++; 
     947        } 
     948 
     949        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2, itIndex; 
    867950        face_faces.resize(nvertex, nbFaces_); 
    868  
    869         CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm); 
    870         dhtEdge2Face.computeIndexInfoMapping(edgeIdxGloList); 
    871         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 
    872         CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2; 
    873  
    874951        for (int nf = 0; nf < nbFaces_; ++nf) 
    875952        { 
     
    896973              size_t faceIdxGlo = nbFacesAccum + nf; 
    897974              size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 
    898               itEdgeHash = edgeHash2IdxGlo.find(edgeHash); 
    899               if (itEdgeHash != edgeHashMin2IdxGlo.end()) 
     975              itEdgeHash = edgeHash2Info.find(edgeHash); 
     976              int edgeIdxGlo = (itEdgeHash->second)[1]; 
     977 
     978              if ( (itEdgeHash->second)[0] == mpiRank) 
    900979              { 
    901                 int edgeIdxGlo = itEdgeHash->second[0]; 
    902                 itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
     980                itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 
    903981                int face1 = itFace1->second[0]; 
    904982                if (itFace1->second.size() == 1) 
    905983                { 
    906                   edge_faces(0, edgeIdxGlo - edge_start) = face1; 
    907                   edge_faces(1, edgeIdxGlo - edge_start) = -999; 
    908984                  face_faces(nv1, nf) = 999999; 
    909985                } 
     
    911987                { 
    912988                  int face2 = itFace1->second[1]; 
    913                   edge_faces(0, edgeIdxGlo - edge_start) = face1; 
    914                   edge_faces(1, edgeIdxGlo - edge_start) = face2; 
    915989                  face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 
    916990                } 
     
    918992              else 
    919993              { 
    920                 itEdgeHash = edgeHashMin2IdxGlo.find(edgeHash); 
    921                 size_t edgeIdxGlo = itEdgeHash->second[0]; 
    922                 itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
     994                itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 
    923995                int face1 = itFace1->second[0]; 
    924996                int face2 = itFace1->second[1]; 
     
    9571029        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it1, it2; 
    9581030        CArray<size_t,1> edgeHashList(nbFaces_*nvertex); 
     1031        int nEdgeHash = 0; 
    9591032        for (int nf = 0; nf < nbFaces_; ++nf) 
    9601033        { 
     
    9781051            face_nodes(nv1,nf) = it1->second[0]; 
    9791052            size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 
    980             edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(it1->second[0], it2->second[0], mpiRank)); 
    981             edgeHash2Idx[edgeHash].push_back(mpiRank); 
    982             edgeHashList(nf*nvertex + nv1) = edgeHash; 
    983           } 
    984         } 
    985  
    986         // (2.2) Generating global edge indexes 
    987         // The ownership criterion: priority of the process holding the smaller index 
     1053            if (edgeHash2Idx.count(edgeHash) == 0) 
     1054            { 
     1055              edgeHash2Idx[edgeHash].push_back(edgeHash); 
     1056              edgeHash2Idx[edgeHash].push_back(mpiRank); 
     1057              edgeHashList(nEdgeHash) = edgeHash; 
     1058              ++nEdgeHash; 
     1059            } 
     1060          } 
     1061        } 
     1062        edgeHashList.resizeAndPreserve(nEdgeHash); 
     1063 
     1064        // (2.3) Generating global edge indexes 
     1065        // The ownership criterion: priority of the process with smaller rank 
    9881066        // Maps generated in this step are: 
    989         // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
    990         // edgeIdx2IdxMin = = <idx, idxMin> 
    991         // edgeIdx2IdxGlo = <idxMin, idxGlo> 
     1067        // edgeIdx2Idx = = <idx, <rankOwner, idx>> 
     1068        // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 
    9921069 
    9931070        CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); 
    9941071        dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 
    9951072        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 
    996  
    997         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 
    998         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 
    999         CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 
    1000         size_t iIdxMin = 0; 
     1073        // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
     1074 
     1075        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 
    10011076 
    10021077        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 
    10031078        { 
    1004           size_t idxMin = (it->second)[0]; 
     1079          size_t rankMin = (it->second)[1]; 
    10051080          size_t idx = (it->second)[0]; 
     1081 
    10061082          for (int i = 2; i < (it->second).size();) 
    10071083          { 
    1008             if (mpiRank == (it->second)[i+1]) 
    1009             { 
     1084            if ((it->second)[i+1] < rankMin) 
     1085            { 
     1086              rankMin = (it->second)[i+1]; 
    10101087              idx = (it->second)[i]; 
    1011             } 
    1012             if ((it->second)[i] < idxMin) 
    1013             { 
    1014                 idxMin = (it->second)[i]; 
    1015                 (it->second)[i] = (it->second)[i-2]; 
     1088              (it->second)[i+1] = (it->second)[i-1]; 
    10161089            } 
    10171090            i += 2; 
    10181091          } 
    1019           (it->second)[0] = idxMin; 
    1020           if (edgeIdx2IdxMin.count(idx) == 0) 
    1021           { 
    1022             edgeIdx2IdxMin[idx].push_back(idxMin); 
    1023             if (idx == idxMin) 
    1024               edgeIdx2IdxGlo[idxMin].push_back(idxMin); 
    1025             edgeIdxMinList(iIdxMin) = idxMin; 
    1026             ++iIdxMin; 
    1027           } 
    1028         } 
    1029         edgeIdxMinList.resizeAndPreserve(iIdxMin); 
    1030         CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 
    1031         CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 
    1032         dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 
    1033         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
    1034         // edgeIdx2IdxGlo holds global indexes only for edges owned by a process 
    1035         // edgeIdxMin2IdxGlo holds global indexes for all edges generated by a process 
    1036  
    1037         // (2.3) Saving variables: edge_lon, edge_lat, face_edges 
    1038         nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 
    1039         edge_count = dhtEdgeIdxGlo.getIndexCount(); 
    1040         edge_start = dhtEdgeIdxGlo.getIndexStart(); 
    1041         edge_lon.resize(edge_count); 
    1042         edge_lat.resize(edge_count); 
    1043         edge_nodes.resize(2, edge_count); 
    1044         face_edges.resize(nvertex, nbFaces_); 
    1045  
    1046         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 
    1047         CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 
    1048         size_t iIdx = 0; 
     1092          if (edgeIdx2Idx.count(idx) == 0) 
     1093          { 
     1094            if (mpiRank == rankMin) 
     1095            { 
     1096              edgeIdx2Idx[idx].push_back(rankMin); 
     1097              edgeIdx2Idx[idx].push_back(idx); 
     1098            } 
     1099          } 
     1100        } 
     1101 
     1102        int edgeCount = edgeIdx2Idx.size(); 
     1103        int edgeStart, nbEdges; 
     1104        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     1105        int nEdges = edgeStart; 
     1106        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
     1107        nbEdgesGlo = nEdges; 
     1108 
     1109        edgeStart -= edgeCount; 
     1110        edge_start = edgeStart; 
     1111        edge_count = edgeCount; 
     1112        CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 
     1113        int count = 0; 
    10491114 
    10501115        for (int nf = 0; nf < nbFaces_; ++nf) 
     
    10681133              it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 
    10691134            } 
     1135            size_t nodeIdxGlo1 = it1->second[0]; 
     1136            size_t nodeIdxGlo2 = it2->second[0]; 
     1137 
     1138            if (nodeIdxGlo1 != nodeIdxGlo2) 
     1139            { 
     1140              size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
     1141              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 
     1142              if (it != edgeIdx2Idx.end()) 
     1143              { 
     1144                if (dummyEdgeMap.count(edgeIdx) == 0) 
     1145                { 
     1146                  dummyEdgeMap[edgeIdx].push_back(edgeIdx); 
     1147                  (it->second)[1] = edge_start + count; 
     1148                  ++count; 
     1149                } 
     1150              } 
     1151            } 
     1152          } 
     1153        } 
     1154 
     1155        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 
     1156        dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 
     1157        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
     1158 
     1159        // (2.4) Saving variables: edge_lon, edge_lat, face_edges 
     1160        edge_lon.resize(edge_count); 
     1161        edge_lat.resize(edge_count); 
     1162        edge_nodes.resize(2, edge_count); 
     1163        face_edges.resize(nvertex, nbFaces_); 
     1164 
     1165        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 
     1166        CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 
     1167        size_t iIdx = 0; 
     1168 
     1169        for (int nf = 0; nf < nbFaces_; ++nf) 
     1170        { 
     1171          for (int nv1 = 0; nv1 < nvertex; ++nv1) 
     1172          { 
     1173            // Getting global indexes of edge's nodes 
     1174            int nh1 = 0; 
     1175            int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 
     1176            it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1)); 
     1177            while (it1 == nodeHash2IdxGlo.end()) 
     1178            { 
     1179              ++nh1; 
     1180              it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1)); 
     1181            } 
     1182            int nh2 = 0; 
     1183            it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv2)*4 + nh2)); 
     1184            while (it2 == nodeHash2IdxGlo.end()) 
     1185            { 
     1186              ++nh2; 
     1187              it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 
     1188            } 
    10701189            // Getting edge global index 
    10711190            size_t nodeIdxGlo1 = it1->second[0]; 
    10721191            size_t nodeIdxGlo2 = it2->second[0]; 
    1073             size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
     1192            size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    10741193            if (nodeIdxGlo1 != nodeIdxGlo2) 
    10751194            { 
    1076               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
    1077               size_t ownerIdx = (itIdx->second)[0]; 
    1078               int edgeIdxGlo = 0; 
     1195              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 
     1196              int edgeIdxGlo = (itIdx->second)[1]; 
    10791197              size_t faceIdxGlo = nbFacesAccum + nf; 
    10801198 
    1081               if (myIdx == ownerIdx) 
     1199              if (mpiRank == (itIdx->second)[0]) 
    10821200              { 
    1083                 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
    1084                 edgeIdxGlo = (itIdxGlo->second)[0]; 
    10851201                double edgeLon; 
    10861202                double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); 
     
    10961212                edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 
    10971213              } 
    1098               else 
    1099               { 
    1100                 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
    1101                 edgeIdxGlo = (itIdxGlo->second)[0]; 
    1102               } 
    11031214              face_edges(nv1,nf) = edgeIdxGlo; 
    11041215              if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 
     
    11171228        edgeIdxGloList.resizeAndPreserve(iIdx); 
    11181229 
    1119         // (2.4) Saving remaining variables edge_faces and face_faces 
     1230        // (2.5) Saving remaining variables edge_faces and face_faces 
    11201231        edge_faces.resize(2, edge_count); 
    11211232        face_faces.resize(nvertex, nbFaces_); 
     
    11251236        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 
    11261237        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdxGlo1, itNodeIdxGlo2; 
     1238        CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx; 
    11271239 
    11281240        for (int nf = 0; nf < nbFaces_; ++nf) 
     
    11491261            size_t nodeIdxGlo2 = it2->second[0]; 
    11501262 
    1151             size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
    1152             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
    1153             size_t ownerIdx = (itIdx->second)[0]; 
     1263            size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
     1264            itIdx = edgeIdx2IdxGlo.find(myIdx); 
    11541265            size_t faceIdxGlo = nbFacesAccum + nf; 
    1155  
    1156             if (myIdx == ownerIdx) 
    1157             { 
    1158               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
    1159               int edgeIdxGlo = (itIdxGlo->second)[0]; 
     1266            int edgeIdxGlo = (itIdx->second)[1]; 
     1267 
     1268            if (mpiRank == (itIdx->second)[0]) 
     1269            { 
    11601270              it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    11611271              int face1 = it1->second[0]; 
     
    11761286            else 
    11771287            { 
    1178               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
    1179               size_t edgeIdxGlo = (itIdxGlo->second)[0]; 
    11801288              it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    11811289              int face1 = it1->second[0]; 
     
    12001308          { 
    12011309            hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 
    1202             size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 
     1310//            size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 
     1311            size_t nodeIndex = generateNodeIndex(hashValues); 
    12031312            for (int nh = 0; nh < 4; ++nh) 
    12041313            { 
     
    12161325 
    12171326        // (3.2) Generating global node indexes 
    1218         // The ownership criterion: priority of the process holding the smaller index 
     1327        // The ownership criterion: priority of the process with smaller rank. 
     1328        // With any other criterion it is not possible to have consistent node indexing for different number of procs. 
    12191329        // Maps generated in this step are: 
    1220         // nodeHash2Info = <hash, [[idxMin, rankMin], [idx1, rank1], [idx3, rank3]..]> 
    1221         // nodeIdx2IdxMin = = <idx, idxMin> 
    1222         // nodeIdx2IdxGlo = <idxMin, idxGlo> 
     1330        // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 
     1331        // nodeIdx2Idx = <idx, <rankOwner, idx>> 
    12231332 
    12241333        CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 
     
    12261335        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 
    12271336 
    1228         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 
    1229         CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 
    1230         CArray<size_t,1> nodeIdxMinList(nbFaces_*nvertex*4); 
    1231         size_t iIdxMin = 0; 
     1337        CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 
     1338        CArray<size_t,1> nodeIdxList(nbFaces_*nvertex*4); 
     1339        size_t nIdx = 0; 
    12321340 
    12331341        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 
    12341342        { 
    1235           size_t idxMin = (it->second)[0]; 
     1343          size_t rankMin = (it->second)[1]; 
    12361344          size_t idx = (it->second)[0]; 
    12371345          for (int i = 2; i < (it->second).size();) 
    12381346          { 
    1239             if (mpiRank == (it->second)[i+1]) 
     1347            if ( (it->second)[i+1] < rankMin) 
    12401348            { 
    12411349              idx = (it->second)[i]; 
    1242             } 
    1243             if ((it->second)[i] < idxMin) 
    1244             { 
    1245                 idxMin = (it->second)[i]; 
    1246                 (it->second)[i] = (it->second)[i-2]; 
     1350              rankMin = (it->second)[i+1]; 
     1351              (it->second)[i+1] = (it->second)[i-1]; 
    12471352            } 
    12481353            i += 2; 
    12491354          } 
    1250           (it->second)[0] = idxMin; 
    1251           if (nodeIdx2IdxMin.count(idx) == 0) 
    1252           { 
    1253             nodeIdx2IdxMin[idx].push_back(idxMin); 
    1254             if (idx == idxMin) 
    1255               nodeIdx2IdxGlo[idxMin].push_back(idxMin); 
    1256             nodeIdxMinList(iIdxMin) = idxMin; 
    1257             ++iIdxMin; 
    1258           } 
    1259         } 
    1260  
    1261         nodeIdxMinList.resizeAndPreserve(iIdxMin); 
    1262         CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 
    1263         CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 
    1264         dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 
    1265         CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
     1355          if (nodeIdx2Idx.count(idx) == 0) 
     1356          { 
     1357            if (mpiRank == rankMin) 
     1358            { 
     1359              nodeIdx2Idx[idx].push_back(rankMin); 
     1360              nodeIdx2Idx[idx].push_back(idx); 
     1361            } 
     1362            nodeIdxList(nIdx) = idx; 
     1363            ++nIdx; 
     1364          } 
     1365        } 
     1366 
     1367//        CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm); 
     1368        // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 
     1369        // Solution: global node indexing by hand. 
     1370        // Maps modified in this step: 
     1371        // nodeIdx2Idx = <idx, idxGlo> 
     1372        int nodeCount = nodeIdx2Idx.size(); 
     1373        int nodeStart, nbNodes; 
     1374        MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     1375        int nNodes = nodeStart; 
     1376        MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
     1377        nbNodesGlo = nNodes; 
     1378 
     1379        nodeStart -= nodeCount; 
     1380        node_start = nodeStart; 
     1381        node_count = nodeCount; 
     1382        CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 
     1383        size_t count = 0; 
     1384 
     1385        for (int nf = 0; nf < nbFaces_; ++nf) 
     1386        { 
     1387          for (int nv = 0; nv < nvertex; ++nv) 
     1388          { 
     1389            vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 
     1390            size_t nodeIdx = generateNodeIndex(hashValues); 
     1391            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 
     1392            if (it != nodeIdx2Idx.end()) 
     1393            { 
     1394              if (dummyMap.count(nodeIdx) == 0) 
     1395              { 
     1396                dummyMap[nodeIdx].push_back(nodeIdx); 
     1397                (it->second)[1] = node_start + count; 
     1398                ++count; 
     1399              } 
     1400            } 
     1401          } 
     1402        } 
     1403        nodeIdxList.resizeAndPreserve(nIdx); 
     1404        CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 
     1405        dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 
     1406        CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 
    12661407 
    12671408        // (3.3) Saving node data: node_lon, node_lat, and face_nodes 
    12681409        // Generating edgeHash2Info = <hash, <idx, rank>> and edgeHashList 
    1269         nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
    1270         node_count = dhtNodeIdxGlo.getIndexCount(); 
    1271         node_start = dhtNodeIdxGlo.getIndexStart(); 
     1410//        nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 
     1411//        node_count = dhtNodeIdxGlo.getIndexCount(); 
     1412//        node_start = dhtNodeIdxGlo.getIndexStart(); 
    12721413        node_lon.resize(node_count); 
    12731414        node_lat.resize(node_count); 
     
    12861427            vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 
    12871428            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    1288             size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 
    1289             size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 
    1290             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxMin.find(myNodeIdx1); 
    1291             CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxMin.find(myNodeIdx2); 
    1292             size_t ownerNodeIdx = (itNodeIdx1->second)[0]; 
    1293  
    1294             if (myNodeIdx1 == ownerNodeIdx) 
    1295             { 
    1296               itNodeIdxGlo1 = nodeIdx2IdxGlo.find(myNodeIdx1); 
    1297               nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
     1429            size_t nodeIdx1 = generateNodeIndex(hashValues1); 
     1430            size_t nodeIdx2 = generateNodeIndex(hashValues2); 
     1431            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 
     1432            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 
     1433            size_t ownerRank = (itNodeIdx1->second)[0]; 
     1434            nodeIdxGlo1 = (itNodeIdx1->second)[1]; 
     1435            nodeIdxGlo2 = (itNodeIdx2->second)[1]; 
     1436 
     1437            if (mpiRank == ownerRank) 
     1438            { 
    12981439              node_lon(nodeIdxGlo1 - node_start) = bounds_lon(nv1, nf); 
    12991440              node_lat(nodeIdxGlo1 - node_start) = bounds_lat(nv1, nf); 
    13001441            } 
    1301             else 
    1302             { 
    1303               itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find(ownerNodeIdx); 
    1304               nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
    1305             } 
    1306             itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((itNodeIdx2->second)[0]); 
    1307             nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 
    13081442            if (nodeIdxGlo1 != nodeIdxGlo2) 
    13091443            { 
    13101444              size_t edgeHash = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
    1311               edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank)); 
     1445              edgeHash2Idx[edgeHash].push_back(edgeHash); 
    13121446              edgeHash2Idx[edgeHash].push_back(mpiRank); 
    13131447              edgeHashList(nEdgeHash) = edgeHash; 
     
    13211455        // (3.4) Generating global edge indexes 
    13221456        // Maps generated in this step are: 
    1323         // edgeIdx2IdxMin = = <idx, idxMin> 
    1324         // edgeIdx2IdxGlo = <idxMin, idxGlo> 
     1457        // edgeIdx2Idx = = <idx, <rankOwner, idx>> 
     1458        // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 
    13251459 
    13261460        CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); 
     
    13291463        // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 
    13301464 
    1331         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 
    1332         CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 
    1333         CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 
    1334         iIdxMin = 0; 
     1465        CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 
    13351466 
    13361467        for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 
    13371468        { 
    1338           size_t idxMin = (it->second)[0]; 
     1469          size_t rankMin = (it->second)[1]; 
    13391470          size_t idx = (it->second)[0]; 
    13401471 
    13411472          for (int i = 2; i < (it->second).size();) 
    13421473          { 
    1343             if (mpiRank == (it->second)[i+1]) 
    1344             { 
     1474            if ((it->second)[i+1] < rankMin) 
     1475            { 
     1476              rankMin = (it->second)[i+1]; 
    13451477              idx = (it->second)[i]; 
    1346             } 
    1347             if ((it->second)[i] < idxMin) 
    1348             { 
    1349                 idxMin = (it->second)[i]; 
    1350                 (it->second)[i] = (it->second)[i-2]; 
     1478              (it->second)[i+1] = (it->second)[i-1]; 
    13511479            } 
    13521480            i += 2; 
    13531481          } 
    1354           (it->second)[0] = idxMin; 
    1355           if (edgeIdx2IdxMin.count(idx) == 0) 
    1356           { 
    1357             edgeIdx2IdxMin[idx].push_back(idxMin); 
    1358             if (idx == idxMin) 
    1359               edgeIdx2IdxGlo[idxMin].push_back(idxMin); 
    1360             edgeIdxMinList(iIdxMin) = idxMin; 
    1361             ++iIdxMin; 
    1362           } 
    1363         } 
    1364         edgeIdxMinList.resizeAndPreserve(iIdxMin); 
    1365         CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 
    1366         CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 
    1367         dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 
    1368         CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
     1482          if (edgeIdx2Idx.count(idx) == 0) 
     1483          { 
     1484            if (mpiRank == rankMin) 
     1485            { 
     1486              edgeIdx2Idx[idx].push_back(rankMin); 
     1487              edgeIdx2Idx[idx].push_back(idx); 
     1488            } 
     1489          } 
     1490        } 
     1491 
     1492        int edgeCount = edgeIdx2Idx.size(); 
     1493        int edgeStart, nbEdges; 
     1494        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     1495        int nEdges = edgeStart; 
     1496        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
     1497        nbEdgesGlo = nEdges; 
     1498 
     1499        edgeStart -= edgeCount; 
     1500        edge_start = edgeStart; 
     1501        edge_count = edgeCount; 
     1502        CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 
     1503        count = 0; 
     1504 
     1505        for (int nf = 0; nf < nbFaces_; ++nf) 
     1506        { 
     1507          for (int nv1 = 0; nv1 < nvertex; ++nv1) 
     1508          { 
     1509            int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 
     1510            vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 
     1511            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
     1512            size_t nodeIdx1 = generateNodeIndex(hashValues1); 
     1513            size_t nodeIdx2 = generateNodeIndex(hashValues2); 
     1514            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 
     1515            CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 
     1516            nodeIdxGlo1 = (itNodeIdx1->second)[1]; 
     1517            nodeIdxGlo2 = (itNodeIdx2->second)[1]; 
     1518 
     1519            if (nodeIdxGlo1 != nodeIdxGlo2) 
     1520            { 
     1521              size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
     1522              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 
     1523              if (it != edgeIdx2Idx.end()) 
     1524              { 
     1525                if (dummyEdgeMap.count(edgeIdx) == 0) 
     1526                { 
     1527                  dummyEdgeMap[edgeIdx].push_back(edgeIdx); 
     1528                  (it->second)[1] = edge_start + count; 
     1529                  ++count; 
     1530                } 
     1531              } 
     1532            } 
     1533          } 
     1534        } 
     1535        CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 
     1536        dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 
     1537        CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 
    13691538 
    13701539        // (3.5) Saving variables: edge_lon, edge_lat, face_edges 
    13711540        // Creating map edgeIdxGlo2Face <idxGlo, face> 
    1372  
    1373         nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 
    1374         edge_count = dhtEdgeIdxGlo.getIndexCount(); 
    1375         edge_start = dhtEdgeIdxGlo.getIndexStart(); 
     1541//        nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 
     1542//        edge_count = dhtEdgeIdxGlo.getIndexCount(); 
     1543//        edge_start = dhtEdgeIdxGlo.getIndexStart(); 
     1544 
    13761545        edge_lon.resize(edge_count); 
    13771546        edge_lat.resize(edge_count); 
     
    13931562            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    13941563 
    1395             size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 
    1396             size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 
    1397             it1 = nodeIdx2IdxMin.find(myNodeIdx1); 
    1398             it2 = nodeIdx2IdxMin.find(myNodeIdx2); 
    1399             itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 
    1400             itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 
    1401             size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
    1402             size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 
     1564            size_t nodeIdx1 = generateNodeIndex(hashValues1); 
     1565            size_t nodeIdx2 = generateNodeIndex(hashValues2); 
     1566            it1 = nodeIdx2IdxGlo.find(nodeIdx1); 
     1567            it2 = nodeIdx2IdxGlo.find(nodeIdx2); 
     1568            size_t nodeIdxGlo1 = (it1->second)[1]; 
     1569            size_t nodeIdxGlo2 = (it2->second)[1]; 
    14031570 
    14041571            if (nodeIdxGlo1 != nodeIdxGlo2) 
    14051572            { 
    1406               size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
    1407               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
    1408               size_t ownerIdx = (itIdx->second)[0]; 
    1409               int edgeIdxGlo; 
     1573              size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
     1574              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 
     1575              int edgeIdxGlo = (itIdx->second)[1]; 
    14101576              size_t faceIdxGlo = nbFacesAccum + nf; 
    14111577 
    1412               if (myIdx == ownerIdx) 
     1578              if (mpiRank == (itIdx->second)[0]) 
    14131579              { 
    1414                 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
    1415                 edgeIdxGlo = (itIdxGlo->second)[0]; 
    14161580                double edgeLon; 
    14171581                double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); 
     
    14271591                edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 
    14281592              } 
    1429               else 
    1430               { 
    1431                 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
    1432                 edgeIdxGlo = (itIdxGlo->second)[0]; 
    1433               } 
    14341593              face_edges(nv1,nf) = edgeIdxGlo; 
    14351594              if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 
     
    14651624            vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 
    14661625 
    1467             size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 
    1468             size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 
     1626            size_t myNodeIdx1 = generateNodeIndex(hashValues1); 
     1627            size_t myNodeIdx2 = generateNodeIndex(hashValues2); 
    14691628            if (myNodeIdx1 != myNodeIdx2) 
    14701629            { 
    1471               it1 = nodeIdx2IdxMin.find(myNodeIdx1); 
    1472               it2 = nodeIdx2IdxMin.find(myNodeIdx2); 
    1473               itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 
    1474               itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 
    1475               size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 
    1476               size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 
    1477  
    1478               size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 
    1479               CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 
    1480               size_t ownerIdx = (itIdx->second)[0]; 
     1630              it1 = nodeIdx2IdxGlo.find(myNodeIdx1); 
     1631              it2 = nodeIdx2IdxGlo.find(myNodeIdx2); 
     1632              size_t nodeIdxGlo1 = (it1->second)[1]; 
     1633              size_t nodeIdxGlo2 = (it2->second)[1]; 
     1634              size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 
     1635              CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 
     1636              int edgeIdxGlo = (itIdx->second)[1]; 
     1637 
    14811638              size_t faceIdxGlo = nbFacesAccum + nf; 
    14821639 
    1483               if (myIdx == ownerIdx) 
     1640              if (mpiRank == (itIdx->second)[0]) 
    14841641              { 
    1485                 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 
    1486                 int edgeIdxGlo = (itIdxGlo->second)[0]; 
    14871642                it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    14881643                int face1 = it1->second[0]; 
     
    15001655                  face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 
    15011656                } 
    1502               } // myIdx == ownerIdx 
     1657              } 
    15031658              else 
    15041659              { 
    1505                 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 
    1506                 size_t edgeIdxGlo = (itIdxGlo->second)[0]; 
    15071660                it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 
    15081661                int face1 = it1->second[0]; 
    15091662                int face2 = it1->second[1]; 
    15101663                face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 
    1511               } // myIdx != ownerIdx 
     1664              } 
    15121665            } // myNodeIdx1 != myNodeIdx2 
    15131666            else 
     
    15151668          } 
    15161669        } 
     1670 
    15171671      } 
    15181672      facesAreWritten = true; 
  • XIOS/dev/dev_olga/src/node/scalar.cpp

    r1144 r1158  
    6363  { 
    6464 
     65  } 
     66 
     67  /*! 
     68    Compare two scalar objects.  
     69    They are equal if only if they have identical attributes as well as their values. 
     70    Moreover, they must have the same transformations. 
     71  \param [in] scalar Compared scalar 
     72  \return result of the comparison 
     73  */ 
     74  bool CScalar::isEqual(CScalar* obj) 
     75  { 
     76    vector<StdString> excludedAttr; 
     77    excludedAttr.push_back("scalar_ref"); 
     78    bool objEqual = SuperClass::isEqual(obj, excludedAttr); 
     79    if (!objEqual) return objEqual; 
     80 
     81    TransMapTypes thisTrans = this->getAllTransformations(); 
     82    TransMapTypes objTrans  = obj->getAllTransformations(); 
     83 
     84    TransMapTypes::const_iterator it, itb, ite; 
     85    std::vector<ETranformationType> thisTransType, objTransType; 
     86    for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 
     87      thisTransType.push_back(it->first); 
     88    for (it = objTrans.begin(); it != objTrans.end(); ++it) 
     89      objTransType.push_back(it->first); 
     90 
     91    if (thisTransType.size() != objTransType.size()) return false; 
     92    for (int idx = 0; idx < thisTransType.size(); ++idx) 
     93      objEqual &= (thisTransType[idx] == objTransType[idx]); 
     94 
     95    return objEqual; 
    6596  } 
    6697 
  • XIOS/dev/dev_olga/src/node/scalar.hpp

    r1144 r1158  
    7676           void duplicateTransformation(CScalar*); 
    7777           CTransformation<CScalar>* addTransformation(ETranformationType transType, const StdString& id=""); 
     78           bool isEqual(CScalar* scalar); 
    7879 
    7980         private: 
    8081           std::set<StdString> relFiles; 
     82           TransMapTypes transformationMap_; 
    8183 
    82          private: 
    83             TransMapTypes transformationMap_;             
    8484            void setTransformations(const TransMapTypes&); 
    8585 
  • XIOS/dev/dev_olga/src/node/variable.cpp

    r1071 r1158  
    4040      if (!node.getContent(this->content)) 
    4141      { 
     42        xml::THashAttributes attributes = node.getAttributes(); 
     43        StdString variableName = attributes["name"]; 
     44 
     45        node.goToParentElement(); 
     46        StdString parentName = node.getElementName(); 
     47        attributes = node.getAttributes(); 
     48        error << "The variable id = " << id << " and name = " << variableName << " does not have any content. Please define it!" << std::endl 
     49              << "This variable is inside another element whose attributes are :" << std::endl; 
     50 
     51        for (xml::THashAttributes::iterator it = attributes.begin(); it != attributes.end(); ++it) 
     52        { 
     53           error << it->first << "=\"" << it->second.c_str() << "\" "; 
     54        } 
     55        error << std::endl;  
     56 
    4257         ERROR("CVariable::parse(xml::CXMLNode & node)", 
    4358               << "[ variable id = " << id 
    44                << " ] variable is not defined !"); 
     59               << " ] variable is not defined !. It does not have any content. See error log for more details."); 
    4560      } 
    4661      content = boost::trim_copy(content) ; 
     
    108123      } 
    109124     } 
    110  
    111     //  if (!context->hasServer) 
    112     //  { 
    113     //    CContextClient* client=context->client ; 
    114  
    115     //    CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ; 
    116     //    if (client->isServerLeader()) 
    117     //    { 
    118     //      CMessage msg ; 
    119     //      msg<<this->getId() ; 
    120     //      msg<<content ; 
    121     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    122     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    123     //        event.push(*itRank,1,msg); 
    124     //      client->sendEvent(event) ; 
    125     //    } 
    126     //    else client->sendEvent(event) ; 
    127     // } 
    128125   } 
    129126 
  • XIOS/dev/dev_olga/src/node/variable.hpp

    r1071 r1158  
    99#include "attribute_enum.hpp" 
    1010#include "attribute_enum_impl.hpp" 
     11#include "declare_attribute.hpp" 
    1112 
    1213namespace xios 
  • XIOS/dev/dev_olga/src/object_template.hpp

    r1021 r1158  
    6767         static bool dispatchEvent(CEventServer& event) ; 
    6868 
     69         bool isEqual(const string& id, const vector<StdString>& excludedAttrs); 
     70         bool isEqual(T* obj, const vector<StdString>& excludedAttrs); 
     71 
    6972         /// Accesseur statique /// 
    7073         static std::vector<boost::shared_ptr<DerivedType> > & 
  • XIOS/dev/dev_olga/src/object_template_impl.hpp

    r1054 r1158  
    136136   } 
    137137 
     138   /*! 
     139     Compare two object of same type 
     140   */ 
     141   template <class T> 
     142   bool CObjectTemplate<T>::isEqual(const string& id, const vector<StdString>& excludedAttrs) 
     143   { 
     144      T* obj = CObjectTemplate<T>::get(id); 
     145      return this->isEqual(obj, excludedAttrs); 
     146   } 
     147 
     148   template <class T> 
     149   bool CObjectTemplate<T>::isEqual(T* obj, const vector<StdString>& excludedAttrs) 
     150   { 
     151 
     152      CAttributeMap& attrMapThis = *this; 
     153      CAttributeMap& attrMapObj  = *obj; 
     154      return (attrMapThis.isEqual(attrMapObj, excludedAttrs)); 
     155   } 
     156 
    138157   //--------------------------------------------------------------- 
    139158 
     
    199218         } 
    200219       } 
    201  
    202      // if (client->isServerLeader()) 
    203      // { 
    204      //   size_t minimumSize = 0; 
    205      //   CAttributeMap& attrMap = *this; 
    206      //   CAttributeMap::const_iterator it = attrMap.begin(), itE = attrMap.end(); 
    207      //   for (; it != itE; ++it) 
    208      //   { 
    209      //     if (!it->second->isEmpty()) 
    210      //     { 
    211      //       size_t size = it->second->getName().size() + sizeof(size_t) + it->second->size(); 
    212      //       if (size > minimumSize) 
    213      //         minimumSize = size; 
    214      //     } 
    215      //   } 
    216  
    217      //   if (minimumSize) 
    218      //   { 
    219      //     // Account for extra header info 
    220      //     minimumSize += CEventClient::headerSize + getIdServer().size() + sizeof(size_t); 
    221  
    222      //     const std::list<int>& ranks = client->getRanksServerLeader(); 
    223      //     for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    224      //       minimumSizes.insert(std::make_pair(*itRank, minimumSize)); 
    225      //   } 
    226      // } 
    227  
    228220       return minimumSizes; 
    229221     } 
     
    257249      CAttributeMap & attrMap = *this; 
    258250      CAttribute* attr=attrMap[id]; 
    259       if (attr->doSend())  
    260         sendAttributToServer(*attr); 
     251      sendAttributToServer(*attr); 
    261252   } 
    262253 
     
    369360  } 
    370361 
    371  
    372362  template <class T> 
    373363  void CObjectTemplate<T>::recvAttributFromClient(CEventServer& event) 
  • XIOS/dev/dev_olga/src/parse_expr/filter_expr_node.cpp

    r643 r1158  
    22#include "unary_arithmetic_filter.hpp" 
    33#include "binary_arithmetic_filter.hpp" 
     4#include "ternary_arithmetic_filter.hpp" 
    45#include "field.hpp" 
    56 
     
    4041  boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    4142  { 
    42     if (!CField::has(fieldId)) 
     43    boost::shared_ptr<COutputPin> outputPin; 
     44 
     45    if (fieldId == "this") 
     46      outputPin = thisField.getSelfTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 
     47    else if (CField::has(fieldId)) 
     48    { 
     49      CField* field = CField::get(fieldId); 
     50      if (field == &thisField) 
     51        ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 
     52              << "The field " << fieldId << " has an invalid reference to itself. " 
     53              << "Use the keyword \"this\" if you want to reference the input data sent to this field."); 
     54 
     55      field->buildFilterGraph(gc, false); 
     56      outputPin = field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 
     57    } 
     58    else 
    4359      ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 
    4460            << "The field " << fieldId << " does not exist."); 
    4561 
    46     CField* field = CField::get(fieldId); 
    47     if (field == &thisField) 
    48       ERROR("boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 
    49             << "The field " << fieldId << " has an invalid reference to itself."); 
    50  
    51     field->buildFilterGraph(gc, false); 
    52     return field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 
     62    return outputPin; 
    5363  } 
    5464 
     
    120130    return filter; 
    121131  } 
     132 
     133 
     134 
     135 
     136  CFilterScalarScalarFieldOpExprNode::CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3) 
     137    : child1(child1) 
     138    , opId(opId) 
     139    , child2(child2) 
     140    , child3(child3) 
     141  { 
     142    if (!child1 || !child2 || !child3) 
     143      ERROR("  CFilterScalarScalarFieldOpExprNode::CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3)", 
     144            "Impossible to create the new expression node, an invalid child node was provided."); 
     145  } 
     146 
     147  boost::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     148  { 
     149    boost::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 
     150    child3->reduce(gc, thisField)->connectOutput(filter, 0); 
     151    return filter; 
     152  } 
     153 
     154 
     155  CFilterScalarFieldScalarOpExprNode::CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3) 
     156    : child1(child1) 
     157    , opId(opId) 
     158    , child2(child2) 
     159    , child3(child3) 
     160  { 
     161    if (!child1 || !child2 || !child3) 
     162      ERROR("  CFilterScalarFieldScalarOpExprNode::CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3)", 
     163            "Impossible to create the new expression node, an invalid child node was provided."); 
     164  } 
     165 
     166  boost::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     167  { 
     168    boost::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 
     169    child2->reduce(gc, thisField)->connectOutput(filter, 0); 
     170    return filter; 
     171  } 
     172 
     173 
     174  CFilterScalarFieldFieldOpExprNode::CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3) 
     175    : child1(child1) 
     176    , opId(opId) 
     177    , child2(child2) 
     178    , child3(child3) 
     179  { 
     180    if (!child1 || !child2 || !child3) 
     181      ERROR("  CFilterScalarFieldFieldOpExprNode::CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3)", 
     182            "Impossible to create the new expression node, an invalid child node was provided."); 
     183  } 
     184 
     185  boost::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     186  { 
     187    boost::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); 
     188    child2->reduce(gc, thisField)->connectOutput(filter, 0); 
     189    child3->reduce(gc, thisField)->connectOutput(filter, 1); 
     190    return filter; 
     191  } 
     192 
     193 
     194 
     195  CFilterFieldScalarScalarOpExprNode::CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3) 
     196    : child1(child1) 
     197    , opId(opId) 
     198    , child2(child2) 
     199    , child3(child3) 
     200  { 
     201    if (!child1 || !child2 || !child3) 
     202      ERROR("  CFilterFieldScalarScalarOpExprNode::CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3)", 
     203            "Impossible to create the new expression node, an invalid child node was provided."); 
     204  } 
     205 
     206  boost::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     207  { 
     208    boost::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 
     209    child1->reduce(gc, thisField)->connectOutput(filter, 0); 
     210    return filter; 
     211  } 
     212 
     213 
     214 
     215  CFilterFieldScalarFieldOpExprNode::CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3) 
     216    : child1(child1) 
     217    , opId(opId) 
     218    , child2(child2) 
     219    , child3(child3) 
     220  { 
     221    if (!child1 || !child2 || !child3) 
     222      ERROR("  CFilterFieldScalarFieldOpExprNode::CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3)", 
     223            "Impossible to create the new expression node, an invalid child node was provided."); 
     224  } 
     225 
     226  boost::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     227  { 
     228    boost::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); 
     229    child1->reduce(gc, thisField)->connectOutput(filter, 0); 
     230    child3->reduce(gc, thisField)->connectOutput(filter, 1); 
     231    return filter; 
     232  } 
     233 
     234 
     235 
     236  CFilterFieldFieldScalarOpExprNode::CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3) 
     237    : child1(child1) 
     238    , opId(opId) 
     239    , child2(child2) 
     240    , child3(child3) 
     241  { 
     242    if (!child1 || !child2 || !child3) 
     243      ERROR("  CFilterFieldFieldScalarOpExprNode::CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3)", 
     244            "Impossible to create the new expression node, an invalid child node was provided."); 
     245  } 
     246 
     247  boost::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     248  { 
     249    boost::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); 
     250    child1->reduce(gc, thisField)->connectOutput(filter, 0); 
     251    child2->reduce(gc, thisField)->connectOutput(filter, 1); 
     252    return filter; 
     253  } 
     254 
     255 
     256  CFilterFieldFieldFieldOpExprNode::CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3) 
     257    : child1(child1) 
     258    , opId(opId) 
     259    , child2(child2) 
     260    , child3(child3) 
     261  { 
     262    if (!child1 || !child2 || !child3) 
     263      ERROR("  CFilterFieldFieldFieldOpExprNode::CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3)", 
     264            "Impossible to create the new expression node, an invalid child node was provided."); 
     265  } 
     266 
     267  boost::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
     268  { 
     269    boost::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); 
     270    child1->reduce(gc, thisField)->connectOutput(filter, 0); 
     271    child2->reduce(gc, thisField)->connectOutput(filter, 1); 
     272    child3->reduce(gc, thisField)->connectOutput(filter, 2); 
     273    return filter; 
     274  } 
     275   
    122276} 
  • XIOS/dev/dev_olga/src/parse_expr/filter_expr_node.hpp

    r643 r1158  
    169169      boost::scoped_ptr<IFilterExprNode> child1, child2; //!< The field child nodes to which the operator is applied 
    170170  }; 
     171 
     172 
     173 
     174 /*! 
     175   * Expression node corresponding to a ternary operation on a scalar-scalar-field. 
     176   */ 
     177  class CFilterScalarScalarFieldOpExprNode : public IFilterExprNode 
     178  { 
     179    public: 
     180      /*! 
     181       * Constructs an expression node corresponding to the specified ternary operation 
     182       * applied to the provided fields and scalars child nodes. 
     183       * Note that the child nodes will be destroyed automatically when the parent node 
     184       * is destroyed. 
     185       * 
     186       * \param child1 the scalar child node to which the operator is applied 
     187       * \param opId the identifier of the operator 
     188       * \param child2 the scalar child node to which the operator is applied 
     189       * \param child3 the field child node to which the operator is applied 
     190      */ 
     191      CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 
     192 
     193      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     194 
     195    private: 
     196      std::string opId; //!< The identifier of the field 
     197      boost::scoped_ptr<IScalarExprNode> child1; //!< The scalar child node to which the operator is applied 
     198      boost::scoped_ptr<IScalarExprNode> child2; //!< The scalar child node to which the operator is applied 
     199      boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 
     200  }; 
     201 
     202 
     203  /*! 
     204   * Expression node corresponding to a ternary operation on a scalar-field-scalar. 
     205   */ 
     206  class CFilterScalarFieldScalarOpExprNode : public IFilterExprNode 
     207  { 
     208    public: 
     209      /*! 
     210       * Constructs an expression node corresponding to the specified ternary operation 
     211       * applied to the provided fields and scalars child nodes. 
     212       * Note that the child nodes will be destroyed automatically when the parent node 
     213       * is destroyed. 
     214       * 
     215       * \param child1 the scalar child node to which the operator is applied 
     216       * \param opId the identifier of the operator 
     217       * \param child2 the field child node to which the operator is applied 
     218       * \param child3 the scalar child node to which the operator is applied 
     219      */ 
     220      CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 
     221 
     222      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     223 
     224    private: 
     225      std::string opId; //!< The identifier of the field 
     226      boost::scoped_ptr<IScalarExprNode> child1; //!< The scalar child node to which the operator is applied 
     227      boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 
     228      boost::scoped_ptr<IScalarExprNode> child3; //!< The scalar child node to which the operator is applied 
     229  }; 
     230 
     231 
     232  /*! 
     233   * Expression node corresponding to a ternary operation on a scalar-field-field. 
     234   */ 
     235  class CFilterScalarFieldFieldOpExprNode : public IFilterExprNode 
     236  { 
     237    public: 
     238      /*! 
     239       * Constructs an expression node corresponding to the specified ternary operation 
     240       * applied to the provided fields and scalars child nodes. 
     241       * Note that the child nodes will be destroyed automatically when the parent node 
     242       * is destroyed. 
     243       * 
     244       * \param child1 the scalar child node to which the operator is applied 
     245       * \param opId the identifier of the operator 
     246       * \param child2 the field child node to which the operator is applied 
     247       * \param child3 the field child node to which the operator is applied 
     248      */ 
     249      CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 
     250 
     251      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     252 
     253    private: 
     254      std::string opId; //!< The identifier of the field 
     255      boost::scoped_ptr<IScalarExprNode> child1; //!< The scalar child node to which the operator is applied 
     256      boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 
     257      boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 
     258  }; 
     259 
     260 
     261 
     262/*! 
     263   * Expression node corresponding to a ternary operation on a field-scalar-scalar. 
     264   */ 
     265  class CFilterFieldScalarScalarOpExprNode : public IFilterExprNode 
     266  { 
     267    public: 
     268      /*! 
     269       * Constructs an expression node corresponding to the specified ternary operation 
     270       * applied to the provided fields and scalars child nodes. 
     271       * Note that the child nodes will be destroyed automatically when the parent node 
     272       * is destroyed. 
     273       * 
     274       * \param child1 the field child node to which the operator is applied 
     275       * \param opId the identifier of the operator 
     276       * \param child2 the scalar child node to which the operator is applied 
     277       * \param child3 the scalar child node to which the operator is applied 
     278      */ 
     279      CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3); 
     280 
     281      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     282 
     283    private: 
     284      std::string opId; //!< The identifier of the field 
     285      boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 
     286      boost::scoped_ptr<IScalarExprNode> child2; //!< The scalar child node to which the operator is applied 
     287      boost::scoped_ptr<IScalarExprNode> child3; //!< The scalar child node to which the operator is applied 
     288  }; 
     289 
     290 
     291/*! 
     292   * Expression node corresponding to a ternary operation on a field-scalar-field. 
     293   */ 
     294  class CFilterFieldScalarFieldOpExprNode : public IFilterExprNode 
     295  { 
     296    public: 
     297      /*! 
     298       * Constructs an expression node corresponding to the specified ternary operation 
     299       * applied to the provided fields and scalars child nodes. 
     300       * Note that the child nodes will be destroyed automatically when the parent node 
     301       * is destroyed. 
     302       * 
     303       * \param child1 the field child node to which the operator is applied 
     304       * \param opId the identifier of the operator 
     305       * \param child2 the scalar child node to which the operator is applied 
     306       * \param child3 the field child node to which the operator is applied 
     307      */ 
     308      CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 
     309 
     310      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     311 
     312    private: 
     313      std::string opId; //!< The identifier of the field 
     314      boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 
     315      boost::scoped_ptr<IScalarExprNode> child2; //!< The scalar child node to which the operator is applied 
     316      boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 
     317  }; 
     318 
     319  /*! 
     320   * Expression node corresponding to a ternary operation on a field-field-scalar. 
     321   */ 
     322  class CFilterFieldFieldScalarOpExprNode : public IFilterExprNode 
     323  { 
     324    public: 
     325      /*! 
     326       * Constructs an expression node corresponding to the specified ternary operation 
     327       * applied to the provided fields and scalars child nodes. 
     328       * Note that the child nodes will be destroyed automatically when the parent node 
     329       * is destroyed. 
     330       * 
     331       * \param child1 the field child node to which the operator is applied 
     332       * \param opId the identifier of the operator 
     333       * \param child2 the field child node to which the operator is applied 
     334       * \param child3 the scalar child node to which the operator is applied 
     335      */ 
     336      CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 
     337 
     338      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     339 
     340    private: 
     341      std::string opId; //!< The identifier of the field 
     342      boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 
     343      boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 
     344      boost::scoped_ptr<IScalarExprNode> child3; //!< The scalar child node to which the operator is applied 
     345  }; 
     346 
     347 
     348  /*! 
     349   * Expression node corresponding to a ternary operation on a field-field-field. 
     350   */ 
     351  class CFilterFieldFieldFieldOpExprNode : public IFilterExprNode 
     352  { 
     353    public: 
     354      /*! 
     355       * Constructs an expression node corresponding to the specified ternary operation 
     356       * applied to the provided fields and scalars child nodes. 
     357       * Note that the child nodes will be destroyed automatically when the parent node 
     358       * is destroyed. 
     359       * 
     360       * \param child1 the field child node to which the operator is applied 
     361       * \param opId the identifier of the operator 
     362       * \param child2 the field child node to which the operator is applied 
     363       * \param child3 the field child node to which the operator is applied 
     364      */ 
     365      CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 
     366 
     367      virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 
     368 
     369    private: 
     370      std::string opId; //!< The identifier of the field 
     371      boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 
     372      boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 
     373      boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 
     374  }; 
     375 
     376 
     377 
    171378} 
    172379 
  • XIOS/dev/dev_olga/src/parse_expr/generate_lex_yacc.sh

    r501 r1158  
    1 bison -d yacc_parser.yacc -o yacc_parser.cpp 
     1bison --verbose -d yacc_parser.yacc -o yacc_parser.cpp 
    22flex -o lex_parser.cpp -f lex_parser.lex  
  • XIOS/dev/dev_olga/src/parse_expr/lex_parser.cpp

    r728 r1158  
    1010#define YY_FLEX_MAJOR_VERSION 2 
    1111#define YY_FLEX_MINOR_VERSION 5 
    12 #define YY_FLEX_SUBMINOR_VERSION 39 
     12#define YY_FLEX_SUBMINOR_VERSION 37 
    1313#if YY_FLEX_SUBMINOR_VERSION > 0 
    1414#define FLEX_BETA 
     
    143143/* Size of default input buffer. */ 
    144144#ifndef YY_BUF_SIZE 
    145 #ifdef __ia64__ 
    146 /* On IA-64, the buffer size is 16k, not 8k. 
    147  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 
    148  * Ditto for the __ia64__ case accordingly. 
    149  */ 
    150 #define YY_BUF_SIZE 32768 
    151 #else 
    152145#define YY_BUF_SIZE 16384 
    153 #endif /* __ia64__ */ 
    154146#endif 
    155147 
     
    177169 
    178170    #define YY_LESS_LINENO(n) 
    179     #define YY_LINENO_REWIND_TO(ptr) 
    180171     
    181172/* Return all but the first "n" matched characters back to the input stream. */ 
     
    356347extern char *yytext; 
    357348#define yytext_ptr yytext 
    358  
    359349static yyconst flex_int16_t yy_nxt[][128] = 
    360350    { 
     
    382372        4,    4,    5,    4,    4,    4,    6,    4,    4,    4, 
    383373        7,    8,    9,   10,    4,   11,    4,   12,   13,   13, 
    384        13,   13,   13,   13,   13,   13,   13,   13,    4,    4, 
    385        14,   15,   16,    4,   17,   18,   18,   18,   18,   18, 
    386  
    387        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    388        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    389        18,    4,    4,    4,   19,    4,    4,   18,   18,   18, 
    390        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    391        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    392        18,   18,   18,    4,    4,    4,    4,    4 
     374       13,   13,   13,   13,   13,   13,   13,   13,   14,    4, 
     375       15,   16,   17,   18,   19,   20,   20,   20,   20,   20, 
     376 
     377       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     378       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     379       20,    4,    4,    4,   21,    4,    4,   20,   20,   20, 
     380       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     381       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     382       20,   20,   20,    4,    4,    4,    4,    4 
    393383    }, 
    394384 
     
    400390 
    401391        7,    8,    9,   10,    4,   11,    4,   12,   13,   13, 
    402        13,   13,   13,   13,   13,   13,   13,   13,    4,    4, 
    403        14,   15,   16,    4,   17,   18,   18,   18,   18,   18, 
    404        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    405        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    406        18,    4,    4,    4,   19,    4,    4,   18,   18,   18, 
    407        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    408        18,   18,   18,   18,   18,   18,   18,   18,   18,   18, 
    409        18,   18,   18,    4,    4,    4,    4,    4 
     392       13,   13,   13,   13,   13,   13,   13,   13,   14,    4, 
     393       15,   16,   17,   18,   19,   20,   20,   20,   20,   20, 
     394       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     395       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     396       20,    4,    4,    4,   21,    4,    4,   20,   20,   20, 
     397       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     398       20,   20,   20,   20,   20,   20,   20,   20,   20,   20, 
     399       20,   20,   20,    4,    4,    4,    4,    4 
    410400    }, 
    411401 
     
    446436 
    447437    { 
    448         3,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   21, 
     438        3,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   23, 
    449439       -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5, 
    450440       -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5, 
    451        -5,   -5,   21,   -5,   -5,   -5,   -5,   -5,   -5,   -5, 
     441       -5,   -5,   23,   -5,   -5,   -5,   -5,   -5,   -5,   -5, 
    452442       -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5,   -5, 
    453443 
     
    470460       -6,   -6,   -6,   -6,   -6,   -6,   -6,   -6,   -6,   -6, 
    471461       -6,   -6,   -6,   -6,   -6,   -6,   -6,   -6,   -6,   -6, 
    472        -6,   -6,   -6,   -6,   -6,   22,   22,   22,   22,   22, 
    473        22,   22,   22,   22,   22,   22,   22,   22,   22,   22, 
    474        22,   22,   22,   22,   22,   22,   22,   22,   22,   22, 
    475        22,   -6,   -6,   -6,   -6,   -6,   -6,   22,   22,   22, 
    476        22,   22,   22,   22,   22,   22,   22,   22,   22,   22, 
    477        22,   22,   22,   22,   22,   22,   22,   22,   22,   22, 
    478  
    479        22,   22,   22,   -6,   -6,   -6,   -6,   -6 
     462       -6,   -6,   -6,   -6,   -6,   24,   24,   24,   24,   24, 
     463       24,   24,   24,   24,   24,   24,   24,   24,   24,   24, 
     464       24,   24,   24,   24,   24,   24,   24,   24,   24,   24, 
     465       24,   -6,   -6,   -6,   -6,   -6,   -6,   24,   24,   24, 
     466       24,   24,   24,   24,   24,   24,   24,   24,   24,   24, 
     467       24,   24,   24,   24,   24,   24,   24,   24,   24,   24, 
     468 
     469       24,   24,   24,   -6,   -6,   -6,   -6,   -6 
    480470    }, 
    481471 
     
    574564      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    575565      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    576       -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
     566      -12,   25,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    577567      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
    578568      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12, 
     
    589579      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    590580      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    591       -13,  -13,  -13,  -13,  -13,  -13,   23,  -13,   24,   24, 
    592        24,   24,   24,   24,   24,   24,   24,   24,  -13,  -13, 
    593       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,   25, 
     581      -13,  -13,  -13,  -13,  -13,  -13,   26,  -13,   27,   27, 
     582       27,   27,   27,   27,   27,   27,   27,   27,  -13,  -13, 
     583      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,   28, 
    594584      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    595585      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    596586      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    597       -13,   25,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
     587      -13,   28,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
    598588 
    599589      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13, 
     
    608598      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    609599      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    610       -14,   26,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
     600      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    611601      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14, 
    612602 
     
    626616 
    627617      -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
    628       -15,   27,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
     618      -15,   29,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
    629619      -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
    630620      -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15,  -15, 
     
    643633      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    644634      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    645       -16,   28,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
     635      -16,   30,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    646636      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
    647637      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16, 
     
    660650      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
    661651      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
    662       -17,  -17,  -17,  -17,  -17,   29,   29,   29,   29,   29, 
    663        29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
    664        29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
    665  
    666        29,  -17,  -17,  -17,  -17,  -17,  -17,   29,   29,   29, 
    667        29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
    668        29,   29,   29,   29,   29,   29,   29,   29,   29,   29, 
    669        29,   29,   29,  -17,  -17,  -17,  -17,  -17 
     652      -17,   31,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
     653      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
     654      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
     655 
     656      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
     657      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
     658      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17, 
     659      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17 
    670660    }, 
    671661 
     
    675665      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
    676666      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
    677       -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,   30,   30, 
    678        30,   30,   30,   30,   30,   30,   30,   30,  -18,  -18, 
    679  
    680       -18,  -18,  -18,  -18,  -18,   30,   30,   30,   30,   30, 
    681        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    682        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    683        30,  -18,  -18,  -18,  -18,   30,  -18,   30,   30,   30, 
    684        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    685        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    686        30,   30,   30,  -18,  -18,  -18,  -18,  -18 
     667      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     668      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     669 
     670      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     671      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     672      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     673      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     674      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     675      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18, 
     676      -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18 
    687677    }, 
    688678 
     
    695685      -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    696686      -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    697       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    698       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    699       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    700       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    701       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    702       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19, 
    703       -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19 
     687      -19,  -19,  -19,  -19,  -19,   32,   32,   32,   32,   32, 
     688       32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
     689       32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
     690       32,  -19,  -19,  -19,  -19,  -19,  -19,   32,   32,   32, 
     691       32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
     692       32,   32,   32,   32,   32,   32,   32,   32,   32,   32, 
     693       32,   32,   32,  -19,  -19,  -19,  -19,  -19 
    704694 
    705695    }, 
     
    710700      -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    711701      -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    712       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    713       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    714       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    715       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    716       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    717       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    718  
    719       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    720       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20, 
    721       -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20 
    722     }, 
    723  
    724     { 
    725         3,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,   21, 
     702      -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,   33,   33, 
     703       33,   33,   33,   33,   33,   33,   33,   33,  -20,  -20, 
     704      -20,  -20,  -20,  -20,  -20,   33,   33,   33,   33,   33, 
     705       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     706       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     707       33,  -20,  -20,  -20,  -20,   33,  -20,   33,   33,   33, 
     708 
     709       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     710       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     711       33,   33,   33,  -20,  -20,  -20,  -20,  -20 
     712    }, 
     713 
     714    { 
     715        3,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
    726716      -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
    727717      -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
    728       -21,  -21,   21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
     718      -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
    729719      -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
    730720      -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21, 
     
    745735      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
    746736 
    747       -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,   31,   31, 
    748        31,   31,   31,   31,   31,   31,   31,   31,  -22,  -22, 
    749       -22,  -22,  -22,  -22,  -22,   31,   31,   31,   31,   31, 
    750        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    751        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    752        31,  -22,  -22,  -22,  -22,   31,  -22,   31,   31,   31, 
    753        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    754        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    755        31,   31,   31,  -22,  -22,  -22,  -22,  -22 
    756     }, 
    757  
    758     { 
    759         3,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     737      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     738      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     739      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     740      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     741      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     742      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     743      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     744      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22, 
     745      -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22 
     746    }, 
     747 
     748    { 
     749        3,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,   23, 
    760750 
    761751      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    762752      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    763       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    764       -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,   32,   32, 
    765        32,   32,   32,   32,   32,   32,   32,   32,  -23,  -23, 
     753      -23,  -23,   23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    766754      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    767755      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     
    769757      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    770758      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     759      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     760      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
    771761 
    772762      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23, 
     
    779769      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    780770      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    781       -24,  -24,  -24,  -24,  -24,  -24,   23,  -24,   24,   24, 
    782        24,   24,   24,   24,   24,   24,   24,   24,  -24,  -24, 
    783       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,   25, 
    784       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    785  
    786       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    787       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    788       -24,   25,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    789       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24, 
    790       -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24 
     771      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,   34,   34, 
     772       34,   34,   34,   34,   34,   34,   34,   34,  -24,  -24, 
     773      -24,  -24,  -24,  -24,  -24,   34,   34,   34,   34,   34, 
     774       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     775 
     776       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     777       34,  -24,  -24,  -24,  -24,   34,  -24,   34,   34,   34, 
     778       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     779       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     780       34,   34,   34,  -24,  -24,  -24,  -24,  -24 
    791781    }, 
    792782 
     
    796786      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    797787      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    798       -25,  -25,  -25,   33,  -25,   33,  -25,  -25,   34,   34, 
    799  
    800        34,   34,   34,   34,   34,   34,   34,   34,  -25,  -25, 
     788      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
     789 
     790      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    801791      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
    802792      -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25, 
     
    814804      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    815805      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
     806      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,   35,   35, 
     807       35,   35,   35,   35,   35,   35,   35,   35,  -26,  -26, 
    816808      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    817809      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
     
    820812      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    821813      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    822       -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    823       -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26, 
    824814 
    825815      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26 
     
    831821      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    832822      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
     823      -27,  -27,  -27,  -27,  -27,  -27,   26,  -27,   27,   27, 
     824       27,   27,   27,   27,   27,   27,   27,   27,  -27,  -27, 
     825      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,   28, 
    833826      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    834827      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
     828 
    835829      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    836       -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    837       -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    838  
    839       -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    840       -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
     830      -27,   28,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    841831      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27, 
    842832      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27 
     
    848838      -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28, 
    849839      -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28, 
    850       -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28, 
    851       -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28, 
     840      -28,  -28,  -28,   36,  -28,   36,  -28,  -28,   37,   37, 
     841       37,   37,   37,   37,   37,   37,   37,   37,  -28,  -28, 
    852842 
    853843      -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28, 
     
    866856 
    867857      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
    868       -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,   35,   35, 
    869        35,   35,   35,   35,   35,   35,   35,   35,  -29,  -29, 
    870       -29,  -29,  -29,  -29,  -29,   35,   35,   35,   35,   35, 
    871        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    872        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    873        35,  -29,  -29,  -29,  -29,   35,  -29,   35,   35,   35, 
    874        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    875        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    876        35,   35,   35,  -29,  -29,  -29,  -29,  -29 
     858      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     859      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     860      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     861      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     862      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     863      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     864      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     865      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29, 
     866      -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29 
    877867 
    878868    }, 
     
    883873      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
    884874      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
    885       -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,   30,   30, 
    886        30,   30,   30,   30,   30,   30,   30,   30,  -30,  -30, 
    887       -30,  -30,  -30,  -30,  -30,   30,   30,   30,   30,   30, 
    888        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    889        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    890        30,  -30,  -30,  -30,  -30,   30,  -30,   30,   30,   30, 
    891  
    892        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    893        30,   30,   30,   30,   30,   30,   30,   30,   30,   30, 
    894        30,   30,   30,  -30,  -30,  -30,  -30,  -30 
     875      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     876      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     877      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     878      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     879      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     880      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     881 
     882      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     883      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30, 
     884      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30 
    895885    }, 
    896886 
     
    900890      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
    901891      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
    902       -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,   31,   31, 
    903        31,   31,   31,   31,   31,   31,   31,   31,  -31,  -31, 
    904       -31,  -31,  -31,  -31,  -31,   31,   31,   31,   31,   31, 
    905  
    906        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    907        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    908        31,  -31,  -31,  -31,  -31,   31,  -31,   31,   31,   31, 
    909        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    910        31,   31,   31,   31,   31,   31,   31,   31,   31,   31, 
    911        31,   31,   31,  -31,  -31,  -31,  -31,  -31 
     892      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     893      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     894      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     895 
     896      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     897      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     898      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     899      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     900      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31, 
     901      -31,  -31,  -31,  -31,  -31,  -31,  -31,  -31 
    912902    }, 
    913903 
     
    918908      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
    919909 
    920       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   32,   32, 
    921        32,   32,   32,   32,   32,   32,   32,   32,  -32,  -32, 
    922       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   25, 
    923       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
    924       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
    925       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
    926       -32,   25,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
    927       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32, 
    928       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32 
     910      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,   38,   38, 
     911       38,   38,   38,   38,   38,   38,   38,   38,  -32,  -32, 
     912      -32,  -32,  -32,  -32,  -32,   38,   38,   38,   38,   38, 
     913       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     914       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     915       38,  -32,  -32,  -32,  -32,   38,  -32,   38,   38,   38, 
     916       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     917       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     918       38,   38,   38,  -32,  -32,  -32,  -32,  -32 
    929919    }, 
    930920 
     
    935925      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    936926      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    937       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   34,   34, 
    938        34,   34,   34,   34,   34,   34,   34,   34,  -33,  -33, 
    939       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    940       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    941       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    942       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    943       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    944  
    945       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33, 
    946       -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33 
     927      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,   33,   33, 
     928       33,   33,   33,   33,   33,   33,   33,   33,  -33,  -33, 
     929      -33,  -33,  -33,  -33,  -33,   33,   33,   33,   33,   33, 
     930       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     931       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     932       33,  -33,  -33,  -33,  -33,   33,  -33,   33,   33,   33, 
     933       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     934 
     935       33,   33,   33,   33,   33,   33,   33,   33,   33,   33, 
     936       33,   33,   33,  -33,  -33,  -33,  -33,  -33 
    947937    }, 
    948938 
     
    954944      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,   34,   34, 
    955945       34,   34,   34,   34,   34,   34,   34,   34,  -34,  -34, 
    956       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    957       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    958  
    959       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    960       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    961       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    962       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34, 
    963       -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34 
     946      -34,  -34,  -34,  -34,  -34,   34,   34,   34,   34,   34, 
     947       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     948 
     949       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     950       34,  -34,  -34,  -34,  -34,   34,  -34,   34,   34,   34, 
     951       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     952       34,   34,   34,   34,   34,   34,   34,   34,   34,   34, 
     953       34,   34,   34,  -34,  -34,  -34,  -34,  -34 
    964954    }, 
    965955 
     
    972962 
    973963       35,   35,   35,   35,   35,   35,   35,   35,  -35,  -35, 
    974       -35,  -35,  -35,  -35,  -35,   35,   35,   35,   35,   35, 
    975        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    976        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    977        35,  -35,  -35,  -35,  -35,   35,  -35,   35,   35,   35, 
    978        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    979        35,   35,   35,   35,   35,   35,   35,   35,   35,   35, 
    980        35,   35,   35,  -35,  -35,  -35,  -35,  -35 
     964      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,   28, 
     965      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
     966      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
     967      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
     968      -35,   28,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
     969      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35, 
     970      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35 
     971    }, 
     972 
     973    { 
     974        3,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     975      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     976 
     977      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     978      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     979      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,   37,   37, 
     980       37,   37,   37,   37,   37,   37,   37,   37,  -36,  -36, 
     981      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     982      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     983      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     984      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     985      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     986      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36, 
     987 
     988      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36 
     989    }, 
     990 
     991    { 
     992        3,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     993      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     994      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     995      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     996      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,   37,   37, 
     997       37,   37,   37,   37,   37,   37,   37,   37,  -37,  -37, 
     998      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     999      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     1000      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     1001 
     1002      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     1003      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     1004      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37, 
     1005      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37 
     1006    }, 
     1007 
     1008    { 
     1009        3,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38, 
     1010      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38, 
     1011      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38, 
     1012      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38, 
     1013      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,   38,   38, 
     1014       38,   38,   38,   38,   38,   38,   38,   38,  -38,  -38, 
     1015 
     1016      -38,  -38,  -38,  -38,  -38,   38,   38,   38,   38,   38, 
     1017       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     1018       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     1019       38,  -38,  -38,  -38,  -38,   38,  -38,   38,   38,   38, 
     1020       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     1021       38,   38,   38,   38,   38,   38,   38,   38,   38,   38, 
     1022       38,   38,   38,  -38,  -38,  -38,  -38,  -38 
    9811023    }, 
    9821024 
     
    9981040        (yy_c_buf_p) = yy_cp; 
    9991041 
    1000 #define YY_NUM_RULES 19 
    1001 #define YY_END_OF_BUFFER 20 
     1042#define YY_NUM_RULES 22 
     1043#define YY_END_OF_BUFFER 23 
    10021044/* This struct is not used in this scanner, 
    10031045   but its presence is necessary. */ 
     
    10071049        flex_int32_t yy_nxt; 
    10081050        }; 
    1009 static yyconst flex_int16_t yy_accept[36] = 
     1051static yyconst flex_int16_t yy_accept[39] = 
    10101052    {   0, 
    1011         0,    0,   20,   19,    1,   19,   16,   17,    8,    6, 
    1012         7,    9,    2,   12,   19,   13,   19,    5,   10,   18, 
    1013         1,    4,    0,    2,    0,   14,   11,   15,    3,    5, 
    1014         4,    2,    0,    2,    3 
     1053        0,    0,   23,   22,    1,   22,   19,   20,    8,    6, 
     1054        7,    9,    2,   18,   12,   22,   13,   17,   22,    5, 
     1055       10,   21,    1,    4,   16,    0,    2,    0,   14,   11, 
     1056       15,    3,    5,    4,    2,    0,    2,    3 
    10151057    } ; 
    10161058 
     
    10181060static char *yy_last_accepting_cpos; 
    10191061 
    1020 static yyconst yy_state_type yy_NUL_trans[36] = 
     1062static yyconst yy_state_type yy_NUL_trans[39] = 
    10211063    {   0, 
    1022        20,   20,    0,    0,    0,    0,    0,    0,    0,    0, 
     1064       22,   22,    0,    0,    0,    0,    0,    0,    0,    0, 
    10231065        0,    0,    0,    0,    0,    0,    0,    0,    0,    0, 
    10241066        0,    0,    0,    0,    0,    0,    0,    0,    0,    0, 
    1025         0,    0,    0,    0,    0 
     1067        0,    0,    0,    0,    0,    0,    0,    0 
    10261068    } ; 
    10271069 
     
    10531095#include "yacc_parser.hpp" 
    10541096 
    1055 #line 1056 "lex_parser.cpp" 
     1097#line 1098 "lex_parser.cpp" 
    10561098 
    10571099#define INITIAL 0 
     
    11341176/* Amount of stuff to slurp up with each read. */ 
    11351177#ifndef YY_READ_BUF_SIZE 
    1136 #ifdef __ia64__ 
    1137 /* On IA-64, the buffer size is 16k, not 8k */ 
    1138 #define YY_READ_BUF_SIZE 16384 
    1139 #else 
    11401178#define YY_READ_BUF_SIZE 8192 
    1141 #endif /* __ia64__ */ 
    11421179#endif 
    11431180 
     
    12241261        register int yy_act; 
    12251262     
     1263#line 29 "lex_parser.lex" 
     1264 
     1265 
     1266#line 1267 "lex_parser.cpp" 
     1267 
    12261268        if ( !(yy_init) ) 
    12271269                { 
     
    12491291                yy_load_buffer_state( ); 
    12501292                } 
    1251  
    1252         { 
    1253 #line 29 "lex_parser.lex" 
    1254  
    1255  
    1256 #line 1257 "lex_parser.cpp" 
    12571293 
    12581294        while ( 1 )             /* loops until end-of-file is reached */ 
     
    13881424case 16: 
    13891425YY_RULE_SETUP 
    1390 #line 68 "lex_parser.lex" 
    1391 return LEFT_PARENTHESIS; 
     1426#line 67 "lex_parser.lex" 
     1427return NE; 
    13921428        YY_BREAK 
    13931429case 17: 
    13941430YY_RULE_SETUP 
    1395 #line 69 "lex_parser.lex" 
    1396 return RIGHT_PARENTHESIS; 
     1431#line 68 "lex_parser.lex" 
     1432return QUESTION_MARK; 
    13971433        YY_BREAK 
    13981434case 18: 
    13991435YY_RULE_SETUP 
    1400 #line 71 "lex_parser.lex" 
    1401 return END; 
     1436#line 69 "lex_parser.lex" 
     1437return COLON; 
    14021438        YY_BREAK 
    14031439case 19: 
    14041440YY_RULE_SETUP 
    1405 #line 72 "lex_parser.lex" 
     1441#line 70 "lex_parser.lex" 
     1442return LEFT_PARENTHESIS; 
     1443        YY_BREAK 
     1444case 20: 
     1445YY_RULE_SETUP 
     1446#line 71 "lex_parser.lex" 
     1447return RIGHT_PARENTHESIS; 
     1448        YY_BREAK 
     1449case 21: 
     1450YY_RULE_SETUP 
     1451#line 73 "lex_parser.lex" 
     1452return END; 
     1453        YY_BREAK 
     1454case 22: 
     1455YY_RULE_SETUP 
     1456#line 74 "lex_parser.lex" 
    14061457ECHO; 
    14071458        YY_BREAK 
    1408 #line 1409 "lex_parser.cpp" 
     1459#line 1460 "lex_parser.cpp" 
    14091460case YY_STATE_EOF(INITIAL): 
    14101461        yyterminate(); 
     
    15371588        } /* end of action switch */ 
    15381589                } /* end of scanning one token */ 
    1539         } /* end of user's declarations */ 
    15401590} /* end of yylex */ 
    15411591 
     
    21662216        char *buf; 
    21672217        yy_size_t n; 
    2168         yy_size_t i; 
     2218        int i; 
    21692219     
    21702220        /* Get memory for full buffer, including space for trailing EOB's. */ 
     
    23962446#define YYTABLES_NAME "yytables" 
    23972447 
    2398 #line 71 "lex_parser.lex" 
     2448#line 74 "lex_parser.lex" 
  • XIOS/dev/dev_olga/src/parse_expr/lex_parser.lex

    r728 r1158  
    6565"<=" return LE; 
    6666">=" return GE; 
    67  
     67"/=" return NE; 
     68"?" return QUESTION_MARK; 
     69":" return COLON; 
    6870"("  return LEFT_PARENTHESIS; 
    6971")"  return RIGHT_PARENTHESIS; 
  • XIOS/dev/dev_olga/src/parse_expr/operator_expr.hpp

    r728 r1158  
    1717    typedef double (*functionScalar)(double); 
    1818    typedef double (*functionScalarScalar)(double, double); 
     19    typedef double (*functionScalarScalarScalar)(double, double,double); 
    1920    typedef CArray<double,1> (*functionField)(const CArray<double,1>&); 
    2021    typedef CArray<double,1> (*functionFieldField)(const CArray<double,1>&, const CArray<double,1>&); 
    2122    typedef CArray<double,1> (*functionFieldScalar)(const CArray<double,1>&, double); 
    2223    typedef CArray<double,1> (*functionScalarField)(double, const CArray<double,1>&); 
    23  
     24    typedef CArray<double,1> (*functionScalarScalarField)(double, double, const CArray<double,1>&); 
     25    typedef CArray<double,1> (*functionScalarFieldScalar)(double, const CArray<double,1>&, double); 
     26    typedef CArray<double,1> (*functionScalarFieldField)(double, const CArray<double,1>&, const CArray<double,1>&); 
     27    typedef CArray<double,1> (*functionFieldScalarScalar)(const CArray<double,1>&, double, double); 
     28    typedef CArray<double,1> (*functionFieldScalarField)(const CArray<double,1>&, double, const CArray<double,1>&); 
     29    typedef CArray<double,1> (*functionFieldFieldScalar)(const CArray<double,1>&,  const CArray<double,1>&, double); 
     30    typedef CArray<double,1> (*functionFieldFieldField)(const CArray<double,1>&,  const CArray<double,1>&, const CArray<double,1>&); 
     31     
    2432    COperatorExpr(void) 
    2533    { 
     
    4351      opScalarScalar[string("le")] = le_ss; 
    4452      opScalarScalar[string("ge")] = ge_ss; 
    45  
     53      opScalarScalar[string("ne")] = ne_ss; 
     54      opScalarScalarScalar[string("cond")] = cond_sss; 
     55       
    4656      opField[string("neg")] = neg_f; 
    4757      opField[string("cos")] = cos_f; 
     
    6373      opFieldField[string("le")] = le_ff; 
    6474      opFieldField[string("ge")] = ge_ff; 
     75      opFieldField[string("ne")] = ne_ff; 
    6576 
    6677      opFieldScalar[string("add")] = add_fs; 
     
    7485      opFieldScalar[string("le")] = le_fs; 
    7586      opFieldScalar[string("ge")] = ge_fs; 
     87      opFieldScalar[string("ne")] = ne_fs; 
    7688 
    7789      opScalarField[string("add")] = add_sf; 
     
    8496      opScalarField[string("le")] = le_sf; 
    8597      opScalarField[string("ge")] = ge_sf; 
     98      opScalarField[string("ne")] = ne_sf; 
     99 
     100      opScalarScalarField[string("cond")] = cond_ssf; 
     101      opScalarFieldScalar[string("cond")] = cond_sfs; 
     102      opScalarFieldField[string("cond")] = cond_sff; 
     103      opFieldScalarScalar[string("cond")] = cond_fss; 
     104      opFieldScalarField[string("cond")] = cond_fsf; 
     105      opFieldFieldScalar[string("cond")] = cond_ffs; 
     106      opFieldFieldField[string("cond")] = cond_fff; 
     107 
     108 
    86109    } 
    87110 
     
    102125    } 
    103126 
     127    functionScalarScalarScalar getOpScalarScalarScalar(const string& id) 
     128    { 
     129      map<string,double (*)(double,double,double)>::iterator it; 
     130      it = opScalarScalarScalar.find(id); 
     131      if (it == opScalarScalarScalar.end()) ERROR("functionScalarScalarScalar getOpScalarScalarScalar(const string& id)", << "unknown operator : " << id) 
     132      return it->second; 
     133    } 
     134 
    104135    functionField getOpField(const string& id) 
    105136    { 
     
    134165    } 
    135166 
     167    functionScalarScalarField getOpScalarScalarField(const string& id) 
     168    { 
     169      map<string,functionScalarScalarField>::iterator it; 
     170      it = opScalarScalarField.find(id); 
     171      if (it == opScalarScalarField.end()) ERROR("functionScalarScalarField getOpScalarScalarField(const string& id)", << "unknown operator : " << id) 
     172      return it->second; 
     173    } 
     174 
     175    functionScalarFieldScalar getOpScalarFieldScalar(const string& id) 
     176    { 
     177      map<string,functionScalarFieldScalar>::iterator it; 
     178      it = opScalarFieldScalar.find(id); 
     179      if (it == opScalarFieldScalar.end()) ERROR("functionScalarFieldScalar getOpScalarScalarField(const string& id)", << "unknown operator : " << id) 
     180      return it->second; 
     181    } 
     182 
     183    functionScalarFieldField getOpScalarFieldField(const string& id) 
     184    { 
     185      map<string,functionScalarFieldField>::iterator it; 
     186      it = opScalarFieldField.find(id); 
     187      if (it == opScalarFieldField.end()) ERROR("functionScalarFieldField getOpScalarFieldField(const string& id)", << "unknown operator : " << id) 
     188      return it->second; 
     189    } 
     190 
     191    functionFieldScalarScalar getOpFieldScalarScalar(const string& id) 
     192    { 
     193      map<string,functionFieldScalarScalar>::iterator it; 
     194      it = opFieldScalarScalar.find(id); 
     195      if (it == opFieldScalarScalar.end()) ERROR("functionFieldScalarScalar getOpFieldScalarScalar(const string& id)", << "unknown operator : " << id) 
     196      return it->second; 
     197    } 
     198 
     199    functionFieldScalarField getOpFieldScalarField(const string& id) 
     200    { 
     201      map<string,functionFieldScalarField>::iterator it; 
     202      it = opFieldScalarField.find(id); 
     203      if (it == opFieldScalarField.end()) ERROR("functionFieldScalarField getOpFieldScalarField(const string& id)", << "unknown operator : " << id) 
     204      return it->second; 
     205    } 
     206 
     207    functionFieldFieldScalar getOpFieldFieldScalar(const string& id) 
     208    { 
     209      map<string,functionFieldFieldScalar>::iterator it; 
     210      it = opFieldFieldScalar.find(id); 
     211      if (it == opFieldFieldScalar.end()) ERROR("functionFieldFieldScalar getOpFieldFieldScalar(const string& id)", << "unknown operator : " << id) 
     212      return it->second; 
     213    } 
     214 
     215    functionFieldFieldField getOpFieldFieldField(const string& id) 
     216    { 
     217      map<string,functionFieldFieldField>::iterator it; 
     218      it = opFieldFieldField.find(id); 
     219      if (it == opFieldFieldField.end()) ERROR("functionFieldFieldField getOpFieldFieldField(const string& id)", << "unknown operator : " << id) 
     220      return it->second; 
     221    } 
     222     
     223     
    136224    map<string,functionScalar> opScalar; 
    137225    map<string,functionScalarScalar> opScalarScalar; 
     226    map<string,functionScalarScalarScalar> opScalarScalarScalar; 
    138227    map<string,functionField> opField; 
    139228    map<string,functionFieldField> opFieldField; 
    140229    map<string,functionFieldScalar> opFieldScalar; 
    141230    map<string,functionScalarField> opScalarField; 
     231    map<string,functionScalarScalarField> opScalarScalarField; 
     232    map<string,functionScalarFieldScalar> opScalarFieldScalar; 
     233    map<string,functionScalarFieldField> opScalarFieldField; 
     234    map<string,functionFieldScalarScalar> opFieldScalarScalar; 
     235    map<string,functionFieldScalarField> opFieldScalarField; 
     236    map<string,functionFieldFieldScalar> opFieldFieldScalar; 
     237    map<string,functionFieldFieldField> opFieldFieldField; 
     238 
     239 
    142240 
    143241    static inline double neg_s(double x)   { return -x; } 
     
    160258    static inline double le_ss(double x, double y)    { return x <= y; } 
    161259    static inline double ge_ss(double x, double y)    { return x >= y; } 
     260    static inline double ne_ss(double x, double y)    { return x != y; } 
    162261 
    163262    static inline CArray<double,1> neg_f(const CArray<double,1>& x)   { return Array<double,1>(-x); } 
     
    180279    static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); } 
    181280    static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); } 
     281    static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x != y); } 
    182282 
    183283    static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(x + y); } 
     
    191291    static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x <= y); } 
    192292    static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x >= y); } 
     293    static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x != y); } 
    193294 
    194295    static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x + y); } 
     
    201302    static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); } 
    202303    static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); } 
     304    static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x != y); } 
     305 
     306 
     307    static inline double cond_sss(double x, double y, double z)   { return (x==0) ? z : y ; } 
     308 
     309    static inline CArray<double,1> cond_ssf(double x, double y, const CArray<double,1>& z) 
     310    { 
     311      CArray<double,1> ret(z.numElements()) ; 
     312      if (x==0) ret=z ; 
     313      else ret=y ; 
     314      return ret ; 
     315    } 
     316 
     317    static inline CArray<double,1> cond_sfs(double x, const CArray<double,1>& y, double z) 
     318    { 
     319      CArray<double,1> ret(y.numElements()) ; 
     320     if (x==0) ret=z ; 
     321      else ret=y ; 
     322      return ret ; 
     323    } 
     324 
     325    static inline CArray<double,1> cond_sff(double x, const CArray<double,1>& y, const CArray<double,1>& z) 
     326    { 
     327      CArray<double,1> ret(y.numElements()) ; 
     328      if (x==0) ret=z ; 
     329      else ret=y ; 
     330      return ret ; 
     331    } 
     332     
     333    static inline CArray<double,1> cond_fss(const CArray<double,1>& x, double y, double z) 
     334    { 
     335      CArray<double,1> ret(x.numElements()) ; 
     336      Array<double,1>::const_iterator itx=x.begin(),itxe=x.end(); 
     337      Array<double,1>::iterator itret=ret.begin() ; 
     338       
     339      for(;itx!=itxe;++itx,++itret) *itret=( (*itx==0)?z:y) ; 
     340      return ret ; 
     341    } 
     342 
     343    static inline CArray<double,1> cond_fsf(const CArray<double,1>& x, double y, const CArray<double,1>& z) 
     344    { 
     345      CArray<double,1> ret(x.numElements()) ; 
     346      Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), itz=z.begin(); 
     347      Array<double,1>::iterator itret=ret.begin() ; 
     348      for(;itx!=itxe;++itx,++itz,++itret) *itret=( (*itx==0)?*itz:y) ; 
     349      return ret ; 
     350    } 
     351 
     352    static inline CArray<double,1> cond_ffs(const CArray<double,1>& x, const CArray<double,1>& y, double z) 
     353    { 
     354      CArray<double,1> ret(x.numElements()) ; 
     355      Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), ity=y.begin() ; 
     356      Array<double,1>::iterator itret=ret.begin() ; 
     357      for(;itx!=itxe;++itx,++ity,++itret) *itret=( (*itx==0)?z:*ity) ; 
     358      return ret ; 
     359    } 
     360 
     361    static inline CArray<double,1> cond_fff(const CArray<double,1>& x, const CArray<double,1>& y, const CArray<double,1>&  z) 
     362    { 
     363      CArray<double,1> ret(x.numElements()) ; 
     364      Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), ity=y.begin(), itz=z.begin() ; 
     365      Array<double,1>::iterator itret=ret.begin() ; 
     366      for(;itx!=itxe;++itx,++ity,++itz,++itret) *itret=( (*itx==0)?*itz:*ity) ; 
     367      return ret ; 
     368    } 
     369 
    203370  }; 
    204371 
  • XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.cpp

    r642 r1158  
    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 
     
    5967    return op(child1->reduce(), child2->reduce()); 
    6068  } 
     69 
     70 
     71  CScalarTernaryOpExprNode::CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3) 
     72    : child1(child1) 
     73    , opId(opId) 
     74    , child2(child2) 
     75    , child3(child3) 
     76  { 
     77    if (!child1 || !child2 || !child3) 
     78      ERROR("CScalarTernaryOpExprNode::CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3)", 
     79            "Impossible to create the new expression node, an invalid child node was provided."); 
     80  } 
     81 
     82  double CScalarTernaryOpExprNode::reduce() const 
     83  { 
     84    COperatorExpr::functionScalarScalarScalar op = operatorExpr.getOpScalarScalarScalar(opId); 
     85    return op(child1->reduce(), child2->reduce(), child3->reduce()); 
     86  } 
    6187} 
  • XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.hpp

    r642 r1158  
    107107      boost::scoped_ptr<IScalarExprNode> child1, child2; //!< The scalar child nodes to which the operator is applied 
    108108  }; 
     109 
     110    class CScalarTernaryOpExprNode : public IScalarExprNode 
     111  { 
     112    public: 
     113      /*! 
     114       * Constructs an expression node corresponding to the specified ternary operation 
     115       * applied to the provided scalar child nodes. 
     116       * Note that the child nodes will be destroyed automatically when the parent node 
     117       * is destroyed. 
     118       * 
     119       * \param opId the identifier of the operator 
     120       * \param child1, child2 , child3 the scalar child nodes to which the operator is applied 
     121       */ 
     122      CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3); 
     123 
     124      double reduce() const; 
     125 
     126    private: 
     127      std::string opId; //!< The identifier of the field 
     128      boost::scoped_ptr<IScalarExprNode> child1, child2, child3; //!< The scalar child nodes to which the operator is applied 
     129  }; 
    109130} 
    110131 
  • XIOS/dev/dev_olga/src/parse_expr/yacc_parser.cpp

    r728 r1158  
    145145    LE = 270, 
    146146    GE = 271, 
    147     LEFT_PARENTHESIS = 272, 
    148     RIGHT_PARENTHESIS = 273, 
    149     END = 274, 
    150     NEG = 275 
     147    NE = 272, 
     148    LEFT_PARENTHESIS = 273, 
     149    RIGHT_PARENTHESIS = 274, 
     150    QUESTION_MARK = 275, 
     151    COLON = 276, 
     152    END = 277, 
     153    NEG = 278 
    151154  }; 
    152155#endif 
     
    163166  xios::IFilterExprNode* filterNode; 
    164167 
    165 #line 166 "yacc_parser.cpp" /* yacc.c:355  */ 
     168#line 169 "yacc_parser.cpp" /* yacc.c:355  */ 
    166169}; 
    167170# define YYSTYPE_IS_TRIVIAL 1 
     
    178181/* Copy the second part of user declarations.  */ 
    179182 
    180 #line 181 "yacc_parser.cpp" /* yacc.c:358  */ 
     183#line 184 "yacc_parser.cpp" /* yacc.c:358  */ 
    181184 
    182185#ifdef short 
     
    420423#define YYFINAL  16 
    421424/* YYLAST -- Last index in YYTABLE.  */ 
    422 #define YYLAST   204 
     425#define YYLAST   371 
    423426 
    424427/* YYNTOKENS -- Number of terminals.  */ 
    425 #define YYNTOKENS  21 
     428#define YYNTOKENS  24 
    426429/* YYNNTS -- Number of nonterminals.  */ 
    427430#define YYNNTS  4 
    428431/* YYNRULES -- Number of rules.  */ 
    429 #define YYNRULES  52 
     432#define YYNRULES  64 
    430433/* YYNSTATES -- Number of states.  */ 
    431 #define YYNSTATES  108 
     434#define YYNSTATES  138 
    432435 
    433436/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 
    434437   by yylex, with out-of-bounds checking.  */ 
    435438#define YYUNDEFTOK  2 
    436 #define YYMAXUTOK   275 
     439#define YYMAXUTOK   278 
    437440 
    438441#define YYTRANSLATE(YYX)                                                \ 
     
    470473       2,     2,     2,     2,     2,     2,     1,     2,     3,     4, 
    471474       5,     6,     7,     8,     9,    10,    11,    12,    13,    14, 
    472       15,    16,    17,    18,    19,    20 
     475      15,    16,    17,    18,    19,    20,    21,    22,    23 
    473476}; 
    474477 
     
    477480static const yytype_uint8 yyrline[] = 
    478481{ 
    479        0,    61,    61,    62,    66,    67,    68,    69,    70,    71, 
    480       72,    73,    74,    75,    76,    77,    78,    79,    80,    84, 
    481       85,    86,    87,    88,    89,    90,    91,    92,    93,    94, 
    482       95,    96,    97,    98,    99,   100,   101,   102,   103,   104, 
    483      105,   106,   107,   108,   109,   110,   111,   112,   113,   114, 
    484      115,   116,   117 
     482       0,    63,    63,    64,    68,    69,    70,    71,    72,    73, 
     483      74,    75,    76,    77,    78,    79,    80,    81,    82,    83, 
     484      84,    88,    89,    90,    91,    92,    93,    94,    95,    96, 
     485      97,    98,    99,   100,   101,   102,   103,   104,   105,   106, 
     486     107,   108,   109,   110,   111,   112,   113,   114,   115,   116, 
     487     117,   118,   119,   120,   121,   122,   123,   124,   125,   126, 
     488     127,   128,   129,   130,   131 
    485489}; 
    486490#endif 
     
    492496{ 
    493497  "$end", "error", "$undefined", "NUMBER", "VAR", "ID", "AVERAGE", "PLUS", 
    494   "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", 
    495   "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "END", "NEG", "$accept", "Line", 
    496   "Expression", "Field_expr", YY_NULLPTR 
     498  "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", "NE", 
     499  "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "QUESTION_MARK", "COLON", "END", 
     500  "NEG", "$accept", "Line", "Expression", "Field_expr", YY_NULLPTR 
    497501}; 
    498502#endif 
     
    505509       0,   256,   257,   258,   259,   260,   261,   262,   263,   264, 
    506510     265,   266,   267,   268,   269,   270,   271,   272,   273,   274, 
    507      275 
     511     275,   276,   277,   278 
    508512}; 
    509513# endif 
    510514 
    511 #define YYPACT_NINF -13 
     515#define YYPACT_NINF -14 
    512516 
    513517#define yypact_value_is_default(Yystate) \ 
    514   (!!((Yystate) == (-13))) 
     518  (!!((Yystate) == (-14))) 
    515519 
    516520#define YYTABLE_NINF -1 
    517521 
    518522#define yytable_value_is_error(Yytable_value) \ 
    519   0 
     523  (!!((Yytable_value) == (-1))) 
    520524 
    521525  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 
     
    523527static const yytype_int16 yypact[] = 
    524528{ 
    525       90,   -13,   -13,   -12,   -13,    35,    35,   -13,    44,   188, 
    526      103,    35,    24,    34,   116,   128,   -13,    35,    35,    35, 
    527       35,    65,    35,    35,    35,    35,    35,    35,    35,    35, 
    528       35,    35,    35,    35,    35,    35,    35,   -13,   140,   152, 
    529      -13,   -13,    -7,    23,    -7,    23,    24,    34,    24,    34, 
    530       54,    65,    65,    24,     0,    67,     0,    67,     0,    67, 
    531        0,    67,     0,    67,    -7,    23,    -7,    23,    24,    34, 
    532       24,    34,    24,    34,     0,    67,     0,    67,     0,    67, 
    533        0,    67,     0,    67,   -13,   -13,    65,    24,   164,    65, 
    534       65,    65,    65,    65,    65,    65,    65,    65,   176,    95, 
    535       95,    24,    24,    92,    92,    92,    92,    92 
     529      73,   -14,   -14,   -13,   -14,   124,   124,   -14,    39,   304, 
     530     104,   124,    34,    36,   220,   234,   -14,   124,   124,   124, 
     531     124,   133,   124,   124,   124,   124,   124,   124,   124,   124, 
     532     124,   124,   124,   124,   124,   124,   124,   124,   124,   124, 
     533     124,   -14,   248,   262,   -14,   -14,    -7,    27,    -7,    27, 
     534      34,    36,    34,    36,    30,   133,   133,    34,     0,    75, 
     535       0,    75,     0,    75,     0,    75,     0,    75,     0,    75, 
     536     145,   160,    -7,    27,    -7,    27,    34,    36,    34,    36, 
     537      34,    36,     0,    75,     0,    75,     0,    75,     0,    75, 
     538       0,    75,     0,    75,   175,   190,   -14,   -14,   133,    34, 
     539     276,   133,   133,   133,   133,   133,   133,   133,   133,   133, 
     540     133,   133,   124,   124,   124,   124,   290,    33,    33,    34, 
     541      34,   360,   360,   360,   360,   360,   360,   205,   318,   332, 
     542     318,   332,   318,   332,   318,   332,   133,   346 
    536543}; 
    537544 
     
    541548static const yytype_uint8 yydefact[] = 
    542549{ 
    543        0,     4,     5,    19,    20,     0,     0,     2,     0,     0, 
    544        0,     0,    10,    25,     0,     0,     1,     0,     0,     0, 
     550       0,     4,     5,    21,    22,     0,     0,     2,     0,     0, 
     551       0,     0,    10,    27,     0,     0,     1,     0,     0,     0, 
    545552       0,     0,     0,     0,     0,     0,     0,     0,     0,     0, 
    546        0,     0,     0,     0,     0,     0,     0,     3,     0,     0, 
    547       17,    32,     6,    34,     7,    36,     8,    38,     9,    40, 
    548        0,     0,     0,    11,    12,    43,    13,    45,    14,    47, 
    549       15,    49,    16,    51,    33,    21,    35,    22,    37,    23, 
    550       39,    24,    41,    26,    42,    27,    44,    28,    46,    29, 
    551       48,    30,    50,    31,    18,    52,     0,    10,     0,     0, 
    552        0,     0,     0,     0,     0,     0,     0,     0,     0,     6, 
    553        7,     8,     9,    12,    13,    14,    15,    16 
     553       0,     0,     0,     0,     0,     0,     0,     0,     0,     0, 
     554       0,     3,     0,     0,    19,    35,     6,    44,     7,    46, 
     555       8,    48,     9,    50,     0,     0,     0,    11,    12,    53, 
     556      13,    55,    14,    57,    15,    59,    16,    61,    17,    63, 
     557       0,     0,    43,    23,    45,    24,    47,    25,    49,    26, 
     558      51,    28,    52,    29,    54,    30,    56,    31,    58,    32, 
     559      60,    33,    62,    34,     0,     0,    20,    64,     0,    10, 
     560       0,     0,     0,     0,     0,     0,     0,     0,     0,     0, 
     561       0,     0,     0,     0,     0,     0,     0,     6,     7,     8, 
     562       9,    12,    13,    14,    15,    16,    17,     0,    18,    36, 
     563      37,    38,    39,    40,    41,    42,     0,    18 
    554564}; 
    555565 
     
    557567static const yytype_int8 yypgoto[] = 
    558568{ 
    559      -13,   -13,    -5,    31 
     569     -14,   -14,    -5,    35 
    560570}; 
    561571 
     
    569579     positive, shift that token.  If negative, reduce the rule whose 
    570580     number is the opposite.  If YYTABLE_NINF, syntax error.  */ 
    571 static const yytype_uint8 yytable[] = 
    572 { 
    573       12,    14,    19,    20,    21,    11,    38,    17,    18,    19, 
    574       20,    21,    42,    44,    46,    48,    53,    54,    56,    58, 
    575       60,    62,    64,    66,    68,    70,    72,    74,    76,    78, 
    576       80,    82,    29,    30,    31,    21,    13,    15,     1,     2, 
    577        3,     4,    39,     5,    16,    31,    87,    88,    43,    45, 
    578       47,    49,     6,    55,    57,    59,    61,    63,    65,    67, 
    579       69,    71,    73,    75,    77,    79,    81,    83,     1,     2, 
    580       50,    86,     0,    51,    27,    28,    29,    30,    31,     0, 
    581        0,    98,    52,     0,    99,   100,   101,   102,   103,   104, 
    582      105,   106,   107,     1,     2,     3,     4,     0,     5,    89, 
    583       90,    91,    92,    21,    91,    92,    21,     6,     0,     7, 
    584       27,    28,    29,    30,    31,    32,    33,    34,    35,    36, 
    585        0,     0,    37,    17,    18,    19,    20,    21,    22,    23, 
    586       24,    25,    26,     0,    40,    27,    28,    29,    30,    31, 
    587       32,    33,    34,    35,    36,     0,    41,    17,    18,    19, 
    588       20,    21,    22,    23,    24,    25,    26,     0,    84,    27, 
    589       28,    29,    30,    31,    32,    33,    34,    35,    36,     0, 
    590       85,    89,    90,    91,    92,    21,    93,    94,    95,    96, 
    591       97,     0,    40,    89,    90,    91,    92,    21,    93,    94, 
    592       95,    96,    97,     0,    84,    17,    18,    19,    20,    21, 
    593       22,    23,    24,    25,    26 
     581static const yytype_int16 yytable[] = 
     582{ 
     583      12,    14,    19,    20,    21,    11,    42,    17,    18,    19, 
     584      20,    21,    46,    48,    50,    52,    57,    58,    60,    62, 
     585      64,    66,    68,    70,    72,    74,    76,    78,    80,    82, 
     586      84,    86,    88,    90,    92,    94,    31,    32,    33,    16, 
     587      13,    15,   103,   104,    21,    21,    43,    33,    98,     0, 
     588      99,   100,    47,    49,    51,    53,     0,    59,    61,    63, 
     589      65,    67,    69,    71,    73,    75,    77,    79,    81,    83, 
     590      85,    87,    89,    91,    93,    95,     1,     2,     3,     4, 
     591       0,     5,    29,    30,    31,    32,    33,     0,     0,     0, 
     592       0,     6,     0,   116,     0,     7,   117,   118,   119,   120, 
     593     121,   122,   123,   124,   125,   126,   127,   128,   130,   132, 
     594     134,    29,    30,    31,    32,    33,    34,    35,    36,    37, 
     595      38,    39,     0,     0,    40,     0,    41,     1,     2,     3, 
     596       4,   137,     5,     0,     0,     0,     1,     2,    54,     0, 
     597       0,    55,     6,     0,     0,     0,     0,   129,   131,   133, 
     598     135,    56,    17,    18,    19,    20,    21,    22,    23,    24, 
     599      25,    26,    27,     0,     0,    28,   112,    29,    30,    31, 
     600      32,    33,    34,    35,    36,    37,    38,    39,     0,     0, 
     601      40,   113,    17,    18,    19,    20,    21,    22,    23,    24, 
     602      25,    26,    27,     0,     0,    28,   114,    29,    30,    31, 
     603      32,    33,    34,    35,    36,    37,    38,    39,     0,     0, 
     604      40,   115,   101,   102,   103,   104,    21,   105,   106,   107, 
     605     108,   109,   110,     0,     0,   111,   136,    17,    18,    19, 
     606      20,    21,    22,    23,    24,    25,    26,    27,     0,    44, 
     607      28,    29,    30,    31,    32,    33,    34,    35,    36,    37, 
     608      38,    39,     0,    45,    40,    17,    18,    19,    20,    21, 
     609      22,    23,    24,    25,    26,    27,     0,    96,    28,    29, 
     610      30,    31,    32,    33,    34,    35,    36,    37,    38,    39, 
     611       0,    97,    40,   101,   102,   103,   104,    21,   105,   106, 
     612     107,   108,   109,   110,     0,    44,   111,   101,   102,   103, 
     613     104,    21,   105,   106,   107,   108,   109,   110,     0,    96, 
     614     111,    17,    18,    19,    20,    21,    22,    23,    24,    25, 
     615      26,    27,     0,     0,    28,    17,    18,    19,    20,    21, 
     616      22,    23,    24,    25,    26,    27,     0,     0,    -1,    29, 
     617      30,    31,    32,    33,    34,    35,    36,    37,    38,    39, 
     618       0,     0,    -1,   101,   102,   103,   104,    21,   105,   106, 
     619     107,   108,   109,   110,     0,     0,    -1,   101,   102,   103, 
     620     104,    21 
    594621}; 
    595622 
    596 static const yytype_int8 yycheck[] = 
    597 { 
    598        5,     6,     9,    10,    11,    17,    11,     7,     8,     9, 
     623static const yytype_int16 yycheck[] = 
     624{ 
     625       5,     6,     9,    10,    11,    18,    11,     7,     8,     9, 
    599626      10,    11,    17,    18,    19,    20,    21,    22,    23,    24, 
    600627      25,    26,    27,    28,    29,    30,    31,    32,    33,    34, 
    601       35,    36,     9,    10,    11,    11,     5,     6,     3,     4, 
    602        5,     6,    11,     8,     0,    11,    51,    52,    17,    18, 
    603       19,    20,    17,    22,    23,    24,    25,    26,    27,    28, 
    604       29,    30,    31,    32,    33,    34,    35,    36,     3,     4, 
    605        5,    17,    -1,     8,     7,     8,     9,    10,    11,    -1, 
    606       -1,    86,    17,    -1,    89,    90,    91,    92,    93,    94, 
    607       95,    96,    97,     3,     4,     5,     6,    -1,     8,     7, 
    608        8,     9,    10,    11,     9,    10,    11,    17,    -1,    19, 
    609        7,     8,     9,    10,    11,    12,    13,    14,    15,    16, 
    610       -1,    -1,    19,     7,     8,     9,    10,    11,    12,    13, 
    611       14,    15,    16,    -1,    18,     7,     8,     9,    10,    11, 
    612       12,    13,    14,    15,    16,    -1,    18,     7,     8,     9, 
    613       10,    11,    12,    13,    14,    15,    16,    -1,    18,     7, 
    614        8,     9,    10,    11,    12,    13,    14,    15,    16,    -1, 
    615       18,     7,     8,     9,    10,    11,    12,    13,    14,    15, 
    616       16,    -1,    18,     7,     8,     9,    10,    11,    12,    13, 
    617       14,    15,    16,    -1,    18,     7,     8,     9,    10,    11, 
    618       12,    13,    14,    15,    16 
     628      35,    36,    37,    38,    39,    40,     9,    10,    11,     0, 
     629       5,     6,     9,    10,    11,    11,    11,    11,    18,    -1, 
     630      55,    56,    17,    18,    19,    20,    -1,    22,    23,    24, 
     631      25,    26,    27,    28,    29,    30,    31,    32,    33,    34, 
     632      35,    36,    37,    38,    39,    40,     3,     4,     5,     6, 
     633      -1,     8,     7,     8,     9,    10,    11,    -1,    -1,    -1, 
     634      -1,    18,    -1,    98,    -1,    22,   101,   102,   103,   104, 
     635     105,   106,   107,   108,   109,   110,   111,   112,   113,   114, 
     636     115,     7,     8,     9,    10,    11,    12,    13,    14,    15, 
     637      16,    17,    -1,    -1,    20,    -1,    22,     3,     4,     5, 
     638       6,   136,     8,    -1,    -1,    -1,     3,     4,     5,    -1, 
     639      -1,     8,    18,    -1,    -1,    -1,    -1,   112,   113,   114, 
     640     115,    18,     7,     8,     9,    10,    11,    12,    13,    14, 
     641      15,    16,    17,    -1,    -1,    20,    21,     7,     8,     9, 
     642      10,    11,    12,    13,    14,    15,    16,    17,    -1,    -1, 
     643      20,    21,     7,     8,     9,    10,    11,    12,    13,    14, 
     644      15,    16,    17,    -1,    -1,    20,    21,     7,     8,     9, 
     645      10,    11,    12,    13,    14,    15,    16,    17,    -1,    -1, 
     646      20,    21,     7,     8,     9,    10,    11,    12,    13,    14, 
     647      15,    16,    17,    -1,    -1,    20,    21,     7,     8,     9, 
     648      10,    11,    12,    13,    14,    15,    16,    17,    -1,    19, 
     649      20,     7,     8,     9,    10,    11,    12,    13,    14,    15, 
     650      16,    17,    -1,    19,    20,     7,     8,     9,    10,    11, 
     651      12,    13,    14,    15,    16,    17,    -1,    19,    20,     7, 
     652       8,     9,    10,    11,    12,    13,    14,    15,    16,    17, 
     653      -1,    19,    20,     7,     8,     9,    10,    11,    12,    13, 
     654      14,    15,    16,    17,    -1,    19,    20,     7,     8,     9, 
     655      10,    11,    12,    13,    14,    15,    16,    17,    -1,    19, 
     656      20,     7,     8,     9,    10,    11,    12,    13,    14,    15, 
     657      16,    17,    -1,    -1,    20,     7,     8,     9,    10,    11, 
     658      12,    13,    14,    15,    16,    17,    -1,    -1,    20,     7, 
     659       8,     9,    10,    11,    12,    13,    14,    15,    16,    17, 
     660      -1,    -1,    20,     7,     8,     9,    10,    11,    12,    13, 
     661      14,    15,    16,    17,    -1,    -1,    20,     7,     8,     9, 
     662      10,    11 
    619663}; 
    620664 
     
    623667static const yytype_uint8 yystos[] = 
    624668{ 
    625        0,     3,     4,     5,     6,     8,    17,    19,    22,    23, 
    626       24,    17,    23,    24,    23,    24,     0,     7,     8,     9, 
    627       10,    11,    12,    13,    14,    15,    16,     7,     8,     9, 
    628       10,    11,    12,    13,    14,    15,    16,    19,    23,    24, 
    629       18,    18,    23,    24,    23,    24,    23,    24,    23,    24, 
    630        5,     8,    17,    23,    23,    24,    23,    24,    23,    24, 
    631       23,    24,    23,    24,    23,    24,    23,    24,    23,    24, 
    632       23,    24,    23,    24,    23,    24,    23,    24,    23,    24, 
    633       23,    24,    23,    24,    18,    18,    17,    23,    23,     7, 
    634        8,     9,    10,    12,    13,    14,    15,    16,    23,    23, 
    635       23,    23,    23,    23,    23,    23,    23,    23 
     669       0,     3,     4,     5,     6,     8,    18,    22,    25,    26, 
     670      27,    18,    26,    27,    26,    27,     0,     7,     8,     9, 
     671      10,    11,    12,    13,    14,    15,    16,    17,    20,     7, 
     672       8,     9,    10,    11,    12,    13,    14,    15,    16,    17, 
     673      20,    22,    26,    27,    19,    19,    26,    27,    26,    27, 
     674      26,    27,    26,    27,     5,     8,    18,    26,    26,    27, 
     675      26,    27,    26,    27,    26,    27,    26,    27,    26,    27, 
     676      26,    27,    26,    27,    26,    27,    26,    27,    26,    27, 
     677      26,    27,    26,    27,    26,    27,    26,    27,    26,    27, 
     678      26,    27,    26,    27,    26,    27,    19,    19,    18,    26, 
     679      26,     7,     8,     9,    10,    12,    13,    14,    15,    16, 
     680      17,    20,    21,    21,    21,    21,    26,    26,    26,    26, 
     681      26,    26,    26,    26,    26,    26,    26,    26,    26,    27, 
     682      26,    27,    26,    27,    26,    27,    21,    26 
    636683}; 
    637684 
     
    639686static const yytype_uint8 yyr1[] = 
    640687{ 
    641        0,    21,    22,    22,    23,    23,    23,    23,    23,    23, 
    642       23,    23,    23,    23,    23,    23,    23,    23,    23,    24, 
    643       24,    24,    24,    24,    24,    24,    24,    24,    24,    24, 
    644       24,    24,    24,    24,    24,    24,    24,    24,    24,    24, 
    645       24,    24,    24,    24,    24,    24,    24,    24,    24,    24, 
    646       24,    24,    24 
     688       0,    24,    25,    25,    26,    26,    26,    26,    26,    26, 
     689      26,    26,    26,    26,    26,    26,    26,    26,    26,    26, 
     690      26,    27,    27,    27,    27,    27,    27,    27,    27,    27, 
     691      27,    27,    27,    27,    27,    27,    27,    27,    27,    27, 
     692      27,    27,    27,    27,    27,    27,    27,    27,    27,    27, 
     693      27,    27,    27,    27,    27,    27,    27,    27,    27,    27, 
     694      27,    27,    27,    27,    27 
    647695}; 
    648696 
     
    651699{ 
    652700       0,     2,     1,     2,     1,     1,     3,     3,     3,     3, 
    653        2,     3,     3,     3,     3,     3,     3,     3,     4,     1, 
    654        1,     3,     3,     3,     3,     2,     3,     3,     3,     3, 
     701       2,     3,     3,     3,     3,     3,     3,     3,     5,     3, 
     702       4,     1,     1,     3,     3,     3,     3,     2,     3,     3, 
     703       3,     3,     3,     3,     3,     3,     5,     5,     5,     5, 
     704       5,     5,     5,     3,     3,     3,     3,     3,     3,     3, 
    655705       3,     3,     3,     3,     3,     3,     3,     3,     3,     3, 
    656        3,     3,     3,     3,     3,     3,     3,     3,     3,     3, 
    657        3,     3,     4 
     706       3,     3,     3,     3,     4 
    658707}; 
    659708 
     
    13321381    { 
    13331382        case 2: 
    1334 #line 61 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1383#line 63 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13351384    { /* Nothing to do */ } 
    1336 #line 1337 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1385#line 1386 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13371386    break; 
    13381387 
    13391388  case 3: 
    1340 #line 62 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1389#line 64 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13411390    { parsed = (yyvsp[-1].filterNode); } 
    1342 #line 1343 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1391#line 1392 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13431392    break; 
    13441393 
    13451394  case 4: 
    1346 #line 66 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1395#line 68 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13471396    { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
    1348 #line 1349 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1397#line 1398 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13491398    break; 
    13501399 
    13511400  case 5: 
    1352 #line 67 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1401#line 69 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13531402    { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
    1354 #line 1355 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1403#line 1404 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13551404    break; 
    13561405 
    13571406  case 6: 
    1358 #line 68 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1407#line 70 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13591408    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); } 
    1360 #line 1361 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1409#line 1410 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13611410    break; 
    13621411 
    13631412  case 7: 
    1364 #line 69 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1413#line 71 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13651414    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); } 
    1366 #line 1367 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1415#line 1416 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13671416    break; 
    13681417 
    13691418  case 8: 
    1370 #line 70 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1419#line 72 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13711420    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); } 
    1372 #line 1373 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1421#line 1422 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13731422    break; 
    13741423 
    13751424  case 9: 
    1376 #line 71 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1425#line 73 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13771426    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); } 
    1378 #line 1379 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1427#line 1428 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13791428    break; 
    13801429 
    13811430  case 10: 
    1382 #line 72 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1431#line 74 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13831432    { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); } 
    1384 #line 1385 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1433#line 1434 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13851434    break; 
    13861435 
    13871436  case 11: 
    1388 #line 73 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1437#line 75 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13891438    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); } 
    1390 #line 1391 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1439#line 1440 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13911440    break; 
    13921441 
    13931442  case 12: 
    1394 #line 74 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1443#line 76 "yacc_parser.yacc" /* yacc.c:1646  */ 
    13951444    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].scalarNode)); } 
    1396 #line 1397 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1445#line 1446 "yacc_parser.cpp" /* yacc.c:1646  */ 
    13971446    break; 
    13981447 
    13991448  case 13: 
    1400 #line 75 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1449#line 77 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14011450    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].scalarNode)); } 
    1402 #line 1403 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1451#line 1452 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14031452    break; 
    14041453 
    14051454  case 14: 
    1406 #line 76 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1455#line 78 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14071456    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].scalarNode)); } 
    1408 #line 1409 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1457#line 1458 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14091458    break; 
    14101459 
    14111460  case 15: 
    1412 #line 77 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1461#line 79 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14131462    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].scalarNode)); } 
    1414 #line 1415 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1463#line 1464 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14151464    break; 
    14161465 
    14171466  case 16: 
    1418 #line 78 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1467#line 80 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14191468    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].scalarNode)); } 
    1420 #line 1421 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1469#line 1470 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14211470    break; 
    14221471 
    14231472  case 17: 
    1424 #line 79 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1473#line 81 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1474    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ne", (yyvsp[0].scalarNode)); } 
     1475#line 1476 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1476    break; 
     1477 
     1478  case 18: 
     1479#line 82 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1480    {(yyval.scalarNode) = new CScalarTernaryOpExprNode((yyvsp[-4].scalarNode), "cond", (yyvsp[-2].scalarNode), (yyvsp[0].scalarNode));} 
     1481#line 1482 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1482    break; 
     1483 
     1484  case 19: 
     1485#line 83 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14251486    { (yyval.scalarNode) = (yyvsp[-1].scalarNode); } 
    1426 #line 1427 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1427     break; 
    1428  
    1429   case 18: 
    1430 #line 80 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1487#line 1488 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1488    break; 
     1489 
     1490  case 20: 
     1491#line 84 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14311492    { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); } 
    1432 #line 1433 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1433     break; 
    1434  
    1435   case 19: 
    1436 #line 84 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1493#line 1494 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1494    break; 
     1495 
     1496  case 21: 
     1497#line 88 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14371498    { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
    1438 #line 1439 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1439     break; 
    1440  
    1441   case 20: 
    1442 #line 85 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1499#line 1500 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1500    break; 
     1501 
     1502  case 22: 
     1503#line 89 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14431504    { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
    1444 #line 1445 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1445     break; 
    1446  
    1447   case 21: 
    1448 #line 86 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1505#line 1506 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1506    break; 
     1507 
     1508  case 23: 
     1509#line 90 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14491510    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); } 
    1450 #line 1451 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1451     break; 
    1452  
    1453   case 22: 
    1454 #line 87 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1511#line 1512 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1512    break; 
     1513 
     1514  case 24: 
     1515#line 91 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14551516    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); } 
    1456 #line 1457 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1457     break; 
    1458  
    1459   case 23: 
    1460 #line 88 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1517#line 1518 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1518    break; 
     1519 
     1520  case 25: 
     1521#line 92 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14611522    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); } 
    1462 #line 1463 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1463     break; 
    1464  
    1465   case 24: 
    1466 #line 89 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1523#line 1524 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1524    break; 
     1525 
     1526  case 26: 
     1527#line 93 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14671528    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); } 
    1468 #line 1469 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1469     break; 
    1470  
    1471   case 25: 
    1472 #line 90 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1529#line 1530 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1530    break; 
     1531 
     1532  case 27: 
     1533#line 94 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14731534    { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); } 
    1474 #line 1475 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1475     break; 
    1476  
    1477   case 26: 
    1478 #line 91 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1535#line 1536 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1536    break; 
     1537 
     1538  case 28: 
     1539#line 95 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14791540    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); } 
    1480 #line 1481 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1481     break; 
    1482  
    1483   case 27: 
    1484 #line 92 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1541#line 1542 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1542    break; 
     1543 
     1544  case 29: 
     1545#line 96 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14851546    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].filterNode)); } 
    1486 #line 1487 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1487     break; 
    1488  
    1489   case 28: 
    1490 #line 93 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1547#line 1548 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1548    break; 
     1549 
     1550  case 30: 
     1551#line 97 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14911552    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].filterNode)); } 
    1492 #line 1493 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1493     break; 
    1494  
    1495   case 29: 
    1496 #line 94 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1553#line 1554 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1554    break; 
     1555 
     1556  case 31: 
     1557#line 98 "yacc_parser.yacc" /* yacc.c:1646  */ 
    14971558    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].filterNode)); } 
    1498 #line 1499 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1499     break; 
    1500  
    1501   case 30: 
    1502 #line 95 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1559#line 1560 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1560    break; 
     1561 
     1562  case 32: 
     1563#line 99 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15031564    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].filterNode)); } 
    1504 #line 1505 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1505     break; 
    1506  
    1507   case 31: 
    1508 #line 96 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1565#line 1566 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1566    break; 
     1567 
     1568  case 33: 
     1569#line 100 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15091570    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].filterNode)); } 
    1510 #line 1511 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1511     break; 
    1512  
    1513   case 32: 
    1514 #line 97 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1571#line 1572 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1572    break; 
     1573 
     1574  case 34: 
     1575#line 101 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1576    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ne", (yyvsp[0].filterNode)); } 
     1577#line 1578 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1578    break; 
     1579 
     1580  case 35: 
     1581#line 102 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15151582    { (yyval.filterNode) = (yyvsp[-1].filterNode); } 
    1516 #line 1517 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1517     break; 
    1518  
    1519   case 33: 
    1520 #line 98 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1583#line 1584 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1584    break; 
     1585 
     1586  case 36: 
     1587#line 103 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1588    {(yyval.filterNode) = new CFilterScalarScalarFieldOpExprNode((yyvsp[-4].scalarNode), "cond",(yyvsp[-2].scalarNode), (yyvsp[0].filterNode));} 
     1589#line 1590 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1590    break; 
     1591 
     1592  case 37: 
     1593#line 104 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1594    {(yyval.filterNode) = new CFilterScalarFieldScalarOpExprNode((yyvsp[-4].scalarNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].scalarNode));} 
     1595#line 1596 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1596    break; 
     1597 
     1598  case 38: 
     1599#line 105 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1600    {(yyval.filterNode) = new CFilterScalarFieldFieldOpExprNode((yyvsp[-4].scalarNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].filterNode));} 
     1601#line 1602 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1602    break; 
     1603 
     1604  case 39: 
     1605#line 106 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1606    {(yyval.filterNode) = new CFilterFieldScalarScalarOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].scalarNode), (yyvsp[0].scalarNode));} 
     1607#line 1608 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1608    break; 
     1609 
     1610  case 40: 
     1611#line 107 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1612    {(yyval.filterNode) = new CFilterFieldScalarFieldOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].scalarNode), (yyvsp[0].filterNode));} 
     1613#line 1614 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1614    break; 
     1615 
     1616  case 41: 
     1617#line 108 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1618    {(yyval.filterNode) = new CFilterFieldFieldScalarOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].scalarNode));} 
     1619#line 1620 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1620    break; 
     1621 
     1622  case 42: 
     1623#line 109 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1624    {(yyval.filterNode) = new CFilterFieldFieldFieldOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].filterNode));} 
     1625#line 1626 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1626    break; 
     1627 
     1628  case 43: 
     1629#line 110 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15211630    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); } 
    1522 #line 1523 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1523     break; 
    1524  
    1525   case 34: 
    1526 #line 99 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1631#line 1632 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1632    break; 
     1633 
     1634  case 44: 
     1635#line 111 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15271636    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); } 
    1528 #line 1529 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1529     break; 
    1530  
    1531   case 35: 
    1532 #line 100 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1637#line 1638 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1638    break; 
     1639 
     1640  case 45: 
     1641#line 112 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15331642    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); } 
    1534 #line 1535 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1535     break; 
    1536  
    1537   case 36: 
    1538 #line 101 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1643#line 1644 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1644    break; 
     1645 
     1646  case 46: 
     1647#line 113 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15391648    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); } 
    1540 #line 1541 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1541     break; 
    1542  
    1543   case 37: 
    1544 #line 102 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1649#line 1650 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1650    break; 
     1651 
     1652  case 47: 
     1653#line 114 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15451654    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); } 
    1546 #line 1547 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1547     break; 
    1548  
    1549   case 38: 
    1550 #line 103 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1655#line 1656 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1656    break; 
     1657 
     1658  case 48: 
     1659#line 115 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15511660    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); } 
    1552 #line 1553 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1553     break; 
    1554  
    1555   case 39: 
    1556 #line 104 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1661#line 1662 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1662    break; 
     1663 
     1664  case 49: 
     1665#line 116 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15571666    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); } 
    1558 #line 1559 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1559     break; 
    1560  
    1561   case 40: 
    1562 #line 105 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1667#line 1668 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1668    break; 
     1669 
     1670  case 50: 
     1671#line 117 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15631672    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); } 
    1564 #line 1565 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1565     break; 
    1566  
    1567   case 41: 
    1568 #line 106 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1673#line 1674 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1674    break; 
     1675 
     1676  case 51: 
     1677#line 118 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15691678    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); } 
    1570 #line 1571 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1571     break; 
    1572  
    1573   case 42: 
    1574 #line 107 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1679#line 1680 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1680    break; 
     1681 
     1682  case 52: 
     1683#line 119 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15751684    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].scalarNode)); } 
    1576 #line 1577 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1577     break; 
    1578  
    1579   case 43: 
    1580 #line 108 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1685#line 1686 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1686    break; 
     1687 
     1688  case 53: 
     1689#line 120 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15811690    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].filterNode)); } 
    1582 #line 1583 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1583     break; 
    1584  
    1585   case 44: 
    1586 #line 109 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1691#line 1692 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1692    break; 
     1693 
     1694  case 54: 
     1695#line 121 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15871696    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].scalarNode)); } 
    1588 #line 1589 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1589     break; 
    1590  
    1591   case 45: 
    1592 #line 110 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1697#line 1698 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1698    break; 
     1699 
     1700  case 55: 
     1701#line 122 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15931702    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].filterNode)); } 
    1594 #line 1595 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1595     break; 
    1596  
    1597   case 46: 
    1598 #line 111 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1703#line 1704 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1704    break; 
     1705 
     1706  case 56: 
     1707#line 123 "yacc_parser.yacc" /* yacc.c:1646  */ 
    15991708    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].scalarNode)); } 
    1600 #line 1601 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1601     break; 
    1602  
    1603   case 47: 
    1604 #line 112 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1709#line 1710 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1710    break; 
     1711 
     1712  case 57: 
     1713#line 124 "yacc_parser.yacc" /* yacc.c:1646  */ 
    16051714    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].filterNode)); } 
    1606 #line 1607 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1607     break; 
    1608  
    1609   case 48: 
    1610 #line 113 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1715#line 1716 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1716    break; 
     1717 
     1718  case 58: 
     1719#line 125 "yacc_parser.yacc" /* yacc.c:1646  */ 
    16111720    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].scalarNode)); } 
    1612 #line 1613 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1613     break; 
    1614  
    1615   case 49: 
    1616 #line 114 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1721#line 1722 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1722    break; 
     1723 
     1724  case 59: 
     1725#line 126 "yacc_parser.yacc" /* yacc.c:1646  */ 
    16171726    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].filterNode)); } 
    1618 #line 1619 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1619     break; 
    1620  
    1621   case 50: 
    1622 #line 115 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1727#line 1728 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1728    break; 
     1729 
     1730  case 60: 
     1731#line 127 "yacc_parser.yacc" /* yacc.c:1646  */ 
    16231732    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].scalarNode)); } 
    1624 #line 1625 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1625     break; 
    1626  
    1627   case 51: 
    1628 #line 116 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1733#line 1734 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1734    break; 
     1735 
     1736  case 61: 
     1737#line 128 "yacc_parser.yacc" /* yacc.c:1646  */ 
    16291738    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].filterNode)); } 
    1630 #line 1631 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1631     break; 
    1632  
    1633   case 52: 
    1634 #line 117 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1739#line 1740 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1740    break; 
     1741 
     1742  case 62: 
     1743#line 129 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1744    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ne", (yyvsp[0].scalarNode)); } 
     1745#line 1746 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1746    break; 
     1747 
     1748  case 63: 
     1749#line 130 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1750    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ne", (yyvsp[0].filterNode)); } 
     1751#line 1752 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1752    break; 
     1753 
     1754  case 64: 
     1755#line 131 "yacc_parser.yacc" /* yacc.c:1646  */ 
    16351756    { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); } 
    1636 #line 1637 "yacc_parser.cpp" /* yacc.c:1646  */ 
    1637     break; 
    1638  
    1639  
    1640 #line 1641 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1757#line 1758 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1758    break; 
     1759 
     1760 
     1761#line 1762 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16411762      default: break; 
    16421763    } 
     
    18661987  return yyresult; 
    18671988} 
    1868 #line 119 "yacc_parser.yacc" /* yacc.c:1906  */ 
     1989#line 133 "yacc_parser.yacc" /* yacc.c:1906  */ 
    18691990 
    18701991 
  • XIOS/dev/dev_olga/src/parse_expr/yacc_parser.hpp

    r728 r1158  
    6060    LE = 270, 
    6161    GE = 271, 
    62     LEFT_PARENTHESIS = 272, 
    63     RIGHT_PARENTHESIS = 273, 
    64     END = 274, 
    65     NEG = 275 
     62    NE = 272, 
     63    LEFT_PARENTHESIS = 273, 
     64    RIGHT_PARENTHESIS = 274, 
     65    QUESTION_MARK = 275, 
     66    COLON = 276, 
     67    END = 277, 
     68    NEG = 278 
    6669  }; 
    6770#endif 
     
    7881  xios::IFilterExprNode* filterNode; 
    7982 
    80 #line 81 "yacc_parser.hpp" /* yacc.c:1909  */ 
     83#line 84 "yacc_parser.hpp" /* yacc.c:1909  */ 
    8184}; 
    8285# define YYSTYPE_IS_TRIVIAL 1 
  • XIOS/dev/dev_olga/src/parse_expr/yacc_parser.yacc

    r728 r1158  
    4242%token <str> VAR ID AVERAGE 
    4343%token PLUS MINUS TIMES DIVIDE POWER 
    44 %token EQ LT GT LE GE 
     44%token EQ LT GT LE GE NE 
    4545%token LEFT_PARENTHESIS RIGHT_PARENTHESIS 
     46%token QUESTION_MARK COLON 
    4647%token <str> END 
    4748 
    48 %left EQ LT GT LE GE 
     49%nonassoc QUESTION_MARK COLON 
     50%left EQ LT GT LE GE NE 
    4951%left PLUS MINUS 
    5052%left TIMES DIVIDE 
     
    7779          | Expression LE Expression  { $$ = new CScalarBinaryOpExprNode($1, "le", $3); } 
    7880          | Expression GE Expression  { $$ = new CScalarBinaryOpExprNode($1, "ge", $3); } 
     81          | Expression NE Expression  { $$ = new CScalarBinaryOpExprNode($1, "ne", $3); } 
     82          | Expression QUESTION_MARK Expression COLON Expression {$$ = new CScalarTernaryOpExprNode($1, "cond", $3, $5);}  
    7983          | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS    { $$ = $2; } 
    8084          | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = new CScalarUnaryOpExprNode(*$1, $3); delete $1; } 
     
    9599          | Field_expr LE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "le", $3); } 
    96100          | Field_expr GE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ge", $3); } 
     101          | Field_expr NE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ne", $3); } 
    97102          | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS       { $$ = $2; } 
     103          | Expression QUESTION_MARK Expression COLON Field_expr {$$ = new CFilterScalarScalarFieldOpExprNode($1, "cond",$3, $5);} 
     104          | Expression QUESTION_MARK Field_expr COLON Expression {$$ = new CFilterScalarFieldScalarOpExprNode($1, "cond",$3, $5);} 
     105          | Expression QUESTION_MARK Field_expr COLON Field_expr {$$ = new CFilterScalarFieldFieldOpExprNode($1, "cond",$3, $5);} 
     106          | Field_expr QUESTION_MARK Expression COLON Expression {$$ = new CFilterFieldScalarScalarOpExprNode($1, "cond",$3, $5);} 
     107          | Field_expr QUESTION_MARK Expression COLON Field_expr {$$ = new CFilterFieldScalarFieldOpExprNode($1, "cond",$3, $5);} 
     108          | Field_expr QUESTION_MARK Field_expr COLON Expression {$$ = new CFilterFieldFieldScalarOpExprNode($1, "cond",$3, $5);} 
     109          | Field_expr QUESTION_MARK Field_expr COLON Field_expr {$$ = new CFilterFieldFieldFieldOpExprNode($1, "cond",$3, $5);} 
    98110          | Field_expr PLUS Expression   { $$ = new CFilterFieldScalarOpExprNode($1, "add", $3); } 
    99111          | Expression PLUS Field_expr   { $$ = new CFilterScalarFieldOpExprNode($1, "add", $3); } 
     
    115127          | Field_expr GE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ge", $3); } 
    116128          | Expression GE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ge", $3); } 
     129          | Field_expr NE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ne", $3); } 
     130          | Expression NE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ne", $3); } 
    117131          | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = new CFilterUnaryOpExprNode(*$1, $3); delete $1; } 
    118132          ; 
  • XIOS/dev/dev_olga/src/server.cpp

    r1152 r1158  
    298298    void CServer::finalize(void) 
    299299    { 
    300  
    301300      CTimer::get("XIOS").suspend() ; 
    302301      
     
    328327      report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl  ; 
    329328      report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl  ; 
     329      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
    330330    } 
    331331 
     
    352352         if (finished && contextList.empty()) stop=true ; 
    353353         eventScheduler->checkEvent() ; 
    354  
    355354       } 
    356355       CTimer::get("XIOS server").suspend() ; 
     
    422421       MPI_Status status ; 
    423422       int flag ; 
    424        static void* buffer ; 
     423       static char* buffer ; 
    425424       static MPI_Request request ; 
    426425       static bool recept=false ; 
     
    438437           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    439438           buffer=new char[count] ; 
    440            MPI_Irecv(buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ; 
     439           MPI_Irecv((void*)buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ; 
    441440           recept=true ; 
    442441         } 
     
    451450           rank=status.MPI_SOURCE ; 
    452451           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    453            recvContextMessage(buffer,count) ; 
    454            delete [] buffer; 
     452           recvContextMessage((void*)buffer,count) ; 
     453           delete [] buffer ; 
    455454           recept=false ; 
    456455         } 
     
    540539           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    541540           buffer=new char[count] ; 
    542            MPI_Irecv(buffer,count,MPI_CHAR,root,2,intraComm,&request) ; 
     541           MPI_Irecv((void*)buffer,count,MPI_CHAR,root,2,intraComm,&request) ; 
    543542           recept=true ; 
    544543         } 
     
    552551           MPI_Get_count(&status,MPI_CHAR,&count) ; 
    553552           eventScheduler->registerEvent(nbContexts,hashId); 
    554 //           registerContext(buffer,count) ; 
     553//           registerContext((void*)buffer,count) ; 
    555554//           delete [] buffer ; 
    556555           recept=false ; 
     
    685684      id = getRank(); 
    686685 
    687 //      if (!CXios::usingServer2) 
    688 //        id = getRank(); 
    689 //      else 
    690 //      { 
    691 //        if (serverLevel == 1) 
    692 //          id = rank_; 
    693 //        else 
    694 //          id = poolId; 
    695 //      } 
    696686      fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << id << ext; 
    697687      fb->open(fileNameClient.str().c_str(), std::ios::out); 
  • XIOS/dev/dev_olga/src/test/test_regular.f90

    r1009 r1158  
    1818  INTEGER :: comm   
    1919  INTEGER :: ierr 
    20   INTEGER :: size, rank 
    21  
    22   INTEGER :: nlon = 5 !100  
    23   INTEGER :: nlat = 5 !100 
     20  INTEGER :: sizeComm, rank    ! SIZE is a fortran function 
     21 
     22  INTEGER :: nlon = 100  
     23  INTEGER :: nlat = 100 
    2424  INTEGER :: ncell  
    2525  INTEGER :: ilat, ilon, ind 
  • XIOS/dev/dev_olga/src/timer.cpp

    r652 r1158  
    33#include <string> 
    44#include <map> 
     5#include <iostream> 
     6#include <sstream> 
    57#include "tracer.hpp" 
    68 
     
    5759    return it->second; 
    5860  } 
     61 
     62  string CTimer::getAllCumulatedTime(void) 
     63  { 
     64    std::ostringstream strOut ; 
     65    for(std::map<std::string,CTimer>::iterator it=allTimer.begin();it!=allTimer.end();++it) 
     66      strOut<<"Timer : "<<it->first<<"    -->   cumulated time : "<<it->second.getCumulatedTime()<<std::endl ; 
     67    return strOut.str() ; 
     68  } 
    5969} 
  • XIOS/dev/dev_olga/src/timer.hpp

    r688 r1158  
    2323      static double getTime(void); 
    2424      static CTimer& get(std::string name); 
     25      static std::string getAllCumulatedTime(void) ; 
    2526  }; 
    2627} 
  • XIOS/dev/dev_olga/src/transformation/Functions/average_reduction.cpp

    r979 r1158  
    33   \author Ha NGUYEN 
    44   \since 8 Sep 2016 
    5    \date 8 Sep 2016 
     5   \date 9 Jan 2017 
    66 
    77   \brief average reduction 
    88 */ 
    99#include "average_reduction.hpp" 
     10#include "utils.hpp" 
    1011 
    1112namespace xios { 
     
    2930                                       const double* dataInput, 
    3031                                       CArray<double,1>& dataOut, 
    31                                        std::vector<bool>& flagInitial) 
     32                                       std::vector<bool>& flagInitial,                      
     33                                       bool ignoreMissingValue) 
    3234{ 
    33   if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; } 
     35  if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; }   
    3436 
    35   int nbLocalIndex = localIndex.size(); 
    36   int currentlocalIndex = 0; 
    37   double currentWeight  = 0.0; 
    38   for (int idx = 0; idx < nbLocalIndex; ++idx) 
     37  if (ignoreMissingValue) 
    3938  { 
    40     currentlocalIndex = localIndex[idx].first; 
    41     currentWeight     = localIndex[idx].second; 
     39    int nbLocalIndex = localIndex.size(); 
     40    int currentlocalIndex = 0; 
     41    double currentWeight  = 0.0; 
    4242 
    43     if (flagInitial[currentlocalIndex]) 
     43    dataOut=std::numeric_limits<double>::quiet_NaN(); 
     44 
     45    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4446    { 
    45       dataOut(currentlocalIndex) = *(dataInput + idx); 
    46       flagInitial[currentlocalIndex] = false; 
     47      currentlocalIndex = localIndex[idx].first; 
     48      currentWeight     = localIndex[idx].second; 
     49      if (!NumTraits<double>::isnan(*(dataInput + idx))) 
     50      { 
     51        if (flagInitial[currentlocalIndex]) 
     52        { 
     53          dataOut(currentlocalIndex) = *(dataInput + idx); 
     54          flagInitial[currentlocalIndex] = false; 
     55        } 
     56        else 
     57        { 
     58          dataOut(currentlocalIndex)  += *(dataInput + idx); 
     59          weights_(currentlocalIndex) += 1.0; 
     60        } 
     61      } 
    4762    } 
    48     else 
     63  } 
     64  else 
     65  { 
     66    int nbLocalIndex = localIndex.size(); 
     67    int currentlocalIndex = 0; 
     68    double currentWeight  = 0.0; 
     69    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4970    { 
    50       dataOut(currentlocalIndex)  += *(dataInput + idx); 
    51       weights_(currentlocalIndex) += 1.0; 
     71      currentlocalIndex = localIndex[idx].first; 
     72      currentWeight     = localIndex[idx].second; 
     73 
     74      if (flagInitial[currentlocalIndex]) 
     75      { 
     76        dataOut(currentlocalIndex) = *(dataInput + idx); 
     77        flagInitial[currentlocalIndex] = false; 
     78      } 
     79      else 
     80      { 
     81        dataOut(currentlocalIndex)  += *(dataInput + idx); 
     82        weights_(currentlocalIndex) += 1.0; 
     83      } 
    5284    } 
    5385  } 
  • XIOS/dev/dev_olga/src/transformation/Functions/average_reduction.hpp

    r979 r1158  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial); 
     28                     std::vector<bool>& flagInitial,                      
     29                     bool ignoreMissingValue); 
    2930 
    3031  virtual void updateData(CArray<double,1>& dataOut); 
  • XIOS/dev/dev_olga/src/transformation/Functions/extract.cpp

    r895 r1158  
    2929                                       const double* dataInput, 
    3030                                       CArray<double,1>& dataOut, 
    31                                        std::vector<bool>& flagInitial) 
     31                                       std::vector<bool>& flagInitial, 
     32                                       bool ignoreMissingValue) 
    3233{ 
    3334  int nbLocalIndex = localIndex.size(); 
  • XIOS/dev/dev_olga/src/transformation/Functions/extract.hpp

    r895 r1158  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial); 
     28                     std::vector<bool>& flagInitial, 
     29                     bool ignoreMissingValue); 
    2930 
    3031  virtual ~CExtractReductionAlgorithm() {} 
  • XIOS/dev/dev_olga/src/transformation/Functions/max_reduction.cpp

    r979 r1158  
    88 */ 
    99#include "max_reduction.hpp" 
     10#include "utils.hpp" 
    1011 
    1112namespace xios { 
     
    2930                                   const double* dataInput, 
    3031                                   CArray<double,1>& dataOut, 
    31                                    std::vector<bool>& flagInitial) 
    32 { 
    33   int nbLocalIndex = localIndex.size(); 
    34   int currentlocalIndex = 0; 
    35   double currentWeight  = 0.0; 
    36   for (int idx = 0; idx < nbLocalIndex; ++idx) 
     32                                   std::vector<bool>& flagInitial, 
     33                                   bool ignoreMissingValue) 
     34{  
     35  if (ignoreMissingValue) 
    3736  { 
    38     currentlocalIndex = localIndex[idx].first; 
    39     currentWeight     = localIndex[idx].second; 
    40     if (flagInitial[currentlocalIndex]) 
     37    int nbLocalIndex = localIndex.size(); 
     38    int currentlocalIndex = 0; 
     39    dataOut=std::numeric_limits<double>::quiet_NaN();     
     40    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4141    { 
    42       dataOut(currentlocalIndex) = *(dataInput + idx); 
    43       flagInitial[currentlocalIndex] = false; 
     42      currentlocalIndex = localIndex[idx].first;       
     43      if (!NumTraits<double>::isnan(*(dataInput + idx))) 
     44      { 
     45        if (flagInitial[currentlocalIndex]) 
     46        { 
     47          dataOut(currentlocalIndex) = *(dataInput + idx); 
     48          flagInitial[currentlocalIndex] = false; 
     49        } 
     50        else 
     51        { 
     52          dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
     53        } 
     54      } 
    4455    } 
    45     else 
     56  } 
     57  else 
     58  { 
     59    int nbLocalIndex = localIndex.size(); 
     60    int currentlocalIndex = 0;     
     61    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4662    { 
    47       dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
     63      currentlocalIndex = localIndex[idx].first;       
     64      if (flagInitial[currentlocalIndex]) 
     65      { 
     66        dataOut(currentlocalIndex) = *(dataInput + idx); 
     67        flagInitial[currentlocalIndex] = false; 
     68      } 
     69      else 
     70      { 
     71        dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
     72      } 
    4873    } 
    4974  } 
  • XIOS/dev/dev_olga/src/transformation/Functions/max_reduction.hpp

    r979 r1158  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial); 
     28                     std::vector<bool>& flagInitial, 
     29                     bool ignoreMissingValue); 
    2930 
    3031  virtual ~CMaxReductionAlgorithm() {} 
  • XIOS/dev/dev_olga/src/transformation/Functions/min_reduction.cpp

    r979 r1158  
    33   \author Ha NGUYEN 
    44   \since 27 June 2016 
    5    \date 27 June 2016 
     5   \date 9 Jan 2017 
    66 
    77   \brief min reduction 
    88 */ 
    99#include "min_reduction.hpp" 
     10#include "utils.hpp" 
    1011 
    1112namespace xios { 
     
    2930                                   const double* dataInput, 
    3031                                   CArray<double,1>& dataOut, 
    31                                    std::vector<bool>& flagInitial) 
     32                                   std::vector<bool>& flagInitial, 
     33                                   bool ignoreMissingValue) 
    3234{ 
    33   int nbLocalIndex = localIndex.size(); 
    34   int currentlocalIndex = 0; 
    35   for (int idx = 0; idx < nbLocalIndex; ++idx) 
     35  if (ignoreMissingValue) 
    3636  { 
    37     currentlocalIndex = localIndex[idx].first; 
    38     if (flagInitial[currentlocalIndex]) 
     37    int nbLocalIndex = localIndex.size(); 
     38    int currentlocalIndex = 0; 
     39    dataOut=std::numeric_limits<double>::quiet_NaN(); 
     40    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3941    { 
    40       dataOut(currentlocalIndex) = *(dataInput + idx); 
    41       flagInitial[currentlocalIndex] = false; 
     42      currentlocalIndex = localIndex[idx].first; 
     43      if (!NumTraits<double>::isnan(*(dataInput + idx))) 
     44      { 
     45        if (flagInitial[currentlocalIndex]) 
     46        { 
     47          dataOut(currentlocalIndex) = *(dataInput + idx); 
     48          flagInitial[currentlocalIndex] = false; 
     49        } 
     50        else 
     51        { 
     52          dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
     53        } 
     54      } 
    4255    } 
    43     else 
     56  } 
     57  else 
     58  { 
     59    int nbLocalIndex = localIndex.size(); 
     60    int currentlocalIndex = 0; 
     61    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4462    { 
    45       dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
     63      currentlocalIndex = localIndex[idx].first; 
     64      if (flagInitial[currentlocalIndex]) 
     65      { 
     66        dataOut(currentlocalIndex) = *(dataInput + idx); 
     67        flagInitial[currentlocalIndex] = false; 
     68      } 
     69      else 
     70      { 
     71        dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
     72      } 
    4673    } 
    4774  } 
  • XIOS/dev/dev_olga/src/transformation/Functions/min_reduction.hpp

    r979 r1158  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial); 
     28                     std::vector<bool>& flagInitial,                      
     29                     bool ignoreMissingValue); 
    2930 
    3031  virtual ~CMinReductionAlgorithm() {} 
  • XIOS/dev/dev_olga/src/transformation/Functions/reduction.hpp

    r979 r1158  
    4545                     const double* dataInput, 
    4646                     CArray<double,1>& dataOut, 
    47                      std::vector<bool>& flagInitial) = 0; 
     47                     std::vector<bool>& flagInitial,                      
     48                     bool ignoreMissingValue) = 0; 
    4849  /*! 
    4950    Update local data  
  • XIOS/dev/dev_olga/src/transformation/Functions/sum_reduction.cpp

    r979 r1158  
    33   \author Ha NGUYEN 
    44   \since 27 June 2016 
    5    \date 27 June 2016 
     5   \date 9 Jan 2017 
    66 
    77   \brief sum reduction 
    88 */ 
    99#include "sum_reduction.hpp" 
     10#include "utils.hpp" 
    1011 
    1112namespace xios { 
     
    2930                                   const double* dataInput, 
    3031                                   CArray<double,1>& dataOut, 
    31                                    std::vector<bool>& flagInitial) 
     32                                   std::vector<bool>& flagInitial, 
     33                                   bool ignoreMissingValue) 
    3234{ 
    33   int nbLocalIndex = localIndex.size(); 
    34   int currentlocalIndex = 0; 
    35   double currentWeight  = 0.0; 
    36   for (int idx = 0; idx < nbLocalIndex; ++idx) 
     35  if (ignoreMissingValue) 
    3736  { 
    38     currentlocalIndex = localIndex[idx].first; 
    39     currentWeight     = localIndex[idx].second; 
    40     if (flagInitial[currentlocalIndex]) 
     37    int nbLocalIndex = localIndex.size(); 
     38    int currentlocalIndex = 0; 
     39 
     40    dataOut=std::numeric_limits<double>::quiet_NaN(); 
     41   
     42    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4143    { 
    42       dataOut(currentlocalIndex) = *(dataInput + idx); 
    43       flagInitial[currentlocalIndex] = false; 
    44     } 
    45     else 
     44      currentlocalIndex = localIndex[idx].first;    
     45      if (!NumTraits<double>::isnan(*(dataInput + idx))) 
     46      {    
     47        if (flagInitial[currentlocalIndex]) 
     48        { 
     49          dataOut(currentlocalIndex) = *(dataInput + idx); 
     50          flagInitial[currentlocalIndex] = false; 
     51        } 
     52        else 
     53        { 
     54          dataOut(currentlocalIndex) += *(dataInput + idx); 
     55        } 
     56      } 
     57    }     
     58  } 
     59  else 
     60  { 
     61    int nbLocalIndex = localIndex.size(); 
     62    int currentlocalIndex = 0;     
     63    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4664    { 
    47       dataOut(currentlocalIndex) += *(dataInput + idx); 
     65      currentlocalIndex = localIndex[idx].first;       
     66      if (flagInitial[currentlocalIndex]) 
     67      { 
     68        dataOut(currentlocalIndex) = *(dataInput + idx); 
     69        flagInitial[currentlocalIndex] = false; 
     70      } 
     71      else 
     72      { 
     73        dataOut(currentlocalIndex) += *(dataInput + idx); 
     74      } 
    4875    } 
    4976  } 
  • XIOS/dev/dev_olga/src/transformation/Functions/sum_reduction.hpp

    r979 r1158  
    2626                     const double* dataInput, 
    2727                     CArray<double,1>& dataOut, 
    28                      std::vector<bool>& flagInitial); 
     28                     std::vector<bool>& flagInitial, 
     29                     bool ignoreMissingValue); 
    2930 
    3031  virtual ~CSumReductionAlgorithm() {} 
  • XIOS/dev/dev_olga/src/transformation/axis_algorithm_extract_domain.cpp

    r980 r1158  
    6868                                        const double* dataInput, 
    6969                                        CArray<double,1>& dataOut, 
    70                                         std::vector<bool>& flagInitial, 
    71                                         const double& defaultValue) 
     70                                        std::vector<bool>& flagInitial,                      
     71                                        bool ignoreMissingValue) 
    7272{ 
    73   reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
     73  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 
    7474} 
    7575 
  • XIOS/dev/dev_olga/src/transformation/axis_algorithm_extract_domain.hpp

    r933 r1158  
    3333                     const double* dataInput, 
    3434                     CArray<double,1>& dataOut, 
    35                      std::vector<bool>& flagInitial, 
    36                      const double& defaultValue); 
     35                     std::vector<bool>& flagInitial,                      
     36                     bool ignoreMissingValue); 
    3737 
    3838  virtual ~CAxisAlgorithmExtractDomain(); 
  • XIOS/dev/dev_olga/src/transformation/axis_algorithm_reduce_domain.cpp

    r980 r1158  
    7676                                       const double* dataInput, 
    7777                                       CArray<double,1>& dataOut, 
    78                                        std::vector<bool>& flagInitial, 
    79                                        const double& defaultValue) 
     78                                       std::vector<bool>& flagInitial,                      
     79                                       bool ignoreMissingValue) 
    8080{ 
    81   reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
     81  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 
    8282} 
    8383 
  • XIOS/dev/dev_olga/src/transformation/axis_algorithm_reduce_domain.hpp

    r979 r1158  
    3232                     const double* dataInput, 
    3333                     CArray<double,1>& dataOut, 
    34                      std::vector<bool>& flagInitial, 
    35                      const double& defaultValue); 
     34                     std::vector<bool>& flagInitial,                      
     35                     bool ignoreMissingValue); 
    3636 
    3737  virtual void updateData(CArray<double,1>& dataOut); 
  • XIOS/dev/dev_olga/src/transformation/domain_algorithm_expand.cpp

    r978 r1158  
    4545                                               CDomain* domainSource, 
    4646                                               CExpandDomain* expandDomain) 
    47 : CDomainAlgorithmTransformation(domainDestination, domainSource) 
     47: CDomainAlgorithmTransformation(domainDestination, domainSource), 
     48  isXPeriodic_(false), isYPeriodic_(false) 
    4849{ 
    4950  if (domainDestination == domainSource) 
     
    5556  } 
    5657 
    57 //  if (!domainDestination->hasRefTo(domainSource)) 
    58 //  { 
    59 //    ERROR("CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,CDomain* domainSource, CExpandDomain* expandDomain)", 
    60 //           << "Domain domain destination must refer to domain source (directly or indirectly) by domain_ref " << std::endl 
    61 //           << "Domain source " <<domainSource->getId() << std::endl 
    62 //           << "Domain destination " <<domainDestination->getId() << std::endl); 
    63 //  } 
    64  
    6558  this->type_ = (ELEMENT_MODIFICATION_WITH_DATA); 
     59  // Make sure domain source have all valid attributes 
     60  // domainSource->checkAllAttributes(); 
    6661  expandDomain->checkValid(domainDestination); 
    67  
     62  if (!expandDomain->i_periodic.isEmpty()) isXPeriodic_ = expandDomain->i_periodic; 
     63  if (!expandDomain->j_periodic.isEmpty()) isYPeriodic_ = expandDomain->j_periodic; 
     64   
    6865  switch (expandDomain->type) 
    6966  { 
     
    9289  CContextClient* client=context->client; 
    9390 
     91  int type = 1; // For edge 
     92  CMesh mesh; 
    9493  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 
    9594  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 
    9695  CArray<int,2> neighborsSrc; 
    97  
    98   int type = 1; // For edge 
    99   CMesh mesh; 
    100   mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 
    101   updateDomainAttributes(domainDestination, domainSource, neighborsSrc); 
     96  switch (domainSource->type) { 
     97   case CDomain::type_attr::unstructured:       
     98      mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 
     99      updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 
     100      break; 
     101   default: 
     102      updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc); 
     103      break;       
     104  }   
    102105} 
    103106 
     
    113116  CContextClient* client=context->client; 
    114117 
     118  int type = 1; // For edge 
     119  CMesh mesh; 
    115120  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 
    116121  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 
    117122  CArray<int,2> neighborsSrc; 
    118  
    119   int type = 0; // For node 
    120   CMesh mesh; 
    121   mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 
    122   updateDomainAttributes(domainDestination, domainSource, neighborsSrc); 
     123  switch (domainSource->type) { 
     124   case CDomain::type_attr::unstructured:       
     125      mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 
     126      updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 
     127      break; 
     128   default: 
     129      updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc); 
     130      break;       
     131  }   
     132} 
     133 
     134/*! 
     135 *  Extend rectilinear or curvilinear domain destination and update its attributes 
     136 *  Suppose that domain destination and domain source have the same values for all attributes (by inheritance) 
     137 *  \param [in/out] domainDestination domain destination 
     138 *  \param [in] domainSource domain source 
     139 *  \param [in] neighborsDomainSrc neighbor of domain source. For now, we don't need it for rectilinear 
     140 */ 
     141void CDomainAlgorithmExpand::updateRectilinearDomainAttributes(CDomain* domainDestination, 
     142                                                               CDomain* domainSource, 
     143                                                               CArray<int,2>& neighborsDomainSrc) 
     144{ 
     145  int index, globalIndex, idx; 
     146  int iindexDst, jindexDst, globIndexDst; 
     147  int iindexSrc, jindexSrc, globIndexSrc; 
     148  CContext* context = CContext::getCurrent(); 
     149  CContextClient* client=context->client; 
     150 
     151  // First of all, "copy" all attributes of domain source to domain destination 
     152  StdString domainDstRef = (!domainDestination->domain_ref.isEmpty()) ? domainDestination->domain_ref.getValue() 
     153                                                                      : ""; 
     154  if (domainDstRef != domainSource->getId()) 
     155  { 
     156    domainDestination->domain_ref.setValue(domainSource->getId()); 
     157    domainDestination->solveRefInheritance(true); 
     158  } 
     159 
     160  if (domainDstRef.empty()) domainDestination->domain_ref.reset(); 
     161  else domainDestination->domain_ref.setValue(domainDstRef); 
     162 
     163  // Here are attributes of source need tranfering 
     164  int niGloSrc = domainSource->ni_glo; 
     165  int njGloSrc = domainSource->nj_glo; 
     166  int niSrc = domainSource->ni, ibegin = domainSource->ibegin; 
     167  int njSrc = domainSource->nj, jbegin = domainSource->jbegin; 
     168  int dataDimSrc = domainSource->data_dim; 
     169  CArray<bool,1>& mask_1d_src = domainSource->mask_1d; 
     170  CArray<int,1>& i_index_src = domainSource->i_index; 
     171  CArray<int,1>& j_index_src = domainSource->j_index; 
     172  CArray<int,1>& data_i_index_src = domainSource->data_i_index; 
     173  CArray<int,1>& data_j_index_src = domainSource->data_j_index; 
     174  int data_i_begin_src = domainSource->data_ibegin; 
     175  int data_j_begin_src = domainSource->data_jbegin; 
     176  CArray<double,1>& lon_src = domainSource->lonvalue; 
     177  CArray<double,1>& lat_src = domainSource->latvalue; 
     178 
     179  // We need to generate boundary for longitude and latitude 
     180  if (domainSource->bounds_lon_1d.isEmpty() || domainSource->bounds_lat_1d.isEmpty()) 
     181  { 
     182    CArray<double,1> lon = lon_src(Range(0,niSrc-1)); 
     183    CArray<double,1> lat = lat_src(Range(0,lat_src.numElements()-niSrc,niSrc)); 
     184    CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 
     185    CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 
     186    domainSource->fillInRectilinearBoundLonLat(lon_src, lat_src, bounds_lon_src, bounds_lat_src); 
     187  } 
     188 
     189 
     190  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 
     191  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 
     192 
     193  int nVertex       = bounds_lon_src.shape()[0]; 
     194  int oldNbLocal = i_index_src.numElements(); 
     195  // Calculate ni, nj by using i_index and j_index 
     196  int niSrcByIndex = max(i_index_src) - min(i_index_src) + 1; 
     197  int njSrcByIndex = max(j_index_src) - min(j_index_src) + 1;   
     198  int dataIindexBoundSrc = (1 == dataDimSrc) ? (niSrcByIndex * njSrcByIndex) : niSrcByIndex; 
     199  int dataJindexBoundSrc = (1 == dataDimSrc) ? (niSrcByIndex * njSrcByIndex) : njSrcByIndex; 
     200 
     201  // Uncompress data_i_index, data_j_index 
     202  CArray<int,1> data_i_index_src_full(oldNbLocal); 
     203  CArray<int,1> data_j_index_src_full(oldNbLocal); 
     204  int nbUnMaskedPointOnLocalDomain = 0; 
     205  data_i_index_src_full = -1; // Suppose all values are masked 
     206  data_j_index_src_full = -1; // Suppose all values are masked 
     207  for (idx = 0; idx < data_i_index_src.numElements(); ++idx) 
     208  { 
     209    int dataIidx = data_i_index_src(idx) + data_i_begin_src; 
     210    int dataJidx = data_j_index_src(idx) + data_j_begin_src; 
     211    if ((0 <= dataIidx) && (dataIidx < dataIindexBoundSrc) && 
     212        (0 <= dataJidx) && (dataJidx < dataJindexBoundSrc)) 
     213    { 
     214      data_i_index_src_full(nbUnMaskedPointOnLocalDomain) = dataIidx; 
     215      data_j_index_src_full(nbUnMaskedPointOnLocalDomain) = dataJidx; 
     216      ++nbUnMaskedPointOnLocalDomain; 
     217    } 
     218  } 
     219 
     220  // Expand domain destination, not only local but also global 
     221  int niGloDst = niGloSrc + 2; 
     222  int njGloDst = njGloSrc + 2; 
     223  int niDst = niSrc + 2; 
     224  int njDst = njSrc + 2; 
     225  domainDestination->ni_glo.setValue(niGloDst); 
     226  domainDestination->nj_glo.setValue(njGloDst); 
     227  domainDestination->ni.setValue(niDst); 
     228  domainDestination->nj.setValue(njDst); 
     229  domainDestination->global_zoom_ni.setValue(domainSource->global_zoom_ni+2); 
     230  domainDestination->global_zoom_nj.setValue(domainSource->global_zoom_nj+2); 
     231 
     232  CArray<bool,1>& mask_1d_dst = domainDestination->mask_1d; 
     233  CArray<int,1>& i_index_dst  = domainDestination->i_index; 
     234  CArray<int,1>& j_index_dst  = domainDestination->j_index;   
     235  CArray<int,1>& data_i_index_dst  = domainDestination->data_i_index; 
     236  CArray<int,1>& data_j_index_dst  = domainDestination->data_j_index; 
     237   
     238  // Make sure that we use only lonvalue_client, latvalue_client 
     239  if (!domainDestination->lonvalue_1d.isEmpty()) domainDestination->lonvalue_1d.reset(); 
     240  if (!domainDestination->latvalue_1d.isEmpty()) domainDestination->latvalue_1d.reset(); 
     241  if (!domainDestination->lonvalue_2d.isEmpty()) domainDestination->lonvalue_2d.reset(); 
     242  if (!domainDestination->latvalue_2d.isEmpty()) domainDestination->latvalue_2d.reset(); 
     243 
     244  // Recalculate i_index, j_index of extended domain 
     245  // Should be enough for common case, but if we have arbitrary distribution? 
     246  int newNbLocalDst = niDst * njDst;      
     247 
     248  mask_1d_dst.resize(newNbLocalDst); 
     249  i_index_dst.resize(newNbLocalDst); 
     250  j_index_dst.resize(newNbLocalDst); 
     251  CArray<int,1> data_i_index_dst_full(newNbLocalDst); 
     252  CArray<int,1> data_j_index_dst_full(newNbLocalDst); 
     253 
     254  domainDestination->lonvalue.resizeAndPreserve(newNbLocalDst); 
     255  domainDestination->latvalue.resizeAndPreserve(newNbLocalDst); 
     256  domainDestination->bounds_lon_1d.resizeAndPreserve(nVertex, newNbLocalDst); 
     257  domainDestination->bounds_lat_1d.resizeAndPreserve(nVertex, newNbLocalDst); 
     258  CArray<double,1>& lon_dst   = domainDestination->lonvalue; 
     259  CArray<double,1>& lat_dst   = domainDestination->latvalue; 
     260  CArray<double,2>& bounds_lon_dst = domainDestination->bounds_lon_1d; 
     261  CArray<double,2>& bounds_lat_dst = domainDestination->bounds_lat_1d; 
     262 
     263  // Update i_index, j_index 
     264  for (int j = 0; j < njDst; ++j) 
     265    for (int i = 0; i < niDst; ++i) 
     266    { 
     267      idx = j * niDst + i;  
     268      i_index_dst(idx) = i + ibegin; 
     269      j_index_dst(idx) = j + jbegin; 
     270    } 
     271  
     272 
     273  // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 
     274  // Global index mapping between destination and source 
     275  this->transformationMapping_.resize(1); 
     276  this->transformationWeight_.resize(1); 
     277  TransformationIndexMap& transMap = this->transformationMapping_[0]; 
     278  TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     279 
     280  transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 
     281  transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 
     282   
     283  // Index mapping for local domain 
     284  // Mapping global index of expanded domain into original one  
     285  // (Representing global index of expanded domain in form of global index of original one) 
     286  CArray<size_t,1> globalIndexSrcOnDstDomain(newNbLocalDst);  
     287  for (idx = 0; idx < newNbLocalDst; ++idx) 
     288  { 
     289    iindexDst = i_index_dst(idx); 
     290    jindexDst = j_index_dst(idx); 
     291    globIndexDst = jindexDst * niGloDst + iindexDst; 
     292    globIndexSrc = (((jindexDst-1)+njGloSrc) % njGloSrc) * niGloSrc + (((iindexDst-1)+niGloSrc) % niGloSrc) ; 
     293    globalIndexSrcOnDstDomain(idx) = globIndexSrc; 
     294 
     295    transMap[globIndexDst].push_back(globIndexSrc); 
     296    transWeight[globIndexDst].push_back(1.0);  
     297  } 
     298 
     299  // 2. Exchange local info among domains (lon,lat,bounds,mask,etc,...) 
     300  CClientClientDHTDouble::Index2VectorInfoTypeMap localData; 
     301  localData.rehash(std::ceil(oldNbLocal/localData.max_load_factor())); 
     302 
     303  // Information exchanged among domains (attention to their order), number in parentheses presents size of data 
     304  // lon(1) + lat(1) + bounds_lon(nVertex) + bounds_lat(nVertex) + mask(1) + data_i_index(1) 
     305  int dataPackageSize =  1 + 1 + // lon + lat 
     306                         nVertex + nVertex + //bounds_lon + bounds_lat 
     307                         1 + // mask_1d_dst; 
     308                         1 + 1; // data_i_index + data_j_index 
     309  // Initialize database 
     310  for (int idx = 0; idx < oldNbLocal; ++idx) 
     311  { 
     312    index = i_index_src(idx) + j_index_src(idx) * niGloSrc; 
     313    localData[index].resize(dataPackageSize); 
     314    std::vector<double>& data = localData[index]; 
     315 
     316    //Pack data 
     317    int dataIdx = 0; 
     318    data[dataIdx] = lon_src(idx);++dataIdx; 
     319    data[dataIdx] = lat_src(idx);++dataIdx; 
     320    for (int i = 0; i < nVertex; ++i) 
     321    { 
     322      data[dataIdx] = bounds_lon_src(i,idx); ++dataIdx; 
     323    } 
     324    for (int i = 0; i < nVertex; ++i) 
     325    { 
     326      data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx; 
     327    } 
     328    data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx; 
     329    data[dataIdx] = data_i_index_src_full(idx);++dataIdx; 
     330    data[dataIdx] = data_j_index_src_full(idx); 
     331  } 
     332 
     333  CClientClientDHTDouble dhtData(localData,client->intraComm); 
     334  dhtData.computeIndexInfoMapping(globalIndexSrcOnDstDomain); 
     335  CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap(); 
     336  CClientClientDHTDouble::Index2VectorInfoTypeMap::iterator ite = neighborData.end(), it; 
     337 
     338  // Ok get all data for destination 
     339  // If domain is not periodic, then we mask all extended part. 
     340  int nbUnMaskedPointOnExtendedPart = 0, remainder = 0, dataIIndex, dataJIndex; 
     341  size_t nIdx; 
     342  double maskValue = 1.0; 
     343  for (index = 0; index < newNbLocalDst; ++index) 
     344  { 
     345     nIdx = globalIndexSrcOnDstDomain(index); 
     346     it = neighborData.find(nIdx); 
     347     if (ite != it) 
     348     { 
     349        std::vector<double>& data = it->second; 
     350        // Unpack data 
     351        int dataIdx = 0; 
     352        lon_dst(index) = data[dataIdx]; ++dataIdx; 
     353        lat_dst(index) = data[dataIdx]; ++dataIdx; 
     354        for (int i = 0; i < nVertex; ++i) 
     355        { 
     356          bounds_lon_dst(i,index) = data[dataIdx]; ++dataIdx; 
     357        } 
     358        for (int i = 0; i < nVertex; ++i) 
     359        { 
     360          bounds_lat_dst(i,index) = data[dataIdx]; ++dataIdx; 
     361        } 
     362         
     363        // Check whether we have x periodic. If we don't, we should mask all point at 0 and niGloDst-1 
     364        maskValue = data[dataIdx]; 
     365        if (!isXPeriodic_)  
     366        { 
     367          remainder = i_index_dst(index) % (niGloDst-1); 
     368          if (0 == remainder)  
     369          { 
     370            maskValue = -1.0; 
     371          } 
     372        } 
     373 
     374        if (!isYPeriodic_)  
     375        { 
     376          remainder = j_index_dst(index) % (njGloDst-1); 
     377          if (0 == remainder)  
     378          { 
     379            maskValue = -1.0; 
     380          } 
     381        } 
     382 
     383        mask_1d_dst(index) = (1.0 == maskValue) ? true : false; ++dataIdx; 
     384 
     385        dataIIndex = (int) data[dataIdx]; 
     386        if (!isXPeriodic_)  
     387        { 
     388          remainder = i_index_dst(index) % (niGloDst-1); 
     389          if (0 == remainder)  
     390          { 
     391            dataIIndex = -1; 
     392          } 
     393        } 
     394        data_i_index_dst_full(index) = dataIIndex; ++dataIdx; 
     395         
     396        dataJIndex = (int) data[dataIdx]; 
     397        if (!isYPeriodic_)  
     398        { 
     399          remainder = j_index_dst(index) % (njGloDst-1); 
     400          if (0 == remainder)  
     401          { 
     402            dataJIndex = -1; 
     403          } 
     404        }         
     405        data_j_index_dst_full(index) = dataJIndex; 
     406 
     407        if ((0 <= data_i_index_dst_full(index)) && (0 <= data_j_index_dst_full(index))) 
     408        { 
     409          ++nbUnMaskedPointOnExtendedPart; 
     410        } 
     411     } 
     412  } 
     413 
     414   
     415  // Finally, update data_i_index, data_j_index 
     416  int dataDstDim = domainDestination->data_dim; 
     417  data_i_index_dst.resize(nbUnMaskedPointOnExtendedPart); 
     418  data_j_index_dst.resize(nbUnMaskedPointOnExtendedPart);  
     419  int count = 0;  
     420  for (idx = 0; idx < newNbLocalDst; ++idx) 
     421  { 
     422    dataIIndex = data_i_index_dst_full(idx); 
     423    dataJIndex = data_j_index_dst_full(idx); 
     424    if ((0 <= dataIIndex) && (0 <= dataJIndex)) 
     425    { 
     426      data_i_index_dst(count) = (1 == dataDstDim) ? idx : i_index_dst(idx) - i_index_dst(0); 
     427      data_j_index_dst(count) = (1 == dataDstDim) ? 0   : j_index_dst(idx) - j_index_dst(0); 
     428      ++count; 
     429    } 
     430  } 
     431 
     432  // Update data_ni, data_nj 
     433   
     434  domainDestination->data_ni.setValue((1==dataDstDim) ? niDst * njDst : niDst); 
     435  domainDestination->data_nj.setValue((1==dataDstDim) ? niDst * njDst : njDst);   
     436  domainDestination->data_ibegin.setValue(0); 
     437  domainDestination->data_jbegin.setValue(0); 
     438 
     439  // Update longitude and latitude  
     440  if (niSrc == domainSource->lonvalue_1d.numElements() && njSrc == domainSource->latvalue_1d.numElements()) // Ok, we have rectilinear here 
     441  { 
     442     domainDestination->lonvalue_1d.resize(niDst); 
     443     domainDestination->lonvalue_1d = lon_dst(Range(0,niDst-1)); 
     444     domainDestination->latvalue_1d.resize(njDst); 
     445     domainDestination->latvalue_1d = lat_dst(Range(0,lat_dst.numElements()-niDst,niDst)); 
     446  } 
     447  else // It should be curvilinear 
     448  { 
     449     domainDestination->lonvalue_1d.resize(lon_dst.numElements()); 
     450     domainDestination->lonvalue_1d = lon_dst; 
     451     domainDestination->latvalue_1d.resize(lat_dst.numElements()); 
     452     domainDestination->latvalue_1d = (lat_dst); 
     453  } 
     454 
    123455} 
    124456 
     
    130462 *  \param [in] neighborsDomainSrc domain extended part 
    131463 */ 
    132 void CDomainAlgorithmExpand::updateDomainAttributes(CDomain* domainDestination, 
    133                                                     CDomain* domainSource, 
    134                                                     CArray<int,2>& neighborsDomainSrc) 
    135 { 
     464void CDomainAlgorithmExpand::updateUnstructuredDomainAttributes(CDomain* domainDestination, 
     465                                                                CDomain* domainSource, 
     466                                                                CArray<int,2>& neighborsDomainSrc) 
     467{ 
     468 
    136469  CContext* context = CContext::getCurrent(); 
    137470  CContextClient* client=context->client; 
     
    255588      data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx; 
    256589    } 
    257     data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1; ++dataIdx; 
     590    data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx; 
    258591    data[dataIdx] = data_i_index_src_full(idx); 
    259592  } 
     
    308641  { 
    309642    dataIdx = data_i_index_dst_full(idx); 
    310     if ((0 <= dataIdx) && (dataIdx < newNbLocalDst)) 
     643    if ((0 <= dataIdx)) 
    311644    { 
    312645      ++count; 
     
    322655  { 
    323656    dataIdx = data_i_index_dst_full(idx); 
    324     if ((0 <= dataIdx) && (dataIdx < newNbLocalDst)) 
     657    if ((0 <= dataIdx)) 
    325658    { 
    326659      data_i_index_dst(count) = dataIdx; 
     
    331664  // Update ni 
    332665  domainDestination->ni.setValue(newNbLocalDst); 
    333  
    334666} 
    335667 
  • XIOS/dev/dev_olga/src/transformation/domain_algorithm_expand.hpp

    r941 r1158  
    3030 
    3131protected: 
     32  bool isXPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear) 
     33  bool isYPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear) 
     34 
     35protected: 
    3236  void expandDomainEdgeConnectivity(CDomain* domainDestination, CDomain* domainSource); 
    3337  void expandDomainNodeConnectivity(CDomain* domainDestination, CDomain* domainSource); 
    34   void updateDomainAttributes(CDomain* domainDestination, 
    35                               CDomain* domainSource, 
    36                               CArray<int,2>& neighborsDomainSrc); 
     38  void updateRectilinearDomainAttributes(CDomain* domainDestination, 
     39                                         CDomain* domainSource, 
     40                                         CArray<int,2>& neighborsDomainSrc); 
     41 
     42  void updateUnstructuredDomainAttributes(CDomain* domainDestination, 
     43                                          CDomain* domainSource, 
     44                                          CArray<int,2>& neighborsDomainSrc); 
    3745 
    3846protected: 
  • XIOS/dev/dev_olga/src/transformation/domain_algorithm_generate_rectilinear.cpp

    r933 r1158  
    127127void CDomainAlgorithmGenerateRectilinear::fillInAttributesDomainDestination() 
    128128{ 
    129   domainDest_->redistribute(nbDomainDistributedPart_); 
     129  if (!domainDest_->distributionAttributesHaveValue()) 
     130    domainDest_->redistribute(nbDomainDistributedPart_); 
     131  domainDest_->fillInLonLat(); 
    130132} 
    131133 
  • XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp

    r1021 r1158  
    100100  int orderInterp = interpDomain_->order.getValue(); 
    101101  bool renormalize ; 
     102  bool quantity ; 
    102103 
    103104  if (interpDomain_->renormalize.isEmpty()) renormalize=true; 
    104105  else renormalize = interpDomain_->renormalize; 
     106 
     107  if (interpDomain_->quantity.isEmpty()) quantity=false; 
     108  else quantity = interpDomain_->quantity; 
    105109 
    106110  const double poleValue = 90.0; 
     
    342346  mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 
    343347 
    344   std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize); 
     348  std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); 
    345349 
    346350  std::map<int,std::vector<std::pair<int,double> > > interpMapValue; 
     
    677681/*! Redefined some functions of CONetCDF4 to make use of them */ 
    678682CDomainAlgorithmInterpolate::WriteNetCdf::WriteNetCdf(const StdString& filename, const MPI_Comm comm) 
    679   : CNc4DataOutput(filename, false, false, true, comm, false, true) {} 
     683  : CNc4DataOutput(NULL, filename, false, false, true, comm, false, true) {} 
    680684int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name,  
    681685                                                                const StdSize size) 
    682686{ 
    683   CONetCDF4::addDimension(name, size);   
     687  return CONetCDF4::addDimension(name, size);   
    684688} 
    685689 
     
    687691                                                               const std::vector<StdString>& dim) 
    688692{ 
    689   CONetCDF4::addVariable(name, type, dim); 
     693  return CONetCDF4::addVariable(name, type, dim); 
     694} 
     695 
     696void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 
     697{ 
     698  CONetCDF4::definition_end(); 
    690699} 
    691700 
     
    751760  MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm); 
    752761   
     762  if (0 == globalNbWeight) 
     763  { 
     764    info << "There is no interpolation weights calculated between " 
     765         << "domain source: " << domainSrc_->getDomainOutputName() 
     766         << " and domain destination: " << domainDest_->getDomainOutputName() 
     767         << std::endl; 
     768    return; 
     769  } 
     770 
    753771  std::vector<StdSize> start(1, startIndex - localNbWeight); 
    754772  std::vector<StdSize> count(1, localNbWeight); 
    755  
    756   WriteNetCdf netCdfWriter(filename, client->intraComm); 
    757  
    758   // netCdfWriter = CONetCDF4(filename, false, false, true, client->intraComm, false); 
     773   
     774  WriteNetCdf netCdfWriter(filename, client->intraComm);   
    759775 
    760776  // Define some dimensions 
     
    770786  netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims); 
    771787 
     788  // End of definition 
     789  netCdfWriter.endDefinition(); 
     790 
    772791  // // Write variables 
    773   netCdfWriter.writeDataIndex(src_idx, "src_idx", true, 0, &start, &count); 
    774   netCdfWriter.writeDataIndex(dst_idx, "dst_idx", true, 0, &start, &count); 
    775   netCdfWriter.writeDataIndex(weights, "weight", true, 0, &start, &count); 
     792  if (0 != localNbWeight) 
     793  { 
     794    netCdfWriter.writeDataIndex(src_idx, "src_idx", false, 0, &start, &count); 
     795    netCdfWriter.writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count); 
     796    netCdfWriter.writeDataIndex(weights, "weight", false, 0, &start, &count); 
     797  } 
    776798 
    777799  netCdfWriter.closeFile(); 
  • XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.hpp

    r1021 r1158  
    5959    int addVariableWrite(const StdString& name, nc_type type, 
    6060                         const std::vector<StdString>& dim); 
     61    void endDefinition(); 
    6162    void writeDataIndex(const CArray<int,1>& data, const StdString& name, 
    6263                        bool collective, StdSize record, 
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp

    r979 r1158  
    1111#include "context_client.hpp" 
    1212#include "client_client_dht_template.hpp" 
     13#include "utils.hpp" 
    1314 
    1415namespace xios { 
     
    2930                                            CArray<double,1>& dataOut, 
    3031                                            std::vector<bool>& flagInitial, 
    31                                             const double& defaultValue) 
    32 { 
    33   int nbLocalIndex = localIndex.size(); 
    34   bool hasMissingValue = (0.0 != defaultValue) ? true : false; 
    35   if (hasMissingValue) 
     32                                            bool ignoreMissingValue) 
     33{ 
     34  int nbLocalIndex = localIndex.size();    
     35  double defaultValue = std::numeric_limits<double>::quiet_NaN(); 
     36  if (ignoreMissingValue) 
    3637  { 
    3738    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    3839    { 
    39       if (defaultValue == *(dataInput + idx)) 
     40      if (NumTraits<double>::isnan(*(dataInput + idx))) 
    4041      { 
    4142        flagInitial[localIndex[idx].first] = false; 
     
    4748    } 
    4849 
    49     for (int idx = 0; idx < nbLocalIndex; ++idx) 
    50     { 
    51       if (!flagInitial[localIndex[idx].first]) 
    52         dataOut(localIndex[idx].first) = defaultValue; 
    53     } 
     50    // for (int idx = 0; idx < nbLocalIndex; ++idx) 
     51    // { 
     52    //   if (!flagInitial[localIndex[idx].first]) 
     53    //     dataOut(localIndex[idx].first) = defaultValue; 
     54    // } 
    5455  } 
    5556  else 
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.hpp

    r979 r1158  
    6363    \param [in/out] dataOut Array contains local data 
    6464    \param [in/out] flagInitial vector of boolean to mark the local index already initialized. True means there is a need for initalization 
     65    \param [in] ignoreMissingValue don't count missing value in operation if this flag is true 
    6566  */ 
    6667  virtual void apply(const std::vector<std::pair<int,double> >& localIndex, 
    6768                     const double* dataInput, 
    6869                     CArray<double,1>& dataOut, 
    69                      std::vector<bool>& flagInitial, 
    70                      const double& defaultValue); 
     70                     std::vector<bool>& flagInitial,                      
     71                     bool ignoreMissingValue); 
    7172 
    7273  /*! 
  • XIOS/dev/dev_olga/src/transformation/grid_transformation.cpp

    r978 r1158  
    236236  } 
    237237 
    238   tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder); 
    239   tmpGridDestination_->computeGridGlobalDimension(domainDst, axisDst, scalarDst, elementOrder); 
     238  tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder);   
    240239  tempGridDests_.push_back(tmpGridDestination_); 
    241240} 
     
    322321  } 
    323322 
    324   gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 
    325   gridSource_->computeGridGlobalDimension(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 
     323  gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order);   
    326324 
    327325  tempGridSrcs_.push_back(gridSource_); 
  • XIOS/dev/dev_olga/src/transformation/grid_transformation_selector.cpp

    r980 r1158  
    202202 
    203203    // If source and destination grid share the same scalar 
    204     if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && 
    205         (scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) && !isSameGrid_) return; 
     204    if ((-1 != scalarDstPos) && (-1 != scalarSrcPos)  && !isSameGrid_ && 
     205        ((scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) || 
     206         (scalarListDestP[scalarDstPos]->isEqual(scalarListSrcP[scalarSrcPos])))) return; 
    206207 
    207208    if (scalarListDestP[scalarDstPos]->hasTransformation()) 
     
    242243 
    243244    // If source and destination grid share the same axis 
    244     if ((-1 != axisDstPos) && (-1 != axisSrcPos) && 
    245         (axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) && !isSameGrid_) return; 
     245    if ((-1 != axisDstPos) && (-1 != axisSrcPos) && !isSameGrid_ && 
     246        ((axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) || 
     247         (axisListDestP[axisDstPos]->isEqual(axisListSrcP[axisSrcPos]))) ) return; 
    246248 
    247249    if (axisListDestP[axisDstPos]->hasTransformation()) 
     
    281283 
    282284    // If source and destination grid share the same domain 
    283     if ((-1 != domDstPos) && (-1 != domSrcPos) && 
    284         (domListDestP[domDstPos] == domListSrcP[domSrcPos]) && !isSameGrid_) return; 
     285    if ((-1 != domDstPos) && (-1 != domSrcPos) && !isSameGrid_ && 
     286        ((domListDestP[domDstPos] == domListSrcP[domSrcPos]) || 
     287         (domListDestP[domDstPos]->isEqual(domListSrcP[domSrcPos])))) return; 
    285288 
    286289    if (domListDestP[domDstPos]->hasTransformation()) 
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_extract_axis.cpp

    r980 r1158  
    5555                                         const double* dataInput, 
    5656                                         CArray<double,1>& dataOut, 
    57                                          std::vector<bool>& flagInitial, 
    58                                          const double& defaultValue) 
     57                                         std::vector<bool>& flagInitial,                      
     58                                         bool ignoreMissingValue) 
    5959{ 
    60   reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
     60  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 
    6161} 
    6262 
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_extract_axis.hpp

    r980 r1158  
    3232                     const double* dataInput, 
    3333                     CArray<double,1>& dataOut, 
    34                      std::vector<bool>& flagInitial, 
    35                      const double& defaultValue); 
     34                     std::vector<bool>& flagInitial,                      
     35                     bool ignoreMissingValue); 
    3636 
    3737  virtual ~CScalarAlgorithmExtractAxis(); 
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_axis.cpp

    r980 r1158  
    8888                                         CArray<double,1>& dataOut, 
    8989                                         std::vector<bool>& flagInitial, 
    90                                          const double& defaultValue) 
     90                                       bool ignoreMissingValue) 
    9191{ 
    92   reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
     92  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 
    9393} 
    9494 
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_axis.hpp

    r980 r1158  
    3333                     CArray<double,1>& dataOut, 
    3434                     std::vector<bool>& flagInitial, 
    35                      const double& defaultValue); 
     35                     bool ignoreMissingValue); 
    3636 
    3737  virtual void updateData(CArray<double,1>& dataOut); 
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_domain.cpp

    r979 r1158  
    8181                                         const double* dataInput, 
    8282                                         CArray<double,1>& dataOut, 
    83                                          std::vector<bool>& flagInitial, 
    84                                          const double& defaultValue) 
     83                                         std::vector<bool>& flagInitial,                      
     84                                         bool ignoreMissingValue) 
    8585{ 
    86   reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 
     86  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 
    8787} 
    8888 
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_domain.hpp

    r979 r1158  
    3232                     const double* dataInput, 
    3333                     CArray<double,1>& dataOut, 
    34                      std::vector<bool>& flagInitial, 
    35                      const double& defaultValue); 
     34                     std::vector<bool>& flagInitial,                      
     35                     bool ignoreMissingValue); 
    3636 
    3737  virtual void updateData(CArray<double,1>& dataOut); 
  • XIOS/dev/dev_olga/src/type/enum.hpp

    r591 r1158  
    100100    __INLINE__ const CEnum_ref& operator = (const CEnum_ref& val) const; 
    101101    __INLINE__ operator T_enum&() const; 
    102     bool operator == (const CEnum_ref &other) {return this->get()==other.get() ;} 
     102     
    103103 
    104104    inline virtual CBaseType* clone(void) const   { return _clone(); } 
     
    134134  } ; 
    135135   
     136  template <typename T> bool operator== (const CEnum<T>& lhs, const typename T::t_enum& rhs); 
     137  template <typename T> bool operator== (const typename T::t_enum& lhs, const CEnum<T>& rhs); 
     138  template <typename T> bool operator== (const CEnum<T>& lhs, const CEnum<T>& rhs);   
     139  template <typename T> bool operator== (const CEnum_ref<T>& lhs, const CEnum_ref<T>& rhs); 
     140  template <typename T> bool operator== (const CEnum_ref<T>& lhs, const typename T::t_enum& rhs); 
     141  template <typename T> bool operator== (const typename T::t_enum& lhs, const CEnum_ref<T>& rhs); 
     142  template <typename T> bool operator== (const CEnum<T>& lhs, const CEnum_ref<T>& rhs) {return (lhs.get() == rhs.get());} 
     143  template <typename T> bool operator== (const CEnum_ref<T>& lhs, const CEnum<T>& rhs) {return (rhs == lhs); } 
     144 
    136145  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) ; 
    137146  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type) ;   
  • XIOS/dev/dev_olga/src/type/enum_impl.hpp

    r680 r1158  
    249249                     << "Enum is not initialized."); 
    250250  }   
    251  
    252    
     251   
     252  template <typename T>  
     253  bool operator== (const CEnum<T>& lhs, const typename T::t_enum& rhs) 
     254  { 
     255     if (lhs.isEmpty()) return false; 
     256     return (lhs.get() == rhs); 
     257  } 
     258 
     259  template <typename T>  
     260  bool operator== (const typename T::t_enum& lhs, const CEnum<T>& rhs) 
     261  { 
     262    return rhs == lhs; 
     263  } 
     264 
     265  template <typename T>  
     266  bool operator== (const CEnum<T>& lhs, const CEnum<T>& rhs) 
     267  { 
     268    if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 
     269    if (lhs.isEmpty() && rhs.isEmpty()) return true; 
     270    return (lhs.get() == rhs.get()); 
     271  } 
     272 
     273 
    253274  template <typename T> 
    254275  CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) 
  • XIOS/dev/dev_olga/src/type/enum_ref_impl.hpp

    r680 r1158  
    263263  } 
    264264                      
    265  
     265  template <typename T>  
     266  bool operator== (const CEnum_ref<T>& lhs, const typename T::t_enum& rhs) 
     267  { 
     268     if (lhs.isEmpty()) return false; 
     269     return (lhs.get() == rhs); 
     270  } 
     271 
     272  template <typename T>  
     273  bool operator== (const typename T::t_enum& lhs, const CEnum_ref<T>& rhs) 
     274  { 
     275    return rhs == lhs; 
     276  } 
     277 
     278  template <typename T>  
     279  bool operator== (const CEnum_ref<T>& lhs, const CEnum_ref<T>& rhs) 
     280  { 
     281    if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 
     282    if (lhs.isEmpty() && rhs.isEmpty()) return true; 
     283    return (lhs.get() == rhs.get()); 
     284  } 
    266285   
    267286  template <typename T> 
  • XIOS/dev/dev_olga/src/type/message.cpp

    r1009 r1158  
    2727     size_t retSize=0 ; 
    2828      
    29      for(it=typeList.begin();it!=typeList.end();it++) 
    30          retSize+=(*it)->size() ; 
     29     for(it=typeList.begin();it!=typeList.end();it++) retSize+=(*it)->size() ; 
    3130     return retSize ; 
    3231   } 
  • XIOS/dev/dev_olga/src/type/type.hpp

    r748 r1158  
    9494    const CType_ref& operator = (CType<T>& val) const ; 
    9595    const CType_ref& operator = (const CType_ref& val) const; 
    96     operator T&() const; 
     96    operator T&() const;     
    9797 
    9898    inline virtual CBaseType* clone(void) const   { return _clone(); } 
     
    127127    size_t _size(void) const ; 
    128128  } ; 
     129 
     130  template <typename T> bool operator==(const CType<T>& lhs, const T& rhs);    
     131  template <typename T> bool operator==(const T& lhs, const CType<T>& rhs);    
     132  template <typename T> bool operator==(const CType_ref<T>& lhs, const T& rhs);    
     133  template <typename T> bool operator==(const T& lhs, const CType_ref<T>& rhs);  
     134  template <typename T> bool operator==(const CType<T>& lhs, const CType<T>& rhs);  
     135  template <typename T> bool operator==(const CType_ref<T>& lhs, const CType_ref<T>& rhs);  
     136 
     137  template <typename T> 
     138  bool operator==(const CType_ref<T>& lhs, const CType<T>& rhs) 
     139  { 
     140    if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 
     141    if (lhs.isEmpty() && rhs.isEmpty()) return true; 
     142    return (*lhs.ptrValue == *rhs.ptrValue); 
     143  }  
     144 
     145  template <typename T> 
     146  bool operator==(const CType<T>& lhs, const CType_ref<T>& rhs) 
     147  { 
     148    return (rhs == lhs); 
     149  } 
    129150 
    130151 
  • XIOS/dev/dev_olga/src/type/type_decl.cpp

    r591 r1158  
    1212  template class CType<decl_type> ; \ 
    1313  template class CType_ref<decl_type> ; \ 
    14   template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType<decl_type>& type) ; \ 
    15   template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType_ref<decl_type>& type) ; \ 
    16   template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, decl_type& type) ; \ 
    17   template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const decl_type& type) ; \ 
    18   template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, CType<decl_type>& type) ; \ 
    19   template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, const CType_ref<decl_type>& type) ; \ 
    20   template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, decl_type& type) ; \ 
    21 /*  template CMessage& operator<< <decl_type> (CMessage& msg, const CType<decl_type>& type) ;*/ \ 
    22 /*  template CMessage& operator<< <decl_type> (CMessage& msg, const CType_ref<decl_type>& type) ;*/ \ 
    23   template CMessage& operator<< <decl_type> (CMessage& msg, const decl_type& type) ; \ 
    24   template CMessage& operator<< <decl_type> (CMessage& msg, decl_type& type) ; 
     14  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType<decl_type>& type) ;       \ 
     15  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType_ref<decl_type>& type) ;   \ 
     16  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, decl_type& type) ;                    \ 
     17  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const decl_type& type) ;              \ 
     18  template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, CType<decl_type>& type) ;               \ 
     19  template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, const CType_ref<decl_type>& type) ;     \ 
     20  template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, decl_type& type) ;                      \ 
     21/*  template CMessage& operator<< <decl_type> (CMessage& msg, const CType<decl_type>& type) ;*/          \ 
     22/*  template CMessage& operator<< <decl_type> (CMessage& msg, const CType_ref<decl_type>& type) ;*/      \ 
     23  template CMessage& operator<< <decl_type> (CMessage& msg, const decl_type& type) ;                     \ 
     24  template CMessage& operator<< <decl_type> (CMessage& msg, decl_type& type) ;                           \ 
     25  template bool operator==(const CType<decl_type>& lhs, const decl_type& rhs);                           \ 
     26  template bool operator==(const decl_type& lhs, const CType<decl_type>& rhs);                           \ 
     27  template bool operator==(const CType_ref<decl_type>& lhs, const decl_type& rhs);                       \ 
     28  template bool operator==(const decl_type& lhs, const CType_ref<decl_type>& rhs);                       \ 
     29  template bool operator==(const CType_ref<decl_type>& lhs, const CType<decl_type>& rhs);                \ 
     30  template bool operator==(const CType<decl_type>& lhs, const CType_ref<decl_type>& rhs);                \ 
     31  template bool operator==(const CType<decl_type>& lhs, const CType<decl_type>& rhs);                    \ 
     32  template bool operator==(const CType_ref<decl_type>& lhs, const CType_ref<decl_type>& rhs);     
    2533   
    2634  macro(string) 
  • XIOS/dev/dev_olga/src/type/type_impl.hpp

    r748 r1158  
    211211  } 
    212212 
     213  template <typename T> 
     214  bool operator==(const CType<T>& lhs, const T& rhs) 
     215  { 
     216    if (lhs.isEmpty()) return false; 
     217    return (*lhs.ptrValue == rhs);     
     218  } 
     219 
     220  template <typename T> 
     221  bool operator==(const T& lhs, const CType<T>& rhs) 
     222  { 
     223    return (rhs == lhs); 
     224  } 
     225 
     226  template <typename T> 
     227  bool operator==(const CType<T>& lhs, const CType<T>& rhs) 
     228  { 
     229    if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 
     230    if (lhs.isEmpty() && rhs.isEmpty()) return true; 
     231     
     232    return (*lhs.ptrValue == *rhs.ptrValue); 
     233  } 
    213234 
    214235  template <typename T> 
  • XIOS/dev/dev_olga/src/type/type_ref_impl.hpp

    r680 r1158  
    201201  } 
    202202                      
    203  
     203  template <typename T> 
     204  bool operator==(const CType_ref<T>& lhs, const T& rhs) 
     205  { 
     206    if (lhs.isEmpty()) return false; 
     207    return (*lhs.ptrValue == rhs);     
     208  } 
     209 
     210  template <typename T> 
     211  bool operator==(const T& lhs, const CType_ref<T>& rhs) 
     212  { 
     213    return (rhs == lhs); 
     214  } 
     215 
     216  template <typename T> 
     217  bool operator==(const CType_ref<T>& lhs, const CType_ref<T>& rhs) 
     218  { 
     219    if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 
     220    if (lhs.isEmpty() && rhs.isEmpty()) return true; 
     221     
     222    return (*lhs.ptrValue == *rhs.ptrValue); 
     223  } 
    204224   
    205225  template <typename T> 
  • XIOS/dev/dev_olga/src/utils.hpp

    r814 r1158  
    257257    return 1e-12; 
    258258  } 
     259  static inline bool isnan(const Scalar& v) { 
     260    return (v != v); 
     261  } 
    259262}; 
    260263 
  • XIOS/dev/dev_olga/src/xios_server.f90

    r1054 r1158  
    44  INCLUDE "mpif.h" 
    55  INTEGER :: ierr 
     6   
     7    CALL xios_init_server 
    68 
    7   CALL xios_init_server 
    8  
    9 END PROGRAM server_main 
     9  END PROGRAM server_main 
  • XIOS/dev/dev_olga/src/xios_spl.hpp

    r621 r1158  
    5252typedef  unsigned long int    ulong; 
    5353 
     54const size_t stringArrayLen=255 ; 
     55 
    5456/// XIOS headers /// 
    5557#include "configure.hpp" 
  • XIOS/dev/dev_olga/src/xml_parser.cpp

    r509 r1158  
    7070                  CContext::setCurrent(attributes["id"]) ; 
    7171 
    72                   bool hasctxt = CContext::has(attributes["id"]); 
    73  
    74                   if(hasctxt) 
    75                   { 
    76                      DEBUG("The context will not be processed because it exist an other context with the same id" ); 
    77                      continue; 
    78                   } 
    7972 
    8073                  if (isParseAll) 
    8174                  { 
    8275                    CContext* context = CContext::create(attributes["id"]); 
    83 //                  if (!hasctxt)  group_context->addChild(context); 
    8476                    context->parse(node); 
    8577 
     
    9284                    { 
    9385                      CContext* context = CContext::create(*it); 
    94   //                  if (!hasctxt)  group_context->addChild(context); 
    9586                      context->parse(node); 
    9687 
Note: See TracChangeset for help on using the changeset viewer.