[netcdfgroup] setting a global string attribute using nc_put_att() --- is this legal?

Hi,

I installed netcdf on a debian box using the the usual package means.

I'm trying to assign some global string metadata in a file that i
create, successfully, with nc_create().

My statement to assign the metadata looks like this:
int status =
  nc_put_att_string( ncid, NC_GLOBAL, key, strlen( value ), &value );
where key and value both have declaration const char*.

This compiles without error or warning, and i believe the values i'm
passing in are innocuous.

Nevertheless, at runtime, i get a return status of -45, which
nc_strerror() reports as
   NetCDF: Not a valid data type or _FillValue type mismatch.

Am i missing some piece of setup that i need to do (besides getting
the ncid for the file)?

This is my first call on the library after creating the file, so
presumably my ncid for the file couldn't have gotten too messed up
yet.

TIA for any clues, or pointers to the manual, or any other advice.

dan



  • 2017 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: