3.2 Low-level functions (Deprecated)

3.2.1 netcdf_abort

Loadable Function: netcdf_abort(ncid)

Aborts all changes since the last time the dataset entered in define mode.

See also: netcdf_reDef.

3.2.2 netcdf_close

Loadable Function: netcdf_close(ncid)

Close the NetCDF file with the id ncid.

See also: netcdf_open.

3.2.3 netcdf_copyAtt

Loadable Function: netcdf_copyAtt (ncid,varid,name,ncid_out,varid_out)

Copies the attribute named old_name of the variable varid in the data set ncid to the variable varid_out in the data set ncid_out. To copy a global attribute use netcdf_getConstant("global") for varid or varid_out.

See also: netcdf_getAtt,netcdf_getConstant.

3.2.4 netcdf_create

Loadable Function: ncid = netcdf_create(filename,mode)

Creates the file named filename in the mode mode which can have the following values: "clobber" (overwrite existing files), "noclobber" (prevent to overwrite existing files) "64bit_offset" (use the 64bit-offset format), "netcdf4" (use the NetCDF4, i.e. HDF5 format) or "share" (concurrent reading of the dataset). mode can also be the numeric value return by netcdf_getConstant. In the later-case it can be combined with a bitwise-or.

Example

mode =  bitor(netcdf.getConstant("classic_model"), ...
netcdf.getConstant("netcdf4")); 
ncid = netcdf.create("test.nc",mode); 

See also: netcdf_close.

3.2.5 netcdf_defDim

Loadable Function: dimid = netcdf_defDim(ncid,name,len)

Define the dimension with the name name and the length len in the dataset ncid. The id of the dimension is returned.

See also: netcdf_defVar.

3.2.6 netcdf_defGrp

Loadable Function: new_ncid = netcdf_defGrp(ncid,name)

Define a group in a NetCDF file.

See also: netcdf_inqGrps.

3.2.7 netcdf_defVar

Loadable Function: varid = netcdf_defVar(ncid,name,xtype,dimids)

Defines a variable with the name name in the dataset ncid. xtype can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf_getConstant. The parameter dimids define the ids of the dimension. For scalar this parameter is the empty array ([]). The variable id is returned.

See also: netcdf_open,netcdf_defDim.

3.2.8 netcdf_defVarChunking

Loadable Function: netcdf_defVarChunking (ncid,varid,storage,chunkSizes)

Define the chunking settings of NetCDF variable varid. If storage is the string "chunked", the variable is stored by chunk of the size chunkSizes. If storage is the string "contiguous", the variable is stored in a contiguous way.

See also: netcdf_inqVarChunking.

3.2.9 netcdf_defVarDeflate

Loadable Function: netcdf_defVarDeflate (ncid,varid,shuffle,deflate,deflate_level)

Define the compression settings NetCDF variable varid. If deflate is true, then the variable is compressed. The compression level deflate_level is an integer between 0 (no compression) and 9 (maximum compression).

See also: netcdf_inqVarDeflate.

3.2.10 netcdf_defVarFill

Loadable Function: netcdf_defVarFill(ncid,varid,no_fill,fillvalue)

Define the fill-value settings of the NetCDF variable varid. If no_fill is false, then the values between no-contiguous writes are filled with the value fill_value. This is disabled by setting no_fill to true.

See also: netcdf_inqVarFill.

3.2.11 netcdf_defVarFletcher32

Loadable Function: netcdf_defVarFletcher32(ncid,varid,checksum)

Defines the checksum settings of the variable with the id varid in the data set ncid. If checksum is the string "FLETCHER32", then fletcher32 checksums will be turned on for this variable. If checksum is "NOCHECKSUM", then checksums will be disabled.

See also: netcdf_defVar,netcdf_inqVarFletcher32.

3.2.12 netcdf_defVlen

Loadable Function: varid = netcdf_defVlen(ncid,typename,basetype)

Defines a NC_VLEN variable length array type with the type name typename and a base datatype of basetype in the dataset ncid. basetype can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf_getConstant. The new data type id is returned.

See also: netcdf_open,netcdf_defVar, netcdf_inqVlen.

3.2.13 netcdf_delAtt

Loadable Function: netcdf_delAtt(ncid,varid,name)

Deletes the attribute named name of the variable varid in the data set ncid. To delete a global attribute use netcdf_getConstant("global") for varid.

See also: netcdf_defAtt,netcdf_getConstant.

3.2.14 netcdf_endDef

Loadable Function: netcdf_endDef (ncid)

Leaves define-mode of NetCDF file ncid.

See also: netcdf_reDef.

3.2.15 netcdf_getAtt

Loadable Function: data = netcdf_getAtt (ncid,varid,name)

Get the value of a NetCDF attribute. This function returns the value of the attribute called name of the variable varid in the NetCDF file ncid. For global attributes varid can be netcdf_getConstant("global").

See also: netcdf_putAtt.

3.2.16 netcdf_getChunkCache

Loadable Function: [size, nelems, preemption] = netcdf_getChunkCache()

Gets the default chunk cache settings in the HDF5 library.

See also: netcdf_setChunkCache.

3.2.17 netcdf_getConstant

Loadable Function: value = netcdf_getConstant(name)

Returns the value of a NetCDF constant called name.

See also: netcdf_getConstantNames.

3.2.18 netcdf_getConstantNames

Loadable Function: value = netcdf_getConstantNames()

Returns a list of all constant names.

See also: netcdf_getConstant.

3.2.19 netcdf_getVar

Loadable Function: data = netcdf_getVar (ncid,varid)
Loadable Function: data = netcdf_getVar (ncid,varid,start)
Loadable Function: data = netcdf_getVar (ncid,varid,start,count)
Loadable Function: data = netcdf_getVar (ncid,varid,start,count,stride)

Get the data from a NetCDF variable. The data data is loaded from the variable varid of the NetCDF file ncid. start is the start index of each dimension (0-based and defaults to a vector of zeros), count is the number of elements of to be written along each dimension (default all elements) and stride is the sampling interval.

See also: netcdf_putVar.

3.2.20 netcdf_inq

Loadable Function: vers = netcdf_inqLibVers()

Returns the version of the NetCDF library.

See also: netcdf_open.

3.2.21 netcdf_inqAtt

Loadable Function: name = netcdf_inqAttName (ncid,varid,attnum)

Get the name of a NetCDF attribute. This function returns the name of the attribute with the id attnum of the variable varid in the NetCDF file ncid. For global attributes varid can be netcdf_getConstant("global").

See also: netcdf_inqAttName.

3.2.22 netcdf_inqAttID

Loadable Function: attnum = netcdf_inqAttID(ncid,varid,attname)

Return the attribute id attnum of the attribute named attname of the variable varid in the dataset ncid. For global attributes varid can be netcdf_getConstant("global").

See also: netcdf_inqAttName.

3.2.23 netcdf_inqAttName

Loadable Function: name = netcdf_inqAttName (ncid,varid,attnum)

Get the name of a NetCDF attribute. This function returns the name of the attribute with the id attnum of the variable varid in the NetCDF file ncid. For global attributes varid can be netcdf_getConstant("global").

See also: netcdf_inqAttName.

3.2.24 netcdf_inqDim

Loadable Function: [name,length] = netcdf_inqDim(ncid,dimid)

Returns the name and length of a NetCDF dimension.

See also: netcdf_inqDimID.

3.2.25 netcdf_inqDimID

Loadable Function: dimid = netcdf_inqDimID(ncid,dimname)

Return the id of a NetCDF dimension.

See also: netcdf_inqDim.

3.2.26 netcdf_inqDimIDs

Loadable Function: dimids = netcdf_inqDimID(ncid)
Loadable Function: dimids = netcdf_inqDimID(ncid,include_parents)

Return the dimension ids defined in a NetCDF file. If include_parents is 1, the dimension ids of the parent group are also returned. Per default this is not the case (include_parents is 0).

See also: netcdf_inqDim.

3.2.27 netcdf_inqFormat

Loadable Function: format = netcdf_inqFormat(ncid)

Return the NetCDF format of the dataset ncid. Format might be one of the following "FORMAT_CLASSIC", "FORMAT_64BIT", "FORMAT_NETCDF4" or "FORMAT_NETCDF4_CLASSIC"

See also: netcdf_inq.

3.2.28 netcdf_inqGrpFullNcid

Loadable Function: grp_ncid = netcdf_inqGrpFullNcid(ncid,name)

Return the group id based on the full group name.

See also: netcdf_inqGrpName.

3.2.29 netcdf_inqGrpName

Loadable Function: name = netcdf_inqGrpName(ncid)

Return group name in a NetCDF file.

See also: netcdf_inqGrps.

3.2.30 netcdf_inqGrpNameFull

Loadable Function: name = netcdf_inqGrpNameFull(ncid)

Return full name of group in NetCDF file.

See also: netcdf_inqGrpName.

3.2.31 netcdf_inqGrpParent

Loadable Function: parent_ncid = netcdf_inqGrpParent(ncid)

Return id of the parent group

See also: netcdf_inqGrpName.

3.2.32 netcdf_inqGrps

Loadable Function: ncids = netcdf_inqGrps(ncid)

Return all groups ids in a NetCDF file.

See also: netcdf_inqGrps.

3.2.33 netcdf_inqLibVers

Loadable Function: vers = netcdf_inqLibVers()

Returns the version of the NetCDF library.

See also: netcdf_open.

3.2.34 netcdf_inqNcid

Loadable Function: grp_ncid = netcdf_inqNcid(ncid,name)

Return group id based on its name

See also: netcdf_inqGrpFullNcid.

3.2.35 netcdf_inqUnlimDims

Loadable Function: unlimdimids = netcdf_inqUnlimDims(ncid)

Return the id of all unlimited dimensions of the NetCDF file ncid.

See also: netcdf_inq.

3.2.36 netcdf_inqUserType

Loadable Function: [typename, bytesize, basetypeid, numfields, classid] = netcdf_inqUserType(ncid,typeid)

Provide information on a user defined type typeid in the dataset ncid.

The function returns the typename, bytesize, base type id, number of fields and class identifier of the type.

See also: netcdf_open, netcdf_defVlen, netcdf_inqVlen.

3.2.37 netcdf_inqVar

Loadable Function: [no_fill,fillvalue] = netcdf_inqVarFill(ncid,varid)

Determines the fill-value settings of the NetCDF variable varid. If no_fill is false, then the values between no-contiguous writes are filled with the value fill_value. This is disabled by setting no_fill to true.

See also: netcdf_defVarFill.

3.2.38 netcdf_inqVarChunking

Loadable Function: [storage,chunkSizes] = netcdf_inqVarChunking (ncid,varid)

Determines the chunking settings of NetCDF variable varid. If storage is the string "chunked", the variable is stored by chunk of the size chunkSizes. If storage is the string "contiguous", the variable is stored in a contiguous way.

See also: netcdf_defVarChunking.

3.2.39 netcdf_inqVarDeflate

Loadable Function: [shuffle,deflate,deflate_level] = netcdf_inqVarDeflate (ncid,varid)

Determines the compression settings NetCDF variable varid. If deflate is true, then the variable is compressed. The compression level deflate_level is an integer between 0 (no compression) and 9 (maximum compression).

See also: netcdf_defVarDeflate.

3.2.40 netcdf_inqVarFill

Loadable Function: [no_fill,fillvalue] = netcdf_inqVarFill(ncid,varid)

Determines the fill-value settings of the NetCDF variable varid. If no_fill is false, then the values between no-contiguous writes are filled with the value fill_value. This is disabled by setting no_fill to true.

See also: netcdf_defVarFill.

3.2.41 netcdf_inqVarFletcher32

Loadable Function: checksum = netcdf_inqVarFletcher32(ncid,varid)

Determines the checksum settings of the variable with the id varid in the data set ncid. If fletcher32 checksums is turned on for this variable, then checksum is the string "FLETCHER32". Otherwise it is the string "NOCHECKSUM".

See also: netcdf_defVar,netcdf_inqVarFletcher32.

3.2.42 netcdf_inqVarID

Loadable Function: varid = netcdf_inqVarID (ncid,name)

Return the id of a variable based on its name.

See also: netcdf_defVar,netcdf_inqVarIDs.

3.2.43 netcdf_inqVarIDs

Loadable Function: varids = netcdf_inqVarID (ncid)

Return all variable ids. This functions returns all variable ids in a NetCDF file or NetCDF group.

See also: netcdf_inqVarID.

3.2.44 netcdf_inqVlen

Loadable Function: [typename, bytesize, basetypeid] = netcdf_inqVlen(ncid,typeid)

Provide information on a NC_VLEN variable length array type typeid in the dataset ncid.

The function returns the typename, bytesize, and base type id.

See also: netcdf_open, netcdf_defVlen.

3.2.45 netcdf_open

Loadable Function: ncid = netcdf_open(filename,mode)

Opens the file named filename in the mode mode.

See also: netcdf_close.

3.2.46 netcdf_putAtt

Loadable Function: netcdf_putAtt (ncid,varid,name,data)

Defines a NetCDF attribute. This function defines the attribute called name of the variable varid in the NetCDF file ncid. The value of the attribute will be data. For global attributes varid can be netcdf_getConstant("global").

See also: netcdf_getAtt.

3.2.47 netcdf_putVar

Loadable Function: netcdf_putVar (ncid,varid,data)
Loadable Function: netcdf_putVar (ncid,varid,start,data)
Loadable Function: netcdf_putVar (ncid,varid,start,count,data)
Loadable Function: netcdf_putVar (ncid,varid,start,count,stride,data)

Put data in a NetCDF variable. The data data is stored in the variable varid of the NetCDF file ncid. start is the start index of each dimension (0-based and defaults to a vector of zeros), count is the number of elements of to be written along each dimension (default all elements) and stride is the sampling interval.

See also: netcdf_endDef.

3.2.48 netcdf_reDef

Loadable Function: netcdf_reDef (ncid)

Enter define-mode of NetCDF file ncid.

See also: netcdf_endDef.

3.2.49 netcdf_renameAtt

Loadable Function: netcdf_renameAtt(ncid,varid,old_name,new_name)

Renames the attribute named old_name of the variable varid in the data set ncid. new_name is the new name of the attribute. To rename a global attribute use netcdf_getConstant("global") for varid.

See also: netcdf_copyAtt,netcdf_getConstant.

3.2.50 netcdf_renameDim

Loadable Function: netcdf_renameDim(ncid,dimid,name)

Renames the dimension with the id dimid in the data set ncid. name is the new name of the dimension.

See also: netcdf_defDim.

3.2.51 netcdf_renameVar

Loadable Function: netcdf_renameVar(ncid,varid,name)

Renames the variable with the id varid in the data set ncid. name is the new name of the variable.

See also: netcdf_defVar.

3.2.52 netcdf_setChunkCache

Loadable Function: netcdf_setChunkCache(size, nelems, preemption)

Sets the default chunk cache settings in the HDF5 library. The settings applies to all files which are subsequently opened or created.

See also: netcdf_getChunkCache.

3.2.53 netcdf_setDefaultFormat

Loadable Function: old_format = netcdf_setDefaultFormat(format)

Sets the default format of the NetCDF library and returns the previous default format (as a numeric value). format can be "format_classic", "format_64bit", "format_netcdf4" or "format_netcdf4_classic".

See also: netcdf_open.

3.2.54 netcdf_setFill

Loadable Function: old_mode = netcdf_setFill(ncid,fillmode)

Change the fill mode (fillmode) of the data set ncid. The previous value of the fill mode is returned. fillmode can be either "fill" or "nofill".

See also: netcdf_open.

3.2.55 netcdf_sync

Loadable Function: netcdf_sync(ncid)

Writes all changes to the disk and leaves the file open.

See also: netcdf_close.