[ncl-talk] change global attribute in netcdf file

Mary Haley haley at ucar.edu
Fri Sep 11 09:11:28 MDT 2015


Chao,

I didn't see any response to this; I apologize for the delay.

Whenever you have "non-standard" variable names like this, you can use the
special $"..."$ syntax to work around it:

att_glb         = True
att_glb@$"VAR-LIST"$= name_value;
fileattdef( fout, att_glb  )

Note that this syntax *only* works when you use it for an attribute name, a
dimension name, or a coordinate variable. Some examples:

x!$"dim-0"$ = "lat"   ; as a dimension name

x&$"latitude-0"$ = (/10,20,30,40/)    ; as a coordinate variable name

You can't use it like this:

$"myvar-0"$ = 58.1

--Mary




On Wed, Aug 26, 2015 at 9:26 PM, Luo, Chao <chao.luo at eas.gatech.edu> wrote:

> Dear NCL users,
>
> I am try 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. Any suggestions to solve this problem would be very
> appreciated!
>
> Thanks in advance,
>
> Chao
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150911/3debed4f/attachment.html 


More information about the ncl-talk mailing list