int ncmpi_put_att_text(int fileId, int varId, const char* name, MPI_Offset nelems, const char* buf);
int ncmpi_put_att_int(int fileId, int varId, const char* name, int xType, MPI_Offset nelems, const int* buf);
int ncmpi_put_att_float(int fileId, int varId, const char* name, int xType, MPI_Offset nelems, const float* buf);
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_EBADID |
无效ncid |
NC_EBADNAME |
无效名称 |
NC_ENOMEM |
空指针或无效内存 |
NC_EINVAL |
无效的参数 |