Changeset 183
- Timestamp:
- 04/26/11 09:38:40 (13 years ago)
- Location:
- XMLIO_V2/dev/dev_rv/src/xmlio
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/array.hpp
r182 r183 47 47 48 48 public: 49 49 50 50 void toBinary (StdOStream & os) const; 51 51 void fromBinary(StdIStream & is); -
XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_nemo.f90
r180 r183 19 19 comm_client_grp, & ! communicateur du groupe de clients 20 20 comm_client_server ! communicateur client-serveur 21 REAL(kind = 8), DIMENSION(10000) 21 REAL(kind = 8), DIMENSION(10000) :: real_array 22 22 INTEGER :: rankGrp, error 23 23 INTEGER :: ibegin, iend, jbegin, jend, data_ni, data_ibegin … … 138 138 139 139 CALL set_field_attributes(field_hdl = temp_mod, & 140 ftype 141 operation_ 140 ftype = GFIELD, & 141 operation_ = "instant", & 142 142 enabled_ = .FALSE._1) 143 143 -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.hpp
r179 r183 23 23 static void SetCurrentContextId(const StdString & id); 24 24 static boost::shared_ptr<CContext> CreateContext(const StdString & id = StdString("")); 25 26 template<typename ObjType, typename AttType> // Pas encore implémenté 27 static void SetAttribute(ObjType & obj, const StdString & attname, const AttType & attvalue); 28 template<typename ObjType, typename AttType> // Pas encore implémenté 29 static void SetAttribute(const StdString & objname, const StdString & attname, const AttType & attvalue); 25 30 26 31 /// Sortie /// -
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp
r182 r183 14 14 CDomain::CDomain(void) 15 15 : CObjectTemplate<CDomain>(), CDomainAttributes() 16 , isChecked(false), local_mask(new C Mask()), relFiles()16 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[10][10])), relFiles() 17 17 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 18 18 , lonvalue_sub(), latvalue_sub() … … 21 21 CDomain::CDomain(const StdString & id) 22 22 : CObjectTemplate<CDomain>(id), CDomainAttributes() 23 , isChecked(false), local_mask(new C Mask()), relFiles()23 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[10][10])), relFiles() 24 24 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 25 25 , lonvalue_sub(), latvalue_sub() … … 112 112 } 113 113 114 115 114 //---------------------------------------------------------------- 116 115 … … 162 161 nj.setValue(jend.getValue() - jbegin.getValue() + 1) ; 163 162 164 else if (!jbegin.isEmpty() && !jend.isEmpty() && 165 !nj.isEmpty() &&(jend.getValue() != jbegin.getValue() + nj.getValue() - 1))163 else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty() && 164 (jend.getValue() != jbegin.getValue() + nj.getValue() - 1)) 166 165 { 167 166 ERROR("CDomain::checkAttributes(void)", … … 188 187 void CDomain::checkMask(void) 189 188 { 189 using namespace std; 190 191 int ibegin_mask = 0, 192 jbegin_mask = 0, 193 iend_mask = iend.getValue() - ibegin.getValue(), 194 jend_mask = jend.getValue() - jbegin.getValue(); 195 196 if (!zoom_ibegin.isEmpty()) 197 { 198 int zoom_iend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1; 199 int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1; 200 201 ibegin_mask = max (ibegin.getValue(), zoom_ibegin.getValue()); 202 jbegin_mask = max (jbegin.getValue(), zoom_jbegin.getValue()); 203 iend_mask = min (iend.getValue(), zoom_iend); 204 jend_mask = min (jend.getValue(), zoom_jend); 205 206 ibegin_mask -= ibegin.getValue(); 207 jbegin_mask -= jbegin.getValue(); 208 iend_mask -= ibegin.getValue(); 209 jend_mask -= jbegin.getValue(); 210 } 211 212 //~ std::cout << "-------------------" << std::endl 213 //~ << "zoom : " << std::boolalpha << (!zoom_ibegin.isEmpty()) << std::endl 214 //~ << "size : " << ni.getValue() << " X " << nj.getValue() << std::endl 215 //~ << "i : " << ibegin_mask << ", " << iend_mask << std::endl 216 //~ << "j : " << jbegin_mask << ", " << jend_mask << std::endl 217 //~ << "-------------------" << std::endl; 218 190 219 if (!mask.isEmpty()) 191 220 { 221 ARRAY(bool, 2) mask_ = mask.getValue(); 192 222 unsigned int niu = ni.getValue(), nju = nj.getValue(); 193 if ((mask .getValue()->shape()[0] != niu) ||194 (mask .getValue()->shape()[1] != nju))223 if ((mask_->shape()[0] != niu) || 224 (mask_->shape()[1] != nju)) 195 225 ERROR("CDomain::checkAttributes(void)", 196 226 <<"Le masque n'a pas la même taille que le domaine local") ; 227 228 for (int i = 0; i < ni.getValue(); i++) 229 { 230 for (int j = 0; j < nj.getValue(); j++) 231 { 232 if (i < ibegin_mask && i > iend_mask && 233 j < jbegin_mask && j > jend_mask ) 234 (*mask_)[i][j] = false; 235 } 236 } 197 237 } 198 238 else // (!mask.hasValue()) … … 201 241 ARRAY_CREATE(__arr, bool, 2, [ni.getValue()][nj.getValue()]); 202 242 for (int i = 0; i < ni.getValue(); i++) 243 { 203 244 for (int j = 0; j < nj.getValue(); j++) 204 (*__arr)[i][j] = true; 245 { 246 if (i >= ibegin_mask && i <= iend_mask && 247 j >= jbegin_mask && j <= jend_mask ) 248 (*__arr)[i][j] = true; 249 else (*__arr)[i][j] = false; 250 } 251 } 252 253 205 254 mask.setValue(__arr); 206 255 __arr.reset(); … … 315 364 { 316 365 for(int j = 0; j < data_nj.getValue(); j++, count++) 317 { 366 { 318 367 (*__arri)[count] = i+1 ; 319 368 (*__arrj)[count] = j+1 ; … … 385 434 //---------------------------------------------------------------- 386 435 436 void CDomain::checkZoom(void) 437 { 438 if (!this->zoom_ni.isEmpty() || !this->zoom_nj.isEmpty() || 439 !this->zoom_ibegin.isEmpty() || !this->zoom_jbegin.isEmpty()) 440 { 441 if (this->zoom_ni.isEmpty() && this->zoom_nj.isEmpty() && 442 this->zoom_ibegin.isEmpty() && this->zoom_jbegin.isEmpty()) 443 { 444 ERROR("CDomain::checkZoom(void)", 445 <<"Les attributs définissant un zoom doivent tous être définis") ; 446 } 447 else 448 { 449 int zoom_iend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1; 450 int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1; 451 452 if (zoom_ibegin.getValue() < 1 || zoom_jbegin.getValue() < 1 || 453 zoom_iend > iend.getValue() || zoom_jend > jend.getValue()) 454 ERROR("CDomain::checkZoom(void)", 455 << "Zoom mal défini," 456 << " vérifiez les valeurs zoom_ni, zoom_nj, zoom_ibegin, zoom_ibegin") ; 457 } 458 } 459 } 460 461 //---------------------------------------------------------------- 462 387 463 void CDomain::checkAttributes(void) 388 464 { … … 392 468 this->checkLocalIDomain(); 393 469 this->checkLocalJDomain(); 470 471 this->checkZoom(); 394 472 395 473 if (this->latvalue_sub.size() == 0) 396 { 474 { // CÃŽté client uniquement 397 475 this->checkMask(); 398 476 this->checkDomainData(); … … 400 478 } 401 479 else 402 { 480 { // CÃŽté serveur uniquement 403 481 this->completeLonLat(); 404 482 } … … 412 490 void CDomain::completeMask(void) 413 491 { 414 this->local_mask->resize(ni.getValue(), nj.getValue()); 415 /*this->local_mask->setDataPosition 416 (data_dim.getValue(), data_ni.getValue(), data_nj.getValue(), 417 data_ibegin.getValue(), data_jbegin.getValue(), data_n_index.getValue(), 418 data_i_index.getValue(), data_j_index.getValue());*/ 419 } 420 421 //---------------------------------------------------------------- 422 423 boost::shared_ptr<CMask> CDomain::getLocalMask(void) const 492 this->local_mask->resize(boost::extents[ni.getValue()][nj.getValue()]); 493 } 494 495 //---------------------------------------------------------------- 496 497 ARRAY(int, 2) CDomain::getLocalMask(void) const 424 498 { 425 499 return (this->local_mask); -
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp
r182 r183 5 5 #include "xmlioserver_spl.hpp" 6 6 #include "group_factory.hpp" 7 #include "mask.hpp"8 7 9 8 #include "declare_group.hpp" … … 51 50 private : 52 51 53 v irtual void checkGlobalDomain(void);52 void checkGlobalDomain(void); 54 53 55 v irtual void checkLocalIDomain(void);56 v irtual void checkLocalJDomain(void);54 void checkLocalIDomain(void); 55 void checkLocalJDomain(void); 57 56 58 virtual void checkMask(void); 59 virtual void checkDomainData(void); 60 virtual void checkCompression(void); 57 void checkMask(void); 58 void checkDomainData(void); 59 void checkCompression(void); 60 61 void checkZoom(void); 61 62 62 v irtual void completeMask(void);63 void completeMask(void); 63 64 64 65 public : … … 68 69 69 70 /// Accesseurs /// 70 boost::shared_ptr<CMask>getLocalMask(void) const;71 ARRAY(int, 2) getLocalMask(void) const; 71 72 72 73 const std::set<StdString> & getRelFiles(void) const; … … 102 103 /// Proriétés protégées /// 103 104 bool isChecked; 104 boost::shared_ptr<CMask>local_mask;105 ARRAY(int, 2) local_mask; 105 106 std::set<StdString> relFiles; 106 107 -
XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp
r182 r183 332 332 const std::vector<int> & ibegin = this->domain->getIBeginSub(); 333 333 const std::vector<int> & jbegin = this->domain->getJBeginSub(); 334 335 const int ibegin_srv = this->domain->ibegin.getValue(); 336 const int jbegin_srv = this->domain->jbegin.getValue(); 334 337 335 338 StdSize dn = 0; … … 355 358 { 356 359 (*storeIndex_srv)[n] = (*storeIndex_cl)[m] + dn; 357 (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + ibegin_cl - 1;358 (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + jbegin_cl - 1;360 (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + (ibegin_cl - 1) - (ibegin_srv - 1); 361 (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + (jbegin_cl - 1) - (jbegin_srv - 1); 359 362 (*out_l_index_srv)[n] = (*out_l_index_cl)[m]; 360 363 } … … 375 378 376 379 } 380 381 //---------------------------------------------------------------- 382 383 void CGrid::inputFieldServer 384 (const std::deque<ARRAY(double, 1)> storedClient, 385 ARRAY(double, 1) storedServer) const 386 { 387 if (this->storeIndex.size()-1 != storedClient.size()) 388 ERROR("CGrid::inputFieldServer(...)", 389 << "[ Nombre de tableau attendu = " << (this->storeIndex.size()-1) << ", " 390 << "[ Nombre de tableau reçu = " << storedClient.size() << "] " 391 << "Les données d'un client sont manquantes !") ; 392 if (storedServer.get() != NULL) 393 storedServer->resize(boost::extents[this->storeIndex.size()-1]); 394 else 395 ARRAY_ASSIGN(storedServer, double, 1, [this->storeIndex.size()-1]); 396 397 for (StdSize i = 0, n = 0; i < storedClient.size(); i++) 398 for (StdSize j = 0; j < storedClient[i]->num_elements(); j++) 399 (*storedServer)[n++] = (*storedClient[i])[j]; 400 } 377 401 378 402 ///--------------------------------------------------------------- -
XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp
r182 r183 69 69 /// Entrées-sorties de champs /// 70 70 template <StdSize n> 71 void inputField(const 71 void inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const; 72 72 73 73 void inputFieldServer(const std::deque<ARRAY(double, 1)> storedClient, -
XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp
r180 r183 74 74 StdString maskid = StdString("mask_").append(domid).append("_local"); 75 75 76 boost::shared_ptr<CMask>mask = domain->getLocalMask();76 ARRAY(int, 2) mask = domain->getLocalMask(); 77 77 78 78 unsigned int ssize = domain->ni.getValue() * domain->nj.getValue(); -
XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.cpp
r152 r183 341 341 } 342 342 343 void CONetCDF4::writeData(const boost::shared_ptr<CMask>data, const StdString & name)343 void CONetCDF4::writeData(const ARRAY(int, 2) data, const StdString & name) 344 344 { 345 345 int grpid = this->getCurrentGroup(); … … 349 349 350 350 this->getWriteDataInfos(name, 0, array_size, sstart, scount, NULL, NULL); 351 CheckError(nc_put_vara_int(grpid, varid, &(sstart[0]), &(scount[0]), data-> getData()));351 CheckError(nc_put_vara_int(grpid, varid, &(sstart[0]), &(scount[0]), data->data())); 352 352 } 353 353 -
XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp
r157 r183 62 62 const std::vector<StdSize> * count = NULL); 63 63 64 void writeData(const boost::shared_ptr<CMask>data, const StdString & name);64 void writeData(const ARRAY(int, 2) data, const StdString & name); 65 65 66 66 /// Accesseur ///
Note: See TracChangeset
for help on using the changeset viewer.