- Timestamp:
- 09/17/20 18:30:19 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/distributed_view.cpp
r1930 r1936 29 29 for(int i=0 ; i < size ; i++) 30 30 if (mask(i)) { index(pos) = i ; pos++ ; } 31 index.resizeAndPreserve(pos) ; 31 if (pos==0) index.resize(pos) ; 32 else index.resizeAndPreserve(pos) ; 32 33 size_[rank] = pos ; 33 34 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/distributed_view.hpp
r1930 r1936 43 43 } 44 44 } 45 globalIndView.resizeAndPreserve(pos) ; 45 if (pos==0) globalIndView.resize(pos) ; 46 else globalIndView.resizeAndPreserve(pos) ; 46 47 } 47 48 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/local_view.hpp
r1930 r1936 34 34 } 35 35 } 36 globalIndexView.resizeAndPreserve(pos) ; 36 if(pos==0) globalIndexView.resize(pos) ; 37 else globalIndexView.resizeAndPreserve(pos) ; 37 38 } 38 39 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/mesh.cpp
r1639 r1936 539 539 } 540 540 } 541 nodeHashList.resizeAndPreserve(nbHash); 541 if (nbHash==0) nodeHashList.resize(nbHash); 542 else nodeHashList.resizeAndPreserve(nbHash); 542 543 543 544 // (2.2) Generating global node indexes … … 986 987 } 987 988 } 988 edgeHashList.resizeAndPreserve(nEdgeHash); 989 if (nEdgeHash==0) edgeHashList.resize(nEdgeHash); 990 else edgeHashList.resizeAndPreserve(nEdgeHash); 989 991 990 992 // (2.3) Generating global edge indexes … … 1327 1329 } 1328 1330 } 1329 nodeIdxList.resizeAndPreserve(nIdx); 1331 if (nIdx==0) nodeIdxList.resize(nIdx); 1332 else nodeIdxList.resizeAndPreserve(nIdx); 1330 1333 CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 1331 1334 dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); … … 1377 1380 } 1378 1381 } 1379 edgeHashList.resizeAndPreserve(nEdgeHash); 1382 if (nEdgeHash==0) edgeHashList.resize(nEdgeHash); 1383 else edgeHashList.resizeAndPreserve(nEdgeHash); 1380 1384 1381 1385 // (3.4) Generating global edge indexes … … 1754 1758 } 1755 1759 } 1756 nghbFaces.resizeAndPreserve(2, nbNghb); 1760 if (nbNghb==0) nghbFaces.resize(2, nbNghb); 1761 else nghbFaces.resizeAndPreserve(2, nbNghb); 1757 1762 } // getGloNghbFacesNodeType 1758 1763 … … 1806 1811 } 1807 1812 } 1808 nodeHashList.resizeAndPreserve(iIdx); 1813 if (iIdx==0) nodeHashList.resize(iIdx); 1814 else nodeHashList.resizeAndPreserve(iIdx); 1809 1815 1810 1816 // (1.2) Generating node indexes … … 1934 1940 } 1935 1941 } 1936 nghbFaces.resizeAndPreserve(2, nbNghb); 1942 if (nbNghb==0) nghbFaces.resize(2, nbNghb); 1943 else nghbFaces.resizeAndPreserve(2, nbNghb); 1937 1944 } // getGloNghbFacesEdgeType 1938 1945 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/test/generic_testcase.f90
r1934 r1936 34 34 DOUBLE PRECISION :: pressure_factor 35 35 LOGICAL :: domain_mask 36 CHARACTER(len_str) :: domain_mask_type="cross" 36 37 LOGICAL :: axis_mask 37 38 LOGICAL :: mask3d … … 755 756 IF (.NOT. xios_getvar(prefix//"domain", params%domain) ) params%domain="lmdz" 756 757 IF (.NOT. xios_getvar(prefix//"domain_mask", params%domain_mask) ) params%domain_mask=.FALSE. 758 IF (.NOT. xios_getvar(prefix//"domain_mask_type", params%domain_mask_type) ) params%domain_mask_type="cross" 757 759 IF (.NOT. xios_getvar(prefix//"axis", params%axis) ) params%axis="pressure" 758 760 IF (.NOT. xios_getvar(prefix//"axis_mask", params%axis_mask) ) params%axis_mask=.FALSE. … … 1939 1941 mask(:)=.TRUE. 1940 1942 IF (params%domain_mask) THEN 1941 WHERE (lon(:)-2*lat(:)>-10 .AND. lon(:)-2*lat(:) <10) mask(:)=.FALSE. 1942 WHERE (2*lat(:)+lon(:)>-10 .AND. 2*lat(:)+lon(:)<10) mask(:)=.FALSE. 1943 IF (params%domain_mask_type=="cross") THEN 1944 WHERE (lon(:)-2*lat(:)>-10 .AND. lon(:)-2*lat(:) <10) mask(:)=.FALSE. 1945 WHERE (2*lat(:)+lon(:)>-10 .AND. 2*lat(:)+lon(:)<10) mask(:)=.FALSE. 1946 ELSE IF (params%domain_mask_type=="latitude_band") THEN 1947 WHERE (lat(:)>-30 .AND. lat(:)<30) mask(:)=.FALSE. 1948 ENDIF 1943 1949 ENDIF 1944 1950 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_expand.cpp
r1784 r1936 259 259 CArray<int,1> data_j_index_dst_full(newNbLocalDst); 260 260 261 domainDestination->lonvalue.resizeAndPreserve(newNbLocalDst); 262 domainDestination->latvalue.resizeAndPreserve(newNbLocalDst); 263 domainDestination->bounds_lon_1d.resizeAndPreserve(nVertex, newNbLocalDst); 264 domainDestination->bounds_lat_1d.resizeAndPreserve(nVertex, newNbLocalDst); 261 if (newNbLocalDst==0) 262 { 263 domainDestination->lonvalue.resize(newNbLocalDst); 264 domainDestination->latvalue.resize(newNbLocalDst); 265 domainDestination->bounds_lon_1d.resize(nVertex, newNbLocalDst); 266 domainDestination->bounds_lat_1d.resize(nVertex, newNbLocalDst); 267 } 268 else 269 { 270 domainDestination->lonvalue.resizeAndPreserve(newNbLocalDst); 271 domainDestination->latvalue.resizeAndPreserve(newNbLocalDst); 272 domainDestination->bounds_lon_1d.resizeAndPreserve(nVertex, newNbLocalDst); 273 domainDestination->bounds_lat_1d.resizeAndPreserve(nVertex, newNbLocalDst); 274 } 265 275 CArray<double,1>& lon_dst = domainDestination->lonvalue; 266 276 CArray<double,1>& lat_dst = domainDestination->latvalue; … … 532 542 int nVertex = bounds_lon_dst.shape()[0]; 533 543 534 mask_1d_dst.resizeAndPreserve(newNbLocalDst); 535 i_index_dst.resizeAndPreserve(newNbLocalDst); 536 j_index_dst.resizeAndPreserve(newNbLocalDst); 537 lon_dst.resizeAndPreserve(newNbLocalDst); 538 lat_dst.resizeAndPreserve(newNbLocalDst); 539 bounds_lon_dst.resizeAndPreserve(nVertex, newNbLocalDst); 540 bounds_lat_dst.resizeAndPreserve(nVertex, newNbLocalDst); 544 if (newNbLocalDst==0) 545 { 546 mask_1d_dst.resize(newNbLocalDst); 547 i_index_dst.resize(newNbLocalDst); 548 j_index_dst.resize(newNbLocalDst); 549 lon_dst.resize(newNbLocalDst); 550 lat_dst.resize(newNbLocalDst); 551 bounds_lon_dst.resize(nVertex, newNbLocalDst); 552 bounds_lat_dst.resize(nVertex, newNbLocalDst); 553 } 554 else 555 { 556 mask_1d_dst.resizeAndPreserve(newNbLocalDst); 557 i_index_dst.resizeAndPreserve(newNbLocalDst); 558 j_index_dst.resizeAndPreserve(newNbLocalDst); 559 lon_dst.resizeAndPreserve(newNbLocalDst); 560 lat_dst.resizeAndPreserve(newNbLocalDst); 561 bounds_lon_dst.resizeAndPreserve(nVertex, newNbLocalDst); 562 bounds_lat_dst.resizeAndPreserve(nVertex, newNbLocalDst); 563 } 541 564 CArray<int,1> data_i_index_dst_full(newNbLocalDst); 542 565 data_i_index_dst_full(Range(0,oldNbLocal-1)) = data_i_index_src_full;
Note: See TracChangeset
for help on using the changeset viewer.