Changeset 1420
- Timestamp:
- 02/08/18 14:40:41 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src/transformation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/generic_algorithm_transformation.cpp
r1408 r1420 995 995 gridSrc->getLocalMask(localMaskOnSrcGrid) ; 996 996 // intermediate grid, mask is not initialized => set up mask to true 997 if (localMaskOnSrcGrid.isEmpty()) localMaskOnSrcGrid.resize(nlocalIndexSrc) ; 998 localMaskOnSrcGrid=true ; 997 if (localMaskOnSrcGrid.isEmpty()) 998 { 999 localMaskOnSrcGrid.resize(nlocalIndexSrc) ; 1000 localMaskOnSrcGrid=true ; 1001 } 999 1002 1000 1003 … … 1024 1027 int currentInd ; 1025 1028 int t=0 ; 1026 1027 1028 nonDistributedrecursiveFunct(nElement-1, elementPositionInGrid,maskSrc,maskDst, srcInd, nIndexSrc, t, dstIndWeight,1029 int srcIndCompressed=0 ; 1030 1031 nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, 1029 1032 currentInd,localSrc,localDst,weight, localMaskOnSrcGrid, localMaskOnGridDest ); 1030 1033 … … 1032 1035 1033 1036 1034 void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,1037 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, 1035 1038 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest ) 1036 1039 { … … 1043 1046 for(int i=0;i<nIndexSrc[currentPos];i++) 1044 1047 { 1045 if (mask(i)) 1046 { 1047 nonDistributedrecursiveFunct(currentPos-1, elementPositionInGrid, maskSrc, maskDst, srcInd, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 1048 } 1048 if (!mask(i)) masked=false ; 1049 nonDistributedrecursiveFunct(currentPos-1, masked, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 1049 1050 } 1050 1051 } … … 1054 1055 for(int i=0;i<nIndexSrc[currentPos];i++) 1055 1056 { 1056 if (mask (i))1057 if (masked && mask(i)) 1057 1058 { 1058 1059 if (dstIndWeight[t][currentInd].size()>0) … … 1062 1063 if (localMaskOnGridSrc(srcInd)) 1063 1064 { 1064 localSrc.push_back(srcInd ) ;1065 localSrc.push_back(srcIndCompressed) ; 1065 1066 localDst.push_back(it->first) ; 1066 1067 weight.push_back(it->second) ; … … 1069 1070 (it->first)++ ; 1070 1071 } 1072 if (localMaskOnGridSrc(srcInd)) srcIndCompressed ++ ; 1071 1073 } 1072 srcInd++ ;1073 1074 if (t < dstIndWeight.size()-1) t++ ; 1074 1075 } 1076 srcInd++ ; 1075 1077 } 1076 1078 } … … 1086 1088 { 1087 1089 t=0 ; 1088 if (mask(i)) 1089 { 1090 nonDistributedrecursiveFunct(currentPos-1, elementPositionInGrid, maskSrc, maskDst, srcInd, nIndexSrc, t, dstIndWeight , i, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 1091 } 1090 if (!mask(i)) masked=false ; 1091 nonDistributedrecursiveFunct(currentPos-1, masked, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight , i, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 1092 1092 } 1093 1093 } … … 1096 1096 for(int i=0;i<nIndexSrc[currentPos];i++) 1097 1097 { 1098 t=0 ;1099 if (dstIndWeight[t][i].size()>0)1100 {1101 for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it)1098 if (masked) 1099 { 1100 t=0 ; 1101 if (dstIndWeight[t][i].size()>0) 1102 1102 { 1103 if (localMaskOnGridSrc(srcInd))1103 for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it) 1104 1104 { 1105 localSrc.push_back(srcInd) ; 1106 localDst.push_back(it->first) ; 1107 weight.push_back(it->second) ; 1108 localMaskOnGridDest[it->first]=true ; 1105 if (localMaskOnGridSrc(srcInd)) 1106 { 1107 localSrc.push_back(srcIndCompressed) ; 1108 localDst.push_back(it->first) ; 1109 weight.push_back(it->second) ; 1110 localMaskOnGridDest[it->first]=true ; 1111 } 1112 (it->first)++ ; 1109 1113 } 1110 (it->first)++ ;1114 if (localMaskOnGridSrc(srcInd)) srcIndCompressed ++ ; 1111 1115 } 1116 if (t < dstIndWeight.size()-1) t++ ; 1112 1117 } 1113 1118 srcInd++ ; 1114 if (t < dstIndWeight.size()-1) t++ ;1115 1119 } 1116 1120 } -
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/generic_algorithm_transformation.hpp
r1404 r1420 89 89 void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 90 90 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest); 91 void nonDistributedrecursiveFunct(int currentPos, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,91 void 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, 92 92 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest) ; 93 93
Note: See TracChangeset
for help on using the changeset viewer.