[ncl-talk] reading variable

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Thu Dec 10 13:02:02 MST 2020


Immediate mode string reference also works.  The double quotes must be
*inside* the dollar signs, not the other way around.

    csi_mod  = b1->$"series_cts_CSI_ge0.3"$

Immediate mode is not in the NCL manual, but it should be.  It is useful.


On Thu, Dec 10, 2020 at 12:25 PM Rick Brownrigg via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Yea, I can see where that would be a syntax error to NCL. I *think* this
> might work:
>
> vname = "series_cts_CSI_ge0.3"
> csi_mod  = b1->$vname$
>
> Hope that helps...
> Rick
>
> On Thu, Dec 10, 2020 at 11:48 AM Debasish Hazra via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Hi,
>> I am trying to read a netcdf file generated from other statistical
>> package and getting the following error using NCL :
>> fatal:syntax error: line 19 in file statread.ncl before or near .3
>>           csi_mod  = b1->series_cts_CSI_ge0.3
>> ------------------------------------------------------------------^
>> But when I did ncl_filedump I see variable do exist :
>>
>> Variable: series_cts_CSI_ge0.3
>>     Type: float
>>     Total Size: 207936 values
>>                 831744 bytes
>>     Number of Dimensions: 2
>>     Dimensions and sizes:       [ 361 <lat> x 576 <lon> ]
>>     Coordinates:
>>                 lat: [-90..90]
>>                 lon: [-180..179.375]
>>         Number of Attributes:        5
>>             _FillValue  :       -9999
>>             name        :       CSI
>>             long_name   :       Critical success index
>>
>> Any help on this ?
>> Thanks
>> Debasish
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201210/df35e4bf/attachment.html>


More information about the ncl-talk mailing list