Re: About "-" in attribute name

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 26 May 2009 11:51:14 -0600

f@$"WEST-EAST_GRID_DIMENSION"$

or

att = "WEST-EAST_GRID_DIMENSION"

f@$att$

==========================
 

Jeff wrote:
> Hi Mary,
>
> It does not work here,
> Below is what I did and the error msg.
> ================
> fiw = addfile("wrfout_d02_2001-07-01_23.sample.nc","r")
> print(fiw@$WEST-EAST_GRID_DIMENSION$)
>
> fatal:syntax error: line 75 before or near -
> print(fiw@$WEST-
> ---------------^
>
> fatal:error in statement
> ================
>
> Thank you,
> Yaosheng
>
> On Tue, May 26, 2009 at 1:38 PM, Mary Haley <haley_at_ucar.edu> wrote:
>
>> Use the special syntax "$..$" around the name:
>>
>> f@$WEST-EAST_GRID_DIMENSION$
>>
>> --Mary
>>
>> On Tue, 26 May 2009, Jeff wrote:
>>
>>
>>> Hi,
>>>
>>> In WRF output, there are several global attributes with "-" in their
>>> names, for example, "WEST-EAST_GRID_DIMENSION".
>>> When I use f_at_WEST-EAST_GRID_DIMENSION to read the dimension, NCL keeps
>>> recognize the "-" to be a operator for "subtract" and says
>>> "EAST_GRID_DIMENSION" is not a defined variable.
>>>
>>> How can I visit this attribute?
>>>
>>> Thank you.
>>> Yaosheng
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 26 2009 - 11:51:14 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 01 2009 - 07:47:27 MDT