Ignore:
Timestamp:
09/06/18 18:55:44 (6 years ago)
Author:
oabramkina
Message:

Taking care of cases when a process doesn't possess a grid (its domain or axe size is zero).

Tested with CMIP6 toy models and IPSL model.

To do: remove grid mask from transformations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/axis.hpp

    r1568 r1571  
    114114         void computeWrittenIndex(); 
    115115         void computeWrittenCompressedIndex(MPI_Comm); 
     116 
     117         template <class T> void outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut); 
     118 
    116119         bool hasTransformation(); 
    117120         void solveInheritanceTransformation(); 
     
    126129        bool hasLabel; 
    127130 
    128         CArray<size_t,1> localIndexToWriteOnServer; 
     131//        CArray<size_t,1> localIndexToWriteOnServer; 
     132        CArray<int,1> localIndexToWriteOnServer; 
     133        CArray<size_t,1> localIndexToWriteOnClient; 
    129134 
    130135      private: 
     
    185190   ///-------------------------------------------------------------- 
    186191 
     192   template <class T> void CAxis::outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut) 
     193   { 
     194     int sizeServer = localIndexToWriteOnServer.numElements(); 
     195     int sizeClient = localIndexToWriteOnClient.numElements(); 
     196     valueOut.resize(sizeClient); 
     197 
     198     if (sizeServer == sizeClient) 
     199     { 
     200       valueOut = valueIn; 
     201     } 
     202     else 
     203     // a hole 
     204     { 
     205       valueOut = valueIn; 
     206       //valueOut = -1; initialize here to some value ???? 
     207     } 
     208//      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     209//      CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer; 
     210//      for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx) 
     211//      { 
     212//        fieldOut(outIndexServer(idx)) = recvDataSrv(outIndexClient(idx)); 
     213//      } 
     214   } 
     215 
    187216   // Declare/Define CAxisGroup and CAxisDefinition 
    188217   DECLARE_GROUP(CAxis); 
Note: See TracChangeset for help on using the changeset viewer.