Changeset 679
- Timestamp:
- 09/01/15 17:15:41 (9 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r676 r679 135 135 { 136 136 if (this->n_glo.isEmpty()) 137 ERROR("CAxis::checkAttributes(void)", 138 << "Attribute <n_glo> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be specified"); 137 ERROR("CAxis::checkAttributes(void)", 138 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " 139 << "The axis is wrongly defined, attribute 'n_glo' must be specified"); 139 140 StdSize size = this->n_glo.getValue(); 140 141 … … 143 144 if (!this->begin.isEmpty()) 144 145 { 145 StdSize ibegin = this->begin.getValue(); 146 if ((ibegin < 0) || (ibegin > size-1)) 146 if (begin < 0 || begin > size - 1) 147 147 ERROR("CAxis::checkAttributes(void)", 148 << "Attribute <ibegin> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be non-negative and smaller than size-1"); 148 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " 149 << "The axis is wrongly defined, attribute 'begin' (" << begin.getValue() << ") must be non-negative and smaller than size-1 (" << size - 1 << ")."); 149 150 } 150 151 else this->begin.setValue(0); … … 152 153 if (!this->n.isEmpty()) 153 154 { 154 StdSize ni = this->n.getValue(); 155 if ((ni < 0) || (ni > size)) 155 if (n < 0 || n > size) 156 156 ERROR("CAxis::checkAttributes(void)", 157 << "Attribute <ni> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be non-negative and smaller than size"); 157 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " 158 << "The axis is wrongly defined, attribute 'n' (" << n.getValue() << ") must be non-negative and smaller than size (" << size << ")."); 158 159 } 159 160 else this->n.setValue(size); … … 161 162 StdSize true_size = value.numElements(); 162 163 if (this->n.getValue() != true_size) 163 ERROR("CAxis::checkAttributes(void)", 164 << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); 164 ERROR("CAxis::checkAttributes(void)", 165 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " 166 << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ")."); 165 167 166 168 this->checkData(); … … 173 175 { 174 176 if (data_begin.isEmpty()) data_begin.setValue(0); 175 if (!data_n.isEmpty() && data_n.getValue() <= 0) 177 178 if (data_n.isEmpty()) 179 { 180 data_n.setValue(n); 181 } 182 else if (data_n.getValue() < 0) 176 183 { 177 184 ERROR("CAxis::checkData(void)", 178 << "Data dimension is negative (data_n)."); 179 } 180 else if (data_n.isEmpty()) 181 data_n.setValue(n.getValue()); 185 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 186 << "The data size should be strictly positive ('data_n' = " << data_n.getValue() << ")."); 187 } 182 188 183 189 if (data_index.isEmpty()) 184 190 { 185 int dn = data_n.getValue(); 186 data_index.resize(dn); 187 for (int i = 0; i < dn; ++i) data_index(i) = i; 191 data_index.resize(data_n); 192 for (int i = 0; i < data_n; ++i) data_index(i) = i; 188 193 } 189 194 } … … 199 204 { 200 205 if (mask.extent(0) != n) 201 202 << "the mask has not the same size than the local axis" << endl203 << "Local size is " << n << "x" <<endl204 << "Mask size is " << mask.extent(0) << "x");205 }206 else // (!mask.hasValue())207 { // Si aucun masque n'est défini,208 // on en crée un nouveau qui valide l'intégralité du domaine.206 ERROR("CAxis::checkMask(void)", 207 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 208 << "The mask does not have the same size as the local domain." << std::endl 209 << "Local size is " << n.getValue() << "." << std::endl 210 << "Mask size is " << mask.extent(0) << "."); 211 } 212 else // (mask.isEmpty()) 213 { // If no mask was defined, we create a default one without any masked point. 209 214 mask.resize(n); 210 for (int i = 0; i < n .getValue(); ++i)215 for (int i = 0; i < n; ++i) 211 216 { 212 217 mask(i) = true; … … 221 226 if (bounds.extent(0) != n || bounds.extent(1) != 2) 222 227 ERROR("CAxis::checkAttributes(void)", 223 << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension axis size x 2 " <<endl224 << "Axis size is " << n <<endl225 << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) );228 << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension axis size x 2." << std::endl 229 << "Axis size is " << n.getValue() << "." << std::endl 230 << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << "."); 226 231 hasBounds_ = true; 227 232 } … … 259 264 break; 260 265 default : 261 ERROR("bool C Context::dispatchEvent(CEventServer& event)",266 ERROR("bool CAxis::dispatchEvent(CEventServer& event)", 262 267 << "Unknown Event"); 263 268 return false; -
XIOS/trunk/src/node/domain.cpp
r678 r679 132 132 /*! 133 133 * Test whether the data defined on the domain can be outputted in a compressed way. 134 * 134 * 135 135 * \return true if and only if a mask was defined for this domain 136 136 */ … … 164 164 { 165 165 ERROR("CDomain::checkDomain(void)", 166 << "[ Id = " << this->getId() << " ] "167 << "The domain type is not defined,"168 << " check the 'type' value !")169 } 170 171 if (type ==type_attr::unstructured)172 { 173 if (ni_glo.isEmpty() || ni_glo <= 0)166 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 167 << "The domain type is mandatory, " 168 << "please define the 'type' attribute.") 169 } 170 171 if (type == type_attr::unstructured) 172 { 173 if (ni_glo.isEmpty()) 174 174 { 175 ERROR("CDomain::checkAttributes(void)", 176 << "[ Id = " << this->getId() << " ] " 177 << "The global domain is badly defined," 178 << " check the \'ni_glo\' value !") 175 ERROR("CDomain::checkDomain(void)", 176 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 177 << "The global domain is badly defined, " 178 << "the mandatory 'ni_glo' attribute is missing.") 179 } 180 else if (ni_glo <= 0) 181 { 182 ERROR("CDomain::checkDomain(void)", 183 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 184 << "The global domain is badly defined, " 185 << "'ni_glo' attribute should be strictly positive so 'ni_glo = " << ni_glo.getValue() << "' is invalid.") 179 186 } 180 187 isUnstructed_ = true; … … 189 196 area.transposeSelf(1, 0); 190 197 } 191 else if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) || 192 (nj_glo.isEmpty() || nj_glo.getValue() <= 0 )) 193 { 194 ERROR("CDomain::checkAttributes(void)", 195 << "[ Id = " << this->getId() << " ] " 196 << "The global domain is badly defined," 197 << " check the \'ni_glo\' et \'nj_glo\' values !") 198 199 if (ni_glo.isEmpty()) 200 { 201 ERROR("CDomain::checkDomain(void)", 202 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 203 << "The global domain is badly defined, " 204 << "the mandatory 'ni_glo' attribute is missing.") 205 } 206 else if (ni_glo <= 0) 207 { 208 ERROR("CDomain::checkDomain(void)", 209 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 210 << "The global domain is badly defined, " 211 << "'ni_glo' attribute should be strictly positive so 'ni_glo = " << ni_glo.getValue() << "' is invalid.") 212 } 213 214 if (nj_glo.isEmpty()) 215 { 216 ERROR("CDomain::checkDomain(void)", 217 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 218 << "The global domain is badly defined, " 219 << "the mandatory 'nj_glo' attribute is missing.") 220 } 221 else if (nj_glo <= 0) 222 { 223 ERROR("CDomain::checkDomain(void)", 224 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 225 << "The global domain is badly defined, " 226 << "'nj_glo' attribute should be strictly positive so 'nj_glo = " << nj_glo.getValue() << "' is invalid.") 198 227 } 199 228 … … 240 269 { 241 270 ERROR("CDomain::checkLocalIDomain(void)", 242 << "[ Id = " << this->getId() << " ] "271 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 243 272 << "The local domain is wrongly defined," 244 << " check the attributes 'ni_glo', 'ni' and 'ibegin'"); 245 } 246 } 247 248 //---------------------------------------------------------------- 273 << " check the attributes 'ni_glo' (" << ni_glo.getValue() << "), 'ni' (" << ni.getValue() << ") and 'ibegin' (" << ibegin.getValue() << ")"); 274 } 275 } 276 249 277 void CDomain::checkLocalJDomain(void) 250 278 { … … 263 291 { 264 292 ERROR("CDomain::checkLocalJDomain(void)", 265 << "[ Id = " << this->getId() << " ] "293 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 266 294 << "The local domain is wrongly defined," 267 << " check the attributes 'nj_glo' , 'nj' and 'jbegin'");295 << " check the attributes 'nj_glo' (" << nj_glo.getValue() << "), 'nj' (" << nj.getValue() << ") and 'jbegin' (" << jbegin.getValue() << ")"); 268 296 } 269 297 } 270 298 271 299 //---------------------------------------------------------------- 300 272 301 void CDomain::checkMask(void) 273 302 { 274 303 if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) 275 304 ERROR("CDomain::checkMask(void)", 276 <<"Only one mask is used but both mask_1d and mask_2d are defined! "<<endl 277 <<"Define only one mask: mask_1d or mask_2d "); 305 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 306 << "Both mask_1d and mask_2d are defined but only one can be used at the same time." << std::endl 307 << "Please define only one mask: 'mask_1d' or 'mask_2d'."); 278 308 279 309 if (!mask_1d.isEmpty() && mask_2d.isEmpty()) … … 281 311 if (mask_1d.numElements() != i_index.numElements()) 282 312 ERROR("CDomain::checkMask(void)", 283 <<"the mask_1d has not the same size as the local domain"<<endl 284 <<"Local size is "<<i_index.numElements()<<endl 285 <<"Mask size is "<<mask_1d.numElements()); 313 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 314 << "'mask_1d' does not have the same size as the local domain." << std::endl 315 << "Local size is " << i_index.numElements() << "." << std::endl 316 << "Mask size is " << mask_1d.numElements() << "."); 286 317 } 287 318 288 319 if (mask_1d.isEmpty() && !mask_2d.isEmpty()) 289 320 { 290 if ((mask_2d.extent(0) != ni) ||291 (mask_2d.extent(1) != nj))292 ERROR("CDomain::checkMask(void)",293 <<"the mask has not the same size as the local domain"<<endl294 <<"Local size is "<<ni<<"x"<<nj<<endl295 <<"Mask size is "<<mask_2d.extent(0)<<"x"<<mask_2d.extent(1));321 if (mask_2d.extent(0) != ni || mask_2d.extent(1) != nj) 322 ERROR("CDomain::checkMask(void)", 323 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 324 << "The mask does not have the same size as the local domain." << std::endl 325 << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 326 << "Mask size is " << mask_2d.extent(0) << " x " << mask_2d.extent(1) << "."); 296 327 } 297 328 … … 314 345 void CDomain::checkDomainData(void) 315 346 { 316 if (!data_dim.isEmpty() && 317 !(data_dim.getValue() == 1 || data_dim.getValue() == 2)) 318 { 319 ERROR("CDomain::checkAttributes(void)", 320 << "Data dimension incompatible (must be 1 or 2) !") ; 321 } 322 else if (data_dim.isEmpty()) 347 if (data_dim.isEmpty()) 323 348 { 324 349 data_dim.setValue(1); 325 350 } 351 else if (!(data_dim.getValue() == 1 || data_dim.getValue() == 2)) 352 { 353 ERROR("CDomain::checkDomainData(void)", 354 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 355 << "The data dimension is invalid, 'data_dim' must be 1 or 2 not << " << data_dim.getValue() << "."); 356 } 326 357 327 358 if (data_ibegin.isEmpty()) 328 data_ibegin.setValue(0) 359 data_ibegin.setValue(0); 329 360 if (data_jbegin.isEmpty()) 330 data_jbegin.setValue(0) ; 331 332 if (!data_ni.isEmpty() && data_ni.getValue() < 0) 333 { 334 ERROR("CDomain::checkAttributes(void)", 335 << "Data dimension is negative (data_ni)."); 336 } 337 else if (data_ni.isEmpty()) 338 { 339 data_ni.setValue((data_dim.getValue() == 1) 340 ? (ni.getValue() * nj.getValue()) 341 : ni.getValue()); 342 } 343 344 if (!data_nj.isEmpty() && data_nj.getValue() < 0) 345 { 346 ERROR("CDomain::checkAttributes(void)", 347 << "Data dimension is negative (data_nj)."); 361 data_jbegin.setValue(0); 362 363 if (data_ni.isEmpty()) 364 { 365 data_ni.setValue((data_dim == 1) ? (ni.getValue() * nj.getValue()) : ni.getValue()); 366 } 367 else if (data_ni.getValue() < 0) 368 { 369 ERROR("CDomain::checkDomainData(void)", 370 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 371 << "The data size cannot be negative ('data_ni' = " << data_ni.getValue() << ")."); 348 372 } 349 373 350 374 if (data_nj.isEmpty()) 351 data_nj.setValue((data_dim.getValue() == 1) 352 ? (ni.getValue() * nj.getValue()) 353 : nj.getValue()); 354 375 { 376 data_nj.setValue((data_dim.getValue() == 1) ? (ni.getValue() * nj.getValue()) : nj.getValue()); 377 } 378 else if (data_nj.getValue() < 0) 379 { 380 ERROR("CDomain::checkDomainData(void)", 381 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 382 << "The data size cannot be negative ('data_nj' = " << data_nj.getValue() << ")."); 383 } 355 384 } 356 385 357 386 //---------------------------------------------------------------- 387 358 388 void CDomain::checkCompression(void) 359 389 { … … 363 393 data_j_index.numElements() != data_i_index.numElements()) 364 394 { 365 ERROR("CDomain::checkAttributes(void)", 366 <<"Dimension data_j_index incompatible with data_i_index.") ; 395 ERROR("CDomain::checkCompression(void)", 396 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 397 << "'data_i_index' and 'data_j_index' arrays must have the same size." << std::endl 398 << "'data_i_index' size = " << data_i_index.numElements() << std::endl 399 << "'data_j_index' size = " << data_j_index.numElements()); 367 400 } 368 401 369 if (2 == data_dim.getValue())370 {402 if (2 == data_dim) 403 { 371 404 if (data_j_index.isEmpty()) 372 405 { 373 ERROR("CDomain::checkAttributes(void)", 374 <<"data_j_index must be defined !") ; 406 ERROR("CDomain::checkCompression(void)", 407 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 408 << "'data_j_index' must be defined when 'data_i_index' is set and 'data_dim' is 2."); 375 409 } 376 }377 else // (1 == data_dim.getValue())378 {410 } 411 else // (1 == data_dim) 412 { 379 413 if (data_j_index.isEmpty()) 380 414 { 381 const int dni = data_ni.getValue(); 382 data_j_index.resize(dni); 383 for (int j = 0; j < dni; ++j) data_j_index(j) = 0; 415 data_j_index.resize(data_ni); 416 for (int j = 0; j < data_ni; ++j) data_j_index(j) = 0; 384 417 } 385 }418 } 386 419 } 387 420 else 388 421 { 389 if (data_dim.getValue() == 2 && !data_j_index.isEmpty()) 390 ERROR("CDomain::checkAttributes(void)", << "data_i_index undefined") ; 391 392 if (1 == data_dim.getValue()) 393 { 394 const int dni = data_ni.getValue(); 395 data_i_index.resize(dni) ; 396 data_j_index.resize(dni) ; 397 398 for (int i = 0; i < dni; ++i) 422 if (data_dim == 2 && !data_j_index.isEmpty()) 423 ERROR("CDomain::checkCompression(void)", 424 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 425 << "'data_i_index' must be defined when 'data_j_index' is set and 'data_dim' is 2."); 426 427 if (1 == data_dim) 428 { 429 data_i_index.resize(data_ni); 430 data_j_index.resize(data_ni); 431 432 for (int i = 0; i < data_ni; ++i) 433 { 434 data_i_index(i) = i; 435 data_j_index(i) = 0; 436 } 437 } 438 else // (data_dim == 2) 439 { 440 const int dsize = data_ni * data_nj; 441 data_i_index.resize(dsize); 442 data_j_index.resize(dsize); 443 444 for(int count = 0, j = 0; j < data_nj; ++j) 445 { 446 for(int i = 0; i < data_ni; ++i, ++count) 399 447 { 400 data_i_index( i) = i;401 data_j_index( i) = 0;448 data_i_index(count) = i; 449 data_j_index(count) = j; 402 450 } 403 } 404 else // (data_dim == 2) 405 { 406 const int dni = data_ni.getValue() * data_nj.getValue(); 407 data_i_index.resize(dni) ; 408 data_j_index.resize(dni) ; 409 410 for(int count = 0, j = 0; j < data_nj.getValue(); ++j) 411 { 412 for(int i = 0; i < data_ni.getValue(); ++i, ++count) 413 { 414 data_i_index(count) = i; 415 data_j_index(count) = j; 416 } 417 } 418 } 451 } 452 } 419 453 } 420 454 } … … 433 467 { 434 468 int i,j,k ; 435 CArray<double,1> lonvalue_temp(ni *nj);436 CArray<double,2> bounds_lon_temp(nvertex, ni*nj);437 CArray<double,1> latvalue_temp(ni *nj);438 CArray<double,2> bounds_lat_temp(nvertex, ni*nj);469 CArray<double,1> lonvalue_temp(ni * nj); 470 CArray<double,2> bounds_lon_temp(nvertex, ni * nj); 471 CArray<double,1> latvalue_temp(ni * nj); 472 CArray<double,2> bounds_lat_temp(nvertex, ni * nj); 439 473 440 474 if (!lonvalue_2d.isEmpty()) … … 443 477 for (i = 0; i < ni; ++i) 444 478 { 445 lonvalue_temp(i +j*ni) = lonvalue_2d(i,j);446 latvalue_temp(i +j*ni) = latvalue_2d(i,j);479 lonvalue_temp(i + j * ni) = lonvalue_2d(i,j); 480 latvalue_temp(i + j * ni) = latvalue_2d(i,j); 447 481 if (hasBounds) 448 482 { 449 k =j*ni+i;450 for (int n=0;n<nvertex;++n)483 k = j * ni + i; 484 for (int n = 0; n < nvertex; ++n) 451 485 { 452 486 bounds_lon_temp(n,k) = bounds_lon_2d(n,i,j); … … 461 495 if (type_attr::rectilinear == type) 462 496 { 463 if ( (ni == lonvalue_1d.numElements()) && (nj == latvalue_1d.numElements()))497 if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements()) 464 498 { 465 for (j=0;j<nj;++j)466 for (i=0;i<ni;++i)499 for (j = 0; j < nj; ++j) 500 for (i = 0; i < ni; ++i) 467 501 { 468 k =j*ni+i;502 k = j * ni + i; 469 503 lonvalue_temp(k) = lonvalue_1d(i); 470 504 latvalue_temp(k) = latvalue_1d(j); 471 505 if (hasBounds) 472 506 { 473 for (int n=0;n<nvertex;++n)507 for (int n = 0; n < nvertex; ++n) 474 508 { 475 509 bounds_lon_temp(n,k) = bounds_lon_1d(n,i); … … 481 515 else 482 516 ERROR("CDomain::completeLonClient(void)", 483 <<"lonvalue_1d and latvalue_1d has not the same size as the local domain"<<endl484 <<"Local size is "<<ni<<"x " << nj<<endl485 <<"lonvalue_1d size is "<<lonvalue_1d.numElements()486 <<"latvalue_1d size is "<<latvalue_1d.numElements());517 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 518 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl 519 << "'lonvalue_1d' size is " << lonvalue_1d.numElements() << " but it should be " << ni.getValue() << '.' << std::endl 520 << "'latvalue_1d' size is " << latvalue_1d.numElements() << " but it should be " << nj.getValue() << '.'); 487 521 } 488 else if (type ==type_attr::curvilinear || type==type_attr::unstructured)522 else if (type == type_attr::curvilinear || type == type_attr::unstructured) 489 523 { 490 lonvalue_temp =lonvalue_1d;491 latvalue_temp =latvalue_1d;524 lonvalue_temp = lonvalue_1d; 525 latvalue_temp = latvalue_1d; 492 526 if (hasBounds) 493 527 { 494 bounds_lon_temp =bounds_lon_1d;495 bounds_lat_temp =bounds_lat_1d;528 bounds_lon_temp = bounds_lon_1d; 529 bounds_lat_temp = bounds_lat_1d; 496 530 } 497 531 } … … 552 586 void CDomain::checkBounds(void) 553 587 { 554 if (!nvertex.isEmpty() && (0 != nvertex.getValue()))588 if (!nvertex.isEmpty() && nvertex > 0) 555 589 { 556 590 if (!bounds_lon_1d.isEmpty() && !bounds_lon_2d.isEmpty()) 557 591 ERROR("CDomain::checkBounds(void)", 558 <<"Only one longitude boundary value can be used but both bounds_lon_1d and bounds_lon_2d are defined! "<<endl 559 <<"Define only one longitude boundary value: lonvalue_1d or bounds_lon_2d "); 592 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 593 << "Only one longitude boundary attribute can be used but both 'bounds_lon_1d' and 'bounds_lon_2d' are defined." << std::endl 594 << "Define only one longitude boundary attribute: 'bounds_lon_1d' or 'bounds_lon_2d'."); 560 595 561 596 if (!bounds_lat_1d.isEmpty() && !bounds_lat_2d.isEmpty()) 562 597 ERROR("CDomain::checkBounds(void)", 563 <<"Only one latitude boundary value can be used but both bounds_lat_1d and bounds_lat_2d are defined! "<<endl 564 <<"Define only one latitude boundary value: bounds_lat_1d or bounds_lat_2d "); 598 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 599 << "Only one latitude boundary attribute can be used but both 'bounds_lat_1d' and 'bounds_lat_2d' are defined." << std::endl 600 << "Define only one latitude boundary attribute: 'bounds_lat_1d' or 'bounds_lat_2d'."); 565 601 566 602 if ((!bounds_lon_1d.isEmpty() && bounds_lat_1d.isEmpty()) || (bounds_lon_1d.isEmpty() && !bounds_lat_1d.isEmpty())) 567 603 { 568 604 ERROR("CDomain::checkBounds(void)", 569 <<"Only bounds_lon_1d or bounds_lat_1d is defined "<<endl 570 <<"Both must be defined "); 605 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 606 << "Only 'bounds_lon_1d' or 'bounds_lat_1d' is defined." << std::endl 607 << "Please define either both attributes or none."); 571 608 } 572 609 … … 574 611 { 575 612 ERROR("CDomain::checkBounds(void)", 576 <<"Only bounds_lon_2d or bounds_lat_2d is defined "<<endl 577 <<"Both must be defined "); 613 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 614 << "Only 'bounds_lon_2d' or 'bounds_lat_2d' is defined." << std::endl 615 << "Please define either both attributes or none."); 578 616 } 579 617 580 if (!bounds_lon_1d.isEmpty() && (nvertex.getValue() != bounds_lon_1d.extent(0))) 581 ERROR("CDomain::checkBounds(void)", 582 <<"Only bounds_lon_1d and nvertex are not compatible"<<endl 583 <<"bounds_lon_1d dimension is " << bounds_lon_1d.extent(1) 584 <<"but nvertex is " << nvertex.getValue()); 585 586 if (!bounds_lon_2d.isEmpty() && (nvertex.getValue() != bounds_lon_2d.extent(0))) 587 ERROR("CDomain::checkBounds(void)", 588 <<"Only bounds_lon_2d and nvertex are not compatible"<<endl 589 <<"bounds_lon_2d dimension is " << bounds_lon_1d.extent(2) 590 <<"but nvertex is " << nvertex.getValue()); 618 if (!bounds_lon_1d.isEmpty() && nvertex.getValue() != bounds_lon_1d.extent(1)) 619 ERROR("CDomain::checkBounds(void)", 620 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 621 << "'bounds_lon_1d' dimension is not compatible with 'nvertex'." << std::endl 622 << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(1) 623 << " but nvertex is " << nvertex.getValue() << "."); 624 625 if (!bounds_lon_2d.isEmpty() && nvertex.getValue() != bounds_lon_2d.extent(2)) 626 ERROR("CDomain::checkBounds(void)", 627 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 628 << "'bounds_lon_2d' dimension is not compatible with 'nvertex'." << std::endl 629 << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(2) 630 << " but nvertex is " << nvertex.getValue() << "."); 591 631 592 632 if (!bounds_lon_1d.isEmpty() && lonvalue_1d.isEmpty()) 593 ERROR("CDomain::checkBounds(void)", 594 <<"Both bounds_lon_1d and lonvalue_1d must be defined"<<endl); 633 ERROR("CDomain::checkBounds(void)", 634 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 635 << "Since 'bounds_lon_1d' is defined, 'lonvalue_1d' must be defined too." << std::endl); 595 636 596 637 if (!bounds_lon_2d.isEmpty() && lonvalue_2d.isEmpty()) 597 ERROR("CDomain::checkBounds(void)", 598 <<"Both bounds_lon_1d and lonvalue_1d must be defined"<<endl); 599 600 if (!bounds_lat_1d.isEmpty() && (nvertex.getValue() != bounds_lat_1d.extent(0))) 601 ERROR("CDomain::checkBounds(void)", 602 <<"Only bounds_lat_1d and nvertex are not compatible"<<endl 603 <<"bounds_lat_1d dimension is " << bounds_lat_1d.extent(1) 604 <<"but nvertex is " << nvertex.getValue()); 605 606 if (!bounds_lat_2d.isEmpty() && (nvertex.getValue() != bounds_lat_2d.extent(0))) 607 ERROR("CDomain::checkBounds(void)", 608 <<"Only bounds_lat_2d and nvertex are not compatible"<<endl 609 <<"bounds_lat_2d dimension is " << bounds_lat_1d.extent(2) 610 <<"but nvertex is " << nvertex.getValue()); 638 ERROR("CDomain::checkBounds(void)", 639 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 640 << "Since 'bounds_lon_2d' is defined, 'lonvalue_2d' must be defined too." << std::endl); 641 642 if (!bounds_lat_1d.isEmpty() && nvertex.getValue() != bounds_lat_1d.extent(1)) 643 ERROR("CDomain::checkBounds(void)", 644 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 645 << "'bounds_lat_1d' dimension is not compatible with 'nvertex'." << std::endl 646 << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(1) 647 << " but nvertex is " << nvertex.getValue() << "."); 648 649 if (!bounds_lat_2d.isEmpty() && nvertex.getValue() != bounds_lat_2d.extent(2)) 650 ERROR("CDomain::checkBounds(void)", 651 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 652 << "'bounds_lat_2d' dimension is not compatible with 'nvertex'." << std::endl 653 << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(2) 654 << " but nvertex is " << nvertex.getValue() << "."); 611 655 612 656 if (!bounds_lat_1d.isEmpty() && latvalue_1d.isEmpty()) 613 ERROR("CDomain::checkBounds(void)", 614 <<"Both bounds_lat_1d and latvalue_1d must be defined"<<endl); 657 ERROR("CDomain::checkBounds(void)", 658 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 659 << "Since 'bounds_lat_1d' is defined, 'latvalue_1d' must be defined too." << std::endl); 615 660 616 661 if (!bounds_lat_2d.isEmpty() && latvalue_2d.isEmpty()) 617 ERROR("CDomain::checkBounds(void)", 618 <<"Both bounds_lat_1d and latvalue_1d must be defined"<<endl); 619 hasBounds=true ; 662 ERROR("CDomain::checkBounds(void)", 663 << "Since 'bounds_lat_2d' is defined, 'latvalue_2d' must be defined too." << std::endl); 664 665 hasBounds = true; 620 666 } 621 667 else 622 668 { 623 hasBounds =false;624 nvertex =0;669 hasBounds = false; 670 nvertex = 0; 625 671 } 626 672 } … … 633 679 if (area.extent(0) != ni || area.extent(1) != nj) 634 680 { 635 ERROR("void CDomain::checkArea(void)", 636 "The area attribute must be of size ni x nj."); 681 ERROR("CDomain::checkArea(void)", 682 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 683 << "The area does not have the same size as the local domain." << std::endl 684 << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 685 << "Area size is " << area.extent(0) << " x " << area.extent(1) << "."); 637 686 } 638 687 } … … 647 696 if (!lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty()) 648 697 ERROR("CDomain::completeLonLatClient(void)", 649 <<"Only one longitude value can be used but both lonvalue_1d and lonvalue_2d are defined! "<<endl 650 <<"Define only one longitude value: lonvalue_1d or lonvalue_2d "); 698 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 699 << "Only one longitude attribute can be used but both 'lonvalue_1d' and 'lonvalue_2d' are defined." << std::endl 700 << "Define only one longitude attribute: 'lonvalue_1d' or 'lonvalue_2d'."); 651 701 652 702 if (!lonvalue_1d.isEmpty() && lonvalue_2d.isEmpty()) … … 654 704 if (lonvalue_1d.numElements() != i_index.numElements()) 655 705 ERROR("CDomain::completeLonLatClient(void)", 656 <<"lonvalue_1d has not the same size as the local domain"<<endl 657 <<"Local size is "<<i_index.numElements()<<endl 658 <<"lonvalue_1d size is "<<lonvalue_1d.numElements()); 706 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 707 << "'lonvalue_1d' does not have the same size as the local domain." << std::endl 708 << "Local size is " << i_index.numElements() << "." << std::endl 709 << "'lonvalue_1d' size is " << lonvalue_1d.numElements() << "."); 659 710 } 660 711 661 712 if (lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty()) 662 713 { 663 if ((lonvalue_2d.extent(0) != ni) ||664 (lonvalue_2d.extent(1) != nj))665 ERROR("CDomain::completeLonLatClient(void)",666 <<"the lonvalue has not the same size as the local domain"<<endl667 <<"Local size is "<<ni<<"x"<<nj<<endl668 <<"Lonvalue size is "<<lonvalue_2d.extent(0)<<"x"<<lonvalue_2d.extent(1));714 if (lonvalue_2d.extent(0) != ni || lonvalue_2d.extent(1) != nj) 715 ERROR("CDomain::completeLonLatClient(void)", 716 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 717 << "'lonvalue_2d' does not have the same size as the local domain." << std::endl 718 << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 719 << "'lonvalue_2d' size is " << lonvalue_2d.extent(0) << " x " << lonvalue_2d.extent(1) << "."); 669 720 } 670 721 671 722 if (!latvalue_1d.isEmpty() && !latvalue_2d.isEmpty()) 672 723 ERROR("CDomain::completeLonLatClient(void)", 673 <<"Only one longitude value can be used but both latvalue_1d and latvalue_2d are defined! "<<endl 674 <<"Define only one longitude value: latvalue_1d or latvalue_2d "); 724 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 725 << "Only one latitude attribute can be used but both 'latvalue_1d' and 'latvalue_2d' are defined." << std::endl 726 << "Define only one latitude attribute: 'latvalue_1d' or 'latvalue_2d'."); 675 727 676 728 if (!latvalue_1d.isEmpty() && latvalue_2d.isEmpty()) … … 678 730 if (latvalue_1d.numElements() != i_index.numElements()) 679 731 ERROR("CDomain::completeLonLatClient(void)", 680 <<"the latvalue_1d has not the same size as the local domain"<<endl 681 <<"Local size is "<<i_index.numElements()<<endl 682 <<"Mask size is "<<latvalue_1d.numElements()); 732 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 733 << "'latvalue_1d' does not have the same size as the local domain." << std::endl 734 << "Local size is " << i_index.numElements() << "." << std::endl 735 << "'latvalue_1d' size is " << latvalue_1d.numElements() << "."); 683 736 } 684 737 685 738 if (latvalue_1d.isEmpty() && !latvalue_2d.isEmpty()) 686 739 { 687 if ((latvalue_2d.extent(0) != ni) ||688 (latvalue_2d.extent(1) != nj))689 ERROR("CDomain::completeLonLatClient(void)",690 <<"the mask has not the same size as the local domain"<<endl691 <<"Local size is "<<ni<<"x"<<nj<<endl692 <<"Mask size is "<<latvalue_2d.extent(0)<<"x"<<latvalue_2d.extent(1));740 if (latvalue_2d.extent(0) != ni || latvalue_2d.extent(1) != nj) 741 ERROR("CDomain::completeLonLatClient(void)", 742 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 743 << "'latvalue_2d' does not have the same size as the local domain." << std::endl 744 << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 745 << "'latvalue_2d' size is " << latvalue_2d.extent(0) << " x " << latvalue_2d.extent(1) << "."); 693 746 } 694 747 }
Note: See TracChangeset
for help on using the changeset viewer.