属性信息写入
函数定义
- char类型属性信息写入。
int ncmpi_put_att_text(int fileId, int varId, const char* name, MPI_Offset nelems, const char* buf);
 - int类型属性信息写入。
int ncmpi_put_att_int(int fileId, int varId, const char* name, int xType, MPI_Offset nelems, const int* buf);
 - float类型属性信息写入。
int ncmpi_put_att_float(int fileId, int varId, const char* name, int xType, MPI_Offset nelems, const float* buf);
 - double类型属性信息写入。
int ncmpi_put_att_double(int fileId, int varId, const char* name, int xType, MPI_Offset nelems, const double* buf);
 
参数
参数名  | 
描述  | 
取值范围  | 
输入/输出  | 
|---|---|---|---|
fileId  | 
文件ID  | 
非负整数  | 
输入  | 
varId  | 
variable ID  | 
非负整数  | 
输入  | 
*name  | 
属性名称  | 
非空,长度小于256字节  | 
输入  | 
nelems  | 
写入信息的长度  | 
非负整数  | 
输入  | 
*buf  | 
写入信息的内存的指针  | 
非空  | 
输入  | 
xtype  | 
写入的类型  | 
非负整数  | 
输入  | 
返回值
- 成功:返回NC_NOERR。
 - 失败:返回错误码。
 
错误码
错误码  | 
描述  | 
|---|---|
NC_EBADID  | 
无效ncid  | 
NC_EBADNAME  | 
无效名称  | 
NC_ENOMEM  | 
空指针或无效内存  | 
NC_EINVAL  | 
无效的参数  | 
父主题: PnetCDF桥接函数