Re: error in reading a variable from netcdf file

From: Si-Wan Kim <SiWan.Kim_at_nyahnyahspammersnyahnyah>
Date: Thu, 08 Jun 2006 17:01:16 -0600

Thanks, Adam.

Wonderful. It works!

Si-Wan

Adam Phillips wrote:
> Hi Si-Wan,
>
> Mike's suggestion about using ncrename was the first thing I thought
> of as well. But, Dennis Shea has a faster way:
>
> pm2 = a->$"PM2.5"$
>
> The $ signs only operate on text strings, which is why you have to
> enclose PM2.5 in "".. For those of you not familiar with the use of
> the $, they allow you to pass a text string into a addfile read-in /
> read-out operation:
>
> var = "SLP"
> slparr = a->$var$
> b->$var$ = slparr
>
> Adam
>
> Si-Wan Kim wrote:
>> Hello all,
>>
>> I am trying to read a variable whose name is "PM2.5" from a netcdf file.
>> I can read any variables like o3, co, and no2 except PM2.5.
>>
>> If I try to read "PM2.5", it gives me an error message. Syntax error
>> before or near .5.
>> Below is the part of ncl script.
>> a=
>> addfile("/wrk/d1/swkim/wrf2dat/pert/wrfn3d_d01_2004-"+sdate(imon-1)+"-"+sdate(iday-1)+".nc","r")
>>
>> pm2 = a->PM2.5
>>
>> The dot in the variable may be the problem.
>> Is there anybody who experienced this problem? How can I read this?
>> I appreciate your help. Thanks.
>>
>> Si-Wan
>> CIRES & NOAA/ESRL/CSD
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 08 2006 - 17:01:16 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 12 2006 - 06:59:59 MDT