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

Are you trying to create a netcdf-3 file, which does not
support string type.
=Dennis Heimbigner
 Unidata

On 11/1/2017 1:15 AM, Dan Hitt wrote:
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

_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.


netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/




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