---
name: "pnetcdf"
section: "3"
platform: "linux"
package: "pnetcdf-openmpi"
version: "1.15.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pnetcdf"
---

# pnetcdf(3)

Parallel library for accessing files in Network Common Data Form (CDF, CDF-2 and CDF-5 formats)

## NAME

PnetCDF - Parallel library for accessing files in Network Common Data Form (CDF, CDF-2 and CDF-5 formats)

## SYNOPSIS

**#include \<pnetcdf.h\>**

**mpicc ...  -lpnetcdf**

**Complete documentation for the PnetCDF libraries can be found at the PnetCDF website: http://cucis.ece.northwestern.edu/projects/PnetCDF/.**

## LIBRARY VERSION

**This document describes PnetCDF APIs** **for the C programming language.**

**const char\* ncmpi\_inq\_libvers()**

(Corresponds to **nc\_inq\_libvers()** in netCDF)

Returns a string identifying the version of the PnetCDF library, and when it was built, like: "1.15.1 of 2026-09-18".

The RCS **[ident(1)](/ident/1.md)** command will find a string like "$Id: @(#) PnetCDF library version 1.15.1 of 2026-09-18 $" in the library. The SCCS **[what(1)](/what/1.md)** command will find a string like "PnetCDF library version 1.15.1 of 2026-09-18".

## RETURN VALUES

All PnetCDF functions (except **ncmpi\_inq\_libvers()** and **ncmpi\_strerror()**) return an integer status.

If this returned status value is not equal to **NC\_NOERR** (zero), it indicates that an error occurred. The possible status values are defined in system include file \<errno.h\> and in "pnetcdf.h".

**const char\* ncmpi\_strerror(int** *status***)**

(Corresponds to **nc\_strerror()** in netCDF)

Returns a string textual translation of the *status* value, like "Attribute or variable name contains illegal characters" or "No such file or directory".

## FILE OPERATIONS

**int ncmpi\_create(MPI\_Comm** *comm***, const char** *path***\[\], int** *cmode***, MPI\_Info** *info***, int\*** *ncid***)**

(Corresponds to **nc\_create()** in netCDF)

Creates a new netCDF dataset at *path* collectively by a group of MPI processes specified by *comm*, returning a netCDF ID in *ncid*.  The argument *cmode* may include the bitwise-or of the following flags: **NC\_NOCLOBBER** to protect existing datasets (default is **NC\_CLOBBER**, silently blows them away), **NC\_64BIT\_OFFSET** to create a file in the 64-bit offset format (CDF-2), as opposed to classic format, the default, or **NC\_64BIT\_DATA** to create a file in the 64-bit data format (CDF-5). Use either **NC\_64BIT\_OFFSET** or **NC\_64BIT\_DATA**. The 64-bit offset format allows the creation of very large files with far fewer restrictions than netCDF classic format, but can only be read by the netCDF library version 3.6 or greater. Users are cautioned that files that use the 64-bit offset format will not be recognized by netCDF applications linked to an earlier version of the netCDF library than 3.6.  Applications linked to version 3.6 or later will be able to transparently access either the classic format or 64-bit offset format. The 64-bit data format allows the creation of very large array variables. CDF-5 files currently will not be recognized by netCDF 3 or 4 library.

The argument *cmode* must be consistent among all MPI processes that collectively create the file.  The argument *info* is an MPI info object. Users can use it to supply the file access hints further performance improvement.  The hints include existing MPI-IO hints as well as hints defined and used in PnetCDF.

When a netCDF dataset is created, it is opened in **NC\_WRITE** mode. When this function returns, the new netCDF dataset is in define mode.

**int ncmpi\_open(MPI\_Comm** *comm***, const char** *path***\[\], int** *mode***, MPI\_Info** *info***, int\*** *ncid***)**

(Corresponds to **nc\_open()** in netCDF)

Opens an existing netCDF dataset at *path* collectively by a group of MPI processes specified by *comm*, returning a netCDF ID in *ncid*.  The type of access is described by the *mode* parameter, which may include the bitwise-or of the following flags: **NC\_WRITE** for read-write access (default read-only).

The argument *mode* must be consistent among all MPI processes that collectively open the file.  The argument *info* is an MPI info object. Users can use it to supply the file access hints further performance improvement.  The hints include existing MPI-IO hints as well as hints defined and used in PnetCDF.

**int ncmpi\_redef(int** *ncid***)**

(Corresponds to **nc\_redef()** in netCDF)

Puts an open netCDF dataset into define mode, so dimensions, variables, and attributes can be added or renamed and attributes can be deleted.

**int ncmpi\_enddef(int** *ncid***)**

(Corresponds to **nc\_enddef()** in netCDF)

Takes an open netCDF dataset out of define mode. The changes made to the netCDF dataset while it was in define mode are checked and committed to disk if no problems occurred. After a successful call, variable data can be read or written to the dataset.

**int ncmpi\_sync(int** *ncid***)**

(Corresponds to **nc\_sync()** in netCDF)

Data written by PnetCDF APIs may be cached by local file system on each compute node.  This API flushes cached data by calling MPI\_File\_sync.

**int ncmpi\_abort(int** *ncid***)**

(Corresponds to **nc\_abort()** in netCDF)

You don't need to call this function.  This function is called automatically by **ncmpi\_close()** if the netCDF was in define mode and something goes wrong with the commit.  If the netCDF dataset isn't in define mode, then this function is equivalent to **ncmpi\_close()**.  If it is called after **ncmpi\_redef()**, but before **ncmpi\_enddef()**, the new definitions are not committed and the dataset is closed. If it is called after **ncmpi\_create()** but before **ncmpi\_enddef()**, the dataset disappears.

**int ncmpi\_close(int** *ncid***)**

(Corresponds to **nc\_close()** in netCDF)

Closes an open netCDF dataset.  If the dataset is in define mode, **ncmpi\_enddef()** will be called before closing.  After a dataset is closed, its ID may be reassigned to another dataset.

**int ncmpi\_inq(int** *ncid***, int\*** *ndims***, int\*** *nvars***,** **int\*** *natts***, int\*** *unlimdimid***)**

(Corresponds to **nc\_inq()** in netCDF)

**int ncmpi\_inq\_ndims(int** *ncid***, int\*** *ndims***)**

(Corresponds to **nc\_inq\_ndims()** in netCDF)

**int ncmpi\_inq\_nvars(int** *ncid***, int\*** *nvars***)**

(Corresponds to **nc\_inq\_nvars()** in netCDF)

**int ncmpi\_inq\_natts(int** *ncid***, int\*** *natts***)**

(Corresponds to **nc\_inq\_natts()** in netCDF)

**int ncmpi\_inq\_unlimdim(int** *ncid***, int\*** *unlimdimid***)**

(Corresponds to **nc\_inq\_unlimdim()** in netCDF)

**int ncmpi\_inq\_format(int** *ncid***, int\*** *formatn***)**

(Corresponds to **nc\_inq\_format()** in netCDF)

Use these functions to find out what is in a netCDF dataset. Upon successful return, *ndims* will contain  the number of dimensions defined for this netCDF dataset, *nvars* will contain the number of variables, *natts* will contain the number of attributes, and *unlimdimid* will contain the dimension ID of the unlimited dimension if one exists, or -1 otherwise. *formatn* will contain the version number of the dataset \<format\>, one of **NC\_FORMAT\_CLASSIC**, **NC\_FORMAT\_64BIT**, or **NC\_FORMAT\_64BIT\_DATA**. If any of the return parameters is a **NULL** pointer, then the corresponding information will not be returned; hence, no space need be allocated for it.

**int ncmpi\_def\_dim(int** *ncid***, const char** *name***\[\], MPI\_Offset** *len***, int\*** *dimid***)**

(Corresponds to **nc\_def\_dim()** in netCDF)

Adds a new dimension to an open netCDF dataset, which must be in define mode. *name* is the dimension name. If *dimid* is not a **NULL** pointer then upon successful completion *dimid* will contain the dimension ID of the newly created dimension.

## DIMENSIONS

**int ncmpi\_inq\_dimid(int** *ncid***, const char** *name***\[\], int\*** *dimid***)**

(Corresponds to **nc\_inq\_dimid()** in netCDF)

Given a dimension name, returns the ID of a netCDF dimension in *dimid*.

**int ncmpi\_inq\_dim(int** *ncid***, int** *dimid***, char** *name***\[\], MPI\_Offset\*** *len***)**

(Corresponds to **nc\_inq\_dim()** in netCDF)

**int ncmpi\_inq\_dimname(int** *ncid***, int** *dimid***, char** *name***\[\])**

(Corresponds to **nc\_inq\_dimname()** in netCDF)

**int ncmpi\_inq\_dimlen(int** *ncid***, int** *dimid***, MPI\_Offset\*** *len***)**

(Corresponds to **nc\_inq\_dimlen()** in netCDF)

Use these functions to find out about a dimension. If either the *name* argument or *len* argument is a **NULL** pointer, then the associated information will not be returned.  Otherwise, *name* should be  big enough (**NC\_MAX\_NAME**) to hold the dimension name as the name will be copied into your storage. The length return parameter, *len* will contain the size of the dimension. For the unlimited dimension, the returned length is the current maximum value used for writing into any of the variables which use the dimension.

**int ncmpi\_rename\_dim(int** *ncid***, int** *dimid***, const char** *name***\[\])**

(Corresponds to **nc\_rename\_dim()** in netCDF)

Renames an existing dimension in an open netCDF dataset. If the new name is longer than the old name, the netCDF dataset must be in define mode. You cannot rename a dimension to have the same name as another dimension.

## VARIABLES

**int ncmpi\_def\_var(int** *ncid***, const char** *name***\[\], nc\_type** *xtype***, int** *ndims***, const int** *dimids***\[\], int\*** *varid***)**

(Corresponds to **nc\_def\_var()** in netCDF)

Adds a new variable to a netCDF dataset. The netCDF must be in define mode. If not **NULL**, then *varid* will be set to the netCDF variable ID. *ndims* will be the number of dimensions for the variable. *name* will be the name of the netCDF variable. *xtype* is the external, netCDF type of the variable and should be one of **NC\_BYTE** **NC\_CHAR**, **NC\_SHORT**, **NC\_INT**, **NC\_FLOAT**, or **NC\_DOUBLE**, for CDF-1 and CDF-2 file formats. CDF-5 defines additional external types: **NC\_UBYTE**, **NC\_USHORT**, **NC\_UINT**, **NC\_INT64**, and **NC\_UINT64**. *dimids* argument is a vector of ndims dimension IDs corresponding to the variable dimensions.

**int ncmpi\_inq\_varid(int** *ncid***, const char** *name***\[\], int\*** *varid***)**

(Corresponds to **nc\_inq\_varid()** in netCDF)

Returns the ID of a netCDF variable in *varid* given its name.

**int ncmpi\_inq\_var(int** *ncid***, int** *varid***, char** *name***\[\], nc\_type\*** *xtype***, int\*** *ndims***, int** *dimids***\[\],** **int\*** *natts***)**

(Corresponds to **nc\_inq\_var()** in netCDF)

**int ncmpi\_inq\_varname(int** *ncid***, int** *varid***, char** *name***\[\])**

(Corresponds to **nc\_inq\_varname()** in netCDF)

**int ncmpi\_inq\_vartype(int** *ncid***, int** *varid***, nc\_type\*** *xtype***)**

(Corresponds to **nc\_inq\_vartype()** in netCDF)

**int ncmpi\_inq\_varndims(int** *ncid***, int** *varid***, int\*** *ndims***)**

(Corresponds to **nc\_inq\_varndims()** in netCDF)

**int ncmpi\_inq\_vardimid(int** *ncid***, int** *varid***, int** *dimids***\[\])**

(Corresponds to **nc\_inq\_vardimid()** in netCDF)

**int ncmpi\_inq\_varnatts(int** *ncid***, int** *varid***, int\*** *natts***)**

(Corresponds to **nc\_inq\_varnatts()** in netCDF)

Returns information about a netCDF variable, given its ID. If any of the return parameters (*name*, *xtype*, *ndims*, *dimids*, or *natts*) is a **NULL** pointer, then the corresponding information will not be returned; hence, no space need be allocated for it.

**int ncmpi\_rename\_var(int** *ncid***, int** *varid***, const char** *name***\[\])**

(Corresponds to **nc\_rename\_var()** in netCDF)

Changes the name of a netCDF variable. If the new name is longer than the old name, the netCDF must be in define mode. You cannot rename a variable to have the name of any existing variable.

## WRITING AND READING WHOLE VARIABLES

**int ncmpi\_put\_var\_text(int** *ncid***, int** *varid***, const char** *out***\[\])**

(Corresponds to **nc\_put\_var\_text()** in netCDF)

**int ncmpi\_put\_var\_uchar(int** *ncid***, int** *varid***, const unsigned char** *out***\[\])**

(Corresponds to **nc\_put\_var\_uchar()** in netCDF)

**int ncmpi\_put\_var\_schar(int** *ncid***, int** *varid***, const signed char** *out***\[\])**

(Corresponds to **nc\_put\_var\_schar()** in netCDF)

**int ncmpi\_put\_var\_short(int** *ncid***, int** *varid***, const short** *out***\[\])**

(Corresponds to **nc\_put\_var\_short()** in netCDF)

**int ncmpi\_put\_var\_int(int** *ncid***, int** *varid***, const int** *out***\[\])**

(Corresponds to **nc\_put\_var\_int()** in netCDF)

**int ncmpi\_put\_var\_long(int** *ncid***, int** *varid***, const long** *out***\[\])**

(Corresponds to **nc\_put\_var\_long()** in netCDF)

**int ncmpi\_put\_var\_float(int** *ncid***, int** *varid***, const float** *out***\[\])**

(Corresponds to **nc\_put\_var\_float()** in netCDF)

**int ncmpi\_put\_var\_double(int** *ncid***, int** *varid***, const double** *out***\[\])**

(Corresponds to **nc\_put\_var\_double()** in netCDF)

Writes an entire netCDF variable (i.e. all the values).  The netCDF dataset must be open and in data mode.  The type of the data is specified in the function name, and it is converted to the external type of the specified variable, if possible, otherwise an **NC\_ERANGE** error is returned. Note that rounding is not performed during the conversion. Floating point numbers are truncated when converted to integers.

**int ncmpi\_get\_var\_text(int** *ncid***, int** *varid***, char** *in***\[\])**

(Corresponds to **nc\_get\_var\_text()** in netCDF)

**int ncmpi\_get\_var\_uchar(int** *ncid***, int** *varid***, unsigned char** *in***\[\])**

(Corresponds to **nc\_get\_var\_uchar()** in netCDF)

**int ncmpi\_get\_var\_schar(int** *ncid***, int** *varid***, signed char** *in***\[\])**

(Corresponds to **nc\_get\_var\_schar()** in netCDF)

**int ncmpi\_get\_var\_short(int** *ncid***, int** *varid***, short** *in***\[\])**

(Corresponds to **nc\_get\_var\_short()** in netCDF)

**int ncmpi\_get\_var\_int(int** *ncid***, int** *varid***, int** *in***\[\])**

(Corresponds to **nc\_get\_var\_int()** in netCDF)

**int ncmpi\_get\_var\_long(int** *ncid***, int** *varid***, long** *in***\[\])**

(Corresponds to **nc\_get\_var\_long()** in netCDF)

**int ncmpi\_get\_var\_float(int** *ncid***, int** *varid***, float** *in***\[\])**

(Corresponds to **nc\_get\_var\_float()** in netCDF)

**int ncmpi\_get\_var\_double(int** *ncid***, int** *varid***, double** *in***\[\])**

(Corresponds to **nc\_get\_var\_double()** in netCDF)

Reads an entire netCDF variable (i.e. all the values). The netCDF dataset must be open and in data mode. The data is converted from the external type of the specified variable, if necessary, to the type specified in the function name.  If conversion is not possible, an **NC\_ERANGE** error is returned.

## WRITING AND READING ONE DATUM

**int ncmpi\_put\_var1\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], char** *\*out***)**

(Corresponds to **nc\_put\_var1\_text()** in netCDF)

**int ncmpi\_put\_var1\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], unsigned char** *\*out***)**

(Corresponds to **nc\_put\_var1\_uchar()** in netCDF)

**int ncmpi\_put\_var1\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], signed char** *\*out***)**

(Corresponds to **nc\_put\_var1\_schar()** in netCDF)

**int ncmpi\_put\_var1\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], short** *\*out***)**

(Corresponds to **nc\_put\_var1\_short()** in netCDF)

**int ncmpi\_put\_var1\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], int** *\*out***)**

(Corresponds to **nc\_put\_var1\_int()** in netCDF)

**int ncmpi\_put\_var1\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], long** *\*out***)**

(Corresponds to **nc\_put\_var1\_long()** in netCDF)

**int ncmpi\_put\_var1\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], float** *\*out***)**

(Corresponds to **nc\_put\_var1\_float()** in netCDF)

**int ncmpi\_put\_var1\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], double** *\*out***)**

(Corresponds to **nc\_put\_var1\_double()** in netCDF)

Puts a single data value into a variable at the position *index* of an open netCDF dataset that is in data mode.  The type of the data is specified in the function name, and it is converted to the external type of the specified variable, if possible, otherwise an **NC\_ERANGE** error is returned.

**int ncmpi\_get\_var1\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], char\*** *in***)**

(Corresponds to **nc\_get\_var1\_text()** in netCDF)

**int ncmpi\_get\_var1\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], unsigned char\*** *in***)**

(Corresponds to **nc\_get\_var1\_uchar()** in netCDF)

**int ncmpi\_get\_var1\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], signed char\*** *in***)**

(Corresponds to **nc\_get\_var1\_schar()** in netCDF)

**int ncmpi\_get\_var1\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], short\*** *in***)**

(Corresponds to **nc\_get\_var1\_short()** in netCDF)

**int ncmpi\_get\_var1\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], int\*** *in***)**

(Corresponds to **nc\_get\_var1\_int()** in netCDF)

**int ncmpi\_get\_var1\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], long\*** *in***)**

(Corresponds to **nc\_get\_var1\_long()** in netCDF)

**int ncmpi\_get\_var1\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], float\*** *in***)**

(Corresponds to **nc\_get\_var1\_float()** in netCDF)

**int ncmpi\_get\_var1\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *index***\[\], double\*** *in***)**

(Corresponds to **nc\_get\_var1\_double()** in netCDF)

Gets a single data value from a variable at the position *index* of an open netCDF dataset that is in data mode. The data is converted from the external type of the specified variable, if necessary, to the type specified in the function name.  If conversion is not possible, an **NC\_ERANGE** error is returned.

## WRITING AND READING AN ARRAY

**int ncmpi\_put\_vara\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const char** *out***\[\])**

(Corresponds to **nc\_put\_vara\_text()** in netCDF)

**int ncmpi\_put\_vara\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const unsigned char** *out***\[\])**

(Corresponds to **nc\_put\_vara\_uchar()** in netCDF)

**int ncmpi\_put\_vara\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const signed char** *out***\[\])**

(Corresponds to **nc\_put\_vara\_schar()** in netCDF)

**int ncmpi\_put\_vara\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const short** *out***\[\])**

(Corresponds to **nc\_put\_vara\_short()** in netCDF)

**int ncmpi\_put\_vara\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const int** *out***\[\])**

(Corresponds to **nc\_put\_vara\_int()** in netCDF)

**int ncmpi\_put\_vara\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const long** *out***\[\])**

(Corresponds to **nc\_put\_vara\_long()** in netCDF)

**int ncmpi\_put\_vara\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const float** *out***\[\])**

(Corresponds to **nc\_put\_vara\_float()** in netCDF)

**int ncmpi\_put\_vara\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const double** *out***\[\])**

(Corresponds to **nc\_put\_vara\_double()** in netCDF)

Writes an array section of values into a netCDF variable of an open netCDF dataset, which must be in data mode.  The array section is specified by the *start* and *count* vectors, which give the starting index and count of values along each dimension of the specified variable. The type of the data is specified in the function name and is converted to the external type of the specified variable, if possible, otherwise an **NC\_ERANGE** error is returned.

**int ncmpi\_get\_vara\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], char** *in***\[\])**

(Corresponds to **nc\_get\_vara\_text()** in netCDF)

**int ncmpi\_get\_vara\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], unsigned char** *in***\[\])**

(Corresponds to **nc\_get\_vara\_uchar()** in netCDF)

**int ncmpi\_get\_vara\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], signed char** *in***\[\])**

(Corresponds to **nc\_get\_vara\_schar()** in netCDF)

**int ncmpi\_get\_vara\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], short** *in***\[\])**

(Corresponds to **nc\_get\_vara\_short()** in netCDF)

**int ncmpi\_get\_vara\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], int** *in***\[\])**

(Corresponds to **nc\_get\_vara\_int()** in netCDF)

**int ncmpi\_get\_vara\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], long** *in***\[\])**

(Corresponds to **nc\_get\_vara\_long()** in netCDF)

**int ncmpi\_get\_vara\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], float** *in***\[\])**

(Corresponds to **nc\_get\_vara\_float()** in netCDF)

**int ncmpi\_get\_vara\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], double** *in***\[\])**

(Corresponds to **nc\_get\_vara\_double()** in netCDF)

Reads an array section of values from a netCDF variable of an open netCDF dataset, which must be in data mode.  The array section is specified by the *start* and *count* vectors, which give the starting index and count of values along each dimension of the specified variable. The data is converted from the external type of the specified variable, if necessary, to the type specified in the function name.  If conversion is not possible, an **NC\_ERANGE** error is returned.

## WRITING AND READING A SLICED ARRAY

**int ncmpi\_put\_vars\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const char** *out***\[\])**

(Corresponds to **nc\_put\_vars\_text()** in netCDF)

**int ncmpi\_put\_vars\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const unsigned char** *out***\[\])**

(Corresponds to **nc\_put\_vars\_uchar()** in netCDF)

**int ncmpi\_put\_vars\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const signed char** *out***\[\])**

(Corresponds to **nc\_put\_vars\_schar()** in netCDF)

**int ncmpi\_put\_vars\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const short** *out***\[\])**

(Corresponds to **nc\_put\_vars\_short()** in netCDF)

**int ncmpi\_put\_vars\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const int** *out***\[\])**

(Corresponds to **nc\_put\_vars\_int()** in netCDF)

**int ncmpi\_put\_vars\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const long** *out***\[\])**

(Corresponds to **nc\_put\_vars\_long()** in netCDF)

**int ncmpi\_put\_vars\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const float** *out***\[\])**

(Corresponds to **nc\_put\_vars\_float()** in netCDF)

**int ncmpi\_put\_vars\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const double** *out***\[\])**

(Corresponds to **nc\_put\_vars\_double()** in netCDF)

These functions are used for *strided output*, which is like the array section output described above, except that the sampling stride (the interval between accessed values) is specified for each dimension. For an explanation of the sampling stride vector, see COMMON ARGUMENTS DESCRIPTIONS below.

**int ncmpi\_get\_vars\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], char** *in***\[\])**

(Corresponds to **nc\_get\_vars\_text()** in netCDF)

**int ncmpi\_get\_vars\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], unsigned char** *in***\[\])**

(Corresponds to **nc\_get\_vars\_uchar()** in netCDF)

**int ncmpi\_get\_vars\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], signed char** *in***\[\])**

(Corresponds to **nc\_get\_vars\_schar()** in netCDF)

**int ncmpi\_get\_vars\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], short** *in***\[\])**

(Corresponds to **nc\_get\_vars\_short()** in netCDF)

**int ncmpi\_get\_vars\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], int** *in***\[\])**

(Corresponds to **nc\_get\_vars\_int()** in netCDF)

**int ncmpi\_get\_vars\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], long** *in***\[\])**

(Corresponds to **nc\_get\_vars\_long()** in netCDF)

**int ncmpi\_get\_vars\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], float** *in***\[\])**

(Corresponds to **nc\_get\_vars\_float()** in netCDF)

**int ncmpi\_get\_vars\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], double** *in***\[\])**

(Corresponds to **nc\_get\_vars\_double()** in netCDF)

These functions are used for *strided input*, which is like the array section input described above, except that the sampling stride (the interval between accessed values) is specified for each dimension. For an explanation of the sampling stride vector, see COMMON ARGUMENTS DESCRIPTIONS below.

## WRITING AND READING A MAPPED ARRAY

**int ncmpi\_put\_varm\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const char** *out***\[\])**

(Corresponds to **nc\_put\_varm\_text()** in netCDF)

**int ncmpi\_put\_varm\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const unsigned char** *out***\[\])**

(Corresponds to **nc\_put\_varm\_uchar()** in netCDF)

**int ncmpi\_put\_varm\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const signed char** *out***\[\])**

(Corresponds to **nc\_put\_varm\_schar()** in netCDF)

**int ncmpi\_put\_varm\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const short** *out***\[\])**

(Corresponds to **nc\_put\_varm\_short()** in netCDF)

**int ncmpi\_put\_varm\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const int** *out***\[\])**

(Corresponds to **nc\_put\_varm\_int()** in netCDF)

**int ncmpi\_put\_varm\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const long** *out***\[\])**

(Corresponds to **nc\_put\_varm\_long()** in netCDF)

**int ncmpi\_put\_varm\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const float** *out***\[\])**

(Corresponds to **nc\_put\_varm\_float()** in netCDF)

**int ncmpi\_put\_varm\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], const double** *out***\[\])**

(Corresponds to **nc\_put\_varm\_double()** in netCDF)

These functions are used for *mapped output*, which is like strided output described above, except that an additional index mapping vector is provided to specify the in-memory arrangement of the data values. For an explanation of the index mapping vector, see COMMON ARGUMENTS DESCRIPTIONS below.

**int ncmpi\_get\_varm\_text(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], char** *in***\[\])**

(Corresponds to **nc\_get\_varm\_text()** in netCDF)

**int ncmpi\_get\_varm\_uchar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], unsigned char** *in***\[\])**

(Corresponds to **nc\_get\_varm\_uchar()** in netCDF)

**int ncmpi\_get\_varm\_schar(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], signed char** *in***\[\])**

(Corresponds to **nc\_get\_varm\_schar()** in netCDF)

**int ncmpi\_get\_varm\_short(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], short** *in***\[\])**

(Corresponds to **nc\_get\_varm\_short()** in netCDF)

**int ncmpi\_get\_varm\_int(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], int** *in***\[\])**

(Corresponds to **nc\_get\_varm\_int()** in netCDF)

**int ncmpi\_get\_varm\_long(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], long** *in***\[\])**

(Corresponds to **nc\_get\_varm\_long()** in netCDF)

**int ncmpi\_get\_varm\_float(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], float** *in***\[\])**

(Corresponds to **nc\_get\_varm\_float()** in netCDF)

**int ncmpi\_get\_varm\_double(int** *ncid***, int** *varid***, const MPI\_Offset** *start***\[\], const MPI\_Offset** *count***\[\], const MPI\_Offset** *stride***\[\], const MPI\_Offset** *imap***\[\], double** *in***\[\])**

(Corresponds to **nc\_get\_varm\_double()** in netCDF)

These functions are used for *mapped input*, which is like strided input described above, except that an additional index mapping vector is provided to specify the in-memory arrangement of the data values. For an explanation of the index mapping vector, see COMMON ARGUMENTS DESCRIPTIONS below.

## ATTRIBUTES

**int ncmpi\_put\_att\_text(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const char** *out***\[\])**

(Corresponds to **nc\_put\_att\_text()** in netCDF)

**int ncmpi\_put\_att\_uchar(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const unsigned char** *out***\[\])**

(Corresponds to **nc\_put\_att\_uchar()** in netCDF)

**int ncmpi\_put\_att\_schar(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const signed char** *out***\[\])**

(Corresponds to **nc\_put\_att\_schar()** in netCDF)

**int ncmpi\_put\_att\_short(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const short** *out***\[\])**

(Corresponds to **nc\_put\_att\_short()** in netCDF)

**int ncmpi\_put\_att\_int(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const int** *out***\[\])**

(Corresponds to **nc\_put\_att\_int()** in netCDF)

**int ncmpi\_put\_att\_long(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const long** *out***\[\])**

(Corresponds to **nc\_put\_att\_long()** in netCDF)

**int ncmpi\_put\_att\_float(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const float** *out***\[\])**

(Corresponds to **nc\_put\_att\_float()** in netCDF)

**int ncmpi\_put\_att\_double(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, const double** *out***\[\])**

(Corresponds to **nc\_put\_att\_double()** in netCDF)

**int ncmpi\_put\_att(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type** *xtype***, MPI\_Offset** *len***, void \*** *ip***)**

(Corresponds to **nc\_put\_att()** in netCDF)

**int ncmpi\_get\_att(int** *ncid***, int** *varid***, const char** *name***\[\], void \*\*** *ip***)**

(Corresponds to **nc\_get\_att()** in netCDF)

Unlike variables, attributes do not have separate functions for defining and writing values. This family of functions defines a new attribute with a value or changes the value of an existing attribute. If the attribute is new, or if the space required to store the attribute value is greater than before, the netCDF dataset must be in define mode. The parameter *len* is the number of values from *out* to transfer. It is often one, except that for **ncmpi\_put\_att\_text()** it will usually be **strlen(***out***)**.

For these functions, the type component of the function name refers to the in-memory type of the value, whereas the *xtype* argument refers to the external type for storing the value.  An **NC\_ERANGE** error results if a conversion between these types is not possible.  In this case the value is represented with the appropriate fill-value for the associated external type.

**int ncmpi\_inq\_attname(int** *ncid***, int** *varid***, int** *attnum***, char** *name***\[\])**

(Corresponds to **nc\_inq\_attname()** in netCDF)

Gets the name of an attribute, given its variable ID and attribute number. This function is useful in generic applications that need to get the names of all the attributes associated with a variable, since attributes are accessed by name rather than number in all other attribute functions.  The number of an attribute is more volatile than the name, since it can change when other attributes of the same variable are deleted.  The attributes for each variable are numbered from 0 (the first attribute) to *nvatts*-1, where *nvatts* is the number of attributes for the variable, as returned from a call to **ncmpi\_inq\_varnatts()**. If the *name* parameter is a **NULL** pointer, no name will be returned and no space need be allocated.

**int ncmpi\_inq\_att(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type\*** *xtype***, MPI\_Offset\*** *len***)**

(Corresponds to **nc\_inq\_att()** in netCDF)

**int ncmpi\_inq\_attid(int** *ncid***, int** *varid***, const char** *name***\[\], int\*** *attnum***)**

(Corresponds to **nc\_inq\_attid()** in netCDF)

**int ncmpi\_inq\_atttype(int** *ncid***, int** *varid***, const char** *name***\[\], nc\_type\*** *xtype***)**

(Corresponds to **nc\_inq\_atttype()** in netCDF)

**int ncmpi\_inq\_attlen(int** *ncid***, int** *varid***, const char** *name***\[\], MPI\_Offset\*** *len***)**

(Corresponds to **nc\_inq\_attlen()** in netCDF)

These functions return information about a netCDF attribute, given its variable ID and name.  The information returned is the external type in *xtype* and the number of elements in the attribute as *len*. If any of the return arguments is a **NULL** pointer, the specified information will not be returned.

**int ncmpi\_copy\_att(int** *ncid***, int** *varid\_in***, const char** *name***\[\], int** *ncid\_out***, int** *varid\_out***)**

(Corresponds to **nc\_copy\_att()** in netCDF)

Copies an attribute from one netCDF dataset to another.  It can also be used to copy an attribute from one variable to another within the same netCDF. *ncid\_in* is the netCDF ID of an input netCDF dataset from which the attribute will be copied. *varid\_in* is the ID of the variable in the input netCDF dataset from which the attribute will be copied, or **NC\_GLOBAL** for a global attribute. *name* is the name of the attribute in the input netCDF dataset to be copied. *ncid\_out* is the netCDF ID of the output netCDF dataset to which the attribute will be copied. It is permissible for the input and output netCDF ID's to be the same.  The output netCDF dataset should be in define mode if the attribute to be copied does not already exist for the target variable, or if it would cause an existing target attribute to grow. *varid\_out* is the ID of the variable in the output netCDF dataset to which the attribute will be copied, or **NC\_GLOBAL** to copy to a global attribute.

**int ncmpi\_rename\_att(int** *ncid***, int** *varid***, const char** *name***\[\], const char** *newname***\[\])**

(Corresponds to **nc\_rename\_att()** in netCDF)

Changes the name of an attribute.  If the new name is longer than the original name, the netCDF must be in define mode.  You cannot rename an attribute to have the same name as another attribute of the same variable. *name* is the original attribute name. *newname* is the new name to be assigned to the specified attribute.  If the new name is longer than the old name, the netCDF dataset must be in define mode.

**int ncmpi\_del\_att(int** *ncid***, int** *varid***, const char** *name***\[\])**

(Corresponds to **nc\_del\_att()** in netCDF)

Deletes an attribute from a netCDF dataset.  The dataset must be in define mode.

**int ncmpi\_get\_att\_text(int** *ncid***, int** *varid***, const char** *name***\[\], char** *in***\[\])**

(Corresponds to **nc\_get\_att\_text()** in netCDF)

**int ncmpi\_get\_att\_uchar(int** *ncid***, int** *varid***, const char** *name***\[\], unsigned char** *in***\[\])**

(Corresponds to **nc\_get\_att\_uchar()** in netCDF)

**int ncmpi\_get\_att\_schar(int** *ncid***, int** *varid***, const char** *name***\[\], signed char** *in***\[\])**

(Corresponds to **nc\_get\_att\_schar()** in netCDF)

**int ncmpi\_get\_att\_short(int** *ncid***, int** *varid***, const char** *name***\[\], short** *in***\[\])**

(Corresponds to **nc\_get\_att\_short()** in netCDF)

**int ncmpi\_get\_att\_int(int** *ncid***, int** *varid***, const char** *name***\[\], int** *in***\[\])**

(Corresponds to **nc\_get\_att\_int()** in netCDF)

**int ncmpi\_get\_att\_long(int** *ncid***, int** *varid***, const char** *name***\[\], long** *in***\[\])**

(Corresponds to **nc\_get\_att\_long()** in netCDF)

**int ncmpi\_get\_att\_float(int** *ncid***, int** *varid***, const char** *name***\[\], float** *in***\[\])**

(Corresponds to **nc\_get\_att\_float()** in netCDF)

**int ncmpi\_get\_att\_double(int** *ncid***, int** *varid***, const char** *name***\[\], double** *in***\[\])**

(Corresponds to **nc\_get\_att\_double()** in netCDF)

Gets the value(s) of a netCDF attribute, given its variable ID and name.  Converts from the external type to the type specified in the function name, if possible, otherwise returns an **NC\_ERANGE** error. All elements of the vector of attribute values are returned, so you must allocate enough space to hold them.  If you don't know how much space to reserve, call **ncmpi\_inq\_attlen()** first to find out the length of the attribute.

## COMMON ARGUMENT DESCRIPTIONS

In this section we define some common arguments which are used in the "FUNCTION DESCRIPTIONS" section.

- int *ncid*

  is the netCDF ID returned from a previous, successful call to **ncmpi\_open()** or **ncmpi\_create()**

- char *name*\[\]

  is the name of a dimension, variable, or attribute. The names of dimensions, variables and attributes consist of arbitrary sequences of alphanumeric characters (as well as underscore '\_', period '.' and hyphen '-'), beginning with a letter or underscore. (However names commencing with underscore are reserved for system use.) Case is significant in netCDF names. A zero-length name is not allowed. As an input argument, it shall be a pointer to a 0-terminated string; as an output argument, it shall be the address of a buffer in which to hold such a string. The maximum allowable number of characters (excluding the terminating 0) is **NC\_MAX\_NAME**.

- nc\_type *xtype*

  specifies the external data type of a netCDF variable or attribute and is one of the following: **NC\_BYTE**, **NC\_CHAR**, **NC\_SHORT**, **NC\_INT**, **NC\_FLOAT**, or **NC\_DOUBLE** for CDF-1 and CDF-2 file formats. These are used to specify 8-bit integers, characters, 16-bit integers, 32-bit integers, 32-bit IEEE floating point numbers, and 64-bit IEEE floating-point numbers, respectively. (**NC\_LONG** in netCDF version 2 is now obsolete and set to **NC\_INT**). CDF-5 defines additional external types: **NC\_UBYTE**, **NC\_USHORT**, **NC\_UINT**, **NC\_INT64**, and **NC\_UINT64**.

- int *dimids*\[\]

  is a vector of dimension ID's and defines the shape of a netCDF variable. The size of the vector shall be greater than or equal to the rank (i.e. the number of dimensions) of the variable (*ndims*). The vector shall be ordered by the speed with which a dimension varies: *dimids*\[*ndims*-1\] shall be the dimension ID of the most rapidly varying dimension and *dimids*\[0\] shall be the dimension ID of the most slowly varying dimension. The maximum possible number of dimensions for a variable is given by the symbolic constant **NC\_MAX\_VAR\_DIMS**.

- int *dimid*

  is the ID of a netCDF dimension. netCDF dimension ID's are allocated sequentially from the non-negative integers beginning with 0.

- int *ndims*

  is either the total number of dimensions in a netCDF dataset or the rank (i.e. the number of dimensions) of a netCDF variable. The value shall not be negative or greater than the symbolic constant **NC\_MAX\_VAR\_DIMS**.

- int *varid*

  is the ID of a netCDF variable or (for the attribute-access functions) the symbolic constant **NC\_GLOBAL**, which is used to reference global attributes. netCDF variable ID's are allocated sequentially from the non-negative integers beginning with 0.

- int\* *natts*

  is the number of global attributes in a netCDF dataset  for the **ncmpi\_inquire()** function or the number of attributes associated with a netCDF variable for the **ncmpi\_varinq()** function.

- const MPI\_Offset *index*\[\]

  specifies the  coordinates of the netCDF data value to be accessed. The indices start at 0; thus, for example, the first data value of a two-dimensional variable is (0,0). The size of the vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions.

- const MPI\_Offset *start*\[\]

  specifies the starting point for accessing a netCDF variable's data values in terms of the indicial coordinates of the corner of the array section. The indices start at 0; thus, the first data value of a variable is (0, 0, ..., 0). The size of the vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions.

- const MPI\_Offset *count*\[\]

  specifies the number of indices selected along each dimension of the array section. Thus, to access a single value, for example, specify *count* as (1, 1, ..., 1). Note that, for strided I/O, this argument must be adjusted to be compatible with the *stride* and *start* arguments so that the interaction of the three does not attempt to access an invalid data co-ordinate. The elements of the *count* vector correspond, in order, to the variable's dimensions.

- const MPI\_Offset *stride*\[\]

  specifies the sampling interval along each dimension of the netCDF variable.   The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (*stride*\[0\]) gives the sampling interval along the most slowly varying dimension of the netCDF variable).  Sampling intervals are specified in type-independent units of elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects every other element, etc.). A **NULL** stride argument is treated as (1, 1, ... , 1).

- const MPI\_Offset *imap*\[\]

  specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.  The elements of the index mapping vector correspond, in order, to the netCDF variable's dimensions (*imap*\[0\] gives the distance between elements of the internal array corresponding to the most slowly varying dimension of the netCDF variable). Distances between elements are specified in type-independent units of elements (the distance between internal elements that occupy adjacent memory locations is 1 and not the element's byte-length as in netCDF 2). A **NULL** pointer means the memory-resident values have the same structure as the associated netCDF variable.

## VARIABLE PREFILLING

Prior to version 1.6.1, PnetCDF does not support data filling. The default fill mode in PnetCDF is **NC\_NOFILL** This contrary to netCDF library whose default is **NC\_FILL** When fill mode is enabled, PnetCDF sets the values of all newly-defined variables of finite length (i.e. those that do not have an unlimited, dimension) to the type-dependent fill-value associated with each variable.  This is done when **ncmpi\_enddef()** is called.  The fill-value for a variable may be changed from the default value by defining the attribute \`**\_FillValue**' for the variable.  This attribute must have the same type as the variable and be of length one.

Variables with an unlimited dimension are not prefilled in PnetCDF. This is also contrary to netCDF, which does prefill record variables. In PnetCDF, filling a record variable must be done by calling **ncmpi\_fill\_var\_rec()**. Note this fills only one record of a variable.

The fill mode for the entire file can be set by **ncmpi\_set\_fill()**. Per-variable fill mode setting is also available through **ncmpi\_def\_var\_fill()**. In PnetCDF, changing fill mode must be done in define mode. In netCDF, it is true only for fixed-size variables. For record variables, changing fill mode can be made at any time in NetCDF.

## ENVIRONMENT VARIABLES

- **PNETCDF\_SAFE\_MODE**

  Set to 1 to enable metadata consistency check. Warning messages will be printed to stdout if any inconsistency is detected.

## MAILING-LISTS

A mailing list is available for discussion of the PnetCDF interface and announcements about PnetCDF bugs, fixes, and enhancements. To subscribe or unsubscribe to the PnetCDF mailing list, visit https://lists.mcs.anl.gov/mailman/listinfo/parallel-netcdf

## SEE ALSO

[**ncmpidump**(1)](/ncmpidump/1.md), [**ncmpigen**(1)](/ncmpigen/1.md), [**ncmpidiff**(1)](/ncmpidiff/1.md), [**ncvalidator**(1)](/ncvalidator/1.md), [**pnetcdf**(3)](/pnetcdf/3.md).

## DATE

September 18, 2026

*PnetCDF User's Guide*, published by Northwestern University and Argonne National Laboratory. This document is adopted from the *netCDF User's Guide*, developed at the Unidata Program Center, University Corporation for Atmospheric Research, located in Boulder, Colorado.

PnetCDF home page at https://parallel-netcdf.github.io
