- Timestamp:
- 03/17/17 16:02:40 (7 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/bld.cfg
r1010 r1078 31 31 bld::lib xios 32 32 bld::target libxios.a 33 #bld::target generate_fortran_interface.exe33 bld::target generate_fortran_interface.exe 34 34 bld::target xios_server.exe 35 35 bld::target test_remap.exe … … 37 37 bld::target test_new_features.exe test_unstruct_complete.exe 38 38 bld::target test_client.exe test_complete.exe test_xios2_cmip6.exe 39 bld::target test_connectivity_expand.exe 39 40 bld::exe_dep 40 41 -
XIOS/trunk/src/config/expand_domain_attribute.conf
r941 r1078 2 2 3 3 DECLARE_ENUM2(type,node,edge) 4 5 // Flag to determine if domain expension should be periodic (and in which direction) 6 DECLARE_ATTRIBUTE(bool, i_periodic) 7 DECLARE_ATTRIBUTE(bool, j_periodic) -
XIOS/trunk/src/interface/c_attr/icexpand_domain_attr.cpp
r981 r1078 17 17 { 18 18 typedef xios::CExpandDomain* expand_domain_Ptr; 19 20 void cxios_set_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl, bool i_periodic) 21 { 22 CTimer::get("XIOS").resume(); 23 expand_domain_hdl->i_periodic.setValue(i_periodic); 24 CTimer::get("XIOS").suspend(); 25 } 26 27 void cxios_get_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl, bool* i_periodic) 28 { 29 CTimer::get("XIOS").resume(); 30 *i_periodic = expand_domain_hdl->i_periodic.getInheritedValue(); 31 CTimer::get("XIOS").suspend(); 32 } 33 34 bool cxios_is_defined_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl) 35 { 36 CTimer::get("XIOS").resume(); 37 bool isDefined = expand_domain_hdl->i_periodic.hasInheritedValue(); 38 CTimer::get("XIOS").suspend(); 39 return isDefined; 40 } 41 42 43 void cxios_set_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl, bool j_periodic) 44 { 45 CTimer::get("XIOS").resume(); 46 expand_domain_hdl->j_periodic.setValue(j_periodic); 47 CTimer::get("XIOS").suspend(); 48 } 49 50 void cxios_get_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl, bool* j_periodic) 51 { 52 CTimer::get("XIOS").resume(); 53 *j_periodic = expand_domain_hdl->j_periodic.getInheritedValue(); 54 CTimer::get("XIOS").suspend(); 55 } 56 57 bool cxios_is_defined_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl) 58 { 59 CTimer::get("XIOS").resume(); 60 bool isDefined = expand_domain_hdl->j_periodic.hasInheritedValue(); 61 CTimer::get("XIOS").suspend(); 62 return isDefined; 63 } 64 19 65 20 66 void cxios_set_expand_domain_order(expand_domain_Ptr expand_domain_hdl, int order) -
XIOS/trunk/src/interface/fortran_attr/expand_domain_interface_attr.F90
r981 r1078 9 9 INTERFACE 10 10 ! Do not call directly / interface FORTRAN 2003 <-> C99 11 12 SUBROUTINE cxios_set_expand_domain_i_periodic(expand_domain_hdl, i_periodic) BIND(C) 13 USE ISO_C_BINDING 14 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 15 LOGICAL (KIND=C_BOOL) , VALUE :: i_periodic 16 END SUBROUTINE cxios_set_expand_domain_i_periodic 17 18 SUBROUTINE cxios_get_expand_domain_i_periodic(expand_domain_hdl, i_periodic) BIND(C) 19 USE ISO_C_BINDING 20 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 21 LOGICAL (KIND=C_BOOL) :: i_periodic 22 END SUBROUTINE cxios_get_expand_domain_i_periodic 23 24 FUNCTION cxios_is_defined_expand_domain_i_periodic(expand_domain_hdl) BIND(C) 25 USE ISO_C_BINDING 26 LOGICAL(kind=C_BOOL) :: cxios_is_defined_expand_domain_i_periodic 27 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 28 END FUNCTION cxios_is_defined_expand_domain_i_periodic 29 30 31 SUBROUTINE cxios_set_expand_domain_j_periodic(expand_domain_hdl, j_periodic) BIND(C) 32 USE ISO_C_BINDING 33 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 34 LOGICAL (KIND=C_BOOL) , VALUE :: j_periodic 35 END SUBROUTINE cxios_set_expand_domain_j_periodic 36 37 SUBROUTINE cxios_get_expand_domain_j_periodic(expand_domain_hdl, j_periodic) BIND(C) 38 USE ISO_C_BINDING 39 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 40 LOGICAL (KIND=C_BOOL) :: j_periodic 41 END SUBROUTINE cxios_get_expand_domain_j_periodic 42 43 FUNCTION cxios_is_defined_expand_domain_j_periodic(expand_domain_hdl) BIND(C) 44 USE ISO_C_BINDING 45 LOGICAL(kind=C_BOOL) :: cxios_is_defined_expand_domain_j_periodic 46 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 47 END FUNCTION cxios_is_defined_expand_domain_j_periodic 48 11 49 12 50 SUBROUTINE cxios_set_expand_domain_order(expand_domain_hdl, order) BIND(C) -
XIOS/trunk/src/interface/fortran_attr/iexpand_domain_attr.F90
r981 r1078 12 12 13 13 SUBROUTINE xios(set_expand_domain_attr) & 14 ( expand_domain_id, order, type )14 ( expand_domain_id, i_periodic, j_periodic, order, type ) 15 15 16 16 IMPLICIT NONE 17 17 TYPE(txios(expand_domain)) :: expand_domain_hdl 18 18 CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 19 LOGICAL , OPTIONAL, INTENT(IN) :: i_periodic 20 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 21 LOGICAL , OPTIONAL, INTENT(IN) :: j_periodic 22 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 19 23 INTEGER , OPTIONAL, INTENT(IN) :: order 20 24 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type … … 23 27 (expand_domain_id,expand_domain_hdl) 24 28 CALL xios(set_expand_domain_attr_hdl_) & 25 ( expand_domain_hdl, order, type )29 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 26 30 27 31 END SUBROUTINE xios(set_expand_domain_attr) 28 32 29 33 SUBROUTINE xios(set_expand_domain_attr_hdl) & 30 ( expand_domain_hdl, order, type ) 31 32 IMPLICIT NONE 33 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 34 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 35 36 IMPLICIT NONE 37 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 38 LOGICAL , OPTIONAL, INTENT(IN) :: i_periodic 39 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 40 LOGICAL , OPTIONAL, INTENT(IN) :: j_periodic 41 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 34 42 INTEGER , OPTIONAL, INTENT(IN) :: order 35 43 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 36 44 37 45 CALL xios(set_expand_domain_attr_hdl_) & 38 ( expand_domain_hdl, order, type )46 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 39 47 40 48 END SUBROUTINE xios(set_expand_domain_attr_hdl) 41 49 42 50 SUBROUTINE xios(set_expand_domain_attr_hdl_) & 43 ( expand_domain_hdl, order_, type_ ) 44 45 IMPLICIT NONE 46 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 51 ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 52 53 IMPLICIT NONE 54 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 55 LOGICAL , OPTIONAL, INTENT(IN) :: i_periodic_ 56 LOGICAL (KIND=C_BOOL) :: i_periodic__tmp 57 LOGICAL , OPTIONAL, INTENT(IN) :: j_periodic_ 58 LOGICAL (KIND=C_BOOL) :: j_periodic__tmp 47 59 INTEGER , OPTIONAL, INTENT(IN) :: order_ 48 60 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 61 62 IF (PRESENT(i_periodic_)) THEN 63 i_periodic__tmp = i_periodic_ 64 CALL cxios_set_expand_domain_i_periodic & 65 (expand_domain_hdl%daddr, i_periodic__tmp) 66 ENDIF 67 68 IF (PRESENT(j_periodic_)) THEN 69 j_periodic__tmp = j_periodic_ 70 CALL cxios_set_expand_domain_j_periodic & 71 (expand_domain_hdl%daddr, j_periodic__tmp) 72 ENDIF 49 73 50 74 IF (PRESENT(order_)) THEN … … 61 85 62 86 SUBROUTINE xios(get_expand_domain_attr) & 63 ( expand_domain_id, order, type )87 ( expand_domain_id, i_periodic, j_periodic, order, type ) 64 88 65 89 IMPLICIT NONE 66 90 TYPE(txios(expand_domain)) :: expand_domain_hdl 67 91 CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 92 LOGICAL , OPTIONAL, INTENT(OUT) :: i_periodic 93 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 94 LOGICAL , OPTIONAL, INTENT(OUT) :: j_periodic 95 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 68 96 INTEGER , OPTIONAL, INTENT(OUT) :: order 69 97 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type … … 72 100 (expand_domain_id,expand_domain_hdl) 73 101 CALL xios(get_expand_domain_attr_hdl_) & 74 ( expand_domain_hdl, order, type )102 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 75 103 76 104 END SUBROUTINE xios(get_expand_domain_attr) 77 105 78 106 SUBROUTINE xios(get_expand_domain_attr_hdl) & 79 ( expand_domain_hdl, order, type ) 80 81 IMPLICIT NONE 82 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 107 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 108 109 IMPLICIT NONE 110 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 111 LOGICAL , OPTIONAL, INTENT(OUT) :: i_periodic 112 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 113 LOGICAL , OPTIONAL, INTENT(OUT) :: j_periodic 114 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 83 115 INTEGER , OPTIONAL, INTENT(OUT) :: order 84 116 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 85 117 86 118 CALL xios(get_expand_domain_attr_hdl_) & 87 ( expand_domain_hdl, order, type )119 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 88 120 89 121 END SUBROUTINE xios(get_expand_domain_attr_hdl) 90 122 91 123 SUBROUTINE xios(get_expand_domain_attr_hdl_) & 92 ( expand_domain_hdl, order_, type_ ) 93 94 IMPLICIT NONE 95 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 124 ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 125 126 IMPLICIT NONE 127 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 128 LOGICAL , OPTIONAL, INTENT(OUT) :: i_periodic_ 129 LOGICAL (KIND=C_BOOL) :: i_periodic__tmp 130 LOGICAL , OPTIONAL, INTENT(OUT) :: j_periodic_ 131 LOGICAL (KIND=C_BOOL) :: j_periodic__tmp 96 132 INTEGER , OPTIONAL, INTENT(OUT) :: order_ 97 133 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 134 135 IF (PRESENT(i_periodic_)) THEN 136 CALL cxios_get_expand_domain_i_periodic & 137 (expand_domain_hdl%daddr, i_periodic__tmp) 138 i_periodic_ = i_periodic__tmp 139 ENDIF 140 141 IF (PRESENT(j_periodic_)) THEN 142 CALL cxios_get_expand_domain_j_periodic & 143 (expand_domain_hdl%daddr, j_periodic__tmp) 144 j_periodic_ = j_periodic__tmp 145 ENDIF 98 146 99 147 IF (PRESENT(order_)) THEN … … 110 158 111 159 SUBROUTINE xios(is_defined_expand_domain_attr) & 112 ( expand_domain_id, order, type )160 ( expand_domain_id, i_periodic, j_periodic, order, type ) 113 161 114 162 IMPLICIT NONE 115 163 TYPE(txios(expand_domain)) :: expand_domain_hdl 116 164 CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 165 LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic 166 LOGICAL(KIND=C_BOOL) :: i_periodic_tmp 167 LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic 168 LOGICAL(KIND=C_BOOL) :: j_periodic_tmp 117 169 LOGICAL, OPTIONAL, INTENT(OUT) :: order 118 170 LOGICAL(KIND=C_BOOL) :: order_tmp … … 123 175 (expand_domain_id,expand_domain_hdl) 124 176 CALL xios(is_defined_expand_domain_attr_hdl_) & 125 ( expand_domain_hdl, order, type )177 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 126 178 127 179 END SUBROUTINE xios(is_defined_expand_domain_attr) 128 180 129 181 SUBROUTINE xios(is_defined_expand_domain_attr_hdl) & 130 ( expand_domain_hdl, order, type ) 131 132 IMPLICIT NONE 133 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 182 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 183 184 IMPLICIT NONE 185 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 186 LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic 187 LOGICAL(KIND=C_BOOL) :: i_periodic_tmp 188 LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic 189 LOGICAL(KIND=C_BOOL) :: j_periodic_tmp 134 190 LOGICAL, OPTIONAL, INTENT(OUT) :: order 135 191 LOGICAL(KIND=C_BOOL) :: order_tmp … … 138 194 139 195 CALL xios(is_defined_expand_domain_attr_hdl_) & 140 ( expand_domain_hdl, order, type )196 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 141 197 142 198 END SUBROUTINE xios(is_defined_expand_domain_attr_hdl) 143 199 144 200 SUBROUTINE xios(is_defined_expand_domain_attr_hdl_) & 145 ( expand_domain_hdl, order_, type_ ) 146 147 IMPLICIT NONE 148 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 201 ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 202 203 IMPLICIT NONE 204 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 205 LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic_ 206 LOGICAL(KIND=C_BOOL) :: i_periodic__tmp 207 LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic_ 208 LOGICAL(KIND=C_BOOL) :: j_periodic__tmp 149 209 LOGICAL, OPTIONAL, INTENT(OUT) :: order_ 150 210 LOGICAL(KIND=C_BOOL) :: order__tmp … … 152 212 LOGICAL(KIND=C_BOOL) :: type__tmp 153 213 214 IF (PRESENT(i_periodic_)) THEN 215 i_periodic__tmp = cxios_is_defined_expand_domain_i_periodic & 216 (expand_domain_hdl%daddr) 217 i_periodic_ = i_periodic__tmp 218 ENDIF 219 220 IF (PRESENT(j_periodic_)) THEN 221 j_periodic__tmp = cxios_is_defined_expand_domain_j_periodic & 222 (expand_domain_hdl%daddr) 223 j_periodic_ = j_periodic__tmp 224 ENDIF 225 154 226 IF (PRESENT(order_)) THEN 155 227 order__tmp = cxios_is_defined_expand_domain_order & -
XIOS/trunk/src/node/domain.cpp
r1064 r1078 31 31 : CObjectTemplate<CDomain>(), CDomainAttributes() 32 32 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 33 , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(),isCompressible_(false), isUnstructed_(false)33 , hasBounds(false), hasArea(false), isDistributed_(false), isCompressible_(false), isUnstructed_(false) 34 34 , isClientAfterTransformationChecked(false), hasLonLat(false) 35 35 , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() … … 41 41 : CObjectTemplate<CDomain>(id), CDomainAttributes() 42 42 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 43 , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(),isCompressible_(false), isUnstructed_(false)43 , hasBounds(false), hasArea(false), isDistributed_(false), isCompressible_(false), isUnstructed_(false) 44 44 , isClientAfterTransformationChecked(false), hasLonLat(false) 45 45 , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() … … 844 844 for (int i = 0; i < ni; ++i) j_index(i+j*ni) = j+jbegin; 845 845 } 846 computeNGlobDomain();846 847 847 checkZoom(); 848 848 … … 1550 1550 int nbServer = client->serverSize; 1551 1551 1552 CServerDistributionDescription serverDescription( nGlobDomain_, nbServer);1552 CServerDistributionDescription serverDescription(getNbGlob(), nbServer); 1553 1553 if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 1554 1554 else serverDescription.computeServerDistribution(false, 1); … … 1587 1587 } 1588 1588 1589 void CDomain::computeNGlobDomain() 1590 { 1591 nGlobDomain_.resize(2); 1592 nGlobDomain_[0] = ni_glo.getValue(); 1593 nGlobDomain_[1] = nj_glo.getValue(); 1589 std::vector<int> CDomain::getNbGlob() 1590 { 1591 std::vector<int> nbGlob(2); 1592 nbGlob[0] = ni_glo.getValue(); 1593 nbGlob[1] = nj_glo.getValue(); 1594 1595 return nbGlob; 1594 1596 } 1595 1597 … … 1685 1687 size_t globalSizeIndex = 1, indexBegin, indexEnd; 1686 1688 int range, clientSize = client->clientSize; 1687 for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i];1689 for (int i = 0; i < getNbGlob().size(); ++i) globalSizeIndex *= getNbGlob()[i]; 1688 1690 indexBegin = 0; 1689 1691 if (globalSizeIndex <= clientSize) … … 1704 1706 } 1705 1707 1706 CServerDistributionDescription serverDescription( nGlobDomain_, nbServer);1708 CServerDistributionDescription serverDescription(getNbGlob(), nbServer); 1707 1709 if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 1708 1710 else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); -
XIOS/trunk/src/node/domain.hpp
r1064 r1078 123 123 vector< vector<int> > j_indSrv ; // for each server, j global index to send 124 124 125 std::vector<int> getNbGlob(); 125 126 public: 126 127 /// Mutateur /// … … 210 211 bool isCompressible_; 211 212 bool isRedistributed_; 212 TransMapTypes transformationMap_; 213 std::vector<int> nGlobDomain_; 213 TransMapTypes transformationMap_; 214 214 bool isUnstructed_; 215 215 -
XIOS/trunk/src/node/expand_domain.cpp
r941 r1078 38 38 void CExpandDomain::checkValid(CDomain* domainDst) 39 39 { 40 if (CDomain::type_attr::unstructured != domainDst->type)41 {42 ERROR("CExpandDomain::checkValid(CDomain* domainDst)",43 << "Domain extension is only supported for unstructured" << std::endl44 << "Check type of domain destination, id = " << domainDst->getId());45 }40 // if (CDomain::type_attr::unstructured != domainDst->type) 41 // { 42 // ERROR("CExpandDomain::checkValid(CDomain* domainDst)", 43 // << "Domain extension is only supported for unstructured" << std::endl 44 // << "Check type of domain destination, id = " << domainDst->getId()); 45 // } 46 46 47 47 if (this->type.isEmpty()) this->type.setValue(CExpandDomain::type_attr::edge); -
XIOS/trunk/src/node/grid.cpp
r1008 r1078 31 31 , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 32 32 , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 33 , globalDim_(),connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)33 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 34 34 , transformations_(0), isTransformed_(false) 35 , axisPositionInGrid_(), positionDimensionDistributed_(1),hasDomainAxisBaseRef_(false)35 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 36 36 , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 37 37 { … … 49 49 , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 50 50 , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 51 , globalDim_(),connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)51 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 52 52 , transformations_(0), isTransformed_(false) 53 , axisPositionInGrid_(), positionDimensionDistributed_(1),hasDomainAxisBaseRef_(false)53 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 54 54 , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 55 55 { … … 74 74 75 75 76 StdSize CGrid::getDimension(void) const77 { 78 return g lobalDim_.size();76 StdSize CGrid::getDimension(void) 77 { 78 return getGlobalDimension().size(); 79 79 } 80 80 … … 185 185 for (int i = 0; i < axisListP.size(); ++i) 186 186 { 187 axisListP[i]->checkAttributesOnClientAfterTransformation(g lobalDim_,axisPositionInGrid_[i]);187 axisListP[i]->checkAttributesOnClientAfterTransformation(getGlobalDimension(),axisPositionInGrid_[i]); 188 188 } 189 189 } … … 232 232 this->solveScalarRef(areAttributesChecked); 233 233 this->solveAxisRef(areAttributesChecked); 234 this->solveDomainRef(areAttributesChecked); 235 computeGridGlobalDimension(getDomains(), getAxis(), getScalars(), axis_domain_order); 234 this->solveDomainRef(areAttributesChecked); 236 235 this->isDomainAxisChecked = areAttributesChecked; 237 236 } … … 463 462 { 464 463 if (sendAtt) 465 axisListP[i]->sendCheckedAttributes(g lobalDim_,axisPositionInGrid_[i]);464 axisListP[i]->sendCheckedAttributes(getGlobalDimension(),axisPositionInGrid_[i]); 466 465 else 467 466 axisListP[i]->checkAttributesOnClient(); … … 533 532 // Compute mapping between client and server 534 533 std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement; 535 CServerDistributionDescription serverDistributionDescription(g lobalDim_, client->serverSize);534 CServerDistributionDescription serverDistributionDescription(getGlobalDimension(), client->serverSize); 536 535 serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement, 537 536 client->clientRank, 538 537 client->clientSize, 539 538 axis_domain_order, 540 positionDimensionDistributed_);539 getDistributedDimension()); 541 540 computeIndexByElement(indexServerOnElement, globalIndexOnServer_); 542 541 … … 1323 1322 } 1324 1323 1325 void CGrid::computeGridGlobalDimension(const std::vector<CDomain*>& domains, 1326 const std::vector<CAxis*>& axis, 1327 const std::vector<CScalar*>& scalars, 1328 const CArray<int,1>& axisDomainOrder) 1329 { 1330 globalDim_.resize(domains.size()*2+axis.size()+scalars.size()); 1324 /* 1325 Compute on the fly the global dimension of a grid with its elements 1326 \param[in/out] globalDim global dimension of grid 1327 \param[in] domains list of its domains 1328 \param[in] axiss list of its axis 1329 \param[in] scalars list of its scalars 1330 \param[in] axisDomainOrder the order of element in a grid (e.g: scalar then axis) 1331 \return The dimension of which we do distribution (often for server) 1332 */ 1333 int CGrid::computeGridGlobalDimension(std::vector<int>& globalDim, 1334 const std::vector<CDomain*> domains, 1335 const std::vector<CAxis*> axis, 1336 const std::vector<CScalar*> scalars, 1337 const CArray<int,1>& axisDomainOrder) 1338 { 1339 globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 1340 int positionDimensionDistributed = 1; 1331 1341 int idx = 0, idxDomain = 0, idxAxis = 0, idxScalar = 0; 1332 1342 for (int i = 0; i < axisDomainOrder.numElements(); ++i) … … 1336 1346 if (!(domains[idxDomain]->type.isEmpty()) && (domains[idxDomain]->type==CDomain::type_attr::unstructured)) 1337 1347 { 1338 positionDimensionDistributed _= idx;1348 positionDimensionDistributed = idx; 1339 1349 } 1340 1350 else 1341 1351 { 1342 positionDimensionDistributed _= idx +1;1343 } 1344 1345 globalDim _[idx] = domains[idxDomain]->ni_glo.getValue();1346 globalDim _[idx+1] = domains[idxDomain]->nj_glo.getValue();1352 positionDimensionDistributed = idx +1; 1353 } 1354 1355 globalDim[idx] = domains[idxDomain]->ni_glo.getValue(); 1356 globalDim[idx+1] = domains[idxDomain]->nj_glo.getValue(); 1347 1357 1348 1358 ++idxDomain; … … 1351 1361 else if (1 == axisDomainOrder(i)) 1352 1362 { 1353 globalDim _[idx] = axis[idxAxis]->n_glo.getValue();1363 globalDim[idx] = axis[idxAxis]->n_glo.getValue(); 1354 1364 ++idxAxis; 1355 1365 ++idx; … … 1357 1367 else 1358 1368 { 1359 globalDim _[idx] = 1;1369 globalDim[idx] = 1; 1360 1370 ++idxScalar; 1361 1371 ++idx; 1362 1372 } 1363 1373 } 1364 } 1365 1374 1375 return positionDimensionDistributed; 1376 } 1377 1378 // Retrieve the global dimension of grid 1366 1379 std::vector<int> CGrid::getGlobalDimension() 1367 1380 { 1368 return globalDim_; 1381 std::vector<int> globalDim; 1382 computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1383 1384 return globalDim; 1385 } 1386 1387 // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 1388 int CGrid::getDistributedDimension() 1389 { 1390 std::vector<int> globalDim; 1391 return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1369 1392 } 1370 1393 -
XIOS/trunk/src/node/grid.hpp
r988 r1078 87 87 88 88 /// Accesseurs /// 89 StdSize getDimension(void) const;89 StdSize getDimension(void); 90 90 91 91 StdSize getDataSize(void) const; … … 229 229 void modifyMask(const CArray<int,1>& indexToModify); 230 230 231 void computeGridGlobalDimension(const std::vector<CDomain*>& domains,232 const std::vector<CAxis*>& axis,233 const std::vector<CScalar*>& scalars,234 const CArray<int,1>& axisDomainOrder);235 236 231 private: 237 232 template<int N> … … 261 256 CClientServerMapping::GlobalIndexMap& globalIndexOnServer); 262 257 258 int computeGridGlobalDimension(std::vector<int>& globalDim, 259 const std::vector<CDomain*> domains, 260 const std::vector<CAxis*> axis, 261 const std::vector<CScalar*> scalars, 262 const CArray<int,1>& axisDomainOrder); 263 264 int getDistributedDimension(); 263 265 private: 264 266 CDomainGroup* vDomainGroup_; … … 276 278 std::vector<int> connectedServerRank_; 277 279 bool isDataDistributed_; 278 int positionDimensionDistributed_;280 279 281 //! True if and only if the data defined on the grid can be outputted in a compressed way 280 282 bool isCompressible_; … … 285 287 std::vector<int> axisPositionInGrid_; 286 288 CGridTransformation* transformations_; 287 bool hasDomainAxisBaseRef_; 288 std::vector<int> globalDim_; 289 bool hasDomainAxisBaseRef_; 289 290 std::map<CGrid*, std::pair<bool,StdString> > gridSrc_; 290 291 bool hasTransform_; -
XIOS/trunk/src/transformation/domain_algorithm_expand.cpp
r978 r1078 45 45 CDomain* domainSource, 46 46 CExpandDomain* expandDomain) 47 : CDomainAlgorithmTransformation(domainDestination, domainSource) 47 : CDomainAlgorithmTransformation(domainDestination, domainSource), 48 isXPeriodic_(false), isYPeriodic_(false) 48 49 { 49 50 if (domainDestination == domainSource) … … 55 56 } 56 57 57 // if (!domainDestination->hasRefTo(domainSource))58 // {59 // ERROR("CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,CDomain* domainSource, CExpandDomain* expandDomain)",60 // << "Domain domain destination must refer to domain source (directly or indirectly) by domain_ref " << std::endl61 // << "Domain source " <<domainSource->getId() << std::endl62 // << "Domain destination " <<domainDestination->getId() << std::endl);63 // }64 65 58 this->type_ = (ELEMENT_MODIFICATION_WITH_DATA); 66 59 expandDomain->checkValid(domainDestination); 60 if (!expandDomain->i_periodic.isEmpty()) isXPeriodic_ = expandDomain->i_periodic; 61 if (!expandDomain->j_periodic.isEmpty()) isYPeriodic_ = expandDomain->j_periodic; 67 62 68 63 switch (expandDomain->type) … … 92 87 CContextClient* client=context->client; 93 88 89 int type = 1; // For edge 90 CMesh mesh; 94 91 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 95 92 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 96 93 CArray<int,2> neighborsSrc; 97 98 int type = 1; // For edge 99 CMesh mesh; 100 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 101 updateDomainAttributes(domainDestination, domainSource, neighborsSrc); 94 switch (domainSource->type) { 95 case CDomain::type_attr::unstructured: 96 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 97 updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 98 break; 99 default: 100 updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc); 101 break; 102 } 102 103 } 103 104 … … 113 114 CContextClient* client=context->client; 114 115 116 int type = 1; // For edge 117 CMesh mesh; 115 118 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 116 119 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 117 120 CArray<int,2> neighborsSrc; 118 119 int type = 0; // For node 120 CMesh mesh; 121 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 122 updateDomainAttributes(domainDestination, domainSource, neighborsSrc); 121 switch (domainSource->type) { 122 case CDomain::type_attr::unstructured: 123 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 124 updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 125 break; 126 default: 127 updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc); 128 break; 129 } 130 } 131 132 /*! 133 * Extend rectilinear or curvilinear domain destination and update its attributes 134 * Suppose that domain destination and domain source have the same values for all attributes (by inheritance) 135 * \param [in/out] domainDestination domain destination 136 * \param [in] domainSource domain source 137 * \param [in] neighborsDomainSrc neighbor of domain source. For now, we don't need it for rectilinear 138 */ 139 void CDomainAlgorithmExpand::updateRectilinearDomainAttributes(CDomain* domainDestination, 140 CDomain* domainSource, 141 CArray<int,2>& neighborsDomainSrc) 142 { 143 int index, globalIndex, idx; 144 int iindexDst, jindexDst, globIndexDst; 145 int iindexSrc, jindexSrc, globIndexSrc; 146 CContext* context = CContext::getCurrent(); 147 CContextClient* client=context->client; 148 149 // First of all, "copy" all attributes of domain source to domain destination 150 StdString domainDstRef = (!domainDestination->domain_ref.isEmpty()) ? domainDestination->domain_ref.getValue() 151 : ""; 152 if (domainDstRef != domainSource->getId()) 153 { 154 domainDestination->domain_ref.setValue(domainSource->getId()); 155 domainDestination->solveRefInheritance(true); 156 } 157 158 if (domainDstRef.empty()) domainDestination->domain_ref.reset(); 159 else domainDestination->domain_ref.setValue(domainDstRef); 160 161 // Here are attributes of source need tranfering 162 int niGloSrc = domainSource->ni_glo; 163 int njGloSrc = domainSource->nj_glo; 164 int niSrc = domainSource->ni, ibegin = domainSource->ibegin; 165 int njSrc = domainSource->nj, jbegin = domainSource->jbegin; 166 CArray<bool,1>& mask_1d_src = domainSource->mask_1d; 167 CArray<int,1>& i_index_src = domainSource->i_index; 168 CArray<int,1>& j_index_src = domainSource->j_index; 169 CArray<int,1>& data_i_index_src = domainSource->data_i_index; 170 CArray<int,1>& data_j_index_src = domainSource->data_j_index; 171 int data_i_begin_src = domainSource->data_ibegin; 172 int data_j_begin_src = domainSource->data_jbegin; 173 CArray<double,1>& lon_src = domainSource->lonvalue_client; 174 CArray<double,1>& lat_src = domainSource->latvalue_client; 175 176 // We need to generate boundary for longitude and latitude 177 if (domainSource->bounds_lon_1d.isEmpty() || domainSource->bounds_lat_1d.isEmpty()) 178 { 179 CArray<double,1> lon = lon_src(Range(0,niSrc-1)); 180 CArray<double,1> lat = lat_src(Range(0,lat_src.numElements()-1,niSrc)); 181 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 182 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 183 domainSource->fillInRectilinearBoundLonLat(lon_src, lat_src, bounds_lon_src, bounds_lat_src); 184 } 185 186 187 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 188 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 189 190 int nVertex = bounds_lon_src.shape()[0]; 191 int oldNbLocal = i_index_src.numElements(); 192 int dataIindexBoundSrc = max(i_index_src) - min(i_index_src); 193 int dataJindexBoundSrc = max(j_index_src) - min(j_index_src); 194 195 // Uncompress data_i_index, data_j_index 196 CArray<int,1> data_i_index_src_full(oldNbLocal); 197 CArray<int,1> data_j_index_src_full(oldNbLocal); 198 int nbUnMaskedPointOnLocalDomain = 0; 199 data_i_index_src_full = -1; // Suppose all values are masked 200 data_j_index_src_full = -1; // Suppose all values are masked 201 for (idx = 0; idx < data_i_index_src.numElements(); ++idx) 202 { 203 int dataIidx = data_i_index_src(idx) + data_i_begin_src; 204 int dataJidx = data_j_index_src(idx) + data_j_begin_src; 205 if ((0 <= dataIidx) && (dataIidx <= dataIindexBoundSrc) && 206 (0 <= dataJidx) && (dataJidx <= dataJindexBoundSrc)) 207 { 208 data_i_index_src_full(nbUnMaskedPointOnLocalDomain) = dataIidx; 209 data_j_index_src_full(nbUnMaskedPointOnLocalDomain) = dataJidx; 210 ++nbUnMaskedPointOnLocalDomain; 211 } 212 } 213 214 // Expand domain destination, not only local but also global 215 int niGloDst = niGloSrc + 2; 216 int njGloDst = njGloSrc + 2; 217 int niDst = niSrc + 2; 218 int njDst = njSrc + 2; 219 domainDestination->ni_glo.setValue(niGloDst); 220 domainDestination->nj_glo.setValue(njGloDst); 221 domainDestination->ni.setValue(niDst); 222 domainDestination->nj.setValue(njDst); 223 domainDestination->global_zoom_ni.setValue(domainSource->global_zoom_ni+2); 224 domainDestination->global_zoom_nj.setValue(domainSource->global_zoom_nj+2); 225 226 CArray<bool,1>& mask_1d_dst = domainDestination->mask_1d; 227 CArray<int,1>& i_index_dst = domainDestination->i_index; 228 CArray<int,1>& j_index_dst = domainDestination->j_index; 229 CArray<int,1>& data_i_index_dst = domainDestination->data_i_index; 230 CArray<int,1>& data_j_index_dst = domainDestination->data_j_index; 231 232 // Make sure that we use only lonvalue_client, latvalue_client 233 if (!domainDestination->lonvalue_1d.isEmpty()) domainDestination->lonvalue_1d.reset(); 234 if (!domainDestination->latvalue_1d.isEmpty()) domainDestination->latvalue_1d.reset(); 235 if (!domainDestination->lonvalue_2d.isEmpty()) domainDestination->lonvalue_2d.reset(); 236 if (!domainDestination->latvalue_2d.isEmpty()) domainDestination->latvalue_2d.reset(); 237 238 // Recalculate i_index, j_index of extended domain 239 // Should be enough for common case, but if we have arbitrary distribution? 240 int newNbLocalDst = niDst * njDst; 241 242 mask_1d_dst.resize(newNbLocalDst); 243 i_index_dst.resize(newNbLocalDst); 244 j_index_dst.resize(newNbLocalDst); 245 CArray<int,1> data_i_index_dst_full(newNbLocalDst, -1); 246 CArray<int,1> data_j_index_dst_full(newNbLocalDst, -1); 247 248 domainDestination->lonvalue_client.resizeAndPreserve(newNbLocalDst); 249 domainDestination->latvalue_client.resizeAndPreserve(newNbLocalDst); 250 domainDestination->bounds_lon_1d.resizeAndPreserve(nVertex, newNbLocalDst); 251 domainDestination->bounds_lat_1d.resizeAndPreserve(nVertex, newNbLocalDst); 252 CArray<double,1>& lon_dst = domainDestination->lonvalue_client; 253 CArray<double,1>& lat_dst = domainDestination->latvalue_client; 254 CArray<double,2>& bounds_lon_dst = domainDestination->bounds_lon_1d; 255 CArray<double,2>& bounds_lat_dst = domainDestination->bounds_lat_1d; 256 257 // Update i_index, j_index 258 for (int j = 0; j < njDst; ++j) 259 for (int i = 0; i < niDst; ++i) 260 { 261 idx = j * niDst + i; 262 i_index_dst(idx) = i + ibegin; 263 j_index_dst(idx) = j + jbegin; 264 } 265 266 267 268 // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 269 // Global index mapping between destination and source 270 this->transformationMapping_.resize(1); 271 this->transformationWeight_.resize(1); 272 TransformationIndexMap& transMap = this->transformationMapping_[0]; 273 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 274 275 transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 276 transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 277 278 // Index mapping for local domain 279 // Mapping global index of expanded domain into original one 280 // (Representing global index of expanded domain in form of global index of original one) 281 CArray<size_t,1> globalIndexSrcOnDstDomain(newNbLocalDst); 282 for (idx = 0; idx < newNbLocalDst; ++idx) 283 { 284 iindexDst = i_index_dst(idx); 285 jindexDst = j_index_dst(idx); 286 globIndexDst = jindexDst * niGloDst + iindexDst; 287 globIndexSrc = (((jindexDst-1)+njGloSrc) % njGloSrc) * niGloSrc + (((iindexDst-1)+niGloSrc) % niGloSrc) ; 288 globalIndexSrcOnDstDomain(idx) = globIndexSrc; 289 290 transMap[globIndexDst].push_back(globIndexSrc); 291 transWeight[globIndexDst].push_back(1.0); 292 } 293 294 // 2. Exchange local info among domains (lon,lat,bounds,mask,etc,...) 295 CClientClientDHTDouble::Index2VectorInfoTypeMap localData; 296 localData.rehash(std::ceil(oldNbLocal/localData.max_load_factor())); 297 298 // Information exchanged among domains (attention to their order), number in parentheses presents size of data 299 // lon(1) + lat(1) + bounds_lon(nVertex) + bounds_lat(nVertex) + mask(1) + data_i_index(1) 300 int dataPackageSize = 1 + 1 + // lon + lat 301 nVertex + nVertex + //bounds_lon + bounds_lat 302 1 + // mask_1d_dst; 303 1 + 1; // data_i_index + data_j_index 304 // Initialize database 305 for (int idx = 0; idx < oldNbLocal; ++idx) 306 { 307 index = i_index_src(idx) + j_index_src(idx) * niGloSrc; 308 localData[index].resize(dataPackageSize); 309 std::vector<double>& data = localData[index]; 310 311 //Pack data 312 int dataIdx = 0; 313 data[dataIdx] = lon_src(idx);++dataIdx; 314 data[dataIdx] = lat_src(idx);++dataIdx; 315 for (int i = 0; i < nVertex; ++i) 316 { 317 data[dataIdx] = bounds_lon_src(i,idx); ++dataIdx; 318 } 319 for (int i = 0; i < nVertex; ++i) 320 { 321 data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx; 322 } 323 data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx; 324 data[dataIdx] = data_i_index_src_full(idx);++dataIdx; 325 data[dataIdx] = data_j_index_src_full(idx); 326 } 327 328 CClientClientDHTDouble dhtData(localData,client->intraComm); 329 dhtData.computeIndexInfoMapping(globalIndexSrcOnDstDomain); 330 CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap(); 331 CClientClientDHTDouble::Index2VectorInfoTypeMap::iterator ite = neighborData.end(), it; 332 333 // Ok get all data for destination 334 // If domain is not periodic, then we mask all extended part. 335 int nbUnMaskedPointOnExtendedPart = 0, remainder = 0, dataIIndex, dataJIndex; 336 size_t nIdx; 337 double maskValue = 1.0; 338 for (index = 0; index < newNbLocalDst; ++index) 339 { 340 nIdx = globalIndexSrcOnDstDomain(index); 341 it = neighborData.find(nIdx); 342 if (ite != it) 343 { 344 std::vector<double>& data = it->second; 345 // Unpack data 346 int dataIdx = 0; 347 lon_dst(index) = data[dataIdx]; ++dataIdx; 348 lat_dst(index) = data[dataIdx]; ++dataIdx; 349 for (int i = 0; i < nVertex; ++i) 350 { 351 bounds_lon_dst(i,index) = data[dataIdx]; ++dataIdx; 352 } 353 for (int i = 0; i < nVertex; ++i) 354 { 355 bounds_lat_dst(i,index) = data[dataIdx]; ++dataIdx; 356 } 357 358 // Check whether we have x periodic. If we don't, we should mask all point at 0 and niGloDst-1 359 maskValue = data[dataIdx]; 360 if (!isXPeriodic_) 361 { 362 remainder = i_index_dst(index) % (niGloDst-1); 363 if (0 == remainder) 364 { 365 maskValue = -1.0; 366 } 367 } 368 369 if (!isYPeriodic_) 370 { 371 remainder = j_index_dst(index) % (njGloDst-1); 372 if (0 == remainder) 373 { 374 maskValue = -1.0; 375 } 376 } 377 378 mask_1d_dst(index) = (1.0 == maskValue) ? true : false; ++dataIdx; 379 380 dataIIndex = (int) data[dataIdx]; 381 if (!isXPeriodic_) 382 { 383 remainder = i_index_dst(index) % (niGloDst-1); 384 if (0 == remainder) 385 { 386 dataIIndex = -1; 387 } 388 } 389 data_i_index_dst_full(index) = dataIIndex; ++dataIdx; 390 391 dataJIndex = (int) data[dataIdx]; 392 if (!isYPeriodic_) 393 { 394 remainder = j_index_dst(index) % (njGloDst-1); 395 if (0 == remainder) 396 { 397 dataJIndex = -1; 398 } 399 } 400 data_j_index_dst_full(index) = dataJIndex; 401 402 if ((0 <= data_i_index_dst_full(index)) && (0 <= data_j_index_dst_full(index))) 403 { 404 ++nbUnMaskedPointOnExtendedPart; 405 } 406 } 407 } 408 409 410 // Finally, update data_i_index, data_j_index 411 data_i_index_dst.resize(nbUnMaskedPointOnExtendedPart); 412 data_j_index_dst.resize(nbUnMaskedPointOnExtendedPart); 413 int count = 0; 414 for (idx = 0; idx < newNbLocalDst; ++idx) 415 { 416 dataIIndex = data_i_index_dst_full(idx); 417 dataJIndex = data_j_index_dst_full(idx); 418 if ((0 <= dataIIndex) && (0 <= dataJIndex)) 419 { 420 data_i_index_dst(count) = i_index_dst(idx) - i_index_dst(0); 421 data_j_index_dst(count) = j_index_dst(idx) - j_index_dst(0); 422 ++count; 423 } 424 } 425 426 // Update data_ni, data_nj 427 domainDestination->data_ni.setValue(niDst); 428 domainDestination->data_nj.setValue(njDst); 429 domainDestination->data_ibegin.setValue(0); 430 domainDestination->data_jbegin.setValue(0); 431 432 433 // Update longitude and latitude 434 if (niSrc == domainSource->lonvalue_1d.numElements() && njSrc == domainSource->latvalue_1d.numElements()) // Ok, we have rectilinear here 435 { 436 domainDestination->lonvalue_1d.resize(niDst); 437 domainDestination->lonvalue_1d = lon_dst(Range(0,niDst-1)); 438 domainDestination->latvalue_1d.resize(njDst); 439 domainDestination->latvalue_1d = lat_dst(Range(0,lat_dst.numElements()-1,niDst)); 440 } 441 else // It should be curvilinear 442 { 443 domainDestination->lonvalue_1d.resize(lon_dst.numElements()); 444 domainDestination->lonvalue_1d = lon_dst; 445 domainDestination->latvalue_1d.resize(lat_dst.numElements()); 446 domainDestination->latvalue_1d = (lat_dst); 447 } 448 123 449 } 124 450 … … 130 456 * \param [in] neighborsDomainSrc domain extended part 131 457 */ 132 void CDomainAlgorithmExpand::updateDomainAttributes(CDomain* domainDestination, 133 CDomain* domainSource, 134 CArray<int,2>& neighborsDomainSrc) 135 { 458 void CDomainAlgorithmExpand::updateUnstructuredDomainAttributes(CDomain* domainDestination, 459 CDomain* domainSource, 460 CArray<int,2>& neighborsDomainSrc) 461 { 462 136 463 CContext* context = CContext::getCurrent(); 137 464 CContextClient* client=context->client; … … 255 582 data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx; 256 583 } 257 data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1 ; ++dataIdx;584 data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx; 258 585 data[dataIdx] = data_i_index_src_full(idx); 259 586 } … … 308 635 { 309 636 dataIdx = data_i_index_dst_full(idx); 310 if ((0 <= dataIdx) && (dataIdx < newNbLocalDst))637 if ((0 <= dataIdx)) 311 638 { 312 639 ++count; … … 322 649 { 323 650 dataIdx = data_i_index_dst_full(idx); 324 if ((0 <= dataIdx) && (dataIdx < newNbLocalDst))651 if ((0 <= dataIdx)) 325 652 { 326 653 data_i_index_dst(count) = dataIdx; … … 331 658 // Update ni 332 659 domainDestination->ni.setValue(newNbLocalDst); 333 334 660 } 335 661 -
XIOS/trunk/src/transformation/domain_algorithm_expand.hpp
r941 r1078 30 30 31 31 protected: 32 bool isXPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear) 33 bool isYPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear) 34 35 protected: 32 36 void expandDomainEdgeConnectivity(CDomain* domainDestination, CDomain* domainSource); 33 37 void expandDomainNodeConnectivity(CDomain* domainDestination, CDomain* domainSource); 34 void updateDomainAttributes(CDomain* domainDestination, 35 CDomain* domainSource, 36 CArray<int,2>& neighborsDomainSrc); 38 void updateRectilinearDomainAttributes(CDomain* domainDestination, 39 CDomain* domainSource, 40 CArray<int,2>& neighborsDomainSrc); 41 42 void updateUnstructuredDomainAttributes(CDomain* domainDestination, 43 CDomain* domainSource, 44 CArray<int,2>& neighborsDomainSrc); 37 45 38 46 protected: -
XIOS/trunk/src/transformation/grid_transformation.cpp
r978 r1078 236 236 } 237 237 238 tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder); 239 tmpGridDestination_->computeGridGlobalDimension(domainDst, axisDst, scalarDst, elementOrder); 238 tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder); 240 239 tempGridDests_.push_back(tmpGridDestination_); 241 240 } … … 322 321 } 323 322 324 gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 325 gridSource_->computeGridGlobalDimension(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 323 gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 326 324 327 325 tempGridSrcs_.push_back(gridSource_);
Note: See TracChangeset
for help on using the changeset viewer.