Rate This Document
Findability
Accuracy
Completeness
Readability

Reading in Single-Element Mode

Function Syntax

  • Read data in single-element mode.

    nc_get_var1(int ncid, int varid, const size_t* indexp, void* ip)

  • Read data of the int type in single-element mode.

    nc_get_var1_int(int ncid, int varid, const size_t* indexp, int* ip)

  • Read data of the double type in single-element mode.

    nc_get_var1_double(int ncid, int varid, const size_t* indexp, double* ip)

Parameters

Parameter

Description

Value Range

Input/Output

ncid

File ID

Non-negative integer

Input

varid

Variable ID

Non-negative integer

Input

*indexp

Starting 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.