Re: how to read a variable "x-wind" in a nc file with NCL

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 01 2012 - 18:05:03 MDT

That question was answered earlier just today by Dennis. A legal variable name in a classic NetCDF file is supposed to begin with a letter [A-Za-z] and contain only letters, numbers, or the underscore character [A-za-z0-9_]. NCL can still read NetCDF variables that have other characters but you need to use the string referencing syntax.
In your case, just change:

uu = f1->x-wind(0,0,:,:)

to

uu = f1->$"x-wind"$(0,0,:,:)

 -dave

On Nov 1, 2012, at 5:56 PM, Yang Yang wrote:

> Hi There:
>
> I have a nc file with a zonal wind component named as "x-wind".
> When I read it in NCL as:
> uu = f1->x-wind(0,0,:,:)
> It had errors: fatal:Undefined identifier: (wind) is undefined, can't continue.
> The "x-wind" cannot be recognized by NCL. NCL took "-" as minus or somethingelse.
> Can anyone tell me how to read this data in NCL? Thanks!
>
> Regards
> Ed
> _______________________________________________
> 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
Received on Thu Nov 1 18:05:11 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 06 2012 - 15:05:49 MST