Ignore:
Timestamp:
10/12/18 16:02:37 (6 years ago)
Author:
oabramkina
Message:

Clean-up in transformation classes related to the new treatment of grid mask at the entrance of a workflow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp

    r1542 r1584  
    843843 
    844844 
    845  
    846845void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
    847                                                                                  vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest) 
     846                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, 
     847                                                                                 int nlocalIndexDest) 
     848 
     849//void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
     850//                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, 
     851//                                                                                 vector<bool>& localMaskOnGridDest) 
    848852{ 
    849853 
     
    871875     
    872876  int nlocalIndexSrc=1 ; 
    873   int nlocalIndexDest=1 ; 
     877//  int nlocalIndexDest=1 ; 
     878  nlocalIndexDest=1 ; 
    874879  CArray<bool,1> maskScalar(1) ; 
    875880  maskScalar  = true ; 
     
    933938    nlocalIndexDest=nlocalIndexDest*nIndexDst[i] ; 
    934939  } 
    935  
    936  
    937  
    938  
    939  
    940940 
    941941  vector<int> dstLocalInd ; 
     
    986986 
    987987// just get the local src mask 
    988   CArray<bool,1> localMaskOnSrcGrid; 
    989   gridSrc->getLocalMask(localMaskOnSrcGrid) ; 
     988//  CArray<bool,1> localMaskOnSrcGrid; 
     989//  gridSrc->getLocalMask(localMaskOnSrcGrid) ; 
    990990// intermediate grid, mask is not initialized => set up mask to true 
    991   if (localMaskOnSrcGrid.isEmpty()) 
    992   { 
    993     localMaskOnSrcGrid.resize(nlocalIndexSrc) ; 
    994     localMaskOnSrcGrid=true ; 
    995   } 
    996    
    997  
    998   localMaskOnGridDest.resize(nlocalIndexDest,false) ; 
     991//  if (localMaskOnSrcGrid.isEmpty()) 
     992//  { 
     993//    localMaskOnSrcGrid.resize(nlocalIndexSrc) ; 
     994//    localMaskOnSrcGrid=true ; 
     995//  } 
     996   
     997 
     998//  localMaskOnGridDest.resize(nlocalIndexDest,false) ; 
    999999 
    10001000  vector<vector<vector<pair<int,double> > > > dstIndWeight(transformationMapping_.size()) ; 
     
    10231023  int srcIndCompressed=0 ; 
    10241024   
     1025//  nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, 
     1026//                               currentInd,localSrc,localDst,weight, localMaskOnSrcGrid, localMaskOnGridDest ); 
     1027//  nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, 
     1028//                               currentInd,localSrc,localDst,weight, localMaskOnGridDest ); 
    10251029  nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight,   
    1026                                currentInd,localSrc,localDst,weight, localMaskOnSrcGrid, localMaskOnGridDest ); 
     1030                               currentInd,localSrc,localDst,weight); 
    10271031                
    10281032} 
    10291033 
    10301034 
    1031 void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 
    1032                     vector<int>& localSrc, vector<int>& localDst, vector<double>& weight,  CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest ) 
     1035void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, 
     1036                                                                   vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, 
     1037                                                                   int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, 
     1038                                                                   int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 
     1039                                                                   vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) 
     1040//                                                                   CArray<bool,1>& localMaskOnGridSrc 
     1041//                                                                   , vector<bool>& localMaskOnGridDest ) 
    10331042{ 
    10341043  int masked_ ; 
     
    10431052        masked_=masked ; 
    10441053        if (!mask(i)) masked_=false ; 
    1045         nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 
     1054//        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 
     1055        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, 
     1056                                     dstIndWeight, currentInd, localSrc, localDst, weight);//, localMaskOnGridDest) ; 
    10461057      } 
    10471058    } 
     
    10571068            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][currentInd].begin(); it!=dstIndWeight[t][currentInd].end(); ++it) 
    10581069            { 
    1059               if (localMaskOnGridSrc(srcInd)) 
     1070//              if (localMaskOnGridSrc(srcInd)) 
    10601071              { 
    10611072                localSrc.push_back(srcIndCompressed) ; 
    10621073                localDst.push_back(it->first) ; 
    10631074                weight.push_back(it->second) ; 
    1064                 localMaskOnGridDest[it->first]=true ; 
     1075//                localMaskOnGridDest[it->first]=true ; 
    10651076              } 
    10661077              (it->first)++ ; 
     
    10681079          } 
    10691080          if (t < dstIndWeight.size()-1) t++ ; 
    1070           if (localMaskOnGridSrc(srcInd)) srcIndCompressed ++ ; 
     1081//          if (localMaskOnGridSrc(srcInd)) 
     1082            srcIndCompressed ++ ; 
    10711083        } 
    10721084        srcInd++ ; 
     
    10861098        masked_=masked ; 
    10871099        if (!mask(i)) masked_=false ;  
    1088         nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight , i,  localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 
     1100        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, 
     1101                                     srcIndCompressed, nIndexSrc, t, dstIndWeight , i,  localSrc, localDst, weight); 
     1102//                                     localMaskOnGridSrc, 
     1103//                                     localMaskOnGridDest) ; 
    10891104      } 
    10901105    } 
     
    11001115            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it) 
    11011116            { 
    1102               if (localMaskOnGridSrc(srcInd)) 
     1117//              if (localMaskOnGridSrc(srcInd)) 
    11031118              { 
    11041119                localSrc.push_back(srcIndCompressed) ; 
    11051120                localDst.push_back(it->first) ; 
    11061121                weight.push_back(it->second) ; 
    1107                 localMaskOnGridDest[it->first]=true ; 
     1122//                localMaskOnGridDest[it->first]=true ; 
    11081123              } 
    11091124              (it->first)++ ; 
     
    11111126           } 
    11121127          if (t < dstIndWeight.size()-1) t++ ; 
    1113           if (localMaskOnGridSrc(srcInd)) srcIndCompressed ++ ; 
     1128//          if (localMaskOnGridSrc(srcInd)) 
     1129            srcIndCompressed ++ ; 
    11141130        } 
    11151131        srcInd++ ; 
Note: See TracChangeset for help on using the changeset viewer.