Querying Variable Information
Function Syntax
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
ncid |
File ID |
Non-negative integer |
Input |
varid |
Variable ID |
Non-negative integer |
Input |
const *name |
Variable name |
Non-empty string of less than 256 bytes |
Input |
*name |
Pointer to the variable name |
Non-empty |
Output |
*xtypep |
Pointer to the variable data type |
Non-empty |
Output |
*ndimsp |
Pointer to the number of variable dimensions |
Non-empty |
Output |
*dimidsp |
Pointer to the array of variable dimension IDs |
Non-empty |
Output |
*nattsp |
Pointer to the number of variable attributes |
Non-empty |
Output |
*varidp |
Pointer to the variable ID |
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 |
Invalid variable ID |
Notes
*name, *xtypep, *ndimsp, *dimidsp, *nattsp, and *varidp can be null pointers only if no data needs to be obtained.
Parent topic: Information Query