Rate This Document
Findability
Accuracy
Completeness
Readability

Querying Dimension Information

Function Syntax

  • Query the name and length of a dimension.

    nc_inq_dim(int ncid, int dimid, char *name, size_t* lenp)

  • Query the name of a dimension.

    nc_inq_dimname(int ncid, int dimid, char *name)

  • Query the length of a dimension.

    nc_inq_dimlen(int ncid, int dimid, size_t *lenp)

  • Query a dimension ID by name.

    nc_inq_dimid(int ncid, const char *name, int* idp)

Parameters

Parameter

Description

Value Range

Input/Output

ncid

File ID

Non-negative integer

Input

dimid

Dimension ID

Non-negative integer

Input

const *name

Dimension name

Non-empty string of less than 256 bytes

Input

*name

Pointer to the dimension name

Non-empty

Output

*lenp

Pointer to the dimension length

Non-empty

Output

*idp

Pointer to the dimension 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_EBADDIM

Invalid dimid

Notes

*name, *lenp, and *idp can be null pointers only if no data needs to be obtained.