Changeset 1445
- Timestamp:
- 03/02/18 10:48:21 (6 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/io/inetcdf4.cpp
r1444 r1445 501 501 { 502 502 const StdString& coord = *it; 503 if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) )503 if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) && this->isLonOrLat(coord, path)) 504 504 { 505 505 std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path); 506 506 if ((dimvar.size() == 1)) 507 507 { 508 // Check that the coordinate is not a scalar label 509 StdString dimTmp = dimvar.begin()->first; 510 if (dimTmp.compare("str_len") != 0) 511 { 512 dimVarList.insert(dimvar.begin()->first); 513 continue; 514 } 508 dimVarList.insert(dimvar.begin()->first); 509 continue; 515 510 } 516 else 517 return false; 518 } 519 } 520 511 } 512 } 521 513 return (dimVarList.size() != 1); 522 514 } … … 534 526 { 535 527 const StdString& coord = *it; 536 if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) )528 if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) && this->isLonOrLat(coord, path)) 537 529 { 538 530 std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path); … … 561 553 { 562 554 const StdString& coord = *it; 563 if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) )555 if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) && this->isLonOrLat(coord, path)) 564 556 { 565 557 std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path); … … 791 783 return *(++(++clist.rbegin())); 792 784 } 785 786 bool CINetCDF4::isLonOrLat(const StdString& varname, const CVarPath* const path) 787 { 788 if (this->hasAttribute(CCFKeywords::XIOS_CF_units, &varname, path)) 789 { 790 StdString unit = this->getAttributeValue(CCFKeywords::XIOS_CF_units, &varname, path); 791 return (CCFConvention::XIOS_CF_Latitude_units.end() != CCFConvention::XIOS_CF_Latitude_units.find(unit) 792 || CCFConvention::XIOS_CF_Longitude_units.end() != CCFConvention::XIOS_CF_Longitude_units.find(unit)); 793 } 794 } 795 793 796 } // namespace xios -
XIOS/dev/XIOS_DEV_CMIP6/src/io/inetcdf4.hpp
r802 r1445 135 135 bool isCellGrid(const StdString& name, const CVarPath* const path = NULL); 136 136 137 bool isLonOrLat(const StdString& varname, const CVarPath* const path = NULL); 138 137 139 protected: 138 140 /// Getters ///
Note: See TracChangeset
for help on using the changeset viewer.