Changeset 666 for XIOS/trunk/src/node
- Timestamp:
- 08/24/15 14:53:27 (9 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r657 r666 76 76 void CAxis::checkAttributes(void) 77 77 { 78 if (this-> size.isEmpty())78 if (this->n_glo.isEmpty()) 79 79 ERROR("CAxis::checkAttributes(void)", 80 << "Attribute < size> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be specified");81 StdSize size = this-> size.getValue();82 83 isDistributed_ = !this-> ibegin.isEmpty() || !this->ni.isEmpty();84 85 if (!this-> ibegin.isEmpty())86 { 87 StdSize ibegin = this-> ibegin.getValue();80 << "Attribute <n_glo> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be specified"); 81 StdSize size = this->n_glo.getValue(); 82 83 isDistributed_ = !this->begin.isEmpty() || !this->n.isEmpty(); 84 85 if (!this->begin.isEmpty()) 86 { 87 StdSize ibegin = this->begin.getValue(); 88 88 if ((ibegin < 0) || (ibegin > size-1)) 89 89 ERROR("CAxis::checkAttributes(void)", 90 90 << "Attribute <ibegin> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be non-negative and smaller than size-1"); 91 91 } 92 else this-> ibegin.setValue(0);93 94 if (!this->n i.isEmpty())95 { 96 StdSize ni = this->n i.getValue();92 else this->begin.setValue(0); 93 94 if (!this->n.isEmpty()) 95 { 96 StdSize ni = this->n.getValue(); 97 97 if ((ni < 0) || (ni > size)) 98 98 ERROR("CAxis::checkAttributes(void)", 99 99 << "Attribute <ni> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be non-negative and smaller than size"); 100 100 } 101 else this->n i.setValue(size);101 else this->n.setValue(size); 102 102 103 103 StdSize true_size = value.numElements(); 104 if (this->n i.getValue() != true_size)104 if (this->n.getValue() != true_size) 105 105 ERROR("CAxis::checkAttributes(void)", 106 106 << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); … … 121 121 } 122 122 else if (data_n.isEmpty()) 123 data_n.setValue(n i.getValue());123 data_n.setValue(n.getValue()); 124 124 125 125 if (data_index.isEmpty()) … … 127 127 int dn = data_n.getValue(); 128 128 data_index.resize(dn); 129 for (int i = 0; i < dn; ++i) data_index(i) = (i+1);129 for (int i = 0; i < dn; ++i) data_index(i) = i; 130 130 } 131 131 } … … 133 133 void CAxis::checkZoom(void) 134 134 { 135 if (0 == global_zoom_size) global_zoom_size = this-> size.getValue();135 if (0 == global_zoom_size) global_zoom_size = this->n_glo.getValue(); 136 136 } 137 137 138 138 void CAxis::checkMask() 139 139 { 140 int begin_mask = 0,141 end_mask = ni.getValue()-1;142 143 if (!zoom_begin.isEmpty())144 {145 int zoom_end = zoom_begin.getValue() + zoom_size.getValue() - 1;146 147 begin_mask = std::max(ibegin.getValue(), zoom_begin.getValue());148 end_mask = std::min(ibegin.getValue() + ni.getValue()-1, zoom_end);149 150 begin_mask -= ibegin.getValue();151 end_mask -= ibegin.getValue();152 }153 154 155 140 if (!mask.isEmpty()) 156 141 { 157 if (mask.extent(0) != n i)142 if (mask.extent(0) != n) 158 143 ERROR("CAxis::checkMask(void)", 159 144 << "the mask has not the same size than the local axis" << endl 160 << "Local size is " << n i<< "x" << endl145 << "Local size is " << n << "x" << endl 161 146 << "Mask size is " << mask.extent(0) << "x"); 162 for (int i = 0; i < ni; ++i)163 {164 if (i < begin_mask && i > end_mask) mask(i) = false;165 }166 147 } 167 148 else // (!mask.hasValue()) 168 149 { // Si aucun masque n'est défini, 169 150 // on en crée un nouveau qui valide l'intégralité du domaine. 170 mask.resize(n i);171 for (int i = 0; i < n i.getValue(); ++i)151 mask.resize(n); 152 for (int i = 0; i < n.getValue(); ++i) 172 153 { 173 if (i >= begin_mask && i <= end_mask) 174 mask(i) = true; 175 else mask(i) = false; 154 mask(i) = true; 176 155 } 177 156 } … … 182 161 if (!bounds.isEmpty()) 183 162 { 184 if (bounds.extent(0) != n i|| bounds.extent(1) != 2)163 if (bounds.extent(0) != n || bounds.extent(1) != 2) 185 164 ERROR("CAxis::checkAttributes(void)", 186 165 << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension axis size x 2" << endl 187 << "Axis size is " << n i<< endl166 << "Axis size is " << n << endl 188 167 << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1)); 189 168 hasBounds_ = true; … … 255 234 void CAxis::sendValue() 256 235 { 257 if (n i.getValue() == size.getValue())236 if (n.getValue() == n_glo.getValue()) 258 237 { 259 238 sendNonDistributedValue(); … … 272 251 int nbServer = client->serverSize; 273 252 int range, clientSize = client->clientSize; 253 size_t ni = this->n.getValue(); 254 size_t ibegin = this->begin.getValue(); 274 255 275 256 CArray<size_t,1> globalIndexAxis(ni); 276 size_t ibegin = this->ibegin.getValue();277 257 int zoom_end = global_zoom_begin+global_zoom_size-1; 278 258 std::vector<size_t> globalAxisZoom; … … 285 265 286 266 std::vector<int> nGlobDomain(1); 287 nGlobDomain[0] = size.getValue();267 nGlobDomain[0] = n_glo.getValue(); 288 268 289 269 size_t globalSizeIndex = 1, indexBegin, indexEnd; … … 348 328 int zoom_end = global_zoom_begin+global_zoom_size-1; 349 329 int nb =0; 350 for (size_t idx = 0; idx < n i; ++idx)351 { 352 size_t globalIndex = ibegin + idx;330 for (size_t idx = 0; idx < n; ++idx) 331 { 332 size_t globalIndex = begin + idx; 353 333 if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nb; 354 334 } … … 356 336 CArray<double,1> val(nb); 357 337 nb = 0; 358 for (size_t idx = 0; idx < n i; ++idx)359 { 360 size_t globalIndex = ibegin + idx;338 for (size_t idx = 0; idx < n; ++idx) 339 { 340 size_t globalIndex = begin + idx; 361 341 if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) 362 342 { … … 424 404 { 425 405 idx = static_cast<int>(it->second[n]); 426 ind = idx - ibegin;406 ind = idx - begin; 427 407 428 408 val(n) = value(ind); … … 602 582 } 603 583 604 if ( size == ni)584 if (n_glo == n) 605 585 { 606 586 zoom_begin_srv = global_zoom_begin; -
XIOS/trunk/src/node/domain.cpp
r665 r666 138 138 checkLocalIDomain(); 139 139 checkLocalJDomain(); 140 141 ibegin_client = ibegin; ni_client = ni; iend_client = ibegin + ni - 1;142 jbegin_client = jbegin; nj_client = nj; jend_client = jbegin + nj - 1;143 140 144 141 if (i_index.isEmpty()) … … 340 337 data_i_index.resize(dni) ; 341 338 data_j_index.resize(dni) ; 342 data_n_index.setValue(dni); 339 343 340 for (int i = 0; i < dni; ++i) 344 341 { … … 353 350 data_j_index.resize(dni) ; 354 351 355 data_n_index.setValue(dni);356 357 352 for(int count = 0, j = 0; j < data_nj.getValue(); ++j) 358 353 { … … 367 362 } 368 363 369 void CDomain::completeLonClient() 364 //---------------------------------------------------------------- 365 void CDomain::completeLonLatClient(void) 370 366 { 371 367 int i,j,k ; 372 368 CArray<double,1> lonvalue_temp(ni*nj) ; 373 369 CArray<double,2> bounds_lon_temp(nvertex,ni*nj); 374 375 if (!lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty()) 376 ERROR("CDomain::completeLonLatClient(void)", 377 <<"Only one longitude value can be used but both lonvalue_1d and lonvalue_2d are defined! "<<endl 378 <<"Define only one longitude value: lonvalue_1d or lonvalue_2d "); 379 380 if (!lonvalue_1d.isEmpty() && lonvalue_2d.isEmpty()) 381 { 382 if (lonvalue_1d.numElements() != i_index.numElements()) 383 ERROR("CDomain::completeLonLatClient(void)", 384 <<"lonvalue_1d has not the same size as the local domain"<<endl 385 <<"Local size is "<<i_index.numElements()<<endl 386 <<"lonvalue_1d size is "<<lonvalue_1d.numElements()); 387 } 388 389 if (lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty()) 390 { 391 if ((lonvalue_2d.extent(0) != ni) || 392 (lonvalue_2d.extent(1) != nj)) 393 ERROR("CDomain::completeLonLatClient(void)", 394 <<"the lonvalue has not the same size as the local domain"<<endl 395 <<"Local size is "<<ni<<"x"<<nj<<endl 396 <<"Lonvalue size is "<<lonvalue_2d.extent(0)<<"x"<<lonvalue_2d.extent(1)); 397 } 370 CArray<double,1> latvalue_temp(ni*nj) ; 371 CArray<double,2> bounds_lat_temp(nvertex,ni*nj); 398 372 399 373 if (!lonvalue_2d.isEmpty()) … … 403 377 { 404 378 lonvalue_temp(i+j*ni) = lonvalue_2d(i,j); 379 latvalue_temp(i+j*ni) = latvalue_2d(i,j); 405 380 if (hasBounds) 406 381 { 407 382 k=j*ni+i; 408 for(int n=0;n<nvertex;++n) bounds_lon_temp(n,k) = bounds_lon_2d(n,i,j); 383 for(int n=0;n<nvertex;++n) 384 { 385 bounds_lon_temp(n,k) = bounds_lon_2d(n,i,j); 386 bounds_lat_temp(n,k) = bounds_lat_2d(n,i,j); 387 } 409 388 } 410 389 } … … 415 394 if (type_attr::rectilinear == type) 416 395 { 417 if ( ni == lonvalue_1d.numElements())396 if ((ni == lonvalue_1d.numElements()) && (nj == latvalue_1d.numElements())) 418 397 { 419 398 for(j=0;j<nj;++j) … … 422 401 k=j*ni+i; 423 402 lonvalue_temp(k) = lonvalue_1d(i); 403 latvalue_temp(k) = latvalue_1d(j); 424 404 if (hasBounds) 425 405 { 426 for(int n=0;n<nvertex;++n) bounds_lon_temp(n,k) = bounds_lon_1d(n,i); 406 for(int n=0;n<nvertex;++n) 407 { 408 bounds_lon_temp(n,k) = bounds_lon_1d(n,i); 409 bounds_lat_temp(n,k) = bounds_lat_1d(n,j); 410 } 427 411 } 428 412 } … … 430 414 else 431 415 ERROR("CDomain::completeLonClient(void)", 432 <<"The lonvalue_1d has not the same size as the local domain"<<endl 433 <<"Local size is "<<ni<<endl 434 <<"Lonvalue_1d size is "<<lonvalue_1d.numElements()); 416 <<"lonvalue_1d and latvalue_1d has not the same size as the local domain"<<endl 417 <<"Local size is "<<ni<<"x " << nj<< endl 418 <<"lonvalue_1d size is "<<lonvalue_1d.numElements() 419 <<"latvalue_1d size is "<<latvalue_1d.numElements()); 435 420 } 436 421 else if (type==type_attr::curvilinear || type==type_attr::unstructured) 437 422 { 438 423 lonvalue_temp=lonvalue_1d; 424 latvalue_temp=latvalue_1d; 439 425 if (hasBounds) 440 426 { 441 427 bounds_lon_temp=bounds_lon_1d; 442 }443 }444 }445 446 StdSize dm = zoom_ni_client * zoom_nj_client;447 448 // Make sure that this attribute is non-empty for every client.449 if (0 != dm)450 {451 lonvalue_client.resize(dm);452 if (hasBounds) bounds_lon_client.resize(nvertex, dm);453 }454 455 456 for (i = 0; i < zoom_ni_client; ++i)457 {458 for (j = 0; j < zoom_nj_client; ++j)459 {460 lonvalue_client(i + j * zoom_ni_client) = lonvalue_temp( (i + zoom_ibegin_client-ibegin) + (j + zoom_jbegin_client -jbegin)*ni );461 if (hasBounds)462 {463 for(int n=0;n<nvertex;n++)464 {465 bounds_lon_client(n,i + j * zoom_ni_client) = bounds_lon_temp( n, (i + zoom_ibegin_client - ibegin) + (j + zoom_jbegin_client -jbegin)*ni );466 }467 }468 }469 }470 }471 472 void CDomain::completeLatClient()473 {474 int i,j,k;475 CArray<double,1> latvalue_temp(ni*nj) ;476 CArray<double,2> bounds_lat_temp(nvertex,ni*nj);477 478 if (!latvalue_1d.isEmpty() && !latvalue_2d.isEmpty())479 ERROR("CDomain::completeLonLatClient(void)",480 <<"Only one longitude value can be used but both latvalue_1d and latvalue_2d are defined! "<<endl481 <<"Define only one longitude value: latvalue_1d or latvalue_2d ");482 483 if (!latvalue_1d.isEmpty() && latvalue_2d.isEmpty())484 {485 if (latvalue_1d.numElements() != i_index.numElements())486 ERROR("CDomain::completeLonLatClient(void)",487 <<"the latvalue_1d has not the same size as the local domain"<<endl488 <<"Local size is "<<i_index.numElements()<<endl489 <<"Mask size is "<<latvalue_1d.numElements());490 }491 492 if (latvalue_1d.isEmpty() && !latvalue_2d.isEmpty())493 {494 if ((latvalue_2d.extent(0) != ni) ||495 (latvalue_2d.extent(1) != nj))496 ERROR("CDomain::completeLonLatClient(void)",497 <<"the mask has not the same size as the local domain"<<endl498 <<"Local size is "<<ni<<"x"<<nj<<endl499 <<"Mask size is "<<latvalue_2d.extent(0)<<"x"<<latvalue_2d.extent(1));500 }501 502 if (!latvalue_2d.isEmpty())503 {504 for (j = 0; j < nj; ++j)505 for (i = 0; i < ni; ++i)506 {507 latvalue_temp(i+j*ni) = latvalue_2d(i,j);508 if (hasBounds)509 {510 k=j*ni+i;511 for(int n=0;n<nvertex;n++) bounds_lat_temp(n,k) = bounds_lat_2d(n,i,j);512 }513 }514 }515 516 if (!latvalue_1d.isEmpty())517 {518 if (type_attr::rectilinear == type)519 {520 521 if (nj == latvalue_1d.numElements())522 {523 for(j=0;j<nj;++j)524 for(i=0;i<ni;++i)525 {526 k=j*ni+i;527 latvalue_temp(k) = latvalue_1d(j);528 if (hasBounds)529 {530 for(int n=0;n<nvertex;n++) bounds_lat_temp(n,k) = bounds_lat_1d(n,j);531 }532 }533 }534 else535 ERROR("CDomain::completeLonClient(void)",536 <<"The latvalue_1d has not the same size as the local domain"<<endl537 <<"Local size is "<<nj<<endl538 <<"Latvalue_1d size is "<<latvalue_1d.numElements());539 }540 else if (type==type_attr::curvilinear || type==type_attr::unstructured)541 {542 latvalue_temp=latvalue_1d;543 if (hasBounds)544 {545 428 bounds_lat_temp=bounds_lat_1d; 546 429 } … … 548 431 } 549 432 550 StdSize dm = zoom_ni_client * zoom_nj_client; 433 int i_ind,j_ind; 434 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1; 435 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1; 436 437 int globalIndexCountZoom = 0; 438 int nbIndex = i_index.numElements(); 439 for (i = 0; i < nbIndex; ++i) 440 { 441 i_ind=i_index(i); 442 j_ind=j_index(i); 443 444 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 445 { 446 ++globalIndexCountZoom; 447 } 448 } 551 449 552 450 // Make sure that this attribute is non-empty for every client. 553 if (0 != dm) 554 { 555 latvalue_client.resize(dm); 556 if (hasBounds) bounds_lat_client.resize(nvertex,dm); 557 } 558 559 for (i = 0; i < zoom_ni_client; i++) 560 { 561 for (j = 0; j < zoom_nj_client; j++) 451 if (0 != globalIndexCountZoom) 452 { 453 lonvalue_client.resize(globalIndexCountZoom); 454 latvalue_client.resize(globalIndexCountZoom); 455 if (hasBounds) 562 456 { 563 latvalue_client(i + j * zoom_ni_client) = latvalue_temp( (i + zoom_ibegin_client-ibegin) + (j + zoom_jbegin_client -jbegin)*ni ); 457 bounds_lon_client.resize(nvertex,globalIndexCountZoom); 458 bounds_lat_client.resize(nvertex,globalIndexCountZoom); 459 } 460 } 461 462 int nCountZoom = 0; 463 for (i = 0; i < nbIndex; ++i) 464 { 465 i_ind=i_index(i); 466 j_ind=j_index(i); 467 468 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 469 { 470 lonvalue_client(nCountZoom) = lonvalue_temp(i); 471 latvalue_client(nCountZoom) = latvalue_temp(i); 564 472 if (hasBounds) 565 473 { 566 for (int n=0;n<nvertex;n++)474 for (int n = 0; n < nvertex; ++n) 567 475 { 568 bounds_lat_client(n,i + j * zoom_ni_client) = bounds_lat_temp( n, (i + zoom_ibegin_client - ibegin) + (j + zoom_jbegin_client -jbegin)*ni ); 476 bounds_lon_client(n,nCountZoom) = bounds_lon_temp(n,i); 477 bounds_lat_client(n,nCountZoom) = bounds_lat_temp(n,i); 569 478 } 570 479 } 480 ++nCountZoom; 571 481 } 572 482 } 573 }574 575 //----------------------------------------------------------------576 void CDomain::completeLonLatClient(void)577 {578 completeLonClient();579 completeLatClient();580 }581 582 583 //----------------------------------------------------------------584 void CDomain::checkZoom(void)585 {586 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;587 zoom_ibegin_client = ibegin_client > global_zoom_ibegin ? ibegin_client : global_zoom_ibegin ;588 zoom_iend_client = iend_client < global_zoom_iend ? iend_client : global_zoom_iend ;589 zoom_ni_client=zoom_iend_client-zoom_ibegin_client+1 ;590 if (zoom_ni_client<0) zoom_ni_client=0 ;591 592 593 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;594 zoom_jbegin_client = jbegin_client > global_zoom_jbegin ? jbegin_client : global_zoom_jbegin ;595 zoom_jend_client = jend_client < global_zoom_jend ? jend_client : global_zoom_jend ;596 zoom_nj_client=zoom_jend_client-zoom_jbegin_client+1 ;597 if (zoom_nj_client<0) zoom_nj_client=0;598 483 } 599 484 … … 691 576 hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || 692 577 (!latvalue_2d.isEmpty() && !lonvalue_2d.isEmpty()); 578 if (hasLonLat) 579 { 580 if (!lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty()) 581 ERROR("CDomain::completeLonLatClient(void)", 582 <<"Only one longitude value can be used but both lonvalue_1d and lonvalue_2d are defined! "<<endl 583 <<"Define only one longitude value: lonvalue_1d or lonvalue_2d "); 584 585 if (!lonvalue_1d.isEmpty() && lonvalue_2d.isEmpty()) 586 { 587 if (lonvalue_1d.numElements() != i_index.numElements()) 588 ERROR("CDomain::completeLonLatClient(void)", 589 <<"lonvalue_1d has not the same size as the local domain"<<endl 590 <<"Local size is "<<i_index.numElements()<<endl 591 <<"lonvalue_1d size is "<<lonvalue_1d.numElements()); 592 } 593 594 if (lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty()) 595 { 596 if ((lonvalue_2d.extent(0) != ni) || 597 (lonvalue_2d.extent(1) != nj)) 598 ERROR("CDomain::completeLonLatClient(void)", 599 <<"the lonvalue has not the same size as the local domain"<<endl 600 <<"Local size is "<<ni<<"x"<<nj<<endl 601 <<"Lonvalue size is "<<lonvalue_2d.extent(0)<<"x"<<lonvalue_2d.extent(1)); 602 } 603 604 if (!latvalue_1d.isEmpty() && !latvalue_2d.isEmpty()) 605 ERROR("CDomain::completeLonLatClient(void)", 606 <<"Only one longitude value can be used but both latvalue_1d and latvalue_2d are defined! "<<endl 607 <<"Define only one longitude value: latvalue_1d or latvalue_2d "); 608 609 if (!latvalue_1d.isEmpty() && latvalue_2d.isEmpty()) 610 { 611 if (latvalue_1d.numElements() != i_index.numElements()) 612 ERROR("CDomain::completeLonLatClient(void)", 613 <<"the latvalue_1d has not the same size as the local domain"<<endl 614 <<"Local size is "<<i_index.numElements()<<endl 615 <<"Mask size is "<<latvalue_1d.numElements()); 616 } 617 618 if (latvalue_1d.isEmpty() && !latvalue_2d.isEmpty()) 619 { 620 if ((latvalue_2d.extent(0) != ni) || 621 (latvalue_2d.extent(1) != nj)) 622 ERROR("CDomain::completeLonLatClient(void)", 623 <<"the mask has not the same size as the local domain"<<endl 624 <<"Local size is "<<ni<<"x"<<nj<<endl 625 <<"Mask size is "<<latvalue_2d.extent(0)<<"x"<<latvalue_2d.extent(1)); 626 } 627 } 693 628 } 694 629 … … 697 632 CContext* context=CContext::getCurrent() ; 698 633 699 this->checkZoom();700 634 if (this->isClientAfterTransformationChecked) return; 701 635 if (context->hasClient) … … 742 676 CContext* context=CContext::getCurrent() ; 743 677 744 this->checkZoom();745 678 if (this->isChecked) return; 746 679 if (context->hasClient) … … 759 692 760 693 this->checkDomain(); 761 this->checkZoom();762 694 this->checkLonLat(); 763 695 this->checkBounds(); … … 769 701 this->checkDomainData(); 770 702 this->checkCompression(); 771 this->completeLonLatClient(); 703 772 704 } 773 705 else … … 777 709 if (context->hasClient) 778 710 { 779 computeConnectedServer() ; 780 sendServerAttribut() ; 781 sendLonLatArea() ; 711 this->computeConnectedServer(); 712 this->completeLonLatClient(); 713 this->sendServerAttribut(); 714 this->sendLonLatArea(); 782 715 } 783 716 … … 837 770 void CDomain::computeConnectedServer(void) 838 771 { 839 ibegin_client=ibegin; ni_client=ni; iend_client=ibegin_client + ni_client - 1;840 jbegin_client=jbegin; nj_client=nj; jend_client=jbegin_client + nj_client - 1;841 842 772 CContext* context=CContext::getCurrent() ; 843 773 CContextClient* client=context->client ; … … 846 776 847 777 int i,j,i_ind,j_ind, nbIndex; 848 int zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;849 int zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;778 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ; 779 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ; 850 780 851 781 // Precompute number of index … … 857 787 j_ind=j_index(i); 858 788 859 if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <=zoom_jend)789 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 860 790 { 861 791 ++globalIndexCountZoom; … … 878 808 globalIndexDomain(globalIndexCount) = globalIndex; 879 809 ++globalIndexCount; 880 if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <=zoom_jend)810 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 881 811 { 882 812 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; … … 1076 1006 { 1077 1007 idx = static_cast<int>(it->second[n]); 1078 i = i_index(idx); 1079 j = j_index(idx); 1080 ind = (i - zoom_ibegin_client) + (j - zoom_jbegin_client) * zoom_ni_client; 1081 1082 lon(n) = lonvalue_client(ind); 1083 lat(n) = latvalue_client(ind); 1008 lon(n) = lonvalue_client(idx); 1009 lat(n) = latvalue_client(idx); 1084 1010 1085 1011 if (hasBounds) … … 1088 1014 CArray<double,2>& boundslat = list_boundslat.back(); 1089 1015 1090 for (nv = 0; nv < nvertex; nv++)1016 for (nv = 0; nv < nvertex; ++nv) 1091 1017 { 1092 boundslon(nv, n) = bounds_lon_client(nv, i nd);1093 boundslat(nv, n) = bounds_lat_client(nv, i nd);1018 boundslon(nv, n) = bounds_lon_client(nv, idx); 1019 boundslat(nv, n) = bounds_lat_client(nv, idx); 1094 1020 } 1095 1021 } … … 1252 1178 if (hasBounds) 1253 1179 { 1254 for (int nv = 0; nv < nvertex; nv++)1180 for (int nv = 0; nv < nvertex; ++nv) 1255 1181 bounds_lon_srv(nv, ind_srv) = boundslon(nv, ind); 1256 1182 } -
XIOS/trunk/src/node/domain.hpp
r665 r666 77 77 78 78 private : 79 80 79 void checkDomain(void); 81 82 80 void checkLocalIDomain(void); 83 81 void checkLocalJDomain(void); … … 87 85 void checkCompression(void); 88 86 89 void checkZoom(void);90 87 void checkBounds(void); 91 88 void checkArea(void); 92 89 void checkLonLat(); 93 94 90 95 91 public : … … 107 103 108 104 109 int ni_client,ibegin_client,iend_client ;110 int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ;111 112 int nj_client,jbegin_client,jend_client ;113 int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ;105 // int ni_client,ibegin_client,iend_client ; 106 // int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ; 107 // 108 // int nj_client,jbegin_client,jend_client ; 109 // int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ; 114 110 115 111 int ni_srv,ibegin_srv,iend_srv ; … … 133 129 134 130 135 CArray<int,2> mapConnectedServer ; // (ni,nj) => mapped to connected server number, -1 if no server is target131 // CArray<int,2> mapConnectedServer ; // (ni,nj) => mapped to connected server number, -1 if no server is target 136 132 137 133 int global_zoom_ibegin, global_zoom_ni; 138 134 int global_zoom_jbegin, global_zoom_nj; 139 // CArray<bool,1> maskInter;140 135 141 136 public : 142 143 137 /// Mutateur /// 144 138 void addRelFile(const StdString & filename); … … 178 172 void setTransformations(const TransMapTypes&); 179 173 void computeNGlobDomain(); 180 void completeLonClient();181 void completeLatClient();182 174 183 175 void sendIndex(); -
XIOS/trunk/src/node/grid.cpp
r664 r666 686 686 else 687 687 { 688 globalDim_[idx] = axis[idxAxis]-> size.getValue();688 globalDim_[idx] = axis[idxAxis]->n_glo.getValue(); 689 689 ++idxAxis; 690 690 ++idx; … … 807 807 nZoomSize[indexMap[i]] = axisList[axisId]->zoom_size_srv; 808 808 nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin; 809 nGlob[indexMap[i]] = axisList[axisId]-> size;809 nGlob[indexMap[i]] = axisList[axisId]->n_glo; 810 810 ++axisId; 811 811 } -
XIOS/trunk/src/node/zoom_axis.cpp
r623 r666 25 25 void CZoomAxis::checkValid(CAxis* axisDest) 26 26 { 27 int axisIBegin, axisNi, axis Size;27 int axisIBegin, axisNi, axisGlobalSize; 28 28 int zoom_begin, zoom_end, zoom_size; 29 29 30 axisIBegin = axisDest-> ibegin.getValue();31 axisNi = axisDest->n i.getValue();32 axis Size = axisDest->size.getValue();30 axisIBegin = axisDest->begin.getValue(); 31 axisNi = axisDest->n.getValue(); 32 axisGlobalSize = axisDest->n_glo.getValue(); 33 33 34 34 zoom_begin = (this->zoom_begin.isEmpty()) ? 0 : this->zoom_begin.getValue() ; 35 zoom_size = (this->zoom_size.isEmpty()) ? axis Size : this->zoom_size.getValue() ;36 zoom_end = (this->zoom_end.isEmpty()) ? (axis Size - 1) : this->zoom_end.getValue() ;35 zoom_size = (this->zoom_size.isEmpty()) ? axisGlobalSize : this->zoom_size.getValue() ; 36 zoom_end = (this->zoom_end.isEmpty()) ? (axisGlobalSize - 1) : this->zoom_end.getValue() ; 37 37 38 38 if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1; … … 40 40 if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1; 41 41 42 if ((zoom_begin < 0) || (zoom_begin > axis Size-1) || (zoom_end<0) || (zoom_end>axisSize-1) || (zoom_size<1) || (zoom_size>axisSize) || (zoom_begin>zoom_end))42 if ((zoom_begin < 0) || (zoom_begin > axisGlobalSize-1) || (zoom_end<0) || (zoom_end>axisGlobalSize-1) || (zoom_size<1) || (zoom_size>axisGlobalSize) || (zoom_begin>zoom_end)) 43 43 ERROR("CZoomAxis::checkAttributes(void)", 44 44 << "One or more attributes among <zoom_begin>, <zoom_end>, <zoom_size> of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified");
Note: See TracChangeset
for help on using the changeset viewer.