#include "ncVarAtt.h" #include "ncDim.h" #include "ncVar.h" #include "ncGroup.h" #include "ncCheck.h" #include "ncException.h" #include using namespace std; using namespace netCDF::exceptions; namespace netCDF { // Global comparator operator ============== // comparator operator bool operator<(const NcVar& lhs,const NcVar& rhs) { return false; } // comparator operator bool operator>(const NcVar& lhs,const NcVar& rhs) { return true; } } using namespace netCDF; // assignment operator NcVar& NcVar::operator=(const NcVar & rhs) { nullObject = rhs.nullObject; myId = rhs.myId; groupId = rhs.groupId; return *this; } // The copy constructor. NcVar::NcVar(const NcVar& rhs) : nullObject(rhs.nullObject), myId(rhs.myId), groupId(rhs.groupId) {} // equivalence operator bool NcVar::operator==(const NcVar & rhs) const { // simply check the netCDF id. return (myId == rhs.myId); } // != operator bool NcVar::operator!=(const NcVar & rhs) const { return !(*this == rhs); } ///////////////// // Constructors and intialization ///////////////// // Constructor generates a null object. NcVar::NcVar() : nullObject(true) {} // Constructor for a variable (must already exist in the netCDF file.) NcVar::NcVar (const NcGroup& grp, const int& varId) : nullObject (false), myId (varId), groupId(grp.getId()) {} // Gets parent group. NcGroup NcVar::getParentGroup() const { return NcGroup(groupId); } // Get the variable id. int NcVar::getId() const {return myId;} ////////////////////// // Information about the variable type ///////////////////// // Gets the NcType object with a given name. NcType NcVar::getType() const { // if this variable has not been defined, return a NULL type if(isNull()) return NcType(); // first get the typeid nc_type xtypep; ncCheck(nc_inq_vartype(groupId,myId,&xtypep),__FILE__,__LINE__,__FUNCTION__); if(xtypep == ncByte.getId() ) return ncByte; if(xtypep == ncUbyte.getId() ) return ncUbyte; if(xtypep == ncChar.getId() ) return ncChar; if(xtypep == ncShort.getId() ) return ncShort; if(xtypep == ncUshort.getId() ) return ncUshort; if(xtypep == ncInt.getId() ) return ncInt; if(xtypep == ncUint.getId() ) return ncUint; if(xtypep == ncInt64.getId() ) return ncInt64; if(xtypep == ncUint64.getId() ) return ncUint64; if(xtypep == ncFloat.getId() ) return ncFloat; if(xtypep == ncDouble.getId() ) return ncDouble; if(xtypep == ncString.getId() ) return ncString; multimap::const_iterator it; multimap types(NcGroup(groupId).getTypes(NcGroup::ParentsAndCurrent)); for(it=types.begin(); it!=types.end(); it++) { if(it->second.getId() == xtypep) return it->second; } // we will never reach here return true; } ///////////////// // Information about Dimensions ///////////////// // Gets the number of dimensions. int NcVar::getDimCount() const { // get the number of dimensions int dimCount; ncCheck(nc_inq_varndims(groupId,myId, &dimCount),__FILE__,__LINE__,__FUNCTION__); return dimCount; } // Gets the set of Ncdim objects. vector NcVar::getDims() const { // get the number of dimensions int dimCount = getDimCount(); // create a vector of dimensions. vector ncDims; vector dimids(dimCount); ncCheck(nc_inq_vardimid(groupId,myId, &dimids[0]),__FILE__,__LINE__,__FUNCTION__); ncDims.reserve(dimCount); for (int i=0; i ncDims = getDims(); if((size_t)i >= ncDims.size() | i < 0) throw NcException("NcException","Index out of range",__FILE__,__LINE__,__FUNCTION__); return ncDims[i]; } ///////////////// // Information about Attributes ///////////////// // Gets the number of attributes. int NcVar::getAttCount() const { // get the number of attributes int attCount; ncCheck(nc_inq_varnatts(groupId,myId, &attCount),__FILE__,__LINE__,__FUNCTION__); return attCount; } // Gets the set of attributes. map NcVar::getAtts() const { // get the number of attributes int attCount = getAttCount(); // create a container of attributes. map ncAtts; for (int i=0; i(tmpAtt.getName(),tmpAtt)); } return ncAtts; } // Gets attribute by name. NcVarAtt NcVar::getAtt(const string& name) const { map attributeList = getAtts(); map::iterator myIter; myIter = attributeList.find(name); if(myIter == attributeList.end()) throw NcException("NcException","attribute '"+name+"' not found",__FILE__,__LINE__,__FUNCTION__); return NcVarAtt(myIter->second); } ///////////////////////// // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const string& dataValues) const { ncCheck(nc_put_att_text(groupId,myId,name.c_str(),dataValues.size(),dataValues.c_str()),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const unsigned char* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_uchar(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const signed char* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_schar(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } ///////////////////////////////// // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, short datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_short(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, int datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_int(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, long datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_long(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, float datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_float(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, double datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_double(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, unsigned short datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_ushort(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, unsigned int datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_uint(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, long long datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_longlong(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, unsigned long long datumValue) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_ulonglong(groupId,myId,name.c_str(),type.getId(),1,&datumValue),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } ///////////////////////////////// // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const short* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_short(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const int* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_int(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const long* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_long(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const float* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_float(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const double* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_double(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const unsigned short* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_ushort(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const unsigned int* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_uint(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const long long* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_longlong(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const unsigned long long* dataValues) const { NcType::ncType typeClass(type.getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_att(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_att_ulonglong(groupId,myId,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, size_t len, const char** dataValues) const { ncCheck(nc_put_att_string(groupId,myId,name.c_str(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } // Creates a new NetCDF variable attribute or if already exisiting replaces it. NcVarAtt NcVar::putAtt(const string& name, const NcType& type, size_t len, const void* dataValues) const { ncCheck(nc_put_att(groupId,myId ,name.c_str(),type.getId(),len,dataValues),__FILE__,__LINE__,__FUNCTION__); // finally instantiate this attribute and return return getAtt(name); } //////////////////// // Other Basic variable info //////////////////// // The name of this variable. string NcVar::getName() const{ char charName[NC_MAX_NAME+1]; ncCheck(nc_inq_varname(groupId, myId, charName),__FILE__,__LINE__,__FUNCTION__); return string(charName); } //////////////////// // Chunking details //////////////////// // Sets chunking parameters. void NcVar::setChunking(ChunkMode chunkMode, vector& chunksizes) const { ncCheck(nc_def_var_chunking(groupId,myId,static_cast (chunkMode), &chunksizes[0]),__FILE__,__LINE__,__FUNCTION__); } // Gets the chunking parameters void NcVar::getChunkingParameters(ChunkMode& chunkMode, vector& chunkSizes) const { int chunkModeInt; chunkSizes.reserve(getDimCount()); ncCheck(nc_inq_var_chunking(groupId,myId,&chunkModeInt, &chunkSizes[0]),__FILE__,__LINE__,__FUNCTION__); chunkMode = static_cast (chunkModeInt); } //////////////////// // Fill details //////////////////// // Sets the fill parameters void NcVar::setFill(bool fillMode, void* fillValue) const { // If fillMode is enabled, check that fillValue has a legal pointer. if(fillMode && fillValue == NULL) throw NcException("NcException","FillMode was set to zero but fillValue has invalid pointer",__FILE__,__LINE__,__FUNCTION__); ncCheck(nc_def_var_fill(groupId,myId,static_cast (!fillMode),fillValue),__FILE__,__LINE__,__FUNCTION__); } // Sets the fill parameters void NcVar::setFill(bool fillMode,const void* fillValue) const { setFill(fillMode,const_cast(fillValue)); } // Gets the fill parameters void NcVar::getFillModeParameters(bool& fillMode, void* fillValue)const{ int fillModeInt; ncCheck(nc_inq_var_fill(groupId,myId,&fillModeInt,fillValue),__FILE__,__LINE__,__FUNCTION__); fillMode= static_cast (fillModeInt == 0); } //////////////////// // Compression details //////////////////// // Sets the compression parameters void NcVar::setCompression(bool enableShuffleFilter, bool enableDeflateFilter, int deflateLevel) const { // Check that the deflate level is legal if(enableDeflateFilter & (deflateLevel < 0 | deflateLevel >9)) throw NcException("NcException","The deflateLevel must be set between 0 and 9.",__FILE__,__LINE__,__FUNCTION__); ncCheck(nc_def_var_deflate(groupId,myId, static_cast (enableShuffleFilter), static_cast (enableDeflateFilter), deflateLevel),__FILE__,__LINE__,__FUNCTION__); } // Gets the compression parameters void NcVar::getCompressionParameters(bool& shuffleFilterEnabled, bool& deflateFilterEnabled, int& deflateLevel) const { int enableShuffleFilterInt; int enableDeflateFilterInt; ncCheck(nc_inq_var_deflate(groupId,myId, &enableShuffleFilterInt, &enableDeflateFilterInt, &deflateLevel),__FILE__,__LINE__,__FUNCTION__); shuffleFilterEnabled = static_cast (enableShuffleFilterInt); deflateFilterEnabled = static_cast (enableDeflateFilterInt); } //////////////////// // Endianness details //////////////////// // Sets the endianness of the variable. void NcVar::setEndianness(EndianMode endianMode) const { ncCheck(nc_def_var_endian(groupId,myId,static_cast (endianMode)),__FILE__,__LINE__,__FUNCTION__); } // Gets the endianness of the variable. NcVar::EndianMode NcVar::getEndianness() const { int endianInt; ncCheck(nc_inq_var_endian(groupId,myId,&endianInt),__FILE__,__LINE__,__FUNCTION__); return static_cast (endianInt); } //////////////////// // Checksum details //////////////////// // Sets the checksum parameters of a variable. void NcVar::setChecksum(ChecksumMode checksumMode) const { ncCheck(nc_def_var_fletcher32(groupId,myId,static_cast (checksumMode)),__FILE__,__LINE__,__FUNCTION__); } // Gets the checksum parameters of the variable. NcVar::ChecksumMode NcVar::getChecksum() const { int checksumInt; ncCheck(nc_inq_var_fletcher32(groupId,myId,&checksumInt),__FILE__,__LINE__,__FUNCTION__); return static_cast (checksumInt); } //////////////////// // renaming the variable //////////////////// void NcVar::rename( const string& newname ) const { ncCheck(nc_rename_var(groupId,myId,newname.c_str()),__FILE__,__LINE__,__FUNCTION__); } //////////////////// // data writing //////////////////// // Writes the entire data into the netCDF variable. void NcVar::putVar(const char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_text(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_uchar(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_schar(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_short(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_int(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_long(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_float(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_double(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_ushort(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_uint(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_longlong(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_ulonglong(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable. void NcVar::putVar(const char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var_string(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes the entire data into the netCDF variable with no data conversion. void NcVar::putVar(const void* dataValues) const { ncCheck(nc_put_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } /////////////////// // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const char* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_text(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const unsigned char* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_uchar(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const signed char* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_schar(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const short* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_short(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const int* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_int(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const long* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_long(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const float* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_float(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const double* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_double(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const unsigned short* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_ushort(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const unsigned int* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_uint(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const long long* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_longlong(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const unsigned long long* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_ulonglong(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable. void NcVar::putVar(const vector& index, const char** datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_var1_string(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Writes a single datum value into the netCDF variable with no data conversion. void NcVar::putVar(const vector& index, const void* datumValue) const { ncCheck(nc_put_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } //////////////////// // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_text(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_uchar(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_schar(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_short(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_int(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_long(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_float(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_double(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_ushort(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_uint(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_longlong(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_ulonglong(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector& countp, const char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vara_string(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes an array of values into the netCDF variable with no data conversion. void NcVar::putVar(const vector& startp, const vector& countp, const void* dataValues) const { ncCheck(nc_put_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } //////////////////// // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_text(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_uchar(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_schar(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_short(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_int(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_long(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_float(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_double(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_ushort(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_uint(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_longlong(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_ulonglong(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_vars_string(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a set of subsampled array values into the netCDF variable with no data conversion. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const void* dataValues) const { ncCheck(nc_put_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } //////////////////// // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_text(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_uchar(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_schar(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_short(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_int(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_long(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_float(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_double(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_ushort(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_uint(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_longlong(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_ulonglong(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_put_varm_string(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Writes a mapped array section of values into the netCDF variable with no data conversion. void NcVar::putVar(const vector& startp, const vector&countp, const vector& stridep, const vector& imapp, const void* dataValues) const { ncCheck(nc_put_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Data reading // Reads the entire data of the netCDF variable. void NcVar::getVar(char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_text(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_uchar(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_schar(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_short(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_int(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_long(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_float(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_double(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_ushort(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_uint(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_longlong(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_ulonglong(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable. void NcVar::getVar(char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var_string(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads the entire data of the netCDF variable with no data conversion. void NcVar::getVar(void* dataValues) const { ncCheck(nc_get_var(groupId, myId,dataValues),__FILE__,__LINE__,__FUNCTION__); } /////////// // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, char* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_text(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, unsigned char* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_uchar(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, signed char* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_schar(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, short* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_short(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, int* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_int(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, long* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_long(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, float* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_float(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, double* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_double(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, unsigned short* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_ushort(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, unsigned int* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_uint(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, long long* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_longlong(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable void NcVar::getVar(const vector& index, unsigned long long* datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_ulonglong(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable. void NcVar::getVar(const vector& index, char** datumValue) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_var1_string(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } // Reads a single datum value of a netCDF variable with no data conversion. void NcVar::getVar(const vector& index, void* datumValue) const { ncCheck(nc_get_var1(groupId, myId,&index[0],datumValue),__FILE__,__LINE__,__FUNCTION__); } /////////// // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_text(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_uchar(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_schar(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_short(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_int(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_long(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_float(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_double(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_ushort(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_uint(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_longlong(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable void NcVar::getVar(const vector& startp, const vector& countp, unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_ulonglong(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vara_string(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads an array of values from a netCDF variable with no data conversion. void NcVar::getVar(const vector& startp, const vector& countp, void* dataValues) const { ncCheck(nc_get_vara(groupId, myId,&startp[0],&countp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } /////////// // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_text(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_uchar(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_schar(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_short(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_int(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_long(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_float(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_double(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_ushort(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_uint(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_longlong(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_ulonglong(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_vars_string(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a subsampled (strided) array section of values from a netCDF variable with no data conversion. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, void* dataValues) const { ncCheck(nc_get_vars(groupId, myId,&startp[0],&countp[0],&stridep[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } /////////// // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_text(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, unsigned char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_uchar(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, signed char* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_schar(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_short(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_int(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_long(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, float* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_float(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, double* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_double(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, unsigned short* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_ushort(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, unsigned int* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_uint(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_longlong(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, unsigned long long* dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_ulonglong(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, char** dataValues) const { NcType::ncType typeClass(getType().getTypeClass()); if(typeClass == NcType::nc_VLEN | typeClass == NcType::nc_OPAQUE | typeClass == NcType::nc_ENUM | typeClass == NcType::nc_COMPOUND) ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); else ncCheck(nc_get_varm_string(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); } // Reads a mapped array section of values from a netCDF variable with no data conversion. void NcVar::getVar(const vector& startp, const vector& countp, const vector& stridep, const vector& imapp, void* dataValues) const { ncCheck(nc_get_varm(groupId, myId,&startp[0],&countp[0],&stridep[0],&imapp[0],dataValues),__FILE__,__LINE__,__FUNCTION__); }