PIO  2.5.4
Functions
pio_nc.c File Reference
#include <config.h>
#include <pio.h>
#include <pio_internal.h>
Include dependency graph for pio_nc.c:

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)
 Find out how many dimensions are defined in the file. More...
 
int PIOc_inq_nvars (int ncid, int *nvarsp)
 Find out how many variables are defined in a file. More...
 
int PIOc_inq_natts (int ncid, int *ngattsp)
 Find out how many global attributes are defined in a file. More...
 
int PIOc_inq_unlimdim (int ncid, int *unlimdimidp)
 Find out the dimension ids of the unlimited dimension. More...
 
int PIOc_inq_unlimdims (int ncid, int *nunlimdimsp, int *unlimdimidsp)
 Find out the dimension ids of all unlimited dimensions. More...
 
int PIOc_inq_type (int ncid, nc_type xtype, char *name, PIO_Offset *sizep)
 Learn the name and size of a type. More...
 
int PIOc_inq_format (int ncid, int *formatp)
 Learn the netCDF format of an open file. More...
 
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)
 Find the name of a dimension. More...
 
int PIOc_inq_dimlen (int ncid, int dimid, PIO_Offset *lenp)
 Find the length of a dimension. More...
 
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)
 Get the name of a variable. More...
 
int PIOc_inq_vartype (int ncid, int varid, nc_type *xtypep)
 Find the type of a variable. More...
 
int PIOc_inq_varndims (int ncid, int varid, int *ndimsp)
 Find the number of dimensions of a variable. More...
 
int PIOc_inq_vardimid (int ncid, int varid, int *dimidsp)
 Find the dimension IDs associated with a variable. More...
 
int PIOc_inq_varnatts (int ncid, int varid, int *nattsp)
 Find the number of attributes associated with a variable. More...
 
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_eh (int ncid, int varid, const char *name, int eh, nc_type *xtypep, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_att. 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)
 Get the length of an attribute. More...
 
int PIOc_inq_atttype (int ncid, int varid, const char *name, nc_type *xtypep)
 Get the type of an attribute. More...
 
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_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_def_var_fill (int ncid, int varid, int fill_mode, const void *fill_valuep)
 Set the fill value for a variable. 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)
 Get the value of an attribute of any type, with no type conversion. More...
 
int PIOc_get_att_double (int ncid, int varid, const char *name, double *ip)
 Get the value of an 64-bit floating point array attribute. More...
 
int PIOc_get_att_uchar (int ncid, int varid, const char *name, unsigned char *ip)
 Get the value of an 8-bit unsigned char array attribute. More...
 
int PIOc_get_att_ushort (int ncid, int varid, const char *name, unsigned short *ip)
 Get the value of an 16-bit unsigned integer array attribute. More...
 
int PIOc_get_att_uint (int ncid, int varid, const char *name, unsigned int *ip)
 Get the value of an 32-bit unsigned integer array attribute. More...
 
int PIOc_get_att_long (int ncid, int varid, const char *name, long *ip)
 Get the value of an 32-bit ingeger array attribute. More...
 
int PIOc_get_att_text (int ncid, int varid, const char *name, char *ip)
 Get the value of an text attribute. More...
 
int PIOc_get_att_schar (int ncid, int varid, const char *name, signed char *ip)
 Get the value of an 8-bit signed char array attribute. More...
 
int PIOc_get_att_ulonglong (int ncid, int varid, const char *name, unsigned long long *ip)
 Get the value of an 64-bit unsigned integer array attribute. More...
 
int PIOc_get_att_short (int ncid, int varid, const char *name, short *ip)
 Get the value of an 16-bit integer array attribute. More...
 
int PIOc_get_att_int (int ncid, int varid, const char *name, int *ip)
 Get the value of an 32-bit integer array attribute. More...
 
int PIOc_get_att_longlong (int ncid, int varid, const char *name, long long *ip)
 Get the value of an 64-bit integer array attribute. More...
 
int PIOc_get_att_float (int ncid, int varid, const char *name, float *ip)
 Get the value of an 32-bit floating point array attribute. More...
 
int PIOc_put_att (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const void *op)
 Write a netCDF attribute of any type. More...
 
int PIOc_put_att_schar (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const signed char *op)
 Write a netCDF attribute array of 8-bit signed chars. More...
 
int PIOc_put_att_long (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const long *op)
 Write a netCDF attribute array of 32-bit signed integers. More...
 
int PIOc_put_att_int (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const int *op)
 Write a netCDF attribute array of 32-bit signed integers. More...
 
int PIOc_put_att_uchar (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned char *op)
 Write a netCDF attribute array of 8-bit unsigned chars. More...
 
int PIOc_put_att_longlong (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const long long *op)
 Write a netCDF attribute array of 64-bit signed integers. More...
 
int PIOc_put_att_uint (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned int *op)
 Write a netCDF attribute array of 32-bit unsigned integers. More...
 
int PIOc_put_att_float (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const float *op)
 Write a netCDF attribute array of 32-bit floating points. More...
 
int PIOc_put_att_ulonglong (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned long long *op)
 Write a netCDF attribute array of 64-bit unsigned integers. More...
 
int PIOc_put_att_ushort (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned short *op)
 Write a netCDF attribute array of 16-bit unsigned integers. More...
 
int PIOc_put_att_text (int ncid, int varid, const char *name, PIO_Offset len, const char *op)
 Write a netCDF text attribute. More...
 
int PIOc_put_att_short (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const short *op)
 Write a netCDF attribute array of 16-bit integers. More...
 
int PIOc_put_att_double (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const double *op)
 Write a netCDF attribute array of 64-bit floating points. More...
 

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_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.
namea pointer that will get name of attribute. Ignored if NULL.
idpa pointer that will get the id of the variable or attribute. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_attlen()

int PIOc_inq_attlen ( int  ncid,
int  varid,
const char *  name,
PIO_Offset lenp 
)

Get the length of an attribute.

Parameters
ncidthe ID of an open file.
varidthe variable ID, or NC_GLOBAL for global attributes.
namethe name of the attribute.
lenpa pointer that gets the lenght of the attribute array. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ 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.
namethe name of the attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_atttype()

int PIOc_inq_atttype ( int  ncid,
int  varid,
const char *  name,
nc_type *  xtypep 
)

Get the type of an attribute.

Parameters
ncidthe ID of an open file.
varidthe variable ID, or NC_GLOBAL for global attributes.
namethe name of the attribute.
xtypepa pointer that gets the type of the attribute. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_unlimdims()

int PIOc_inq_unlimdims ( int  ncid,
int *  nunlimdimsp,
int *  unlimdimidsp 
)

Find out the dimension ids of all unlimited dimensions.

Note that only netCDF-4 files can have more than 1 unlimited dimension.

Parameters
ncidthe ncid of the open file.
nunlimdimspa pointer that gets the number of unlimited dimensions. Ignored if NULL.
unlimdimidspa pointer that will get an array of unlimited dimension IDs.
Returns
0 for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett