Querying File and Dimension Information
Function Syntax
- Query information.
int ncmpi_inq(int fileId, int* nDims, int* nVars, int* nGAtts, int* unlimDimId);
int ncmpi_inq_version(int fileId, int* ncMode);
const char* ncmpi_inq_libvers(void)
- Query dimension information.
int ncmpi_inq_dim(int fileId, int dimId, char* name, MPI_Offset* length);
int ncmpi_inq_dimlen(int fileId, int dimId, MPI_Offset* lenPoint);
int ncmpi_inq_dimid(int fileId, const char* name, int* idPoint);
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
fileId |
File ID |
Non-negative integer |
Input |
*nDims |
Pointer to the number of dimensions |
Non-empty |
Output |
*nVars |
Pointer to the number of variables |
Non-empty |
Output |
*nGAtts |
Pointer to the number of attributes |
Non-empty |
Output |
*unlimDimId |
Pointer to the ID of an unlimited dimension |
Non-empty |
Output |
*ncMode |
Pointer to the format version |
Non-empty |
Output |
dimId |
Dimension ID |
Non-negative integer |
Input |
*name |
Pointer to the dimension name |
Non-empty |
Input/Output |
*length |
Pointer to the dimension length |
Non-empty |
Output |
*lenPoint |
Pointer to the dimension length |
Non-empty |
Output |
*idPoint |
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 |
NC_ENOMEM |
Null pointer or invalid memory |
Notes
*nDims, *nVars, *nGAtts, *unlimDimId, *ncMode, *name, *length, *lenPoint, and *idPoint can be null pointers only if no data needs to be obtained.