[ncl-talk] change global attribute in netcdf file
Luo, Chao
chao.luo at eas.gatech.edu
Fri Sep 11 16:55:53 MDT 2015
Thanks Mary. This works.
Chao
----- Original Message -----
From: "Mary Haley" <haley at ucar.edu>
To: "Chao Luo" <chao.luo at eas.gatech.edu>
Cc: "ncl-talk Talk" <ncl-talk at ucar.edu>
Sent: Friday, September 11, 2015 8:11:28 AM
Subject: Re: [ncl-talk] change global attribute in netcdf file
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/06cae9b7/attachment.html
More information about the ncl-talk
mailing list