Changeset 1428 for XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.cpp
- Timestamp:
- 02/14/18 17:38:47 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.cpp
r1419 r1428 283 283 else if ((CDomain::type_attr::curvilinear == domain->type)) 284 284 { 285 int ni = domain->ni; 286 int nj = domain->nj; 285 // Make sure that if there is no local domain defined on a process, the process still reads just one value. 286 int ni, nj, ibegin, jbegin; 287 if (domain->ni == 0) 288 { 289 ni = 1; 290 ibegin = 0; 291 } 292 else 293 { 294 ni = domain->ni; 295 ibegin = domain->ibegin; 296 } 297 if (domain->nj == 0) 298 { 299 nj = 1; 300 jbegin = 0; 301 } 302 else 303 { 304 nj = domain->nj; 305 jbegin = domain->jbegin; 306 } 307 287 308 std::vector<StdSize> nBeginLatLon(2), nSizeLatLon(2); 288 nBeginLatLon[0] = domain->jbegin.getValue(); nBeginLatLon[1] = domain->ibegin.getValue();289 nSizeLatLon[0] = domain->nj.getValue(); nSizeLatLon[1] = domain->ni.getValue();309 nBeginLatLon[0] = jbegin; nBeginLatLon[1] = ibegin; 310 nSizeLatLon[0] = nj; nSizeLatLon[1] = ni; 290 311 291 312 StdString latName = this->getLatCoordName(fieldId); 292 313 if (SuperClassWriter::hasVariable(latName)) 293 314 { 294 domain->latvalue_curvilinear_read_from_file.resize( domain->ni,domain->nj);315 domain->latvalue_curvilinear_read_from_file.resize(ni, nj); 295 316 readFieldVariableValue(domain->latvalue_curvilinear_read_from_file, latName, nBeginLatLon, nSizeLatLon); 296 317 } … … 298 319 if (SuperClassWriter::hasVariable(lonName)) 299 320 { 300 domain->lonvalue_curvilinear_read_from_file.resize( domain->ni,domain->nj);321 domain->lonvalue_curvilinear_read_from_file.resize(ni, nj); 301 322 readFieldVariableValue(domain->lonvalue_curvilinear_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 302 323 } … … 320 341 321 342 std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3); 322 nBeginBndsLatLon[0] = domain->jbegin.getValue(); nSizeBndsLatLon[0] = domain->nj.getValue();323 nBeginBndsLatLon[1] = domain->ibegin.getValue(); nSizeBndsLatLon[1] = domain->ni.getValue();343 nBeginBndsLatLon[0] = jbegin; nSizeBndsLatLon[0] = nj; 344 nBeginBndsLatLon[1] = ibegin; nSizeBndsLatLon[1] = ni; 324 345 nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex; 325 346 326 347 if (SuperClassWriter::hasVariable(boundsLatName)) 327 348 { 328 domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex, domain->ni,domain->nj);349 domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex, ni, nj); 329 350 readFieldVariableValue(domain->bounds_latvalue_curvilinear_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 330 351 … … 332 353 if (SuperClassWriter::hasVariable(boundsLonName)) 333 354 { 334 domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex, domain->ni,domain->nj);355 domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex, ni, nj); 335 356 readFieldVariableValue(domain->bounds_lonvalue_curvilinear_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 336 357 } … … 338 359 else if ((CDomain::type_attr::unstructured == domain->type))// || (this->isUnstructured(fieldId))) 339 360 { 361 // Make sure that if there is no local domain defined on a process, the process still reads just one value. 362 int ni, ibegin; 363 if (domain->ni == 0) 364 { 365 ni = 1; 366 ibegin = 0; 367 } 368 else 369 { 370 ni = domain->ni; 371 ibegin = domain->ibegin; 372 } 373 340 374 std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0); 341 nBeginLatLon[0] = domain->ibegin;342 nSizeLatLon[0] = domain->ni.getValue();375 nBeginLatLon[0] = ibegin; 376 nSizeLatLon[0] = ni; 343 377 344 378 StdString latName = this->getLatCoordName(fieldId); 345 379 if (SuperClassWriter::hasVariable(latName)) 346 380 { 347 domain->latvalue_unstructured_read_from_file.resize( domain->ni);381 domain->latvalue_unstructured_read_from_file.resize(ni); 348 382 readFieldVariableValue(domain->latvalue_unstructured_read_from_file, latName, nBeginLatLon, nSizeLatLon); 349 383 } … … 352 386 if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare("")) 353 387 { 354 domain->lonvalue_unstructured_read_from_file.resize( domain->ni);388 domain->lonvalue_unstructured_read_from_file.resize(ni); 355 389 readFieldVariableValue(domain->lonvalue_unstructured_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 356 390 } … … 374 408 375 409 std::vector<StdSize> nBeginBndsLatLon(2), nSizeBndsLatLon(2); 376 nBeginBndsLatLon[0] = domain->ibegin; nSizeBndsLatLon[0] = domain->ni.getValue();410 nBeginBndsLatLon[0] = ibegin; nSizeBndsLatLon[0] = ni; 377 411 nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = nbVertex; 378 412
Note: See TracChangeset
for help on using the changeset viewer.