ParallelIO
Functions
pio_nc.c File Reference

PIO interfaces to NetCDF support functions. More...

#include <config.h>
#include <pio.h>
#include <pio_internal.h>

Functions

int PIOc_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp)
 The PIO-C interface for the NetCDF function nc_inq. More...
 
int PIOc_inq_ndims (int ncid, int *ndimsp)
 The PIO-C interface for the NetCDF function nc_inq_ndims.
 
int PIOc_inq_nvars (int ncid, int *nvarsp)
 The PIO-C interface for the NetCDF function nc_inq_nvars.
 
int PIOc_inq_natts (int ncid, int *ngattsp)
 The PIO-C interface for the NetCDF function nc_inq_natts.
 
int PIOc_inq_unlimdim (int ncid, int *unlimdimidp)
 The PIO-C interface for the NetCDF function nc_inq_unlimdim.
 
int pioc_pnetcdf_inq_type (int ncid, nc_type xtype, char *name, PIO_Offset *sizep)
 Internal function to provide inq_type function for pnetcdf. More...
 
int PIOc_inq_type (int ncid, nc_type xtype, char *name, PIO_Offset *sizep)
 The PIO-C interface for the NetCDF function nctypelen.
 
int PIOc_inq_format (int ncid, int *formatp)
 The PIO-C interface for the NetCDF function nc_inq_format.
 
int PIOc_inq_dim (int ncid, int dimid, char *name, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_dim. More...
 
int PIOc_inq_dimname (int ncid, int dimid, char *name)
 The PIO-C interface for the NetCDF function nc_inq_dimname.
 
int PIOc_inq_dimlen (int ncid, int dimid, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_dimlen.
 
int PIOc_inq_dimid (int ncid, const char *name, int *idp)
 The PIO-C interface for the NetCDF function nc_inq_dimid. More...
 
int PIOc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
 The PIO-C interface for the NetCDF function nc_inq_var. More...
 
int PIOc_inq_varname (int ncid, int varid, char *name)
 The PIO-C interface for the NetCDF function nc_inq_varname.
 
int PIOc_inq_vartype (int ncid, int varid, nc_type *xtypep)
 The PIO-C interface for the NetCDF function nc_inq_vartype.
 
int PIOc_inq_varndims (int ncid, int varid, int *ndimsp)
 The PIO-C interface for the NetCDF function nc_inq_varndims.
 
int PIOc_inq_vardimid (int ncid, int varid, int *dimidsp)
 The PIO-C interface for the NetCDF function nc_inq_vardimid.
 
int PIOc_inq_varnatts (int ncid, int varid, int *nattsp)
 The PIO-C interface for the NetCDF function nc_inq_varnatts.
 
int PIOc_inq_varid (int ncid, const char *name, int *varidp)
 The PIO-C interface for the NetCDF function nc_inq_varid. More...
 
int PIOc_inq_att (int ncid, int varid, const char *name, nc_type *xtypep, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_att. More...
 
int PIOc_inq_attlen (int ncid, int varid, const char *name, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_attlen.
 
int PIOc_inq_atttype (int ncid, int varid, const char *name, nc_type *xtypep)
 The PIO-C interface for the NetCDF function nc_inq_atttype.
 
int PIOc_inq_attname (int ncid, int varid, int attnum, char *name)
 The PIO-C interface for the NetCDF function nc_inq_attname. More...
 
int PIOc_inq_attid (int ncid, int varid, const char *name, int *idp)
 The PIO-C interface for the NetCDF function nc_inq_attid. More...
 
int PIOc_rename_dim (int ncid, int dimid, const char *name)
 The PIO-C interface for the NetCDF function nc_rename_dim. More...
 
int PIOc_rename_var (int ncid, int varid, const char *name)
 The PIO-C interface for the NetCDF function nc_rename_var. More...
 
int PIOc_rename_att (int ncid, int varid, const char *name, const char *newname)
 The PIO-C interface for the NetCDF function nc_rename_att. More...
 
int PIOc_del_att (int ncid, int varid, const char *name)
 The PIO-C interface for the NetCDF function nc_del_att. More...
 
int PIOc_set_fill (int ncid, int fillmode, int *old_modep)
 The PIO-C interface for the NetCDF function nc_set_fill. More...
 
int pioc_change_def (int ncid, int is_enddef)
 This is an internal function that handles both PIOc_enddef and PIOc_redef. More...
 
int PIOc_enddef (int ncid)
 The PIO-C interface for the NetCDF function nc_enddef. More...
 
int PIOc_redef (int ncid)
 The PIO-C interface for the NetCDF function nc_redef. More...
 
int PIOc_def_dim (int ncid, const char *name, PIO_Offset len, int *idp)
 The PIO-C interface for the NetCDF function nc_def_dim. More...
 
int PIOc_def_var (int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp)
 The PIO-C interface for the NetCDF function nc_def_var. More...
 
int PIOc_inq_var_fill (int ncid, int varid, int *no_fill, void *fill_valuep)
 The PIO-C interface for the NetCDF function nc_inq_var_fill. More...
 
int PIOc_get_att (int ncid, int varid, const char *name, void *ip)
 The PIO-C interface for the NetCDF function nc_get_att. More...
 
int PIOc_put_att (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const void *op)
 The PIO-C interface for the NetCDF function nc_put_att. More...
 
int PIOc_get_att_double (int ncid, int varid, const char *name, double *ip)
 The PIO-C interface for the NetCDF function nc_get_att_double.
 
int PIOc_get_att_uchar (int ncid, int varid, const char *name, unsigned char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_uchar.
 
int PIOc_get_att_ushort (int ncid, int varid, const char *name, unsigned short *ip)
 The PIO-C interface for the NetCDF function nc_get_att_ushort.
 
int PIOc_get_att_uint (int ncid, int varid, const char *name, unsigned int *ip)
 The PIO-C interface for the NetCDF function nc_get_att_uint.
 
int PIOc_get_att_long (int ncid, int varid, const char *name, long *ip)
 The PIO-C interface for the NetCDF function nc_get_att_long.
 
int PIOc_get_att_ubyte (int ncid, int varid, const char *name, unsigned char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_ubyte.
 
int PIOc_get_att_text (int ncid, int varid, const char *name, char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_text.
 
int PIOc_get_att_schar (int ncid, int varid, const char *name, signed char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_schar.
 
int PIOc_get_att_ulonglong (int ncid, int varid, const char *name, unsigned long long *ip)
 The PIO-C interface for the NetCDF function nc_get_att_ulonglong.
 
int PIOc_get_att_short (int ncid, int varid, const char *name, short *ip)
 The PIO-C interface for the NetCDF function nc_get_att_short.
 
int PIOc_get_att_int (int ncid, int varid, const char *name, int *ip)
 The PIO-C interface for the NetCDF function nc_get_att_int.
 
int PIOc_get_att_longlong (int ncid, int varid, const char *name, long long *ip)
 The PIO-C interface for the NetCDF function nc_get_att_longlong.
 
int PIOc_get_att_float (int ncid, int varid, const char *name, float *ip)
 The PIO-C interface for the NetCDF function nc_get_att_float.
 
int PIOc_put_att_schar (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const signed char *op)
 The PIO-C interface for the NetCDF function nc_put_att_schar.
 
int PIOc_put_att_long (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const long *op)
 The PIO-C interface for the NetCDF function nc_put_att_long.
 
int PIOc_put_att_int (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const int *op)
 The PIO-C interface for the NetCDF function nc_put_att_int.
 
int PIOc_put_att_uchar (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned char *op)
 The PIO-C interface for the NetCDF function nc_put_att_uchar.
 
int PIOc_put_att_longlong (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const long long *op)
 The PIO-C interface for the NetCDF function nc_put_att_longlong.
 
int PIOc_put_att_uint (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned int *op)
 The PIO-C interface for the NetCDF function nc_put_att_uint.
 
int PIOc_put_att_ubyte (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned char *op)
 The PIO-C interface for the NetCDF function nc_put_att_ubyte.
 
int PIOc_put_att_float (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const float *op)
 The PIO-C interface for the NetCDF function nc_put_att_float.
 
int PIOc_put_att_ulonglong (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned long long *op)
 The PIO-C interface for the NetCDF function nc_put_att_ulonglong.
 
int PIOc_put_att_ushort (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned short *op)
 The PIO-C interface for the NetCDF function nc_put_att_ushort.
 
int PIOc_put_att_text (int ncid, int varid, const char *name, PIO_Offset len, const char *op)
 The PIO-C interface for the NetCDF function nc_put_att_text.
 
int PIOc_put_att_short (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const short *op)
 The PIO-C interface for the NetCDF function nc_put_att_short.
 
int PIOc_put_att_double (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const double *op)
 The PIO-C interface for the NetCDF function nc_put_att_double.
 

Detailed Description

PIO interfaces to NetCDF support functions.

This file provides an interface to the NetCDF support functions. Each subroutine calls the underlying netcdf or pnetcdf or netcdf4 functions from the appropriate subset of mpi tasks (io_comm). Each routine must be called collectively from union_comm.

Author
Jim Edwards (jedwa.nosp@m.rds@.nosp@m.ucar..nosp@m.edu), Ed Hartnett
Date
Feburary 2014, April 2016

Function Documentation

§ pioc_change_def()

int pioc_change_def ( int  ncid,
int  is_enddef 
)

This is an internal function that handles both PIOc_enddef and PIOc_redef.

Parameters
ncidthe ncid of the file to enddef or redef
is_enddefset to non-zero for enddef, 0 for redef.
Returns
PIO_NOERR on success, error code on failure.

§ PIOc_def_dim()

int PIOc_def_dim ( int  ncid,
const char *  name,
PIO_Offset  len,
int *  idp 
)

The PIO-C interface for the NetCDF function nc_def_dim.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
idpa pointer that will get the id of the variable or attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_def_var()

int PIOc_def_var ( int  ncid,
const char *  name,
nc_type  xtype,
int  ndims,
const int *  dimidsp,
int *  varidp 
)

The PIO-C interface for the NetCDF function nc_def_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
varidpa pointer that will get the variable id
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_del_att()

int PIOc_del_att ( int  ncid,
int  varid,
const char *  name 
)

The PIO-C interface for the NetCDF function nc_del_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_enddef()

int PIOc_enddef ( int  ncid)

The PIO-C interface for the NetCDF function nc_enddef.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_get_att()

int PIOc_get_att ( int  ncid,
int  varid,
const char *  name,
void *  ip 
)

The PIO-C interface for the NetCDF function nc_get_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq()

int PIOc_inq ( int  ncid,
int *  ndimsp,
int *  nvarsp,
int *  ngattsp,
int *  unlimdimidp 
)

The PIO-C interface for the NetCDF function nc_inq.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_att()

int PIOc_inq_att ( int  ncid,
int  varid,
const char *  name,
nc_type *  xtypep,
PIO_Offset *  lenp 
)

The PIO-C interface for the NetCDF function nc_inq_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
xtypepa pointer that will get the type of the attribute.
lenpa pointer that will get the number of values
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_attid()

int PIOc_inq_attid ( int  ncid,
int  varid,
const char *  name,
int *  idp 
)

The PIO-C interface for the NetCDF function nc_inq_attid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
idpa pointer that will get the id of the variable or attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_attname()

int PIOc_inq_attname ( int  ncid,
int  varid,
int  attnum,
char *  name 
)

The PIO-C interface for the NetCDF function nc_inq_attname.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
attnumthe attribute ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_dim()

int PIOc_inq_dim ( int  ncid,
int  dimid,
char *  name,
PIO_Offset *  lenp 
)

The PIO-C interface for the NetCDF function nc_inq_dim.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
lenpa pointer that will get the number of values
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_dimid()

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

The PIO-C interface for the NetCDF function nc_inq_dimid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
idpa pointer that will get the id of the variable or attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_var()

int PIOc_inq_var ( int  ncid,
int  varid,
char *  name,
nc_type *  xtypep,
int *  ndimsp,
int *  dimidsp,
int *  nattsp 
)

The PIO-C interface for the NetCDF function nc_inq_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
xtypepa pointer that will get the type of the attribute.
nattspa pointer that will get the number of attributes
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_var_fill()

int PIOc_inq_var_fill ( int  ncid,
int  varid,
int *  no_fill,
void *  fill_valuep 
)

The PIO-C interface for the NetCDF function nc_inq_var_fill.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_varid()

int PIOc_inq_varid ( int  ncid,
const char *  name,
int *  varidp 
)

The PIO-C interface for the NetCDF function nc_inq_varid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
varidpa pointer that will get the variable id
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ pioc_pnetcdf_inq_type()

int pioc_pnetcdf_inq_type ( int  ncid,
nc_type  xtype,
char *  name,
PIO_Offset *  sizep 
)

Internal function to provide inq_type function for pnetcdf.

§ PIOc_put_att()

int PIOc_put_att ( int  ncid,
int  varid,
const char *  name,
nc_type  xtype,
PIO_Offset  len,
const void *  op 
)

The PIO-C interface for the NetCDF function nc_put_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_redef()

int PIOc_redef ( int  ncid)

The PIO-C interface for the NetCDF function nc_redef.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_rename_att()

int PIOc_rename_att ( int  ncid,
int  varid,
const char *  name,
const char *  newname 
)

The PIO-C interface for the NetCDF function nc_rename_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_rename_dim()

int PIOc_rename_dim ( int  ncid,
int  dimid,
const char *  name 
)

The PIO-C interface for the NetCDF function nc_rename_dim.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_rename_var()

int PIOc_rename_var ( int  ncid,
int  varid,
const char *  name 
)

The PIO-C interface for the NetCDF function nc_rename_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_set_fill()

int PIOc_set_fill ( int  ncid,
int  fillmode,
int *  old_modep 
)

The PIO-C interface for the NetCDF function nc_set_fill.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling