NetCDF  4.8.1
dattget.c File Reference
#include "ncdispatch.h"

Go to the source code of this file.

Functions

Getting Attributes

Functions to get the values of attributes.

For classic format files, the netCDF library reads all attributes into memory when the file is opened with nc_open().

For netCDF-4/HDF5 files, since version 4.7.2, attributes are not read on file open. Instead, when the first read of a variable attribute is done, all attributes for that variable are read. Subsequent access to other attributes of that variable will not incur a disk read. Similarly, when the first NC_GLOBAL attribute is read in a group, all NC_GLOBAL attributes for that group will be read.

Note
All elements attribute data array are returned, so you must allocate enough space to hold them. If you don't know how much space to reserve, call nc_inq_attlen() first to find out the length of the attribute.
int nc_get_att (int ncid, int varid, const char *name, void *value)
 
int nc_get_att_double (int ncid, int varid, const char *name, double *value)
 
int nc_get_att_float (int ncid, int varid, const char *name, float *value)
 
int nc_get_att_int (int ncid, int varid, const char *name, int *value)
 
int nc_get_att_long (int ncid, int varid, const char *name, long *value)
 
int nc_get_att_longlong (int ncid, int varid, const char *name, long long *value)
 
int nc_get_att_schar (int ncid, int varid, const char *name, signed char *value)
 
int nc_get_att_short (int ncid, int varid, const char *name, short *value)
 
int nc_get_att_string (int ncid, int varid, const char *name, char **value)
 
int nc_get_att_text (int ncid, int varid, const char *name, char *value)
 
int nc_get_att_ubyte (int ncid, int varid, const char *name, unsigned char *value)
 
int nc_get_att_uchar (int ncid, int varid, const char *name, unsigned char *value)
 
int nc_get_att_uint (int ncid, int varid, const char *name, unsigned int *value)
 
int nc_get_att_ulonglong (int ncid, int varid, const char *name, unsigned long long *value)
 
int nc_get_att_ushort (int ncid, int varid, const char *name, unsigned short *value)
 

Detailed Description

Attribute functions

These functions in this file read attributes.

Definition in file dattget.c.