[ncl-talk] change attribute

David Brown dbrown at ucar.edu
Mon Aug 31 13:21:45 MDT 2015


To expand a bit on Dennis' point: the CF Conventions say that variable
and attribute names should "begin with a letter and be composed of
letters, digits, and underscores." It goes on to say this:

"Note that this is in conformance with the COARDS conventions, but is
more restrictive than the netCDF interface which allows use of the
hyphen character. The netCDF interface also allows leading underscores
in names, but the NUG (NetCDF User Guide) states that this is reserved
for system use."

And also for completeness it says this:

"Case is significant in netCDF names, but it is recommended that names
should not be distinguished purely by case, i.e., if case is
disregarded, no two names should be the same. It is also recommended
that names should be obviously meaningful, if possible, as this
renders the file more effectively self-describing."
 -dave





On Fri, Aug 28, 2015 at 10:06 AM, Dennis Shea <shea at ucar.edu> wrote:
> A side point.
>
> I think netCDF-3 does not support the -
> It does support the _
>
> I suggest using _ and not -
>
> :-)
>
> On Fri, Aug 28, 2015 at 9:12 AM, Adam Phillips <asphilli at ucar.edu> wrote:
>> Hi Chao,
>> Try this:
>>
>> att_glb = True
>> tt = "VAR-LIST"
>> att_glb@$tt$ = name_value
>> fileattdef(fout,att_glb)
>>
>> If you have any further issues please respond to ncl-talk.
>> Adam
>>
>>
>> On Fri, Aug 28, 2015 at 9:02 AM, Luo, Chao <chao.luo at eas.gatech.edu> wrote:
>>>
>>> Dear NCL users,
>>>
>>> I am trying to change global attribute in netcdf file. What I did is:
>>>
>>> att_glb         = True
>>> att_glb at VAR-LIST = name_value;
>>> fileattdef( fout, att_glb  )
>>>
>>> I happened the error at att_glb at VAR-LIST, It was caused by hyphen sign
>>> between VAR and LIST.
>>> in this attribute, and I don't know how to do it. Very appreciate any
>>> suggestions and help.
>>>
>>> Thanks,
>>>
>>> Chao
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
>> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk


More information about the ncl-talk mailing list