source: XIOS/dev/branch_openmp/src/node/grid.hpp @ 1460

Last change on this file since 1460 was 1460, checked in by yushan, 6 years ago

branch_openmp merged with XIOS_DEV_CMIP6@1459

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:executable set to *
File size: 23.1 KB
Line 
1#ifndef __XIOS_CGrid__
2#define __XIOS_CGrid__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "group_factory.hpp"
7
8#include "declare_group.hpp"
9#include "domain.hpp"
10#include "axis.hpp"
11#include "scalar.hpp"
12#include "array_new.hpp"
13#include "attribute_array.hpp"
14#include "distribution_server.hpp"
15#include "client_server_mapping.hpp"
16#include "utils.hpp"
17#include "transformation_enum.hpp"
18
19namespace xios {
20
21   /// ////////////////////// Dᅵᅵclarations ////////////////////// ///
22
23   class CGridGroup;
24   class CGridAttributes;
25   class CDomainGroup;
26   class CAxisGroup;
27   class CScalarGroup;
28   class CGrid;
29   class CDistributionClient;
30   class CDistributionServer;
31   class CServerDistributionDescription;
32   class CClientServerMapping;
33   class CGridTransformation;
34
35   ///--------------------------------------------------------------
36
37   // Declare/Define CGridAttribute
38   BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid)
39#  include "grid_attribute.conf"
40   END_DECLARE_ATTRIBUTE_MAP(CGrid)
41
42   ///--------------------------------------------------------------
43
44   class CGrid
45      : public CObjectTemplate<CGrid>
46      , public CGridAttributes
47   {
48         /// typedef ///
49         typedef CObjectTemplate<CGrid>   SuperClass;
50         typedef CGridAttributes SuperClassAttribute;
51
52      public:
53
54         typedef CGridAttributes RelAttributes;
55         typedef CGridGroup      RelGroup;
56
57         enum EEventId
58         {
59           EVENT_ID_INDEX, EVENT_ID_ADD_DOMAIN, EVENT_ID_ADD_AXIS, EVENT_ID_ADD_SCALAR
60         };
61
62         /// Constructeurs ///
63         CGrid(void);
64         explicit CGrid(const StdString& id);
65         CGrid(const CGrid& grid);       // Not implemented yet.
66         CGrid(const CGrid* const grid); // Not implemented yet.
67
68         /// Traitements ///
69//         void solveReference(void);
70
71         void checkEligibilityForCompressedOutput();
72
73         void solveDomainAxisRef(bool areAttributesChecked);
74
75         void checkMaskIndex(bool doCalculateIndex);
76
77 //        virtual void toBinary  (StdOStream& os) const;
78//         virtual void fromBinary(StdIStream& is);
79
80         void addRelFileCompressed(const StdString& filename);
81
82         /// Tests ///
83         bool isCompressible(void) const;
84         bool isWrittenCompressed(const StdString& filename) const;
85
86      public:
87
88         /// Accesseurs ///
89         StdSize getDimension(void);
90
91         StdSize  getDataSize(void) const;
92
93         /// Entrᅵᅵes-sorties de champs
94         template <int n>
95         void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const;
96         template <int n>
97         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const; 
98         template <int n>
99         void uncompressField(const CArray<double,n>& data, CArray<double,1>& outData) const; 
100
101         virtual void parse(xml::CXMLNode& node);
102
103         /// Destructeur ///
104         virtual ~CGrid(void);
105
106      public:
107
108         /// Accesseurs statiques ///
109         static StdString GetName(void);
110         static StdString GetDefName(void);
111
112         static ENodeType GetType(void);
113
114         /// Instanciateurs Statiques ///
115         static CGrid* createGrid(CDomain* domain);
116         static CGrid* createGrid(CDomain* domain, CAxis* axis);
117         static CGrid* createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
118                                  const CArray<int,1>& axisDomainOrder = CArray<int,1>());
119         static CGrid* createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
120                                  const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder = CArray<int,1>());
121         static CGrid* createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
122                                  const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder);
123         static StdString generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
124                                     const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder = CArray<int,1>());
125         static StdString generateId(const CGrid* gridSrc, const CGrid* gridDest);
126         static CGrid* cloneGrid(const StdString& idNewGrid, CGrid* gridSrc);
127
128      public:           
129         void computeIndexServer(void);
130         void computeIndex(void);
131         void computeIndexScalarGrid();
132         void computeWrittenIndex();
133
134         void solveDomainRef(bool checkAtt);
135         void solveAxisRef(bool checkAtt);
136         void solveScalarRef(bool checkAtt);
137         void solveDomainAxisRefInheritance(bool apply = true);
138         void solveTransformations();
139         void solveDomainAxisBaseRef();
140
141         CDomain* addDomain(const std::string& id=StdString());
142         CAxis* addAxis(const std::string& id=StdString());
143         CScalar* addScalar(const std::string& id=StdString());
144         void sendAddDomain(const std::string& id="");
145         void sendAddAxis(const std::string& id="");
146         void sendAddScalar(const std::string& id="");
147         void sendAllDomains();
148         void sendAllAxis();
149         void sendAllScalars();
150
151         static void recvAddDomain(CEventServer& event);
152         void recvAddDomain(CBufferIn& buffer);
153         static void recvAddAxis(CEventServer& event);
154         void recvAddAxis(CBufferIn& buffer);
155         static void recvAddScalar(CEventServer& event);
156         void recvAddScalar(CBufferIn& buffer);
157
158         static bool dispatchEvent(CEventServer& event);
159         static void recvIndex(CEventServer& event);
160         void recvIndex(vector<int> ranks, vector<CBufferIn*> buffers);
161         void sendIndex(void);
162         void sendIndexScalarGrid();
163
164         void setContextClient(CContextClient* contextClient);
165
166         void computeDomConServer();
167         std::map<int, int> getDomConServerSide();
168         std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, bool bufferForWriting = false);
169         std::map<int, StdSize> getDataBufferSize(CContextClient* client, const std::string& id = "", bool bufferForWriting = false);
170         std::vector<StdString> getDomainList();
171         std::vector<StdString> getAxisList();
172         std::vector<StdString> getScalarList();
173         std::vector<CDomain*> getDomains();
174         std::vector<CAxis*> getAxis();
175         std::vector<CScalar*> getScalars();
176         CDomain* getDomain(int domainIndex);
177         CAxis* getAxis(int axisIndex);
178         CScalar* getScalar(int scalarIndex);
179         std::vector<int> getAxisOrder();
180         std::vector<int> getGlobalDimension();
181         bool isScalarGrid() const;         
182
183         bool doGridHaveDataToWrite();
184         bool doGridHaveDataDistributed(CContextClient* client = 0);
185         size_t getWrittenDataSize() const;
186         int getNumberWrittenIndexes() const;
187         int getTotalNumberWrittenIndexes() const;
188         int getOffsetWrittenIndexes() const;
189
190         CDistributionServer* getDistributionServer();
191         CDistributionClient* getDistributionClient();
192         CGridTransformation* getTransformations();
193
194         void transformGrid(CGrid* transformGridSrc);
195         void completeGrid(CGrid* transformGridSrc = 0);
196         void doAutoDistribution(CGrid* transformGridSrc);
197         bool isTransformed();
198         void setTransformed();
199         bool isGenerated();
200         void setGenerated();
201         void addTransGridSource(CGrid* gridSrc);
202         std::map<CGrid*, std::pair<bool,StdString> >& getTransGridSource();
203         bool hasTransform();
204         size_t getGlobalWrittenSize(void) ;
205         void getLocalMask(CArray<bool,1>& localMask) ;
206         template<int N>
207         void getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) ;
208      public:
209         CArray<int, 1> storeIndex_client;
210
211/** Map containing indexes that will be sent in sendIndex(). */
212         std::map<CContextClient*, map<int, CArray<int, 1> > > storeIndex_toSrv;
213
214/** Map storing the number of senders. Key = size of receiver's intracomm */
215         std::map<int, std::map<int,int> > nbSenders;
216
217         std::map<CContextClient*, std::map<int,int> > nbReadSenders;
218
219         map<int, CArray<int, 1> > storeIndex_fromSrv; // Support, for now, reading with level-1 server
220
221         map<int, CArray<size_t, 1> > outIndexFromClient;  // Deprecated
222
223         map<int, CArray<size_t, 1> > compressedOutIndexFromClient;
224
225/** Map storing received indexes. Key = sender rank, value = index array. */
226         map<int, CArray<size_t, 1> > outGlobalIndexFromClient;
227
228// Manh Ha's comment: " A client receives global index from other clients (via recvIndex)
229// then does mapping these index into local index of STORE_CLIENTINDEX
230// In this way, store_clientIndex can be used as an input of a source filter
231// Maybe we need a flag to determine whether a client wants to write. TODO "
232
233/** Map storing received data. Key = sender rank, value = data array.
234 *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */
235         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient; 
236
237/** Indexes calculated based on server-like distribution.
238 *  They are used for writing/reading data and only calculated for server level that does the writing/reading.
239 *  Along with localIndexToWriteOnClient, these indexes are used to correctly place incoming data. */
240         CArray<size_t,1> localIndexToWriteOnServer;
241
242/** Indexes calculated based on client-like distribution.
243 *  They are used for writing/reading data and only calculated for server level that does the writing/reading.
244 *  Along with localIndexToWriteOnServer, these indexes are used to correctly place incoming data. */
245         CArray<size_t,1> localIndexToWriteOnClient;
246
247         CArray<size_t,1> indexFromClients;
248
249         void checkMask(void);
250         void createMask(void);
251         void modifyMask(const CArray<int,1>& indexToModify, bool valueToModify = false);
252         void modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue = false);
253
254         void computeGridGlobalDimension(const std::vector<CDomain*>& domains,
255                                         const std::vector<CAxis*>& axis,
256                                         const std::vector<CScalar*>& scalars,
257                                         const CArray<int,1>& axisDomainOrder);
258
259      private:
260       template<int N>
261       void checkGridMask(CArray<bool,N>& gridMask,
262                          const std::vector<CArray<bool,1>* >& domainMasks,
263                          const std::vector<CArray<bool,1>* >& axisMasks,
264                          const CArray<int,1>& axisDomainOrder,
265                          bool createMask = false);
266        template<int N>
267        void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify);
268
269        template<int N>
270        void modifyGridMaskSize(CArray<bool,N>& gridMask, const std::vector<int>& eachDimSize, bool newValue);
271
272        void storeField_arr(const double* const data, CArray<double, 1>& stored) const;
273        void restoreField_arr(const CArray<double, 1>& stored, double* const data) const;
274        void uncompressField_arr(const double* const data, CArray<double, 1>& outData) const;
275
276        void setVirtualDomainGroup(CDomainGroup* newVDomainGroup);
277        void setVirtualAxisGroup(CAxisGroup* newVAxisGroup);
278        void setVirtualScalarGroup(CScalarGroup* newVScalarGroup);
279
280        void setDomainList(const std::vector<CDomain*> domains = std::vector<CDomain*>());
281        void setAxisList(const std::vector<CAxis*> axis = std::vector<CAxis*>());
282        void setScalarList(const std::vector<CScalar*> scalars = std::vector<CScalar*>());
283
284        CDomainGroup* getVirtualDomainGroup() const;
285        CAxisGroup* getVirtualAxisGroup() const;
286        CScalarGroup* getVirtualScalarGroup() const;
287
288        void checkAttributesAfterTransformation();
289        void setTransformationAlgorithms();
290        void computeIndexByElement(const std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
291                                   const CContextClient* client,
292                                   CClientServerMapping::GlobalIndexMap& globalIndexOnServer);
293        int computeGridGlobalDimension(std::vector<int>& globalDim,
294                                       const std::vector<CDomain*> domains,
295                                       const std::vector<CAxis*> axis,
296                                       const std::vector<CScalar*> scalars,
297                                       const CArray<int,1>& axisDomainOrder);
298        int getDistributedDimension();
299
300        void computeClientIndex();
301        void computeConnectedClients();
302        void computeClientIndexScalarGrid(); 
303        void computeConnectedClientsScalarGrid(); 
304
305      private:
306
307/** Clients that have to send a grid. There can be multiple clients in case of secondary server, otherwise only one client. */
308        std::list<CContextClient*> clients;
309        std::set<CContextClient*> clientsSet;
310
311        bool isChecked;
312        bool isDomainAxisChecked;
313        bool isIndexSent;
314
315        CDomainGroup* vDomainGroup_;
316        CAxisGroup* vAxisGroup_;
317        CScalarGroup* vScalarGroup_;
318        std::vector<std::string> axisList_, domList_, scalarList_;
319        bool isAxisListSet, isDomListSet, isScalarListSet;
320
321/** Client-like distribution calculated based on the knowledge of the entire grid */
322        CDistributionClient* clientDistribution_;
323
324/** Server-like distribution calculated upon receiving indexes */
325        CDistributionServer* serverDistribution_;
326
327        CClientServerMapping* clientServerMap_;
328        size_t writtenDataSize_;
329        int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
330
331/** Map storing local ranks of connected receivers. Key = size of receiver's intracomm.
332  * It is calculated in computeConnectedClients(). */
333        std::map<int, std::vector<int> > connectedServerRank_;
334
335/** Map storing the size of data to be send. Key = size of receiver's intracomm
336  * It is calculated in computeConnectedClients(). */
337        std::map<int, std::map<int,size_t> > connectedDataSize_;
338
339/** Ranks of connected receivers in case of reading. It is calculated in recvIndex(). */
340        std::vector<int> connectedServerRankRead_;
341
342/** Size of data to be send in case of reading. It is calculated in recvIndex(). */
343        std::map<int,size_t> connectedDataSizeRead_;
344
345        bool isDataDistributed_;       
346         //! True if and only if the data defined on the grid can be outputted in a compressed way
347        bool isCompressible_;
348        std::set<std::string> relFilesCompressed;
349
350        bool isTransformed_, isGenerated_;
351        bool computedWrittenIndex_;
352        std::vector<int> axisPositionInGrid_;
353        CGridTransformation* transformations_;
354        bool hasDomainAxisBaseRef_;       
355        std::map<CGrid*, std::pair<bool,StdString> > gridSrc_;
356        bool hasTransform_;
357
358/** Map storing global indexes of server-like (band-wise) distribution for sending to receivers.
359  * Key = size of receiver's intracomm.
360  */
361//        std::map<CContextClient*, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
362        std::map<int, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
363
364
365/** List order of axis and domain in a grid, if there is a domain, it will take value 1 (true), axis 0 (false) */
366        std::vector<int> order_;
367
368   }; // class CGrid
369
370   ///--------------------------------------------------------------
371
372   template <int n>
373   void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const
374   {
375//#ifdef __XIOS_DEBUG
376      if (this->getDataSize() != field.numElements())
377         ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const",
378                << "[ Awaiting data of size = " << this->getDataSize() << ", "
379                << "Received data size = "      << field.numElements() << " ] "
380                << "The data array does not have the right size! "
381                << "Grid = " << this->getId())
382//#endif
383      this->storeField_arr(field.dataFirst(), stored);
384   }
385
386   template <int n>
387   void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const
388   {
389//#ifdef __XIOS_DEBUG
390      if (this->getDataSize() != field.numElements())
391         ERROR("void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const",
392                << "[ Size of the data = " << this->getDataSize() << ", "
393                << "Output data size = "   << field.numElements() << " ] "
394                << "The ouput array does not have the right size! "
395                << "Grid = " << this->getId())
396//#endif
397      this->restoreField_arr(stored, field.dataFirst());
398   }
399
400   /*!
401     This function removes the effect of mask on received data on the server.
402     This function only serve for the checking purpose. TODO: Something must be done to seperate mask and data_index from each other in received data
403     \data data received data with masking effect on the server
404     \outData data without masking effect
405   */
406   template <int N>
407   void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const
408   {     
409     uncompressField_arr(data.dataFirst(), outData);
410   }
411
412   template<int N>
413   void CGrid::checkGridMask(CArray<bool,N>& gridMask,
414                             const std::vector<CArray<bool,1>* >& domainMasks,
415                             const std::vector<CArray<bool,1>* >& axisMasks,
416                             const CArray<int,1>& axisDomainOrder,
417                             bool createMask)
418   {
419     int idx = 0;
420     int numElement = axisDomainOrder.numElements();
421     int dim = domainMasks.size() * 2 + axisMasks.size();
422     std::vector<CDomain*> domainP = this->getDomains();
423     std::vector<CAxis*> axisP = this->getAxis();
424
425     std::vector<int> idxLoop(dim,0), indexMap(numElement), eachDimSize(dim);
426     std::vector<int> currentIndex(dim);
427     int idxDomain = 0, idxAxis = 0;
428    for (int i = 0; i < numElement; ++i)
429    {
430      indexMap[i] = idx;
431      if (2 == axisDomainOrder(i)) {
432          eachDimSize[indexMap[i]]   = domainP[idxDomain]->ni;
433          eachDimSize[indexMap[i]+1] = domainP[idxDomain]->nj;
434          idx += 2; ++idxDomain;
435      }
436      else if (1 == axisDomainOrder(i)) {
437//        eachDimSize[indexMap[i]] = axisMasks[idxAxis]->numElements();
438        eachDimSize[indexMap[i]] = axisP[idxAxis]->n;
439        ++idx; ++idxAxis;
440      }
441      else {};
442    }
443
444    if (!gridMask.isEmpty() && !createMask)
445    {
446      for (int i = 0; i < dim; ++i)
447      {
448        if (gridMask.extent(i) != eachDimSize[i])
449          ERROR("CGrid::checkMask(void)",
450                << "The mask has one dimension whose size is different from the one of the local grid." << std::endl
451                << "Local size of dimension " << i << " is " << eachDimSize[i] << "." << std::endl
452                << "Mask size for dimension " << i << " is " << gridMask.extent(i) << "." << std::endl
453                << "Grid = " << this->getId())
454      }
455    }
456    else {
457        CArrayBoolTraits<CArray<bool,N> >::resizeArray(gridMask,eachDimSize);
458        gridMask = true;
459    }
460
461    int ssize = gridMask.numElements();
462    idx = 0;
463    while (idx < ssize)
464    {
465      for (int i = 0; i < dim-1; ++i)
466      {
467        if (idxLoop[i] == eachDimSize[i])
468        {
469          idxLoop[i] = 0;
470          ++idxLoop[i+1];
471        }
472      }
473
474      // Find out outer index
475      idxDomain = idxAxis = 0;
476      bool maskValue = true;
477      for (int i = 0; i < numElement; ++i)
478      {
479        if (2 == axisDomainOrder(i))
480        {
481          int idxTmp = idxLoop[indexMap[i]] + idxLoop[indexMap[i]+1] * eachDimSize[indexMap[i]];
482          if (idxTmp < (*domainMasks[idxDomain]).numElements())
483            maskValue = maskValue && (*domainMasks[idxDomain])(idxTmp);
484          else
485            maskValue = false;
486          ++idxDomain;
487        }
488        else if (1 == axisDomainOrder(i))
489        {
490          int idxTmp = idxLoop[indexMap[i]];
491          if (idxTmp < (*axisMasks[idxAxis]).numElements())
492            maskValue = maskValue && (*axisMasks[idxAxis])(idxTmp);
493          else
494            maskValue = false;
495
496          ++idxAxis;
497        }
498      }
499
500      int maskIndex = idxLoop[0];
501      int mulDim = 1;
502      for (int k = 1; k < dim; ++k)
503      {
504        mulDim *= eachDimSize[k-1];
505        maskIndex += idxLoop[k]*mulDim;
506      }
507      *(gridMask.dataFirst()+maskIndex) &= maskValue;
508
509      ++idxLoop[0];
510      ++idx;
511    }
512
513   }
514
515   template<int N>
516   void CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask,
517                                  const std::vector<int>& eachDimSize,
518                                  bool newValue)
519   {
520      if (N != eachDimSize.size())
521      {
522        // ERROR("CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask,
523        //                                  const std::vector<int>& eachDimSize,
524        //                                  bool newValue)",
525        //       << "Dimension size of the mask is different from input dimension size." << std::endl
526        //       << "Mask dimension is " << N << "." << std::endl
527        //       << "Input dimension is " << eachDimSize.size() << "." << std::endl
528        //       << "Grid = " << this->getId())
529      }
530      CArrayBoolTraits<CArray<bool,N> >::resizeArray(gridMask,eachDimSize);
531      gridMask = newValue;
532   }
533                                 
534
535   /*!
536     Modify the current mask of grid, the local index to be modified will take value false
537     \param [in/out] gridMask current mask of grid
538     \param [in] indexToModify local index to modify
539   */
540   template<int N>
541   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify)
542   {     
543     int num = indexToModify.numElements();
544     for (int idx = 0; idx < num; ++idx)
545     {
546       *(gridMask.dataFirst()+indexToModify(idx)) = valueToModify;
547     }
548   }
549   ///--------------------------------------------------------------
550
551
552/*!
553  A grid can have multiple dimension, so can its mask in the form of multi-dimension array.
554It's not a good idea to store all multi-dimension arrays corresponding to each mask.
555One of the ways is to convert this array into 1-dimension one and every process is taken place on it.
556  \param [in] multi-dimension array grid mask
557*/
558template<int N>
559void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask)
560{
561  if (gridMask.isEmpty()) return ;
562  int dim = gridMask.dimensions();
563  std::vector<int> dimensionSizes(dim);
564  for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i);
565
566  std::vector<int> idxLoop(dim,0);
567  int ssize = gridMask.numElements(), idx = 0;
568  localMask.resize(ssize);
569  while (idx < ssize)
570  {
571    for (int i = 0; i < dim-1; ++i)
572    {
573      if (idxLoop[i] == dimensionSizes[i])
574      {
575        idxLoop[i] = 0;
576        ++idxLoop[i+1];
577      }
578    }
579
580    int maskIndex = idxLoop[0];
581    int mulDim = 1;
582    for (int k = 1; k < dim; ++k)
583    {
584      mulDim *= dimensionSizes[k-1];
585      maskIndex += idxLoop[k]*mulDim;
586    }
587    localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex);
588
589    ++idxLoop[0];
590    ++idx;
591  }
592}
593
594   // Declare/Define CGridGroup and CGridDefinition
595   DECLARE_GROUP(CGrid);
596
597   ///--------------------------------------------------------------
598
599} // namespace xios
600
601#endif // __XIOS_CGrid__
Note: See TracBrowser for help on using the repository browser.