[ncl-talk] fatal:syntax error

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Fri May 5 08:06:17 MDT 2017


Use a string reference for variable names containing problematic special
characters.

    varname = "series_cnt_RMSE_fcstgt0.05_and_obsgt0.05"
    rmse1 =  a1->$varname$

https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#StringRef

--Dave


On Fri, May 5, 2017 at 6:35 AM, Barry Lynn <barry.h.lynn at gmail.com> wrote:

> Hi:
>
> I stil think it is the decimal point causing the problem, but one the NCL
> folk (or someone else) will have to clarify how to read a variable like
> this.
>
> Are you able to test reading a different variable that does not have
> decimal points?
>
> On Fri, May 5, 2017 at 4:19 PM, Debasish Hazra <debasish.hazra5 at gmail.com>
> wrote:
>
>> Thanks Barry. I put
>>
>> rmse1 =  a1->series_cnt_RMSE_fcstgt0.05_and_obsgt0.05(:,:)
>> but still getting the syntax error at the end. I attached screen shot oft
>> he error I got. Any help
>>
>> Debasish
>>
>> On Thu, May 4, 2017 at 11:09 PM, Barry Lynn <barry.h.lynn at gmail.com>
>> wrote:
>>
>>> Hi:
>>>
>>> Assuming you copied the variable name correctly, perhaps the decimal
>>> point is causing the problem.  I am not sure how to work around this, but
>>> you might try add (:,:) at the end of your read so that NCL might possibly
>>> know that the variable name continues.
>>>
>>> Barry
>>>
>>> On Fri, May 5, 2017 at 5:30 AM, Debasish Hazra <
>>> debasish.hazra5 at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to read bunch of variable in a netcdf file, which shows the
>>>> following if I do ncl_filedump :
>>>>
>>>> float series_cnt_RMSE_fcstgt0.05_and_obsgt0.05 ( lat, lon )
>>>>          _FillValue :   -9999
>>>>          name : RMSE
>>>>          long_name :    Root mean squared error
>>>>
>>>> But, when I am trying to read as :
>>>>
>>>>  rmse1 =  a1->series_cnt_RMSE_fcstgt0.05_and_obsgt0.05
>>>>
>>>> fatal:syntax error: line 24 in file series_plot.ncl before or near .05
>>>>         rmse1 =  a1->series_cnt_RMSE_fcstgt0.05
>>>> ---------------------------------------------------------------^
>>>>
>>>> Any help on this.Thanks
>>>>
>>>> Debasish
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170505/b767d521/attachment.html 


More information about the ncl-talk mailing list