@c ---------------------------------------------------
@node High-level functions
@section High-level functions
@cindex High-level functions
@c High-level functions nccreate
@c -----------------------------------------
@subsection nccreate
@cindex nccreate
 @deftypefn  {Function File} {} nccreate(@var{filename},@var{varname})
 @deftypefnx  {Function File} {} nccreate(@var{filename},@var{varname},"property",@var{value},...)

 Create the variable @var{varname} in the file @var{filename}.

 @subsubheading Properties
 The following properties can be used:
 @itemize
 @item "Dimensions": a cell array with the dimension names followed by their
 length or Inf if the dimension is unlimited. If the property is omitted, a
 scalar variable is created.
 @item "Datatype": a string with the Octave data type name
 (see @code{ncinfo} for the correspondence between Octave and NetCDF data
 types). The default data type is a "double".
 @item "Format": This can be "netcdf4_classic" (default), "classic", "64bit"
 or "netcdf4".
 @item "FillValue": the value used for undefined elements of the NetCDF
 variable.
 @item "ChunkSize": the size of the data chunks. If omitted, the variable is
 not chunked.
 @item "DeflateLevel": The deflate level for compression. It can be the string
 "disable" (default) for no compression or an integer between 0 (no
 compression) and 9 (maximum compression).
 @item "Shuffle": true for enabling the shuffle filter or false (default) for
 disabling it.
 @end itemize

 @subsubheading Example
 @example
 nccreate("test.nc","temp","Dimensions",@{"lon",10,"lat",20@},"Format","classic");
 ncdisp("test.nc");
 @end example
 @xseealso{ncwrite}
 @end deftypefn
@c High-level functions ncdisp
@c -----------------------------------------
@subsection ncdisp
@cindex ncdisp
 @deftypefn {Function File} {} ncdisp (@var{filename})
 Display meta-data of the NetCDF file @var{filename}

 @subsubheading Example
 @example
 ncdisp("test.nc");
 @end example
 @xseealso{ncinfo}
 @end deftypefn
@c High-level functions ncinfo
@c -----------------------------------------
@subsection ncinfo
@cindex ncinfo
 @deftypefn  {Function File} {@var{info} =} ncinfo (@var{filename})
 @deftypefnx  {Function File} {@var{info} =} ncinfo (@var{filename}, @var{varname})
 @deftypefnx  {Function File} {@var{info} =} ncinfo (@var{filename}, @var{groupname})
 Return information about an entire NetCDF file @var{filename} (i.e. the root
 group "/"), about the variable called @var{varname} or the group called
 @var{groupname}.

 The structure @var{info} has always the following fields:
 @itemize
 @item @var{Filename}: the name of the NetCDF file
 @item @var{Format}: one of the strings "CLASSIC", "64BIT", "NETCDF4"
 or "NETCDF4_CLASSIC"
 @end itemize

 The structure @var{info} has additional fields depending on whether a
 group of variable is queried.

 @subsubheading Groups

 Groups are returned as an array structure with the following fields:

 @itemize
 @item @var{Name}: the group name. The root group is named "/".
 @item @var{Dimensions}: a array structure with the dimensions.
 @item @var{Variables}: a array structure with the variables.
 @item @var{Attributes}: a array structure with global attributes.
 @item @var{Groups}: a array structure (one for each group) with the
 same fields as this structure.
 @end itemize

 @subsubheading Dimensions

 Dimensions are returned as an array structure with the following fields:
 @itemize
   @item @var{Name}: the name of the dimension
   @item @var{Length}: the length of the dimension
   @item @var{Unlimited}: true of the dimension has no fixed limited, false
 @end itemize

 @subsubheading Variables

 Variables are returned as an array structure with the following fields:
 @itemize
   @item @var{Name}: the name of the dimension
   @item @var{Dimensions}: array structure of all dimensions of this variable
 with the same structure as above.
   @item @var{Size}: array with the size of the variable
   @item @var{Datatype}: string with the corresponding octave data-type
 (see below)
   @item @var{Attributes}: a array structure of attributes
   @item @var{FillValue}: the NetCDF fill value of the variable. If the fill
 value is not defined, then this attribute is an empty array ([]).
   @item @var{DeflateLevel}: the NetCDF deflate level between 0 (no
   compression) and 9 (maximum compression).
   @item @var{Shuffle}: is true if the shuffle filter is activated to improve
   compression, otherwise false.
   @item @var{CheckSum}: is set to "fletcher32", if check-sums are used,
    otherwise this field is not defined.
 @end itemize

 @subsubheading Attributes

 Attributes are returned as an array structure with the following fields:
 @itemize
   @item @var{Name}: the name of the attribute
   @item @var{Value}: the value of the attribute (with the corresponding type)
   @item @var{Unlimited}: true of the dimension has no fixed limited, false
 @end itemize

 @subsubheading Data-types

 The following the the correspondence between the Octave and NetCDF
 data-types:

 @multitable @columnfractions .5 .5
 @headitem Octave type @tab NetCDF type
 @item @code{int8}    @tab @code{NC_BYTE}
 @item @code{uint8}   @tab @code{NC_UBYTE}
 @item @code{int16}   @tab @code{NC_SHORT}
 @item @code{uint16}  @tab @code{NC_USHORT}
 @item @code{int32}   @tab @code{NC_INT}
 @item @code{uint32}  @tab @code{NC_UINT}
 @item @code{int64}   @tab @code{NC_INT64}
 @item @code{uint64}  @tab @code{NC_UINT64}
 @item @code{single}  @tab @code{NC_FLOAT}
 @item @code{double}  @tab @code{NC_DOUBLE}
 @item @code{char}    @tab @code{NC_CHAR}
 @end multitable

 The output of @code{ncinfo} can be used to create a NetCDF file with the same
 meta-data using @code{ncwriteschema}.

 Note: If there are no attributes (or variable or groups), the corresponding
 field is an empty matrix and not an empty struct array for compatibility
 with matlab.

 @xseealso{ncread,nccreate,ncwriteschema,ncdisp}

 @end deftypefn
@c High-level functions ncread
@c -----------------------------------------
@subsection ncread
@cindex ncread
 @deftypefn  {Function File} {@var{x} =} ncread (@var{filename}, @var{varname})
 @deftypefnx  {Function File} {@var{x} =} ncread (@var{filename}, @var{varname},@var{start},@var{count},@var{stride})

 Read the variable @var{varname} from the NetCDF file @var{filename}.

 If @var{start},@var{count} and @var{stride} are present, a subset of the
 variable is loaded. The parameter @var{start} contains the starting indices
 (1-based), @var{count} is the number of elements and @var{stride} the
 increment between two successive elements. These parameters are vectors whose
 length is equal to the number of dimension of the variable. Elements of
 @var{count} might be Inf which means that as many values as possible are
 loaded.

 If the variable has the _FillValue attribute, then the corresponding values
 are replaced by NaN (except for characters). NetCDF attributes scale_factor
 (default 1) and add_offset (default 0) are use the transform the variable
 during the loading:

 x = scale_factor * x_in_file + add_offset

 The output data type matches the NetCDF datatype, except when the attributes
 _FillValue, add_offset or scale_factor are defined in which case the output
 is a array in double precision.

 Note that values equal to the attribute missing_value are not replaced by
 NaN (for compatibility).

 @subsubheading Example
 Read the data from variable 'mydata' in the file test.nc.
 @example
 data  = ncread('test.nc','mydata');
 @end example

 @xseealso{ncwrite,ncinfo,ncdisp}

 @end deftypefn
@c High-level functions ncreadatt
@c -----------------------------------------
@subsection ncreadatt
@cindex ncreadatt
 @deftypefn  {Function File} {@var{val} =} ncreadatt(@var{filename},@var{varname},@var{attname})

 Return the attribute @var{attname} of the variable @var{varname} in the file
 @var{filename}.

 Global attributes can be accessed by using "/" or the group name as
 @var{varname}. The type of attribute is mapped to the Octave data types.
 (see @code{ncinfo}).

 @subsubheading Example
 Read global attribute 'creation_date'
 @example
 d = ncreadatt('test.nc','/','creation_date')
 @end example
 Read atribute 'myattr' assigned to variable mydata.
 @example
 d = ncreadattr('test.nc', 'mydata', 'myattr');
 @end example
 @xseealso{ncinfo,ncwriteatt}
 @end deftypefn
@c High-level functions ncwrite
@c -----------------------------------------
@subsection ncwrite
@cindex ncwrite
 @deftypefn  {Function File} {} ncwrite (@var{filename}, @var{varname}, @var{x})
 @deftypefnx  {Function File} {} ncwrite (@var{filename}, @var{varname}, @var{x}, @var{start}, @var{stride})

 Write array @var{x} to the the variable @var{varname} in the NetCDF file
 @var{filename}.

 The variable with the name @var{varname} and the appropriate dimension must
 already exist in the NetCDF file.

 If @var{start} and @var{stride} are present, a subset of the
 variable is written. The parameter @var{start} contains the starting indices
 (1-based) and @var{stride} the
 increment between two successive elements. These parameters are vectors whose
 length is equal to the number of dimension of the variable.

 If the variable has the _FillValue attribute, then the values equal to NaN
 are replaced by corresponding fill value NetCDF attributes scale_factor
 (default 1) and add_oddset (default 0) are use the transform the variable
 during writing:

 x_in_file = (x - add_offset)/scale_factor

 @subsubheading Example
 Create a netcdf file with a variable of 'mydata' and then write
 data to that variable.
 @example
 nccreate('myfile.nc','mydata');
 ncwrite('myfile.nc','mydata', 101);
 @end example

 @xseealso{ncread,nccreate}

 @end deftypefn
@c High-level functions ncwriteatt
@c -----------------------------------------
@subsection ncwriteatt
@cindex ncwriteatt
 @deftypefn  {Function File} {} ncwriteatt(@var{filename},@var{varname},@var{attname},@var{val})

 Defines the attribute @var{attname} of the variable @var{varname} in the file
 @var{filename} with the value @var{val}.

 Global attributes can be defined by using "/" or the group name as
 @var{varname}. The type of value is mapped to the NetCDF data types.
 (see @code{ncinfo}).

 @subsubheading Example
 Create a netcdf4 format file with a variable mydata and assign an attribute "units" to it.
 @example
 nccreate("myfile.nc", "mydata", "Format", "netcdf4");
 ncwriteatt("myfile.nc", "mydata", "Units", "K");
 @end example

 @xseealso{ncinfo}
 @end deftypefn
@c High-level functions ncwriteschema
@c -----------------------------------------
@subsection ncwriteschema
@cindex ncwriteschema
 @deftypefn  {Function File} {} ncwriteschema (@var{filename}, @var{schema})

 Create a NetCDF called @var{filename} with the dimensions, attributes,
 variables and groups given by the structure @var{schema}.

 The variable @var{schema} has the same structure as the results of
 @code{ncinfo}. @code{ncinfo} and @code{ncwriteschema} can be used together to
 create a NetCDF using another file as a template:

 @subsubheading Example
 @example
 schema = ncinfo("template.nc");
 # the new file should be named "new_file.nc"
 ncwriteschema("new_file.nc",schema);
 @end example

 Unused field in @var{schema} such as @var{ChunkSize}, @var{Shuffle},
 @var{DeflateLevel}, @var{FillValue}, @var{Checksum} can be left-out if the
 corresponding feature is not used.

 Dimensions are considered as limited if the field @var{Unlimited} is missing,
 unless the dimension length is Inf.

 @xseealso{ncinfo}

 @end deftypefn
@c ---------------------------------------------------
@node Low-level functions
@section Low-level functions
@cindex Low-level functions
@c Low-level functions netcdf_abort
@c -----------------------------------------
@subsection netcdf_abort
@cindex netcdf_abort
@deftypefn {Loadable Function} {} netcdf_abort(@var{ncid}) 
Aborts all changes since the last time the dataset entered in define mode.
@end deftypefn
@xseealso{netcdf_reDef}

@c Low-level functions netcdf_close
@c -----------------------------------------
@subsection netcdf_close
@cindex netcdf_close
@deftypefn {Loadable Function} {} netcdf_close(@var{ncid}) 
Close the NetCDF file with the id @var{ncid}.
@end deftypefn
@xseealso{netcdf_open}

@c Low-level functions netcdf_copyAtt
@c -----------------------------------------
@subsection netcdf_copyAtt
@cindex netcdf_copyAtt
@deftypefn {Loadable Function} {} netcdf_copyAtt (@var{ncid},@var{varid},@var{name},@var{ncid_out},@var{varid_out}) 
Copies the attribute named @var{old_name} of the variable @var{varid} in the data set @var{ncid} 
to the variable @var{varid_out} in the data set @var{ncid_out}. 
To copy a global attribute use netcdf_getConstant("global") for @var{varid} or @var{varid_out}.
@xseealso{netcdf_getAtt,netcdf_getConstant}
@end deftypefn
@c Low-level functions netcdf_create
@c -----------------------------------------
@subsection netcdf_create
@cindex netcdf_create
@deftypefn {Loadable Function} {@var{ncid} =} netcdf_create(@var{filename},@var{mode}) 
Creates the file named @var{filename} in the mode @var{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). 
@var{mode} can also be the numeric value return by netcdf_getConstant. In the later-case it can be combined with a bitwise-or. 
@end deftypefn
@subsubheading Example
@example 
mode =  bitor(netcdf.getConstant("classic_model"), ...
netcdf.getConstant("netcdf4")); 
ncid = netcdf.create("test.nc",mode); 
@end example 
@xseealso{netcdf_close}

@c Low-level functions netcdf_defDim
@c -----------------------------------------
@subsection netcdf_defDim
@cindex netcdf_defDim
@deftypefn {Loadable Function} {@var{dimid} =} netcdf_defDim(@var{ncid},@var{name},@var{len}) 
Define the dimension with the name @var{name} and the length @var{len} in the dataset @var{ncid}. The id of the dimension is returned.
@end deftypefn
@xseealso{netcdf_defVar}

@c Low-level functions netcdf_defGrp
@c -----------------------------------------
@subsection netcdf_defGrp
@cindex netcdf_defGrp
@deftypefn {Loadable Function} {@var{new_ncid} =} netcdf_defGrp(@var{ncid},@var{name}) 
Define a group in a NetCDF file.
@xseealso{netcdf_inqGrps}
@end deftypefn
@c Low-level functions netcdf_defVar
@c -----------------------------------------
@subsection netcdf_defVar
@cindex netcdf_defVar
@deftypefn {Loadable Function} {@var{varid} = } netcdf_defVar(@var{ncid},@var{name},@var{xtype},@var{dimids}) 
Defines a variable with the name @var{name} in the dataset @var{ncid}. @var{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 @var{dimids} define the ids of the dimension. For scalar this parameter is the empty array ([]). The variable id is returned. 
@end deftypefn
@xseealso{netcdf_open,netcdf_defDim}

@c Low-level functions netcdf_defVarChunking
@c -----------------------------------------
@subsection netcdf_defVarChunking
@cindex netcdf_defVarChunking
@deftypefn {Loadable Function} {} netcdf_defVarChunking (@var{ncid},@var{varid},@var{storage},@var{chunkSizes}) 
Define the chunking settings of NetCDF variable @var{varid}.
If @var{storage} is the string "chunked", the variable is stored by chunk of the size @var{chunkSizes}.
If @var{storage} is the string "contiguous", the variable is stored in a contiguous way.
@end deftypefn
@xseealso{netcdf_inqVarChunking}

@c Low-level functions netcdf_defVarDeflate
@c -----------------------------------------
@subsection netcdf_defVarDeflate
@cindex netcdf_defVarDeflate
@deftypefn {Loadable Function} {} netcdf_defVarDeflate (@var{ncid},@var{varid},@var{shuffle},@var{deflate},@var{deflate_level}) 
Define the compression settings NetCDF variable @var{varid}.
If @var{deflate} is true, then the variable is compressed. The compression level @var{deflate_level} is an integer between 0 (no compression) and 9 (maximum compression).
@end deftypefn
@xseealso{netcdf_inqVarDeflate}

@c Low-level functions netcdf_defVarFill
@c -----------------------------------------
@subsection netcdf_defVarFill
@cindex netcdf_defVarFill
@deftypefn {Loadable Function} {} netcdf_defVarFill(@var{ncid},@var{varid},@var{no_fill},@var{fillvalue}) 
Define the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@xseealso{netcdf_inqVarFill}

@c Low-level functions netcdf_defVarFletcher32
@c -----------------------------------------
@subsection netcdf_defVarFletcher32
@cindex netcdf_defVarFletcher32
@deftypefn {Loadable Function} {} netcdf_defVarFletcher32(@var{ncid},@var{varid},@var{checksum}) 
Defines the checksum settings of the variable with the id @var{varid} in the data set @var{ncid}. If @var{checksum} is the string "FLETCHER32", then fletcher32 checksums will be turned on for this variable. If @var{checksum} is "NOCHECKSUM", then checksums will be disabled. 
@end deftypefn
@xseealso{netcdf_defVar,netcdf_inqVarFletcher32}

@c Low-level functions netcdf_defVlen
@c -----------------------------------------
@subsection netcdf_defVlen
@cindex netcdf_defVlen
@deftypefn {Loadable Function} {@var{varid} = } netcdf_defVlen(@var{ncid},@var{typename},@var{basetype}) 
Defines a NC_VLEN variable length array type with the type name @var{typename} and a base datatype of @var{basetype} in the dataset @var{ncid}. @var{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. 
@end deftypefn
@xseealso{netcdf_open,netcdf_defVar, netcdf_inqVlen}

@c Low-level functions netcdf_delAtt
@c -----------------------------------------
@subsection netcdf_delAtt
@cindex netcdf_delAtt
@deftypefn {Loadable Function} {} netcdf_delAtt(@var{ncid},@var{varid},@var{name}) 
Deletes the attribute named @var{name} of the variable @var{varid} in the data set @var{ncid}. 
To delete a global attribute use netcdf_getConstant("global") for @var{varid}.
@xseealso{netcdf_defAtt,netcdf_getConstant}
@end deftypefn
@c Low-level functions netcdf_endDef
@c -----------------------------------------
@subsection netcdf_endDef
@cindex netcdf_endDef
@deftypefn {Loadable Function} {} netcdf_endDef (@var{ncid}) 
Leaves define-mode of NetCDF file @var{ncid}.
@end deftypefn
@xseealso{netcdf_reDef}

@c Low-level functions netcdf_getAtt
@c -----------------------------------------
@subsection netcdf_getAtt
@cindex netcdf_getAtt
@deftypefn  {Loadable Function} {@var{data} =} netcdf_getAtt (@var{ncid},@var{varid},@var{name}) 
Get the value of a NetCDF attribute.
This function returns the value of the attribute called @var{name} of the variable 
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be 
netcdf_getConstant("global").
@xseealso{netcdf_putAtt}
@end deftypefn
@c Low-level functions netcdf_getChunkCache
@c -----------------------------------------
@subsection netcdf_getChunkCache
@cindex netcdf_getChunkCache
@deftypefn {Loadable Function} {[@var{size}, @var{nelems}, @var{preemption}] =} netcdf_getChunkCache() 
Gets the default chunk cache settings in the HDF5 library. 
@end deftypefn
@xseealso{netcdf_setChunkCache}

@c Low-level functions netcdf_getConstant
@c -----------------------------------------
@subsection netcdf_getConstant
@cindex netcdf_getConstant
@deftypefn {Loadable Function} {@var{value} =} netcdf_getConstant(@var{name}) 
Returns the value of a NetCDF constant called @var{name}.
@xseealso{netcdf_getConstantNames}
@end deftypefn
@c Low-level functions netcdf_getConstantNames
@c -----------------------------------------
@subsection netcdf_getConstantNames
@cindex netcdf_getConstantNames
@deftypefn {Loadable Function} {@var{value} =} netcdf_getConstantNames() 
Returns a list of all constant names.
@end deftypefn
@xseealso{netcdf_getConstant}

@c Low-level functions netcdf_getVar
@c -----------------------------------------
@subsection netcdf_getVar
@cindex netcdf_getVar
@deftypefn  {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid}) 
@deftypefnx {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid},@var{start}) 
@deftypefnx {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid},@var{start},@var{count}) 
@deftypefnx {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid},@var{start},@var{count},@var{stride}) 
Get the data from a NetCDF variable.
The data @var{data} is loaded from the variable @var{varid} of the NetCDF file @var{ncid}. 
@var{start} is the start index of each dimension (0-based and defaults to a vector of zeros), 
@var{count} is the number of elements of to be written along each dimension (default all elements)
and @var{stride} is the sampling interval.
@end deftypefn
@xseealso{netcdf_putVar}

@c Low-level functions netcdf_inq
@c -----------------------------------------
@subsection netcdf_inq
@cindex netcdf_inq
@deftypefn {Loadable Function} {@var{vers} =} netcdf_inqLibVers() 
Returns the version of the NetCDF library.
@end deftypefn
@xseealso{netcdf_open}

@c Low-level functions netcdf_inqAtt
@c -----------------------------------------
@subsection netcdf_inqAtt
@cindex netcdf_inqAtt
@deftypefn  {Loadable Function} {@var{name} =} netcdf_inqAttName (@var{ncid},@var{varid},@var{attnum}) 
Get the name of a NetCDF attribute.
This function returns the name of the attribute with the id @var{attnum} of the variable 
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be 
netcdf_getConstant("global").
@xseealso{netcdf_inqAttName}
@end deftypefn
@c Low-level functions netcdf_inqAttID
@c -----------------------------------------
@subsection netcdf_inqAttID
@cindex netcdf_inqAttID
@deftypefn {Loadable Function} {@var{attnum} =} netcdf_inqAttID(@var{ncid},@var{varid},@var{attname}) 
Return the attribute id @var{attnum} of the attribute named @var{attname} of the variable @var{varid} in the dataset @var{ncid}. 
For global attributes @var{varid} can be 
netcdf_getConstant("global").
@xseealso{netcdf_inqAttName}
@end deftypefn
@c Low-level functions netcdf_inqAttName
@c -----------------------------------------
@subsection netcdf_inqAttName
@cindex netcdf_inqAttName
@deftypefn  {Loadable Function} {@var{name} =} netcdf_inqAttName (@var{ncid},@var{varid},@var{attnum}) 
Get the name of a NetCDF attribute.
This function returns the name of the attribute with the id @var{attnum} of the variable 
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be 
netcdf_getConstant("global").
@xseealso{netcdf_inqAttName}
@end deftypefn
@c Low-level functions netcdf_inqDim
@c -----------------------------------------
@subsection netcdf_inqDim
@cindex netcdf_inqDim
@deftypefn {Loadable Function} {[@var{name},@var{length}] =} netcdf_inqDim(@var{ncid},@var{dimid}) 
Returns the name and length of a NetCDF dimension.
@xseealso{netcdf_inqDimID}
@end deftypefn
@c Low-level functions netcdf_inqDimID
@c -----------------------------------------
@subsection netcdf_inqDimID
@cindex netcdf_inqDimID
@deftypefn {Loadable Function} {@var{dimid} =} netcdf_inqDimID(@var{ncid},@var{dimname}) 
Return the id of a NetCDF dimension.
@xseealso{netcdf_inqDim}
@end deftypefn
@c Low-level functions netcdf_inqDimIDs
@c -----------------------------------------
@subsection netcdf_inqDimIDs
@cindex netcdf_inqDimIDs
@deftypefn {Loadable Function} {@var{dimids} =} netcdf_inqDimID(@var{ncid}) 
@deftypefnx {Loadable Function} {@var{dimids} =} netcdf_inqDimID(@var{ncid},@var{include_parents}) 
Return the dimension ids defined in a NetCDF file.
If @var{include_parents} is 1, the dimension ids of the parent group are also returned.
Per default this is not the case (@var{include_parents} is 0).
@xseealso{netcdf_inqDim}
@end deftypefn
@c Low-level functions netcdf_inqFormat
@c -----------------------------------------
@subsection netcdf_inqFormat
@cindex netcdf_inqFormat
@deftypefn {Loadable Function} {@var{format} =} netcdf_inqFormat(@var{ncid}) 
Return the NetCDF format of the dataset @var{ncid}.
Format might be one of the following 
"FORMAT_CLASSIC", "FORMAT_64BIT", "FORMAT_NETCDF4" or "FORMAT_NETCDF4_CLASSIC" 
@end deftypefn
@xseealso{netcdf_inq}

@c Low-level functions netcdf_inqGrpFullNcid
@c -----------------------------------------
@subsection netcdf_inqGrpFullNcid
@cindex netcdf_inqGrpFullNcid
@deftypefn {Loadable Function} {@var{grp_ncid} =} netcdf_inqGrpFullNcid(@var{ncid},@var{name}) 
Return the group id based on the full group name.
@xseealso{netcdf_inqGrpName}
@end deftypefn
@c Low-level functions netcdf_inqGrpName
@c -----------------------------------------
@subsection netcdf_inqGrpName
@cindex netcdf_inqGrpName
@deftypefn {Loadable Function} {@var{name} =} netcdf_inqGrpName(@var{ncid}) 
Return group name in a NetCDF file.
@xseealso{netcdf_inqGrps}
@end deftypefn
@c Low-level functions netcdf_inqGrpNameFull
@c -----------------------------------------
@subsection netcdf_inqGrpNameFull
@cindex netcdf_inqGrpNameFull
@deftypefn {Loadable Function} {@var{name} =} netcdf_inqGrpNameFull(@var{ncid}) 
Return full name of group in NetCDF file.
@xseealso{netcdf_inqGrpName}
@end deftypefn
@c Low-level functions netcdf_inqGrpParent
@c -----------------------------------------
@subsection netcdf_inqGrpParent
@cindex netcdf_inqGrpParent
@deftypefn {Loadable Function} {@var{parent_ncid} =} netcdf_inqGrpParent(@var{ncid}) 
Return id of the parent group
@xseealso{netcdf_inqGrpName}
@end deftypefn
@c Low-level functions netcdf_inqGrps
@c -----------------------------------------
@subsection netcdf_inqGrps
@cindex netcdf_inqGrps
@deftypefn {Loadable Function} {@var{ncids} =} netcdf_inqGrps(@var{ncid}) 
Return all groups ids in a NetCDF file.
@xseealso{netcdf_inqGrps}
@end deftypefn
@c Low-level functions netcdf_inqLibVers
@c -----------------------------------------
@subsection netcdf_inqLibVers
@cindex netcdf_inqLibVers
@deftypefn {Loadable Function} {@var{vers} =} netcdf_inqLibVers() 
Returns the version of the NetCDF library.
@end deftypefn
@xseealso{netcdf_open}

@c Low-level functions netcdf_inqNcid
@c -----------------------------------------
@subsection netcdf_inqNcid
@cindex netcdf_inqNcid
@deftypefn {Loadable Function} {@var{grp_ncid} =} netcdf_inqNcid(@var{ncid},@var{name}) 
Return group id based on its name
@xseealso{netcdf_inqGrpFullNcid}
@end deftypefn
@c Low-level functions netcdf_inqUnlimDims
@c -----------------------------------------
@subsection netcdf_inqUnlimDims
@cindex netcdf_inqUnlimDims
@deftypefn {Loadable Function} {@var{unlimdimids} =} netcdf_inqUnlimDims(@var{ncid}) 
Return the id of all unlimited dimensions of the NetCDF file @var{ncid}.
@end deftypefn
@xseealso{netcdf_inq}

@c Low-level functions netcdf_inqUserType
@c -----------------------------------------
@subsection netcdf_inqUserType
@cindex netcdf_inqUserType
@deftypefn {Loadable Function} {[@var{typename}, @var{bytesize}, @var{basetypeid}, @var{numfields}, @var{classid}] = } netcdf_inqUserType(@var{ncid},@var{typeid}) 
Provide information on a user defined type @var{typeid} in the dataset @var{ncid}.

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

@end deftypefn
@xseealso{netcdf_open, netcdf_defVlen, netcdf_inqVlen}

@c Low-level functions netcdf_inqVar
@c -----------------------------------------
@subsection netcdf_inqVar
@cindex netcdf_inqVar
@deftypefn {Loadable Function} {[@var{no_fill},@var{fillvalue}] = } netcdf_inqVarFill(@var{ncid},@var{varid}) 
Determines the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@xseealso{netcdf_defVarFill}

@c Low-level functions netcdf_inqVarChunking
@c -----------------------------------------
@subsection netcdf_inqVarChunking
@cindex netcdf_inqVarChunking
@deftypefn {Loadable Function} {[@var{storage},@var{chunkSizes}] = } netcdf_inqVarChunking (@var{ncid},@var{varid}) 
Determines the chunking settings of NetCDF variable @var{varid}.
If @var{storage} is the string "chunked", the variable is stored by chunk of the size @var{chunkSizes}.
If @var{storage} is the string "contiguous", the variable is stored in a contiguous way.
@end deftypefn
@xseealso{netcdf_defVarChunking}

@c Low-level functions netcdf_inqVarDeflate
@c -----------------------------------------
@subsection netcdf_inqVarDeflate
@cindex netcdf_inqVarDeflate
@deftypefn {Loadable Function} {[@var{shuffle},@var{deflate},@var{deflate_level}] = } netcdf_inqVarDeflate (@var{ncid},@var{varid}) 
Determines the compression settings NetCDF variable @var{varid}.
If @var{deflate} is true, then the variable is compressed. The compression level @var{deflate_level} is an integer between 0 (no compression) and 9 (maximum compression).
@end deftypefn
@xseealso{netcdf_defVarDeflate}

@c Low-level functions netcdf_inqVarFill
@c -----------------------------------------
@subsection netcdf_inqVarFill
@cindex netcdf_inqVarFill
@deftypefn {Loadable Function} {[@var{no_fill},@var{fillvalue}] = } netcdf_inqVarFill(@var{ncid},@var{varid}) 
Determines the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@xseealso{netcdf_defVarFill}

@c Low-level functions netcdf_inqVarFletcher32
@c -----------------------------------------
@subsection netcdf_inqVarFletcher32
@cindex netcdf_inqVarFletcher32
@deftypefn {Loadable Function} {@var{checksum} =} netcdf_inqVarFletcher32(@var{ncid},@var{varid}) 
Determines the checksum settings of the variable with the id @var{varid} in the data set @var{ncid}. If fletcher32 checksums is turned on for this variable, then @var{checksum} is the string "FLETCHER32". Otherwise it is the string "NOCHECKSUM". 
@end deftypefn
@xseealso{netcdf_defVar,netcdf_inqVarFletcher32}

@c Low-level functions netcdf_inqVarID
@c -----------------------------------------
@subsection netcdf_inqVarID
@cindex netcdf_inqVarID
@deftypefn {Loadable Function} {@var{varid} = } netcdf_inqVarID (@var{ncid},@var{name}) 
Return the id of a variable based on its name.
@xseealso{netcdf_defVar,netcdf_inqVarIDs}
@end deftypefn
@c Low-level functions netcdf_inqVarIDs
@c -----------------------------------------
@subsection netcdf_inqVarIDs
@cindex netcdf_inqVarIDs
@deftypefn {Loadable Function} {@var{varids} = } netcdf_inqVarID (@var{ncid}) 
Return all variable ids.
This functions returns all variable ids in a NetCDF file or NetCDF group.
@xseealso{netcdf_inqVarID}
@end deftypefn
@c Low-level functions netcdf_inqVlen
@c -----------------------------------------
@subsection netcdf_inqVlen
@cindex netcdf_inqVlen
@deftypefn {Loadable Function} {[@var{typename}, @var{bytesize}, @var{basetypeid}] = } netcdf_inqVlen(@var{ncid},@var{typeid}) 
Provide information on a NC_VLEN variable length array type @var{typeid} in the dataset @var{ncid}.

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

@end deftypefn
@xseealso{netcdf_open, netcdf_defVlen}

@c Low-level functions netcdf_open
@c -----------------------------------------
@subsection netcdf_open
@cindex netcdf_open
@deftypefn {Loadable Function} {@var{ncid} =} netcdf_open(@var{filename},@var{mode}) 
Opens the file named @var{filename} in the mode @var{mode}.
@end deftypefn
@xseealso{netcdf_close}

@c Low-level functions netcdf_putAtt
@c -----------------------------------------
@subsection netcdf_putAtt
@cindex netcdf_putAtt
@deftypefn  {Loadable Function} {} netcdf_putAtt (@var{ncid},@var{varid},@var{name},@var{data}) 
Defines a NetCDF attribute.
This function defines the attribute called @var{name} of the variable 
@var{varid} in the NetCDF file @var{ncid}. The value of the attribute will be @var{data}. 
For global attributes @var{varid} can be 
netcdf_getConstant("global").
@xseealso{netcdf_getAtt}
@end deftypefn
@c Low-level functions netcdf_putVar
@c -----------------------------------------
@subsection netcdf_putVar
@cindex netcdf_putVar
@deftypefn  {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{data}) 
@deftypefnx {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{start},@var{data}) 
@deftypefnx {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{start},@var{count},@var{data}) 
@deftypefnx {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{start},@var{count},@var{stride},@var{data}) 
Put data in a NetCDF variable.
The data @var{data} is stored in the variable @var{varid} of the NetCDF file @var{ncid}. 
@var{start} is the start index of each dimension (0-based and defaults to a vector of zeros), 
@var{count} is the number of elements of to be written along each dimension (default all elements)
and @var{stride} is the sampling interval.
@end deftypefn
@xseealso{netcdf_endDef}

@c Low-level functions netcdf_reDef
@c -----------------------------------------
@subsection netcdf_reDef
@cindex netcdf_reDef
@deftypefn {Loadable Function} {} netcdf_reDef (@var{ncid}) 
Enter define-mode of NetCDF file @var{ncid}.
@end deftypefn
@xseealso{netcdf_endDef}

@c Low-level functions netcdf_renameAtt
@c -----------------------------------------
@subsection netcdf_renameAtt
@cindex netcdf_renameAtt
@deftypefn {Loadable Function} {} netcdf_renameAtt(@var{ncid},@var{varid},@var{old_name},@var{new_name}) 
Renames the attribute named @var{old_name} of the variable @var{varid} in the data set @var{ncid}. @var{new_name} is the new name of the attribute.
To rename a global attribute use netcdf_getConstant("global") for @var{varid}.
@xseealso{netcdf_copyAtt,netcdf_getConstant}
@end deftypefn
@c Low-level functions netcdf_renameDim
@c -----------------------------------------
@subsection netcdf_renameDim
@cindex netcdf_renameDim
@deftypefn {Loadable Function} {} netcdf_renameDim(@var{ncid},@var{dimid},@var{name}) 
Renames the dimension with the id @var{dimid} in the data set @var{ncid}. @var{name} is the new name of the dimension.
@end deftypefn
@xseealso{netcdf_defDim}

@c Low-level functions netcdf_renameVar
@c -----------------------------------------
@subsection netcdf_renameVar
@cindex netcdf_renameVar
@deftypefn {Loadable Function} {} netcdf_renameVar(@var{ncid},@var{varid},@var{name}) 
Renames the variable with the id @var{varid} in the data set @var{ncid}. @var{name} is the new name of the variable.
@end deftypefn
@xseealso{netcdf_defVar}

@c Low-level functions netcdf_setChunkCache
@c -----------------------------------------
@subsection netcdf_setChunkCache
@cindex netcdf_setChunkCache
@deftypefn {Loadable Function} {} netcdf_setChunkCache(@var{size}, @var{nelems}, @var{preemption}) 
Sets the default chunk cache settings in the HDF5 library. The settings applies to all files which are subsequently opened or created.
@end deftypefn
@xseealso{netcdf_getChunkCache}

@c Low-level functions netcdf_setDefaultFormat
@c -----------------------------------------
@subsection netcdf_setDefaultFormat
@cindex netcdf_setDefaultFormat
@deftypefn {Loadable Function} {@var{old_format} =} netcdf_setDefaultFormat(@var{format}) 
Sets the default format of the NetCDF library and returns the previous default format (as a numeric value). @var{format} can be 
"format_classic", "format_64bit",  "format_netcdf4" or "format_netcdf4_classic". 
@end deftypefn
@xseealso{netcdf_open}

@c Low-level functions netcdf_setFill
@c -----------------------------------------
@subsection netcdf_setFill
@cindex netcdf_setFill
@deftypefn {Loadable Function} {@var{old_mode} =} netcdf_setFill(@var{ncid},@var{fillmode}) 
Change the fill mode (@var{fillmode}) of the data set @var{ncid}. The previous value of the fill mode is returned. @var{fillmode} can be either "fill" or "nofill".
@end deftypefn
@xseealso{netcdf_open}

@c Low-level functions netcdf_sync
@c -----------------------------------------
@subsection netcdf_sync
@cindex netcdf_sync
@deftypefn {Loadable Function} {} netcdf_sync(@var{ncid}) 
Writes all changes to the disk and leaves the file open.
@end deftypefn
@xseealso{netcdf_close}

@c ---------------------------------------------------
@node Import functions
@section Import functions
@cindex Import functions
@c Import functions import_netcdf
@c -----------------------------------------
@subsection import_netcdf
@cindex import_netcdf
 @deftypefn {} {} import_fits
 Import the low level netcdf functions into a netcdf.xxxxx variable, to emulate importing the netcdf namespace.
 @end deftypefn
@c ---------------------------------------------------
@node Test function
@section Test function
@cindex Test function
@c Test function test_netcdf
@c -----------------------------------------
@subsection test_netcdf
@cindex test_netcdf
 @deftypefn {} {} test_netcdf
 Function to do a basic test of the netcdf interface
 @end deftypefn
