Changeset 811


Ignore:
Timestamp:
01/07/16 09:21:51 (5 years ago)
Author:
ymipsl
Message:

Bug fix when time dimension is not the unlimited dimension

YM

Location:
XIOS/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/io/inetcdf4.cpp

    r802 r811  
    2727 
    2828    this->timeCounterName = timeCounterName; 
     29    if (!CNetCdfInterface::isDimExisted(this->ncidp, this->timeCounterName)) this->timeCounterName=this->getUnlimitedDimensionName() ; 
     30     
    2931  } 
    3032 
  • XIOS/trunk/src/io/nc4_data_input.cpp

    r807 r811  
    3030    if (SuperClassWriter::isTemporal(fieldId)) 
    3131    { 
    32       return SuperClassWriter::getDimensions(&fieldId)[SuperClassWriter::getUnlimitedDimensionName()]; 
     32//      return SuperClassWriter::getDimensions(&fieldId)[SuperClassWriter::getUnlimitedDimensionName()]; 
     33      return SuperClassWriter::getDimensions(&fieldId)[SuperClassWriter::getTimeCounterName()]; 
    3334    } 
    3435 
  • XIOS/trunk/src/io/netCdfInterface.cpp

    r782 r811  
    995995   int varId = 0; 
    996996   return (NC_NOERR == (nc_inq_varid(ncId, varName.c_str(), &varId))); 
     997} 
     998 
     999bool CNetCdfInterface::isDimExisted(int ncId, const StdString& dimName) 
     1000{ 
     1001   int dimId = 0; 
     1002   return (NC_NOERR == (nc_inq_dimid(ncId, dimName.c_str(), &dimId))); 
    9971003} 
    9981004 
  • XIOS/trunk/src/io/netCdfInterface.hpp

    r686 r811  
    172172    //! Query the existence of a variable 
    173173    static bool isVarExisted(int ncId, const StdString& varName); 
    174  
     174    static bool isDimExisted(int ncId, const StdString& dimName); 
    175175  }; 
    176176} 
  • XIOS/trunk/src/node/file.cpp

    r805 r811  
    525525 
    526526      if (isOpen) data_out->closeFile(); 
    527  
    528       data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, time_counter_name)); 
     527      if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective)); 
     528      else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, time_counter_name)); 
    529529      isOpen = true; 
    530530    } 
Note: See TracChangeset for help on using the changeset viewer.