Changeset 2280 for XIOS/trunk/src/io/inetcdf4.cpp
- Timestamp:
- 01/07/22 12:17:18 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/inetcdf4.cpp
r1639 r2280 28 28 29 29 this->timeCounterName = timeCounterName; 30 30 31 if (!CNetCdfInterface::isDimExisted(this->ncidp, this->timeCounterName)) this->timeCounterName=this->getUnlimitedDimensionName() ; 31 32 … … 87 88 CNetCdfInterface::inqAtt(grpid, varid, attname, retvalue.first, retvalue.second); 88 89 return retvalue; 90 } 91 92 93 bool CINetCDF4::hasUnlimitedDimension(const CVarPath* const path) 94 { 95 int dimid = 0; 96 int grpid = this->getGroup(path); 97 CNetCdfInterface::inqUnLimDim(grpid, dimid); 98 if (dimid==-1) return false ; 99 else return true ; 89 100 } 90 101 … … 174 185 } 175 186 176 StdSize CINetCDF4::getNbOfTimestep(const CVarPath* const path)177 {178 return this->getDimensions(NULL, path)[this->getUnlimitedDimensionName(path)];179 }180 181 187 std::set<StdString> CINetCDF4::getBoundVariables(const CVarPath* const path) 182 188 { … … 337 343 return false; 338 344 } 345 346 template <class T> 347 bool CINetCDF4::hasAttribute(const StdString& name, const StdString* const var, const CVarPath* const path) 348 { 349 std::list<StdString> atts = this->getAttributes(var, path); 350 std::list<StdString>::const_iterator it = atts.begin(), end = atts.end(); 351 for (; it != end; it++) 352 { 353 const StdString& attname = *it; 354 if (attname.compare(0, name.size(), name) == 0) 355 { 356 std::pair<nc_type , StdSize> attinfos = this->getAttribute(name, var, path); 357 std::vector<T> retvalue(attinfos.second); 358 nc_type type = CNetCdfInterface::getNcType<T>(); 359 if (attinfos.first == type) return true; 360 else return false ; 361 } 362 } 363 return false; 364 } 365 366 template bool CINetCDF4::hasAttribute<double>(const StdString& name, const StdString* const var, const CVarPath* const path); 367 template bool CINetCDF4::hasAttribute<float>(const StdString& name, const StdString* const var, const CVarPath* const path); 368 template bool CINetCDF4::hasAttribute<int>(const StdString& name, const StdString* const var, const CVarPath* const path); 369 template bool CINetCDF4::hasAttribute<char>(const StdString& name, const StdString* const var, const CVarPath* const path); 370 339 371 340 372 bool CINetCDF4::hasVariable(const StdString& name,
Note: See TracChangeset
for help on using the changeset viewer.