Changeset 1419
- Timestamp:
- 02/02/18 16:26:29 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.cpp
r1413 r1419 264 264 if ((CDomain::type_attr::rectilinear == domain->type)) 265 265 { 266 // Ok, try to read some f..attributes such as longitude and latitude266 // Ok, try to read some attributes such as longitude and latitude 267 267 bool hasLat = SuperClassWriter::hasVariable(itMapNj->first); 268 268 if (hasLat) … … 286 286 int nj = domain->nj; 287 287 std::vector<StdSize> nBeginLatLon(2), nSizeLatLon(2); 288 nBeginLatLon[0] = 0; nBeginLatLon[1] = 0;289 nSizeLatLon[0] = domain->nj _glo.getValue(); nSizeLatLon[1] = domain->ni_glo.getValue();288 nBeginLatLon[0] = domain->jbegin.getValue(); nBeginLatLon[1] = domain->ibegin.getValue(); 289 nSizeLatLon[0] = domain->nj.getValue(); nSizeLatLon[1] = domain->ni.getValue(); 290 290 291 291 StdString latName = this->getLatCoordName(fieldId); 292 292 if (SuperClassWriter::hasVariable(latName)) 293 293 { 294 domain->latvalue_curvilinear_read_from_file.resize(domain->ni _glo,domain->nj_glo);294 domain->latvalue_curvilinear_read_from_file.resize(domain->ni,domain->nj); 295 295 readFieldVariableValue(domain->latvalue_curvilinear_read_from_file, latName, nBeginLatLon, nSizeLatLon); 296 296 } … … 298 298 if (SuperClassWriter::hasVariable(lonName)) 299 299 { 300 domain->lonvalue_curvilinear_read_from_file.resize(domain->ni _glo,domain->nj_glo);300 domain->lonvalue_curvilinear_read_from_file.resize(domain->ni,domain->nj); 301 301 readFieldVariableValue(domain->lonvalue_curvilinear_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 302 302 } … … 320 320 321 321 std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3); 322 nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->nj_glo.getValue();323 nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->ni_glo.getValue();322 nBeginBndsLatLon[0] = domain->jbegin.getValue(); nSizeBndsLatLon[0] = domain->nj.getValue(); 323 nBeginBndsLatLon[1] = domain->ibegin.getValue(); nSizeBndsLatLon[1] = domain->ni.getValue(); 324 324 nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex; 325 325 326 326 if (SuperClassWriter::hasVariable(boundsLatName)) 327 327 { 328 domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni _glo,domain->nj_glo);328 domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni,domain->nj); 329 329 readFieldVariableValue(domain->bounds_latvalue_curvilinear_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 330 330 … … 332 332 if (SuperClassWriter::hasVariable(boundsLonName)) 333 333 { 334 domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni _glo,domain->nj_glo);334 domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni,domain->nj); 335 335 readFieldVariableValue(domain->bounds_lonvalue_curvilinear_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 336 336 } … … 339 339 { 340 340 std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0); 341 n SizeLatLon[0] = domain->ni_glo.getValue();342 CArray<double,1> globalLonLat(domain->ni_glo.getValue());341 nBeginLatLon[0] = domain->ibegin; 342 nSizeLatLon[0] = domain->ni.getValue(); 343 343 344 344 StdString latName = this->getLatCoordName(fieldId); 345 345 if (SuperClassWriter::hasVariable(latName)) 346 346 { 347 domain->latvalue_unstructured_read_from_file.resize(domain->ni _glo);347 domain->latvalue_unstructured_read_from_file.resize(domain->ni); 348 348 readFieldVariableValue(domain->latvalue_unstructured_read_from_file, latName, nBeginLatLon, nSizeLatLon); 349 349 } … … 352 352 if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare("")) 353 353 { 354 // readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon); 355 domain->lonvalue_unstructured_read_from_file.resize(domain->ni_glo); 354 domain->lonvalue_unstructured_read_from_file.resize(domain->ni); 356 355 readFieldVariableValue(domain->lonvalue_unstructured_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 357 356 } … … 375 374 376 375 std::vector<StdSize> nBeginBndsLatLon(2), nSizeBndsLatLon(2); 377 nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->ni_glo.getValue();376 nBeginBndsLatLon[0] = domain->ibegin; nSizeBndsLatLon[0] = domain->ni.getValue(); 378 377 nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = nbVertex; 379 378 -
XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp
r1413 r1419 256 256 257 257 /*! 258 Redistribute RECTILINEAR domain with a number of local domains.258 Redistribute RECTILINEAR or CURVILINEAR domain with a number of local domains. 259 259 All attributes ni,nj,ibegin,jbegin (if defined) will be rewritten 260 260 The optional attributes lonvalue, latvalue will be added. Because this function only serves (for now) … … 536 536 for (int jdx = 0; jdx < nj; ++jdx) 537 537 for (int idx = 0; idx < ni; ++idx) 538 lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx +ibegin, jdx+jbegin);538 lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx, jdx); 539 539 540 540 lonvalue_curvilinear_read_from_file.free(); … … 546 546 for (int jdx = 0; jdx < nj; ++jdx) 547 547 for (int idx = 0; idx < ni; ++idx) 548 latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin);548 latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx, jdx); 549 549 550 550 latvalue_curvilinear_read_from_file.free(); … … 557 557 for (int idx = 0; idx < ni; ++idx) 558 558 for (int ndx = 0; ndx < nvertex; ++ndx) 559 bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin);559 bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx, jdx); 560 560 561 561 bounds_lonvalue_curvilinear_read_from_file.free(); … … 568 568 for (int idx = 0; idx < ni; ++idx) 569 569 for (int ndx = 0; ndx < nvertex; ++ndx) 570 bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx +ibegin, jdx+jbegin);570 bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx, jdx); 571 571 572 572 bounds_latvalue_curvilinear_read_from_file.free(); … … 591 591 lonvalue_1d.resize(ni); 592 592 for (int idx = 0; idx < ni; ++idx) 593 lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i _index(idx));593 lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(idx); 594 594 595 595 // We dont need these values anymore, so just delete them … … 601 601 latvalue_1d.resize(ni); 602 602 for (int idx = 0; idx < ni; ++idx) 603 latvalue_1d(idx) = latvalue_unstructured_read_from_file(i _index(idx));603 latvalue_1d(idx) = latvalue_unstructured_read_from_file(idx); 604 604 605 605 // We dont need these values anymore, so just delete them … … 613 613 for (int idx = 0; idx < ni; ++idx) 614 614 for (int jdx = 0; jdx < nbVertex; ++jdx) 615 bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i _index(idx));615 bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, idx); 616 616 617 617 // We dont need these values anymore, so just delete them … … 625 625 for (int idx = 0; idx < ni; ++idx) 626 626 for (int jdx = 0; jdx < nbVertex; ++jdx) 627 bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i _index(idx));627 bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, idx); 628 628 629 629 // We dont need these values anymore, so just delete them
Note: See TracChangeset
for help on using the changeset viewer.