我要评分
获取效率
正确性
完整性
易理解

File Operations

Function Syntax

  • Create a file.

    NC_create(const char *name, int mode, size_t initialsz, int basepe,

    size_t *chunksizehintp, int useparallel, void *parameters, int *ncidp)

  • Create a file for parallel I/O.

    nc_create_par(const char *name, int mode, MPI_Comm comm, MPI_Info info, int* ncidp)

  • Open an existing file.

    NC_open(const char *name, int mode, int basepe, size_t *chunksizehintp,

    int useparallel, void *parameters, int *ncidp)

  • Open an existing file for parallel I/O.

    nc_open_par(const char *name, int mode, MPI_Comm comm, MPI_Info info, int* ncidp)

  • Close an opened file.

    nc_close(int ncid)

  • Enter the define mode.

    nc_redef(int ncid)

  • End the define mode.

    nc_enddef(int ncid)

Parameters

Parameter

Description

Value Range

Input/Output

ncid

File ID

Non-negative integer

Input

*ncidp

Pointer to the file ID

Non-empty

Output

*name

File name

Non-empty string of less than 256 bytes

Input

comm

MPI communicator handle

Non-empty

Input

info

MPI info object handle

Non-empty

Input

*chunksizehintp

Pointer to the chunk size

Non-empty

Input

useparallel

Whether to enable parallel I/O

Integer

Input

*parameters

Pointer to the MPI information structure

Non-empty

Input

mode

Create or open mode

Integer

Input

initialsz

Initial size

Non-negative integer

Input

basepe

Base processing element

Integer

Input

Return Value

  • Success: NC_NOERR
  • Failure: An error code is returned.

Error Code

Error Code

Description

NC_EBADID

Invalid ncid

NC_EINVAL

Invalid argument

NC_ENOMEM

Insufficient memory