Reading in Array Mode
Function Syntax
- Read data in array mode.
nc_get_vara(int ncid, int varid, const size_t* startp, const size_t* countp, void* ip)
- Read data of the double type in array mode.
nc_get_vara_double(int ncid, int varid, const size_t *startp, const size_t* countp, double* ip)
- Read data of the char type in array mode.
int nc_get_vara_text(int ncid, int varid, const size_t* startp, const size_t* countp, char* ip)
- Read data of the unsigned char type in array mode.
int nc_get_vara_uchar(int ncid, int varid, const size_t* startp, const size_t* countp, unsigned char* ip)
- Read data of the signed char type in array mode.
int nc_get_vara_schar(int ncid, int varid, const size_t* startp, const size_t* countp, signed char* ip)
- Read data of the short type in array mode.
int nc_get_vara_short(int ncid, int varid, const size_t* startp, const size_t* countp, short* ip)
- Read data of the int type in array mode.
int nc_get_vara_int(int ncid, int varid, const size_t* startp, const size_t* countp, int* ip)
- Read data of the long type in array mode.
int nc_get_vara_long(int ncid, int varid, const size_t* startp, const size_t* countp, long* ip)
- Read data of the float type in array mode.
int nc_get_vara_float(int ncid, int varid, const size_t* startp, const size_t* countp, float* ip)
- Read data of the unsigned short type in array mode.
int nc_get_vara_ushort(int ncid, int varid, const size_t* startp, const size_t* countp, unsigned short* ip)
- Read data of the unsigned int type in array mode.
int nc_get_vara_uint(int ncid, int varid, const size_t* startp, const size_t* countp, unsigned int* ip)
- Read data of the long long type in array mode.
int nc_get_vara_longlong(int ncid, int varid, const size_t* startp, const size_t* countp, long long* ip)
- Read data of the unsigned long long type in array mode.
int nc_get_vara_ulonglong(int ncid, int varid, const size_t* startp, const size_t* countp, unsigned long long* ip)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
ncid |
File ID |
Non-negative integer |
Input |
varid |
Variable ID |
Non-negative integer |
Input |
*startp |
Starting vector for data access |
Non-empty |
Input |
*countp |
Range vector for data access |
Non-empty |
Input |
*ip |
Pointer to data |
Non-empty |
Output |
Return Value
- Success: NC_NOERR
- Failure: An error code is returned.
Error Code
Error Code |
Description |
|---|---|
NC_EBADID |
Invalid ncid |
NC_ENOTVAR |
Variable not found |
NC_EINVALCOORDS |
Invalid coordinate argument |
NC_EEDGE |
Dimension out of bounds |
Notes
Ensure that the pointer memory size is correct. Hyper IO cannot check the pointer size.